Skip to content

sessions: consistent secondary-button pills for session header meta actions#322704

Merged
sandy081 merged 2 commits into
mainfrom
sandy081/sessions-header-meta-row
Jun 24, 2026
Merged

sessions: consistent secondary-button pills for session header meta actions#322704
sandy081 merged 2 commits into
mainfrom
sandy081/sessions-header-meta-row

Conversation

@sandy081

@sandy081 sandy081 commented Jun 24, 2026

Copy link
Copy Markdown
Member

What

Reworks the Agents window session header meta row (the row under the title showing the workspace label plus contributed action buttons) so that contributed actions render consistently, and refines the visual design.

  • Shared meta action view item — adds SessionHeaderMetaActionViewItem, a generic renderer that draws any action contributed into Menus.SessionHeaderMeta as a compact secondary Button pill with an inline icon title label. The Changes diff-stats and GitHub pull request view items now extend this base, so everything in the meta row looks uniform. Features can still register their own action view item if needed.
  • Pull request pill — shows the themed PR state icon + #<number>. The icon color is applied inline with !important priority so it beats button.css's forced .monaco-text-button .codicon { color: inherit !important } and reflects the live PR state. The combined-glyph horizontal advance is clamped so the label sits tight against the icon.
  • Title icon — the title shows the read/unread dot indicator again (filled link-colored dot when unread, small muted dot when read); neither the session-type icon nor the PR icon appears in the title, since the PR is surfaced in the meta row.
  • Layout polish — removed the workspace separator dot, reversed the order so Changes precedes PR, and tightened the meta-button focus ring (removed the meta row's overflow: hidden clip — the workspace label self-truncates — and set outline-offset: 0 so the ring hugs the border instead of clipping top/bottom).
  • Branch changes — the Changes pill now always reflects the Branch Changes changeset (the branch-vs-base diff), located in IActiveSession.changesets by a new shared BRANCH_CHANGES_CHANGESET_ID, so it is independent of whichever changeset the Changes view currently has selected. Falls back to IActiveSession.changes when no branch changeset is present.

Why

Previously the meta-row actions rendered inconsistently (plain labels vs. ad-hoc styling) and the diff-stats value tracked the session's raw changes rather than the branch diff. This makes contributed meta actions render as consistent pills and pins the Changes value to the branch diff.

Notes for reviewers

  • Most changes are scoped to src/vs/sessions/. The one shared addition outside it is the component fixture update (sessionHeader.fixture.ts) which now provides a changesets observable for the mock session.
  • BRANCH_CHANGES_CHANGESET_ID is added to services/sessions/common/session.ts and reused by both the Copilot chat sessions provider and the changes contribution to avoid string coupling.
  • Validated: typecheck-client, valid-layers-check, ESLint, and hygiene all pass. Component screenshots regenerated (no errors).

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…button pills

Render contributed session-header meta-row actions (Changes diff-stats and the
GitHub pull request) as consistent compact secondary Button pills with an inline
"icon title" label via a new shared SessionHeaderMetaActionViewItem, so any
feature contributing into Menus.SessionHeaderMeta renders uniformly. Changes and
PR view items extend this base.

- PR pill shows the themed PR state icon + #<number>; icon color is set inline
  with !important priority (wins over button.css's forced codicon color), and
  the combined-glyph advance is clamped so the label sits tight against the icon.
- Title now shows the read/unread dot indicator again (no session type or PR
  icon); the PR is surfaced in the meta row instead.
- Removed the workspace separator dot; reversed order so Changes precedes PR.
- Tightened the meta-button focus ring: removed the meta row's overflow clip
  (the workspace label self-truncates) and set outline-offset to 0 so the ring
  hugs the border without clipping.
- The Changes pill always reflects the Branch Changes changeset (branch-vs-base
  diff), located by the shared BRANCH_CHANGES_CHANGESET_ID, independent of the
  changeset selected in the Changes view.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 24, 2026 10:49
@sandy081 sandy081 self-assigned this Jun 24, 2026
@sandy081 sandy081 enabled auto-merge (squash) June 24, 2026 10:50
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@benibenj

Matched files:

  • src/vs/sessions/browser/parts/media/chatCompositeBar.css
  • src/vs/sessions/browser/parts/sessionHeader.ts
  • src/vs/sessions/browser/parts/sessionHeaderMetaActionViewItem.ts
  • src/vs/sessions/browser/parts/sessionView.ts

@lszomoru

Matched files:

  • src/vs/sessions/services/sessions/browser/sessionsListModelService.ts
  • src/vs/sessions/services/sessions/common/session.ts

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 57a6f504 Current: f48b8f5d

Changed (20)

sessions/openPullRequest/OpenPullRequest_Open/Dark
Before After
before after
sessions/openPullRequest/OpenPullRequest_Open/Light
Before After
before after
sessions/openPullRequest/OpenPullRequest_Draft/Dark
Before After
before after
sessions/openPullRequest/OpenPullRequest_Draft/Light
Before After
before after
sessions/sessionHeader/SessionHeader_WithPullRequest/Dark
Before After
before after
sessions/sessionHeader/SessionHeader_WithPullRequest/Light
Before After
before after
sessions/sessionHeader/SessionHeader_InProgress/Dark
Before After
before after
sessions/sessionHeader/SessionHeader_InProgress/Light
Before After
before after
sessions/sessionHeader/SessionHeader_LongTitle/Dark
Before After
before after
sessions/sessionHeader/SessionHeader_LongTitle/Light
Before After
before after
sessions/viewAllChanges/ViewAllChanges_SingleFile/Dark
Before After
before after
sessions/viewAllChanges/ViewAllChanges_SingleFile/Light
Before After
before after
sessions/viewAllChanges/ViewAllChanges_MultipleFiles/Dark
Before After
before after
sessions/viewAllChanges/ViewAllChanges_MultipleFiles/Light
Before After
before after
sessions/viewAllChanges/ViewAllChanges_OnlyInsertions/Dark
Before After
before after
sessions/viewAllChanges/ViewAllChanges_OnlyInsertions/Light
Before After
before after
sessions/viewAllChanges/ViewAllChanges_OnlyDeletions/Dark
Before After
before after
sessions/viewAllChanges/ViewAllChanges_OnlyDeletions/Light
Before After
before after
sessions/viewAllChanges/ViewAllChanges_NoChanges/Dark
Before After
before after
sessions/viewAllChanges/ViewAllChanges_NoChanges/Light
Before After
before after

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refines the Agents window session header “meta row” to render contributed actions consistently as compact secondary-button pills, and updates the “Changes” pill to always reflect the branch-vs-base changeset rather than the currently selected changeset in the Changes view.

Changes:

  • Introduces a shared SessionHeaderMetaActionViewItem base renderer so Menus.SessionHeaderMeta actions render uniformly as compact secondary Button pills (with GitHub PR and Changes view items extending it).
  • Adds a shared BRANCH_CHANGES_CHANGESET_ID constant and updates the header + Changes contribution to locate and display the branch-diff changeset consistently (fallback to IActiveSession.changes).
  • Updates header/meta-row layout and styling (ordering, focus ring behavior, separator removal) and adjusts fixtures/docs accordingly.
Show a summary per file
File Description
src/vs/workbench/test/browser/componentFixtures/sessions/sessionHeader.fixture.ts Updates session header fixture mocks to include changesets, icon, and revised meta menu ordering.
src/vs/sessions/services/sessions/common/session.ts Adds exported BRANCH_CHANGES_CHANGESET_ID well-known changeset id constant.
src/vs/sessions/services/sessions/browser/sessionsListModelService.ts Renames getStatusIcon’s optional parameter to a more generic “completed state” icon.
src/vs/sessions/LAYOUT.md Updates Agents window documentation for the new meta-row rendering and related UI pitfalls.
src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.ts Switches the branch changes changeset id to the shared constant.
src/vs/sessions/contrib/github/browser/pullRequestActions.ts Refactors PR pill to extend the shared meta action view item and render icon + #<number>.
src/vs/sessions/contrib/changes/browser/changesActions.ts Refactors Changes pill to extend the shared meta action view item and read stats from the branch changeset by id.
src/vs/sessions/browser/sessionStatusIcon.ts Renames parameter plumbing to match completedStateIcon naming.
src/vs/sessions/browser/parts/sessionView.ts Gates “has changes” context key from the branch changeset so header visibility matches pill counts.
src/vs/sessions/browser/parts/sessionHeaderMetaActionViewItem.ts Adds the new shared meta action renderer based on Button.
src/vs/sessions/browser/parts/sessionHeader.ts Uses the shared renderer as the default for meta toolbar items; removes PR icon from the title/status flow and adjusts meta row visibility logic.
src/vs/sessions/browser/parts/media/chatCompositeBar.css Updates meta-row layout/styling to match the new pill-based design and focus ring behavior.

Copilot's findings

  • Files reviewed: 12/12 changed files
  • Comments generated: 2

Comment thread src/vs/sessions/browser/parts/sessionHeaderMetaActionViewItem.ts
Comment thread src/vs/sessions/browser/parts/sessionHeader.ts Outdated
- SessionHeaderMetaActionViewItem: fall back to the action label for the tooltip
  (MenuItemAction.tooltip defaults to ''), and remove the aria-label attribute
  when there is no tooltip instead of writing an empty string, so the default
  meta pill is always labelled for screen readers and keeps a managed hover.
- sessionHeader.ts: update the stale comment that described meta actions as
  "clickable menu item" to reflect the secondary-button pill rendering.
- viewAllChanges.fixture.ts: provide a Branch Changes changeset on the mock
  session so the diff-stats pill resolves its counts (the view item now reads
  the branch changeset).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sandy081 sandy081 merged commit d05ede2 into main Jun 24, 2026
28 checks passed
@sandy081 sandy081 deleted the sandy081/sessions-header-meta-row branch June 24, 2026 11:52
@vs-code-engineering vs-code-engineering Bot added this to the 1.127.0 milestone Jun 24, 2026
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.

3 participants