Skip to content

sessions: share the session hover between the sessions list and chat pills - #332495

Merged
Benjamin Christopher Simmonds (benibenj) merged 2 commits into
mainfrom
benibenj/agents/hover-widget-structure-improvements
Aug 25, 2026
Merged

sessions: share the session hover between the sessions list and chat pills#332495
Benjamin Christopher Simmonds (benibenj) merged 2 commits into
mainfrom
benibenj/agents/hover-widget-structure-improvements

Conversation

@benibenj

Copy link
Copy Markdown
Contributor

The sessions list hover was an ad-hoc markdown string. It showed the source repository rather than the worktree a session actually works in, never used the word "Worktree", listed no pull requests, and named only the provider. It also could not be reused anywhere else.

What changed

A shared SessionSummaryHoverWidget in the workbench layer renders provider-neutral ISessionSummaryHoverData, plus a small per-window ISessionSummaryHoverService registry so agent-host-session:// pills in chat output show the same hover. Each window adapts its own data source onto that shape and omits what it cannot answer:

  • Agents window: ISession -> hover data (sessionHoverContent.ts), the richest source.
  • Editor window: IChatSessionItem -> hover data, which carries no worktree or pull requests, so those rows are simply absent.

New layout

Fix authentication redirect loop          <- title only, no icon
 folder    \home\user\projects\vscode
 worktree  Worktree - \home\...\vscode.worktrees\fix-auth-redirect
 branch    fix-auth-redirect - 2 files changed +132 -18
------------------------------------------
 PR icon   Fix authentication redirect loop        <- live state colors
 PR icon   Add a regression test for the redirect loop
 PR icon   Revert the earlier redirect workaround
------------------------------------------
Claude - Local Agent Host                 <- dimmed

Separators only appear between blocks that exist, so a session with no pull requests gets one rule and a quick chat none. Despite carrying more information, it stays about as compact as before.

Supporting model change

IGitHubPullRequestRef gained title and createdByThisSession. The agent-host provider populates both: titles come from the PR artifact labels the agent recorded, and createdByThisSession is the "main eligible" set (PRs the agent created plus PRs found for the session branch), excluding ones inherited from the checkout or merely referenced. Only pull requests the session produced are listed. Secondary PRs now also pick up their last-known state icon from IPullRequestIconCache, since only the main PR is polled live.

Validation

  • tsc --noEmit clean, eslint clean, stylelint clean, valid-layers-check passes
  • 227 passing in the affected suites (OpenSessionLinkOpenerContribution, LocalAgentHostSessionsProvider, SessionsLifecycleTracker), including a new test that the pill hover data resolves through the registered provider
  • New component fixtures (sessions/sessionHover) cover both data sources plus the empty cases, verified visually in the component explorer

…pills

The sessions list hover was built as an ad-hoc markdown string: it showed the
source repository rather than the worktree a session actually works in, never
said "Worktree", listed no pull requests, and named only the provider. It was
also unusable anywhere else.

Replace it with a SessionSummaryHoverWidget in the workbench layer that renders
provider-neutral ISessionSummaryHoverData, plus a small per-window registry so
agent-host-session:// pills in chat output show the same hover. Each window
adapts its own data source onto that shape - the Agents window from an ISession,
the editor window from an IChatSessionItem - and omits what it cannot answer.

The hover now reads: title / workspace, worktree, branch and diff stats /
one line per pull request the session created, in its live state color /
session type and provider. Rules only appear between blocks that exist, so it
stays about as compact as before while carrying more.

To support the pull request block, IGitHubPullRequestRef gained title and
createdByThisSession, populated by the agent-host provider from the artifacts
the agent recorded; secondary pull requests now also pick up their last-known
state icon from the icon cache.

Adds component fixtures covering both data sources and the empty cases.
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

Sandeep Somavarapu (@sandy081)

Matched files:

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

Ladislau Szomoru (@lszomoru)

Matched files:

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

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 77f86f3d Current: 24162725

Added (18)

