sessions: share status progress indicator between header and list#319995
Merged
Conversation
The session header showed a static codicon for in-progress / needs-input sessions while the sessions list showed the animated pixel spinner. Make the header render the same spinner, and extract the shared status-icon logic into sessions/browser/sessionStatusIcon.ts so both surfaces stay in sync without the core browser layer importing from contrib. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
Centralizes session status → visual indicator logic so the session header and sessions list render the same progress UI (animated pixel spinner when motion is allowed; codicon fallback when reduced motion is requested), preventing drift between the two surfaces.
Changes:
- Introduces a shared
getSessionStatusIndicator(...)helper (and underlying icon mapping) insrc/vs/sessions/browser/to unify spinner-vs-codicon decisions, variants, and colors. - Refactors the sessions list row renderer to consume the shared indicator instead of duplicating icon/spinner logic.
- Updates the session header to render the same animated pixel spinner as the list, re-rendering on reduced-motion changes while caching the current glyph/variant to avoid restarting animations unnecessarily.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts | Replaces inline status icon/spinner logic with shared getSessionStatusIndicator output while preserving existing crossfade behavior. |
| src/vs/sessions/browser/sessionStatusIcon.ts | New shared status→indicator helper (codicon mapping + discriminated indicator result including spinner variant, cache key, and CSS color). |
| src/vs/sessions/browser/parts/sessionHeader.ts | Uses shared indicator to render animated pixel spinner in header (with reduced-motion fallback), and avoids restarting animation on unrelated observable updates. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 4
…s-indicator # Conflicts: # src/vs/sessions/browser/parts/sessionHeader.ts # src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts
Encapsulate all status-icon rendering (spinner vs. codicon, cross-fade, reduced-motion reactivity, pulse) in a reusable SessionStatusIcon widget so each surface just hosts it and the model service only provides data. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address code review feedback: the status icon fallback serves the sessions list, session header, and picker, not just the list. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
connor4312
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The session header (top of a session view) showed a static codicon for in-progress / needs-input sessions, while the sessions list showed the animated pixel spinner. This makes the header render the same animated progress indicator as the list, and extracts the shared logic so the two surfaces can't drift apart.
Changes
src/vs/sessions/browser/sessionStatusIcon.ts(sessions core layer):getSessionStatusIcon(...)— status → codicon mapping (previously duplicated verbatim).getSessionStatusIndicator(...)— resolves a discriminatedSessionStatusIndicator(spinnervsicon) carrying the spinner variant, acacheKey, and a ready-to-apply CSScolor. Centralizes the spinner-vs-codicon decision, variant selection (grid for in-progress, ring for needs-input), and colors.sessionHeader.ts— now renders the animated pixel spinner for in-progress / needs-input (grid/ring variants), falling back to the static codicon when reduced motion is requested (IAccessibilityService). Re-renders react to reduced-motion changes viaobservableSignalFromEvent. Icon glyph/variant is cached so unrelated observable updates don't restart the animation.sessionsList.ts— refactored its icon block to use the sharedgetSessionStatusIndicator; removed the duplicatedgetStatusIconmethod and local spinner-key constants.Why this layer
browser/parts/(core) must not import fromcontrib/persrc/vs/sessions/LAYERS.md— which is exactly why the logic was originally copied. Placing the helper insessions/browser/lets both the coreSessionHeaderand thecontribSessionsListreuse it without violating layering.Notes for reviewers
reset) since those genuinely differ — only the shared decision logic is centralized.Validation
npm run compile-check-ts-native✅npm run valid-layers-check✅eslinton changed files ✅Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com