Sessions - view all changes action uses the diff editor + navigation tree#308452
Merged
Sessions - view all changes action uses the diff editor + navigation tree#308452
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @jriekenMatched files:
|
Contributor
There was a problem hiding this comment.
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
ViewAllSessionChangesActionfrom the workbench chat editing actions and stop treating it specially in the chat input toolbar button configuration. - Add a Sessions-scoped
ViewAllSessionChangesActionthat calls into the Sessions Changes view (ChangesViewPane.openChanges()). - Refactor file opening logic in
ChangesViewPaneinto a reusable_openFileItem(...)helper and addopenChanges().
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_openFileItemcurrently doesn't awaiteditorService.openEditor(...), soopenChanges()resolves before the editor is actually opened. Either await theopenEditorcall(s) inside_openFileItem(and keep the async contract) or make both methods synchronous to avoid misleadingawaitusage.
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 capturethis. Prefer an inline arrow wrapper when passing callbacks (and considervoid-ing the returned promise if_openFileItemremains 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
aeschli
approved these changes
Apr 8, 2026
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.
No description provided.