Skip to content

Sessions - view all changes action uses the diff editor + navigation tree#308452

Merged
lszomoru merged 1 commit intomainfrom
lszomoru/diplomatic-python
Apr 8, 2026
Merged

Sessions - view all changes action uses the diff editor + navigation tree#308452
lszomoru merged 1 commit intomainfrom
lszomoru/diplomatic-python

Conversation

@lszomoru
Copy link
Copy Markdown
Member

@lszomoru lszomoru commented Apr 8, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 8, 2026 08:10
@lszomoru lszomoru enabled auto-merge (squash) April 8, 2026 08:10
@lszomoru lszomoru self-assigned this Apr 8, 2026
@lszomoru lszomoru added this to the 1.116.0 milestone Apr 8, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jrieken

Matched files:

  • src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts

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 refactors how the “View All Changes” command is wired up in the Sessions window by relocating the action registration into the Sessions Changes view contribution and exposing a ChangesViewPane.openChanges() helper that opens the first changed file with modal diff navigation.

Changes:

  • Remove ViewAllSessionChangesAction from the workbench chat editing actions and stop treating it specially in the chat input toolbar button configuration.
  • Add a Sessions-scoped ViewAllSessionChangesAction that calls into the Sessions Changes view (ChangesViewPane.openChanges()).
  • Refactor file opening logic in ChangesViewPane into a reusable _openFileItem(...) helper and add openChanges().
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts Removes the “View All Changes” action import and its icon-only button configuration in the chat input button bar.
src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts Deletes the old ViewAllSessionChangesAction implementation and related imports.
src/vs/sessions/contrib/changes/browser/changesViewActions.ts Introduces a Sessions Changes-view action (chatEditing.viewAllSessionChanges) that triggers ChangesViewPane.openChanges().
src/vs/sessions/contrib/changes/browser/changesView.ts Adds openChanges() and extracts _openFileItem(...) from the inline tree handler.

Copilot's findings

Comments suppressed due to low confidence (2)

src/vs/sessions/contrib/changes/browser/changesView.ts:909

  • openChanges() awaits _openFileItem(...), but _openFileItem currently doesn't await editorService.openEditor(...), so openChanges() resolves before the editor is actually opened. Either await the openEditor call(s) inside _openFileItem (and keep the async contract) or make both methods synchronous to avoid misleading await usage.
	async openChanges(): Promise<void> {
		const items = this.viewModel.activeSessionChangesObs.get();
		if (items.length === 0) {
			return;
		}

		const changes = toIChangesFileItem(items);
		await this._openFileItem(changes[0], changes, false, false, false, changes.length > 1);
	}

src/vs/sessions/contrib/changes/browser/changesView.ts:919

  • Avoid creating a new bound function on every open: this._openFileItem.bind(this) allocates and is only used to capture this. Prefer an inline arrow wrapper when passing callbacks (and consider void-ing the returned promise if _openFileItem remains async).
		const sidebar = includeSidebar ? {
			render: (container: unknown, onDidLayout: Event<{ readonly height: number; readonly width: number }>) => {
				return this.renderSidebarList(container as HTMLElement, onDidLayout, items, this._openFileItem.bind(this));
			}
		} : undefined;
  • Files reviewed: 4/4 changed files
  • Comments generated: 3

Comment thread src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts
Comment thread src/vs/sessions/contrib/changes/browser/changesView.ts
Comment thread src/vs/sessions/contrib/changes/browser/changesViewActions.ts
@lszomoru lszomoru merged commit d7b82dc into main Apr 8, 2026
27 checks passed
@lszomoru lszomoru deleted the lszomoru/diplomatic-python branch April 8, 2026 08:32
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