Sessions - more improvements to the changes view#305797
Merged
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
Improves the Sessions window “Changes” experience by adjusting the version picker/UI layout and making session-changes toolbar actions less dependent on hasAgentSessionChanges for visibility (to address missing controls in some views).
Changes:
- Adds a new “Branch Changes” version mode (and updates defaults) plus supporting session/git metadata observables.
- Tweaks changes view layout/empty-state placement and minor header styling.
- Relaxes
ChatEditingSessionChangesToolbarmenu visibility conditions across actions (view all changes / code review / apply submenu).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts | Removes when: hasAgentSessionChanges from the “View All Changes” toolbar contribution. |
| src/vs/sessions/contrib/codeReview/browser/codeReview.contributions.ts | Moves “has changes” gating from menu visibility into the action’s precondition. |
| src/vs/sessions/contrib/changes/browser/media/changesView.css | Adds small spacing tweak for action-label text next to icons. |
| src/vs/sessions/contrib/changes/browser/changesView.ts | Introduces new version modes/defaults and adds new derived session/git metadata for the picker + adjusts empty state placement/visibility. |
| src/vs/sessions/contrib/applyCommitsToParentRepo/browser/applyChangesToParentRepo.ts | Makes the Apply Actions submenu entry visible based only on Sessions window context. |
Comments suppressed due to low confidence (2)
src/vs/sessions/contrib/changes/browser/changesView.ts:1611
All ChangesandLast Turn's Changesare disabled unless checkpoint refs exist, but the current rendering logic only treatsLastTurnspecially—AllChangescurrently shows the same entries asBranchChanges. Either implement checkpoint-based behavior forAllChangesor remove the checkpoint gating/extra mode to avoid a misleading UI state.
...action,
id: 'chatEditing.versionsAllChanges',
label: localize('chatEditing.versionsAllChanges', 'All Changes'),
description: localize('chatEditing.versionsAllChanges.description', 'Show all changes made in this session'),
checked: viewModel.versionModeObs.get() === ChangesVersionMode.AllChanges,
category: { label: 'checkpoints', order: 2, showHeader: false },
enabled: viewModel.activeSessionFirstCheckpointRefObs.get() !== undefined &&
viewModel.activeSessionLastCheckpointRefObs.get() !== undefined,
run: async () => {
src/vs/sessions/contrib/changes/browser/changesView.ts:783
combinedEntriesObsonly branches onChangesVersionMode.LastTurn;BranchChangesandAllChangescurrently produce identical results. With the new Branch Changes option, this looks incomplete and will confuse users (the picker changes but the list doesn't). Consider adding explicit handling forBranchChanges(e.g. base↔HEAD diff) and/orAllChanges(checkpoint range) so each mode maps to distinct data.
// Combine both entry sources for display
const combinedEntriesObs = derived(reader => {
const headCommit = headCommitObs.read(reader);
const sessionFiles = sessionFilesObs.read(reader);
const versionMode = this.viewModel.versionModeObs.read(reader);
let sourceEntries: IChangesFileItem[];
if (versionMode === ChangesVersionMode.LastTurn) {
const lastTurnDiffChanges = lastTurnChangesObs.read(reader).read(reader);
const lastCheckpointRef = this.viewModel.activeSessionLastCheckpointRefObs.read(reader);
const diffChanges = lastTurnDiffChanges ?? [];
const ref = lastCheckpointRef
? lastCheckpointRef
: headCommit;
const parentRef = lastCheckpointRef
? `${lastCheckpointRef}^`
: headCommit ? `${headCommit}^` : undefined;
sourceEntries = diffChanges.map(change => {
const isDeletion = change.modifiedUri === undefined;
const isAddition = change.originalUri === undefined;
const uri = change.modifiedUri ?? change.uri;
const fileUri = isDeletion
? uri
: ref
? uri.with({ scheme: 'git', query: JSON.stringify({ path: uri.fsPath, ref }) })
: uri;
const originalUri = isAddition
? change.originalUri
: parentRef
? fileUri.with({ scheme: 'git', query: JSON.stringify({ path: fileUri.fsPath, ref: parentRef }) })
: change.originalUri;
return {
type: 'file',
uri: fileUri,
originalUri,
state: ModifiedFileEntryState.Accepted,
isDeletion,
changeType: isDeletion ? 'deleted' : isAddition ? 'added' : 'modified',
linesAdded: change.insertions,
linesRemoved: change.deletions,
reviewCommentCount: 0,
agentFeedbackCount: 0,
} satisfies IChangesFileItem;
});
} else {
sourceEntries = [...sessionFiles];
}
bhavyaus
approved these changes
Mar 27, 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.