Skip to content

sessions: add rich hover for titlebar and session list items#317975

Merged
sandy081 merged 2 commits into
mainfrom
sandy081/sessions-titlebar-hover
May 22, 2026
Merged

sessions: add rich hover for titlebar and session list items#317975
sandy081 merged 2 commits into
mainfrom
sandy081/sessions-titlebar-hover

Conversation

@sandy081
Copy link
Copy Markdown
Member

Summary

Adds a rich hover tooltip for sessions in both the titlebar pill and session list items.

Titlebar pill

  • Inline diff stats (+insertions -deletions) shown directly in the pill
  • Improved truncation: title shrinks first, keeping folder/branch/diff metadata visible
  • Beacon-style hover (pointer below) with full session details

Session list items

  • Rich hover positioned to the right of the row (like Extensions list)
  • Instant transition between items via shared groupId
  • Hover triggers on the full row, not just the title

Hover content (shared)

Both surfaces use a new buildSessionHoverContent() that returns a MarkdownString:

  1. Session icon + bold title
  2. Folder/worktree icon + full path · git branch
  3. File count + colored diff stats
  4. Provider name

Files changed

  • sessionHoverContent.ts — new reusable hover builder
  • sessionsTitleBarWidget.ts — inline diff stats + beacon hover
  • sessionsTitleBarWidget.css — pill truncation + diff stat colors
  • sessionsList.ts — rich hover on session rows

- Add inline diff stats (+insertions -deletions) to the titlebar pill
- Improve pill truncation so title shrinks first, keeping metadata visible
- Add a beacon-style hover on the titlebar pill showing:
  - Session icon + bold title
  - Folder/worktree icon + full path · git branch
  - File count + colored diff stats
  - Provider name
- Add the same rich hover to session list items, positioned to the right
  with instant transition between items (groupId)
- Extract reusable buildSessionHoverContent() returning MarkdownString
  so both titlebar and session list share the same hover content

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 22, 2026 11:24
@sandy081 sandy081 enabled auto-merge (squash) May 22, 2026 11:25
@sandy081 sandy081 self-assigned this May 22, 2026
@sandy081 sandy081 added this to the 1.122.0 milestone May 22, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a shared “rich hover” tooltip for session surfaces in the Agents (sessions) window, and enhances the titlebar session pill to surface diff stats and improved truncation behavior.

Changes:

  • Introduces buildSessionHoverContent() to generate a reusable session hover MarkdownString (icon/title, folder+branch, diff stats, provider).
  • Wires rich hovers into session list rows (right-positioned hover, shared groupId for quick transitions).
  • Updates the titlebar pill to show inline diff stats and uses a pointer/beacon-style hover; adjusts CSS to prioritize truncation of the title before metadata.
Show a summary per file
File Description
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts Adds a delayed rich hover to session list rows using the shared hover builder and provider lookup service.
src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts Adds diff stat aggregation/rendering in the titlebar pill and replaces the basic hover with a delayed pointer-style hover using the shared builder.
src/vs/sessions/contrib/sessions/browser/sessionHoverContent.ts New shared hover markdown builder for session details (folder/branch/diffs/provider).
src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css Adjusts pill sizing/truncation behavior and adds styling for inline diff stats.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 3

Comment thread src/vs/sessions/contrib/sessions/browser/sessionHoverContent.ts Outdated
Comment thread src/vs/sessions/contrib/sessions/browser/sessionHoverContent.ts Outdated
Comment thread src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts Outdated
- Drop `isTrusted: true` from session hover MarkdownString (avoid command-link
  execution risk with workspace-derived values)
- Use appendText for user-controlled values (folder path, branch) so markdown
  characters are properly escaped
- Extract getSessionDiffStats helper into sessionHoverContent.ts and reuse it
  from the titlebar widget to avoid duplicated diff aggregation logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sandy081 sandy081 merged commit bb678fe into main May 22, 2026
39 of 40 checks passed
@sandy081 sandy081 deleted the sandy081/sessions-titlebar-hover branch May 22, 2026 12: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.

3 participants