Repository navigation
Show New Chat as a "New" split button in the Chat view's sessions list title - #350601
Draft
Sandeep Somavarapu (sandy081) wants to merge 10 commits into
Draft
Sandeep Somavarapu (sandy081) wants to merge 10 commits into
Sandeep Somavarapu (sandy081) wants to merge 10 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The split button can overlap neighboring actions after margin changes, suppress menu-command error notifications, and unintentionally collapse the Chat pane on touch activation.
3 open issues
What changed in this PR
Adds a responsive “New” split button to the Chat view’s sessions-list title, while preserving the existing New menu and leaving shared toolbar code unchanged.
Changes:
- Adapts the button between label-with-keybinding, label-only, and icon-only sizes.
- Integrates the button with the sessions list and refreshes title actions when the list changes.
- Adds browser tests for sizing, action execution, menu contents, and title refreshes.
| File | Description |
|---|---|
src/vs/workbench/contrib/sessions/test/browser/agentsView/chatViewNewSplitButton.test.ts |
Tests split-button behavior and responsive sizing. |
src/vs/workbench/contrib/sessions/browser/media/chatViewNewSplitButton.css |
Styles the button’s three sizes and keybinding hint. |
src/vs/workbench/contrib/sessions/browser/agentsView/chatViewSessionsList.ts |
Creates the custom button for the New menu. |
src/vs/workbench/contrib/sessions/browser/agentsView/chatViewNewSplitButton.ts |
Implements sizing, action execution, and focus handling. |
src/vs/workbench/contrib/chat/test/browser/widgetHosts/viewPane/chatViewPane.test.ts |
Verifies title-action refreshes when the sessions list changes. |
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts |
Refreshes title actions when the sessions control becomes available or changes. |
Review effort: Balanced
…t title While the Chat view shows the shared sessions list, its New Chat title action renders as a split button: "New" with the keybinding of New Chat, and a chevron that opens the same New Chat menu as before. It reuses ButtonWithDropdown and KeybindingLabel with the Agents window's New button colors, and hides the keybinding when the title is narrow. The Chat view's own sessions list keeps its current title action. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The primary button never gets the monaco-text-button class, so its padding, gap and border rules did not apply. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Instead of a fixed title width, the New split button measures its full "New ⌘N | ▾" width against the next title action and hides the keybinding exactly when it would touch it, showing it again when space returns. It observes the title's size, like the toolbar's responsive behavior, and rechecks when keybindings change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The toolbar now reserves the width that the button reports for its compact form, also while it is overflowed, so the compact button never overlaps the next action. The keybinding's fit is also updated when the other actions or the title change at a constant width, and the icon variants of New Chat show its keybinding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The button picks its largest size that keeps a pixel before the next title action, before paint: "New ⌘N | ▾", then "New | ▾", then the icon with its dropdown. It shows the icon outside the responsive title toolbar of the Chat view. The shared toolbar and action bar are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the keybinding measurable in every size and observe it, so a font change at the same width fits the button again before the paint. Skip laying out the sizes again when the widths the fit depends on and the current size are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A replaced action can have contents of the same width but take other room around them, so a membership change invalidates the cached fit, and the fit inputs include the display, margins and minimum width of the other actions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The menu's runner rethrows the title runner's error, so the context menu reports a failed command when the Chat view is in a pane header without the composite title's error listener. Both parts of the button consume taps, so a containing pane header does not toggle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sandeep Somavarapu (sandy081)
force-pushed
the
agents/sessions-list-new-split-button
branch
from
November 26, 2026 22:16
b5d1f04 to
8b008af
Compare
The New split button's menu runner now owns the errors of the actions it runs: it reports them with the notification service, as it outlives the menu, which stops listening when it closes. It runs the actions with the title's context but not through the title's runner, so a composite title, which reports its runner's errors, does not report them twice. Cancellations are not reported. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The toolbar disposes the button when it moves New into its overflow, which stopped a pending menu command from reporting its error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.

When the sessions list is shown in the Chat view, its title shows New Chat as a "New" split button. The main part starts a new chat and shows its keybinding, for example "New ⌘N". The chevron opens the same New menu as before (New Chat, New Chat Editor, New Chat Window). This is on by default wherever the sessions list title is shown.
The button adapts to the space actually available, with no fixed width breakpoints. It has three sizes: "New ⌘N | ▾", then "New | ▾", then "+ | ▾". It always picks the largest size that still leaves room before the next title action. The size is picked after layout and before paint, so the button never overlaps its neighbors, not even for one frame. When the Chat view is moved to a place without the responsive title toolbar, it shows "+ | ▾".
Main parts:
ChatViewNewSplitButtonActionViewItemrenders the split button. It measures the room before the next title action and picks the size. It updates when the title width, the other actions, their margins, the label or keybinding fonts, or the keybindings change, and it skips the work when none of these changed.No shared toolbar, action bar or layout code changes.
Known limit: at extreme side bar widths (below about 260px), the title toolbar's own overflow handling moves the button into the "…" menu, like any other title action.
How to test:
chat.viewSessions.sessionsList.enabledand open the Chat view.Written by GitHub Copilot on behalf of Sandeep Somavarapu (@sandy081)