Skip to content

Sessions - more improvements to the changes view#305797

Merged
lszomoru merged 4 commits intomainfrom
lszomoru/inc-lion
Mar 27, 2026
Merged

Sessions - more improvements to the changes view#305797
lszomoru merged 4 commits intomainfrom
lszomoru/inc-lion

Conversation

@lszomoru
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 27, 2026 19:54
@lszomoru lszomoru enabled auto-merge (squash) March 27, 2026 19:54
@lszomoru lszomoru self-assigned this Mar 27, 2026
@lszomoru lszomoru added this to the 1.114.0 milestone Mar 27, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering bot commented Mar 27, 2026

📬 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

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 ChatEditingSessionChangesToolbar menu 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 Changes and Last Turn's Changes are disabled unless checkpoint refs exist, but the current rendering logic only treats LastTurn specially—AllChanges currently shows the same entries as BranchChanges. Either implement checkpoint-based behavior for AllChanges or 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

  • combinedEntriesObs only branches on ChangesVersionMode.LastTurn; BranchChanges and AllChanges currently 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 for BranchChanges (e.g. base↔HEAD diff) and/or AllChanges (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];
			}

@lszomoru lszomoru merged commit e92b212 into main Mar 27, 2026
18 checks passed
@lszomoru lszomoru deleted the lszomoru/inc-lion branch March 27, 2026 20:57
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