sessions/sessionHover/SessionHover_Folder/Dark

current

sessions/sessionHover/SessionHover_Folder/Light

current

sessions/sessionHover/SessionHover_Worktree/Dark

current

sessions/sessionHover/SessionHover_Worktree/Light

current

sessions/sessionHover/SessionHover_WorktreeWithPullRequests/Dark

current

sessions/sessionHover/SessionHover_WorktreeWithPullRequests/Light

current

sessions/sessionHover/SessionHover_WorktreePending/Dark

current

sessions/sessionHover/SessionHover_WorktreePending/Light

current

sessions/sessionHover/SessionHover_CloudWorkspace/Dark

current

sessions/sessionHover/SessionHover_CloudWorkspace/Light

current

sessions/sessionHover/SessionHover_QuickChat/Dark

current

sessions/sessionHover/SessionHover_QuickChat/Light

current

sessions/sessionHover/SessionHover_LongValues/Dark

current

sessions/sessionHover/SessionHover_LongValues/Light

current

sessions/sessionHover/SessionHover_EditorWindowDataSource/Dark

current

sessions/sessionHover/SessionHover_EditorWindowDataSource/Light

current

sessions/sessionHover/SessionHover_TitleOnly/Dark

current

sessions/sessionHover/SessionHover_TitleOnly/Light

current

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

Introduces a shared session-summary hover for session lists and chat pills, with richer workspace, worktree, change, pull-request, and provider information.

Changes:

  • Adds a reusable hover widget and provider registry.
  • Integrates the hover into Agents and editor windows.
  • Enriches Agent Host pull-request metadata and visual fixtures.
Show a summary per file
File Description
src/vs/workbench/test/browser/componentFixtures/sessions/sessionHover.fixture.ts Adds hover visual fixtures.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatRichLink.ts Adds rich session-pill hovers.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownDecorationsRenderer.ts Injects the hover service.
src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts Registers the shared service.
src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.ts Implements hover-provider resolution.
src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.ts Implements the shared widget.
src/vs/workbench/contrib/chat/browser/agentSessions/media/sessionSummaryHover.css Styles the hover layout.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.ts Adapts editor session items.
src/vs/sessions/services/sessions/common/session.ts Extends pull-request references.
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts Uses the shared list hover.
src/vs/sessions/contrib/sessions/browser/sessionHoverContent.ts Adapts Agents sessions.
src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts Populates PR titles, ownership, and icons.
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionArtifacts.ts Collects PR artifact titles.
src/vs/sessions/contrib/chat/test/browser/openSessionLinkOpener.test.ts Tests Agents-window hover resolution.
src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.ts Registers the Agents-window provider.

Review details

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 15/15 changed files
  • Comments generated: 5
  • Review effort level: Balanced

Comment thread src/vs/sessions/contrib/sessions/browser/sessionHoverContent.ts
Hygiene rejected the new stylesheet on two counts, both introduced by the
follow-up that moved icons onto the first line of a wrapping row:

- Comment continuation lines were indented with spaces to align under the
  opening `/*`. The indentation rule only accepts tabs (or a leading ` *`),
  so those lines now start at the enclosing indentation.
- `--session-summary-hover-line-height` was a locally-defined custom property,
  which stylelint reports as an unknown variable. It only ever held one value,
  so both sites now use the literal instead.

The icon keeps an explicit `line-height`: codicon.css sets `font: ... 16px/1`
whose shorthand carries `line-height: 1`, and at equal specificity that would
otherwise leave the glyph box shorter than the text line it aligns to. Computed
geometry is unchanged from the version verified in the component explorer.
@benibenj
Benjamin Christopher Simmonds (benibenj) merged commit 5aaf097 into main Aug 25, 2026
27 checks passed
@benibenj
Benjamin Christopher Simmonds (benibenj) deleted the benibenj/agents/hover-widget-structure-improvements branch August 25, 2026 08:32
@vs-code-engineering vs-code-engineering Bot added this to the 1.136.0 milestone Aug 25, 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