Skip to content

fix(staged): show pending state for diff comment sessions - #847

Merged
matt2e merged 2 commits into
mainfrom
diffs-comment-list-should-show-pending-state
Jul 2, 2026
Merged

fix(staged): show pending state for diff comment sessions#847
matt2e merged 2 commits into
mainfrom
diffs-comment-list-should-show-pending-state

Conversation

@matt2e

@matt2e matt2e commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

The diff comment list and comment action buttons collapsed the queued session status into running, so a queued Note/Commit session showed the same spinner as an in-progress one. This surfaces queued as a distinct state that renders the Clock icon used elsewhere for queued timeline rows, giving the comment list a proper pending state.

Changes

  • Add queued to CommentSessionState so it is no longer folded into running.
  • sessionStateFor now maps a queued session status to queued; routing in handleNewNote/handleNewCommit treats both queued and running as "open the session".
  • Extract a shared getCommentSessionDisplay helper (commentSessionDisplay.ts) that maps kind/state/context to an icon + title, and use it from both DiffCommentsSection.svelte (badges) and ReviewCommentActions.svelte (action buttons) to keep the icon/title logic in one place.
  • Preserve the projects sidebar scroll position across navigation: persist scrollTop in projectsSidebarState, restore it on mount (falling back to scrolling the active row into view when no saved position exists), and only auto-scroll the active row once restoration has completed.

@matt2e
matt2e requested review from baxen and wesbillman as code owners July 2, 2026 10:59
matt2e and others added 2 commits July 2, 2026 21:12
Sessions linked to code review comments in the diff viewer collapsed the
`queued` status into `running`, so a queued note/commit session showed a
spinner. The branch card timeline rows instead show a Clock icon for
queued sessions.

Add a distinct `queued` state to `CommentSessionState` and stop mapping
it to `running` in `sessionStateFor`, then render a Clock icon (matching
the timeline) in both the comment list badges and the review action
buttons. Session routing treats `queued` like `running` so clicking an
already-launched session opens it rather than starting a new one.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e force-pushed the diffs-comment-list-should-show-pending-state branch from 074a0e4 to ac3e588 Compare July 2, 2026 11:19
@matt2e
matt2e merged commit dff8c1f into main Jul 2, 2026
4 checks passed
@matt2e
matt2e deleted the diffs-comment-list-should-show-pending-state branch July 2, 2026 11:33
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