Conversation
sandy081
commented
Mar 3, 2026
- move changes action to title
- move changes action to title
There was a problem hiding this comment.
Pull request overview
This PR updates the Agent Sessions window UX by persisting the New Chat “draft” (including target/mode/repo selection) across reloads and by surfacing the active session’s changes summary in the title bar.
Changes:
- Persist/restore New Chat draft state (input, attachments, target, isolation mode, branch, repo/folder) via workspace storage.
- Add a changes (+/-) summary next to the repo label in the sessions title bar.
- Refactor the Changes view titlebar action plumbing (removing the custom action view item / menu contribution).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts | Computes and renders insertions/deletions summary in the title bar pill. |
| src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css | Styles the added changes summary (+/-) in the command center title widget. |
| src/vs/sessions/contrib/chat/browser/sessionTargetPicker.ts | Adds preferred/programmatic isolation mode APIs to support draft restore. |
| src/vs/sessions/contrib/chat/browser/newChatViewPane.ts | Implements draft-state tracking, persistence, and restore; adjusts send flow to use async/await. |
| src/vs/sessions/contrib/chat/browser/branchPicker.ts | Adds preferred branch support so draft restore can influence initial branch selection. |
| src/vs/sessions/contrib/changesView/browser/changesViewActions.ts | Removes the titlebar menu contribution/custom view item, leaving only the action registration + context key binding. |
| try { | ||
| await this.sessionsManagementService.sendRequestForNewSession( | ||
| session.resource, | ||
| options?.openNewAfterSend ? { openNewSessionView: true } : undefined | ||
| ); | ||
| this._newSessionListener.clear(); | ||
| this._contextAttachments.clear(); | ||
| }, e => { | ||
| } catch (e) { | ||
| this.logService.error('Failed to send request:', e); | ||
| }).finally(() => { | ||
| this._sending = false; | ||
| this._editor.updateOptions({ readOnly: false }); | ||
| this._updateSendButtonState(); | ||
| this._updateInputLoadingState(); | ||
| }); | ||
| } | ||
|
|
||
|
|
||
| this._sending = false; | ||
| this._editor.updateOptions({ readOnly: false }); | ||
| this._updateSendButtonState(); | ||
| this._updateInputLoadingState(); |
There was a problem hiding this comment.
After sendRequestForNewSession completes, sessionsManagementService disposes its internal _newSession (see SessionsManagementService.sendRequestForNewSession sets _newSession.value = undefined). This widget still keeps the same INewSession instance in its own MutableDisposable, so it can end up holding/disposing an already-disposed session later (and potentially acting on a disposed object). Clear/leak the widget’s _newSession reference after a successful send (as the previous code did) to avoid double-dispose and stale state.
| @@ -34,12 +25,6 @@ const openChangesViewActionOptions: IAction2Options = { | |||
| title: localize2('openChangesView', "Changes"), | |||
| icon: Codicon.diffMultiple, | |||
| f1: false, | |||
There was a problem hiding this comment.
OpenChangesViewAction is still registered but it’s no longer contributed to any menu and has f1: false, so it becomes effectively unreachable from the UI. Either re-add a menu contribution (e.g. Menus.TitleBarSessionMenu or the new title bar widget) and gating when clause, or make it discoverable via the Command Palette (f1: true).
| f1: false, | |
| f1: true, |
| const separator1 = $('span.agent-sessions-titlebar-separator'); | ||
| separator1.textContent = '\u00B7'; | ||
| centerGroup.appendChild(separator1); | ||
|
|
||
| const repoEl = $('span.agent-sessions-titlebar-repo'); | ||
| repoEl.textContent = repoLabel; | ||
| centerGroup.appendChild(repoEl); | ||
| } | ||
|
|
||
| // Changes summary shown next to the repo | ||
| if (changesSummary) { | ||
| const separator2 = $('span.agent-sessions-titlebar-separator'); | ||
| separator2.textContent = '\u00B7'; | ||
| centerGroup.appendChild(separator2); | ||
|
|
||
| const changesEl = $('span.agent-sessions-titlebar-changes'); | ||
|
|
||
| const addedEl = $('span.agent-sessions-titlebar-changes-added'); |
There was a problem hiding this comment.
The title bar now renders a changes summary, but it’s purely informational and doesn’t provide a way to open the Changes view. Since the existing OpenChangesViewAction menu entry was removed, this can leave users without a title bar affordance to navigate to changes. Consider wiring a click/keyboard handler on the changes summary to open the Changes view (or keep a menu action) so the summary is actionable.
- move changes action to title