Skip to content

Agents - rework open changes action#311665

Merged
lszomoru merged 1 commit intomainfrom
lszomoru/victorious-marlin
Apr 21, 2026
Merged

Agents - rework open changes action#311665
lszomoru merged 1 commit intomainfrom
lszomoru/victorious-marlin

Conversation

@lszomoru
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 21, 2026 11:40
@lszomoru lszomoru enabled auto-merge (squash) April 21, 2026 11:40
@lszomoru lszomoru self-assigned this Apr 21, 2026
@lszomoru lszomoru added this to the 1.118.0 milestone Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: df028283 Current: 7794185b

Changed (1)

agentSessionsViewer/ApprovalRowLongLabel/Light
Before After
before after

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

This PR reworks “Open Changes” handling in the Agents Sessions Changes view by moving the per-file toolbar action registration to the per-change toolbar menu and by changing how selected resources are mapped to session changes before opening editors.

Changes:

  • Register the per-file “Open File/Open Changes” action under MenuId.ChatEditingSessionChangeToolbar (instead of the session-level changes toolbar).
  • Rework “Open Changes” to collect matching session changes for the selected resources and open them as editors in a batch.
Show a summary per file
File Description
src/vs/sessions/contrib/changes/browser/changesViewActions.ts Updates menu placement for per-file actions and refactors the “Open Changes” action to filter session changes and open them in bulk.

Copilot's findings

Comments suppressed due to low confidence (2)

src/vs/sessions/contrib/changes/browser/changesViewActions.ts:261

  • editorService.openEditor({ original: { resource: change.originalUri }, modified: { resource: change.modifiedUri } }) does not handle added/deleted changes where originalUri or modifiedUri can be undefined (notably for IChatSessionFileChange2). This ends up passing resource: undefined into the untyped diff input and can open an unintended untitled editor or otherwise fail. Handle the 3 cases explicitly: (1) both URIs -> diff editor, (2) deletion -> open originalUri, (3) addition -> open modifiedUri/change.uri as a normal resource editor (similar to ChangesViewPane._openFileItem).
		await Promise.all(changes.map(change => editorService.openEditor({
			original: { resource: change.originalUri },
			modified: { resource: change.modifiedUri }
		})));

src/vs/sessions/contrib/changes/browser/changesViewActions.ts:261

  • Opening multiple editors via Promise.all(changes.map(...openEditor)) can produce non-deterministic editor activation order (whichever promise resolves last wins) and repeats group/override resolution per editor. Prefer editorService.openEditors(...) for batch opens (it resolves target groups once and opens per-group in a controlled way), or open sequentially if you need deterministic “last opened is active” behavior.
		await Promise.all(changes.map(change => editorService.openEditor({
			original: { resource: change.originalUri },
			modified: { resource: change.modifiedUri }
		})));
  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread src/vs/sessions/contrib/changes/browser/changesViewActions.ts
@lszomoru lszomoru merged commit fa123b8 into main Apr 21, 2026
30 checks passed
@lszomoru lszomoru deleted the lszomoru/victorious-marlin branch April 21, 2026 12:03
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