sessions: add rich hover for titlebar and session list items#317975
Merged
Conversation
- 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>
Contributor
There was a problem hiding this comment.
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 hoverMarkdownString(icon/title, folder+branch, diff stats, provider). - Wires rich hovers into session list rows (right-positioned hover, shared
groupIdfor 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
- 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>
lszomoru
approved these changes
May 22, 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.
Summary
Adds a rich hover tooltip for sessions in both the titlebar pill and session list items.
Titlebar pill
+insertions -deletions) shown directly in the pillSession list items
groupIdHover content (shared)
Both surfaces use a new
buildSessionHoverContent()that returns aMarkdownString:Files changed
sessionHoverContent.ts— new reusable hover buildersessionsTitleBarWidget.ts— inline diff stats + beacon hoversessionsTitleBarWidget.css— pill truncation + diff stat colorssessionsList.ts— rich hover on session rows