Skip to content

feat(ui): add five-bar SessionSpinner for active session indicators#54

Merged
BotCoder254 merged 1 commit into
mainfrom
feat/session-spinner
Jul 6, 2026
Merged

feat(ui): add five-bar SessionSpinner for active session indicators#54
BotCoder254 merged 1 commit into
mainfrom
feat/session-spinner

Conversation

@BotCoder254

@BotCoder254 BotCoder254 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add SessionSpinner for session running indicators
  • Wire into SessionRow, WorktreeTabs, and CenterWorkspace header
  • Keep existing ring Spinner elsewhere

Test plan

  • vite renderer build
  • npm run lint

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added a new loading indicator for active sessions with a smoother multi-segment spinner animation.
    • Updated session and workspace views to use the new spinner for running states.
  • Accessibility

    • The loading indicator now includes status labeling for better assistive technology support.
  • Visual Improvements

    • Spinner appearance adapts to different UI themes and supports sizing options for consistent display across screens.

Replace the ring spinner with a staggered bar spinner in session rows,
worktree tabs, and the center header while agent runs are in flight.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

A new SessionSpinner React component is introduced with configurable size, invert, and disabled props, exported from the UI barrel. It replaces the existing Spinner component in SessionRow, WorktreeTabs, and CenterWorkspace for rendering session "running" status indicators.

Changes

SessionSpinner Introduction and Rollout

Layer / File(s) Summary
SessionSpinner component implementation and export
src/renderer/components/ui/SessionSpinner.tsx, src/renderer/components/ui/index.ts
New SessionSpinnerProps interface and SessionSpinner function render a five-segment radial spinner with role="status", computed size/dimension styling, staggered animation delays, and invert-based color selection; component is null when disabled and re-exported from the UI index.
Replace Spinner with SessionSpinner in feature components
src/renderer/features/sessions/SessionRow.tsx, src/renderer/features/sessions/WorktreeTabs.tsx, src/renderer/features/workspace/CenterWorkspace.tsx
Imports and render calls switched from Spinner to SessionSpinner for running-state indicators, preserving existing size props (13, 11, and default respectively).

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

Not applicable — this change is a UI component swap without multi-component request/response or orchestration flow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main UI change: adding a five-bar SessionSpinner for active session indicators.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/session-spinner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation is clean and follows React best practices. The new SessionSpinner component is properly typed with TypeScript, includes accessibility attributes, and is correctly integrated across all affected files. The changes maintain the existing Spinner component for other use cases (e.g., the "Revalidating" indicator), demonstrating good separation of concerns.

All imports are correct, no logic errors detected, and the animation implementation using staggered delays is sound.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/renderer/components/ui/SessionSpinner.tsx (2)

28-53: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

{...props} spread after style can silently break sizing.

style={{ width: sizePx, height: sizePx }} is set before {...props}, so any caller passing a style prop (allowed since SessionSpinnerProps extends ComponentProps<'div'>) will fully overwrite the sizing style rather than merge with it. No current call site passes style, but the type signature invites it.

🔧 Proposed fix to merge caller style
     <div
       role="status"
       aria-label="Loading"
       className={cn('relative inline-block', className)}
-      style={{ width: sizePx, height: sizePx }}
       {...props}
+      style={{ width: sizePx, height: sizePx, ...props.style }}
     >
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/components/ui/SessionSpinner.tsx` around lines 28 - 53, The
`SessionSpinner` root `<div>` currently sets sizing via `style={{ width: sizePx,
height: sizePx }}` before spreading `props`, so a caller-provided `style` from
`SessionSpinnerProps` can overwrite the spinner dimensions. Update
`SessionSpinner` to merge the incoming `style` prop with the internal
width/height styles instead of letting `{...props}` replace them, preserving the
computed size while still allowing caller customizations.

42-49: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Prefer Tailwind color-token classes over inline CSS-variable styles.

The bar color is set via inline style referencing var(--color-accent)/var(--color-base) rather than a Tailwind utility class. This bypasses the utility-class approach used elsewhere and risks drifting off the approved token set if the underlying CSS variables change independently of the Tailwind theme.

🎨 Proposed fix using theme-token classes
           <div
+            className={invert ? 'bg-base' : 'bg-accent'}
             style={{
-              backgroundColor: invert ? 'var(--color-base)' : 'var(--color-accent)',
               width: barWidth,
               height: barHeight,
               borderRadius: '9999px',
             }}
           />

As per coding guidelines, src/renderer/**/*.{ts,tsx,css} should "Use the approved theme tokens (bg-base, bg-surface, text-fg, etc.) and avoid hardcoded off-palette colors, gradients, and light-mode styling."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/components/ui/SessionSpinner.tsx` around lines 42 - 49, The
spinner bar in SessionSpinner should use Tailwind theme-token classes instead of
inline CSS-variable styles. Update the bar rendering logic in SessionSpinner to
replace the current style-based backgroundColor with approved utility classes
(for example, using bg-base/bg-accent variants selected via the existing invert
prop), while keeping the dynamic width/height/borderRadius behavior unchanged.
Ensure the fix stays within the component’s existing className/style structure
and references the same invert, barWidth, and barHeight logic.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/renderer/components/ui/SessionSpinner.tsx`:
- Around line 28-53: The `SessionSpinner` root `<div>` currently sets sizing via
`style={{ width: sizePx, height: sizePx }}` before spreading `props`, so a
caller-provided `style` from `SessionSpinnerProps` can overwrite the spinner
dimensions. Update `SessionSpinner` to merge the incoming `style` prop with the
internal width/height styles instead of letting `{...props}` replace them,
preserving the computed size while still allowing caller customizations.
- Around line 42-49: The spinner bar in SessionSpinner should use Tailwind
theme-token classes instead of inline CSS-variable styles. Update the bar
rendering logic in SessionSpinner to replace the current style-based
backgroundColor with approved utility classes (for example, using
bg-base/bg-accent variants selected via the existing invert prop), while keeping
the dynamic width/height/borderRadius behavior unchanged. Ensure the fix stays
within the component’s existing className/style structure and references the
same invert, barWidth, and barHeight logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8f9ade06-dc32-4cfd-a8aa-dac53e31287f

📥 Commits

Reviewing files that changed from the base of the PR and between 3804a7e and e1347fd.

📒 Files selected for processing (5)
  • src/renderer/components/ui/SessionSpinner.tsx
  • src/renderer/components/ui/index.ts
  • src/renderer/features/sessions/SessionRow.tsx
  • src/renderer/features/sessions/WorktreeTabs.tsx
  • src/renderer/features/workspace/CenterWorkspace.tsx

@BotCoder254 BotCoder254 merged commit c2f21e4 into main Jul 6, 2026
4 of 10 checks passed
@BotCoder254 BotCoder254 deleted the feat/session-spinner branch July 6, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant