sessions: badge the activity bar Changes entry on unseen changes and show its stats on hover #343335

Merged
sandy081 opened 3:41pm on October 21, 2026 wanted to merge 737 Ξ” into microsoft/vscode main from
sandy081/agents/blue-badge-new-changes-hover-stats
Diff Delta:
737
About 154 Diff Delta/hour
Classified as:  Feature Add

sandy081's Description of Work

What

In the Agents window, the Changes entry of the Session Activity Bar now:


  • shows a blue badge (dot, activityBarBadge colors) over the icon's bottom-right corner β€” like the workbench activity bar β€” when the active chat has changes the user has not yet seen in the Changes tab;

  • shows the same stats as the Changes pill (<n> Files +ins -del) in its hover and accessible label.

How



  • Activity service. New ISessionActivityBarActivityService (services/activity) mirrors the workbench IActivityService: showActivity(commandId, IActivity) / getActivity / onDidChangeActivity, reusing the workbench IActivity/IBadge types. Every Session Activity Bar entry is now a SessionActivityBarActionViewItem that renders reported badges (count for NumberBadge, dot otherwise) and appends badge descriptions to its hover/aria label.


  • Detecting new changes (contrib/changes/browser/changesActivity.ts). Per chat, we remember the Changes pill stats last seen while the session's Changes tab was shown (side pane visible, or in an auxiliary window). The badge shows when the current stats differ and there are changed files. The first observation of a chat only seeds the baseline, and stats are ignored while not loaded yet (changeset loading, or only a summary is known β€” Copilot provider restores), so opening/restoring sessions does not badge. Seen state is persisted (application storage, LRU 200 chats).


  • Hover. The Changes entry uses a custom view item (via IActionViewItemService) that extends the core one and renders the pill stats in the pill's colors.

  • Accessibility help for the Session Activity Bar mentions the new label content.

Notes for reviewers


  • Known limitation: edits that leave the exact file/line counts unchanged are not detected; reverting changes while not looking badges (stats differ from what was seen).

  • New fixture variant sessionActivityBar/NewChanges (Dark/Light/HC) β€” screenshot baselines need to be accepted from CI.

Screenshots

Badge on unseen changes (live)
Hover shows the pill stats (live)

Changes entry with a blue badge over the icon's bottom-right corner
Hover on the Changes entry: Changes, then 1 File +4 -0

Badge across themes (fixture sessionActivityBar/NewChanges: Dark, Light, Dark HC, Light HC):

Session Activity Bar with the Changes badge in Dark, Light, Dark High Contrast and Light High Contrast themes

Testing


  • Unit tests: activity service rendering/placement, seen-store persistence/eviction, contribution behavior (badge on unseen changes, cleared when the Changes tab is shown in the side pane or an auxiliary window, no badge for summary-only restores), loaded-stats helpers. ./scripts/test.sh on the affected suites β€” 435 passing.


  • npm run typecheck-client, npm run hygiene, ESLint, stylelint, npm run valid-layers-check, npm run check-cyclic-dependencies β€” clean.

  • Live in a dev build: a real agent turn with the Files tab active badges the entry; activating Changes clears it; reloading and visiting existing sessions (fresh seen state, side panel hidden) shows no false badges.

17 total changed files
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Congrats, you've cleared the final file
Your attention span may now revert to "default human"