Skip to content

Changes editor: changed files list, opt-in by its host - #345658

Merged
Sandeep Somavarapu (sandy081) merged 6 commits into
mainfrom
agents/changes-file-list
Nov 4, 2026
Merged

Sandeep Somavarapu (sandy081) merged 6 commits into
mainfrom
agents/changes-file-list

Conversation

@sandy081

@sandy081 Sandeep Somavarapu (sandy081) commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

The Changes editor of the Agents window can show the list of the changed files beside its diffs, as the workbench's multi diff editor can. The list is opt-in by its host and off by default, so the main Agents window keeps showing the Changes editor without it, as before.

  • Option: SessionChangesEditorFileListContext (context key sessionChangesEditorFileList, default false), in src/vs/sessions/contrib/changes/common/changes.ts. A host enables the list for the Changes editors it shows by setting the key in its own scoped context key service, which the editors inherit. This can be an editor part (a window, such as an auxiliary window) or a single editor group: SessionChangesEditorFileListContext.bindTo(scopedContextKeyService).set(true). The host does not need to import any Changes-editor code, and the Changes editor does not know about any host. The chat windows (chat windows: chat windows of the Agents window on parts, with drag and drop between parts #345683) will turn it on.
  • While enabled, the Changes editor hosts the workbench's MultiDiffEditorWithFileListWidget. The list shows unless the user hides it with Toggle Files. Hiding is remembered and shared with the multi diff editors. The list doesn't depend on the experimental multiDiffEditor.experimental.fileList setting, which still gates the list of the workbench's multi diff editor.
  • Toggle Files is the workbench's multiDiffEditor.toggleFileList, in the More Actions menu of the tab bar, after Collapse All Diffs, Word Wrap and Diff View. It only appears while the list is enabled. Focus File List is enabled only while the list is visible. Focus File List and the list's accessibility help apply to any editor that hosts the list (IMultiDiffEditorFileListHost).
  • While the list shows, a border runs under the header row (the "Uncommitted ⌄" row) and joins the left border of the list in one continuous line.

With the option off (the main Agents window), nothing visible changes.

Screenshots

Before and in the main Agents window: the Changes editor shows only the diffs.
With a host enabling the option: the changed files list shows beside the diffs. The border under the header row joins the list's separator.

(Screenshots: to be attached with #345683, which is the first host to enable the option.)

How to test

  1. In the main Agents window, open a session with changes, then open its Changes editor. No changed files list appears, and More Actions in the tab bar has no Toggle Files.
  2. In a host that sets sessionChangesEditorFileList (the chat windows of chat windows: chat windows of the Agents window on parts, with drag and drop between parts #345683), open the Changes editor. The list shows beside the diffs, and a single line runs under the header row into the list's left border.
  3. In that host, use More Actions → Toggle Files to hide the list, and run it again to show it. The state survives a reload. Focus File List moves focus into the list.

Validation

  • New and updated tests, failing without the change:
    • SessionChangesEditor changed files list: uses a real host context key service and the real list widget. Off by default: no list, no header border, and Focus File List does nothing. When the host enables the key, the list shows and the header border is 1px in the list's border color at the top of the body. Toggle Files hides the list, Focus File List shows it again, and the list goes away when the host turns the key off.
    • Changes View Actions: Toggle Files only appears when the list is available.
    • Multi diff editor file list of any host: Focus File List focuses any host. The hidden state doesn't depend on the setting.
  • ./scripts/test.sh --reporter dot --runGlob "vs/{sessions/contrib/changes,workbench/contrib/multiDiffEditor}/**/*.test.js" (Electron): 268 passing.
  • node test/unit/browser/index.js --runGlob "**/sessions/contrib/changes/test/browser/{sessionChangesEditor,changesViewActions}.test.js" --browser chromium: 33 passing.
  • pnpm run typecheck-client: passed (exit code 0). pnpm run eslint <changed .ts files>: passed. node build/hygiene.ts <changed files>: passed.
  • Not run live: the main window needs no live check because the option is off there. The header border will be checked live once chat windows: chat windows of the Agents window on parts, with drag and drop between parts #345683 enables the option.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 20:58

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.

🟡 Changes recommended

Hiding the file list removes Focus File List from the Command Palette, while auxiliary Changes-editor windows lack a Toggle Files action, leaving key file-list controls unavailable.

2 open issues
What changed in this PR

Adds the shared multi-diff changed-files list to the Agents window’s Changes editor, reusing workbench controls and persisted visibility preferences.

Changes:

  • Hosts the file-list widget independently of the experimental workbench setting.
  • Adds Toggle Files to the tab bar’s More Actions menu.
  • Generalizes file-list focus and accessibility help to supported editor hosts, with related tests.
File Description
src/​vs/​workbench/​contrib/​multiDiffEditor/​test/​browser/​multiDiffEditorWithFileList.test.ts Tests host-based focus and shared visibility state.
src/​vs/​workbench/​contrib/​multiDiffEditor/​common/​multiDiffEditor.ts Exposes shared hidden-state observation, command ID, and host contract.
src/​vs/​workbench/​contrib/​multiDiffEditor/​browser/​multiDiffEditorAccessibilityHelp.ts Adapts accessibility help to different file-list hosts.
src/​vs/​workbench/​contrib/​multiDiffEditor/​browser/​actions.ts Generalizes Focus File List and reuses the toggle command constant.
src/​vs/​sessions/​contrib/​changes/​test/​browser/​sessionChangesEditor.test.ts Tests file-list visibility, focus, and layout delegation.
src/​vs/​sessions/​contrib/​changes/​test/​browser/​changesViewActions.test.ts Tests Toggle Files menu placement and visibility conditions.
src/​vs/​sessions/​contrib/​changes/​browser/​sessionChangesEditor.ts Integrates the shared file-list widget and context keys.
src/​vs/​sessions/​contrib/​changes/​browser/​changesViewActions.ts Adds the shared toggle command to the Changes tab menu.

Review effort: Balanced

Sandeep Somavarapu (sandy081) added a commit that referenced this pull request Nov 2, 2026
The Changes editor of the Agents window shows its diffs without the list of the changed files that the workbench's multi diff editor can show beside them. It now hosts the workbench's changed files list beside its diffs, in every window it shows in. The list shows unless the user hides it with Toggle Files in the More Actions menu of the tab bar, which hides it in every multi diff editor and is remembered; it does not depend on the experimental file list setting of the multi diff editor. Focus File List, and the accessibility help of the list, apply to any editor that hosts the list.

Stacked from #345658 (unmerged). On this base the Changes editor's UI element factory also takes the editor's session scope.

Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081) added a commit that referenced this pull request Nov 3, 2026
The Changes editor of the Agents window shows its diffs without the list of the changed files that the workbench's multi diff editor can show beside them. It now hosts the workbench's changed files list beside its diffs, in every window it shows in. The list shows unless the user hides it with Toggle Files in the More Actions menu of the tab bar, which hides it in every multi diff editor and is remembered; it does not depend on the experimental file list setting of the multi diff editor. Focus File List, and the accessibility help of the list, apply to any editor that hosts the list.

Stacked from #345658 (unmerged). On this base the Changes editor's UI element factory also takes the editor's session scope.

Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081) added a commit that referenced this pull request Nov 3, 2026
The Changes editor of the Agents window shows its diffs without the list of the changed files that the workbench's multi diff editor can show beside them. It now hosts the workbench's changed files list beside its diffs, in every window it shows in. The list shows unless the user hides it with Toggle Files in the More Actions menu of the tab bar, which hides it in every multi diff editor and is remembered; it does not depend on the experimental file list setting of the multi diff editor. Focus File List, and the accessibility help of the list, apply to any editor that hosts the list.

Stacked from #345658 (unmerged). On this base the Changes editor's UI element factory also takes the editor's session scope.

Co-authored-by: Copilot <[email protected]>
@sandy081 Sandeep Somavarapu (sandy081) changed the title Show the changed files list in the Changes editor Changes editor: changed files list, opt-in by its host Nov 3, 2026
The Changes editor of the Agents window shows its diffs without the list of the changed files that the workbench's multi diff editor can show beside them. It now hosts the workbench's changed files list beside its diffs, in every window it shows in. The list shows unless the user hides it with Toggle Files in the More Actions menu of the tab bar, which hides it in every multi diff editor and is remembered; it does not depend on the experimental file list setting of the multi diff editor. Focus File List, and the accessibility help of the list, apply to any editor that hosts the list.

Co-authored-by: Copilot <[email protected]>
… enables it

The changed files list of the Changes editor is now opt-in: it shows only when its host sets the sessionChangesEditorFileList context key (SessionChangesEditorFileListContext) in its scoped context key service, such as the one of an editor part or editor group. It is off by default, so the main Agents window shows the Changes editor without the list, as before. Toggle Files and Focus File List only apply while the list is enabled. While the list shows, a border under the header row joins the separator of the list in one line.

Co-authored-by: Copilot <[email protected]>
Run Code Review, a More Actions menu with the diff actions (Collapse/Expand All, Word Wrap, Diff View, Files View) and, behind a separator, Toggle Files where the host enables the changed files list, move from the tab row to the right of the header row above the diffs, through a new SessionsEditorHeaderSecondary menu.

Co-authored-by: Copilot <[email protected]>
The first diff card of the Changes editor dropped its top margin, so it sat flush under the header row. It now keeps the margin of the cards below it, the same var(--vscode-spacing-size40) gap the multi-diff editor puts between cards.

Co-authored-by: Copilot <[email protected]>
While the changed files list shows, the line under the header covered the top row of the gap above the first diff card. It now sits on the header's last row, so that gap matches the gap between cards.

Co-authored-by: Copilot <[email protected]>
@sandy081
Sandeep Somavarapu (sandy081) marked this pull request as ready for review November 3, 2026 23:13
Focus File List now requires an editor that supports the changed files
list instead of a visible list, so it stays in the Command Palette after
Toggle Files hides the list, and the multi diff editor shows the list
before focusing it, like the Changes editor.

Co-authored-by: Copilot <[email protected]>
@sandy081
Sandeep Somavarapu (sandy081) merged commit f307ee6 into main Nov 4, 2026
107 of 109 checks passed
@sandy081
Sandeep Somavarapu (sandy081) deleted the agents/changes-file-list branch November 4, 2026 00:13
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 4, 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