Skip to content

Sessions - changes view improvements#300780

Merged
lszomoru merged 2 commits intomainfrom
lszomoru/curious-albatross
Mar 11, 2026
Merged

Sessions - changes view improvements#300780
lszomoru merged 2 commits intomainfrom
lszomoru/curious-albatross

Conversation

@lszomoru
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 11, 2026 12:56
@lszomoru lszomoru enabled auto-merge (squash) March 11, 2026 12:56
@lszomoru lszomoru self-assigned this Mar 11, 2026
@lszomoru lszomoru added this to the 1.112.0 milestone Mar 11, 2026
Copy link
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 Agent Sessions “Changes” view (vs/sessions) by refining reactive git/repository tracking and by wiring additional context keys intended to drive toolbar/menu enablement/visibility.

Changes:

  • Refactors active-session repository tracking to resolve IGitRepository via ObservablePromise rather than nested observableFromPromise values.
  • Adds/binds new context keys for merge-base branch protection and “has open pull request” state, and simplifies several existing context-key bindings.
  • Updates “Last turn” diff computation to use an ObservablePromise-backed observable.
Comments suppressed due to low confidence (1)

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

  • lastTurnChangesObs uses ObservablePromise(...).resolvedValue, which throws when the underlying diffBetweenWithStats promise rejects (e.g. for a root commit where ${headCommit}^ is invalid). That exception will bubble through combinedEntriesObs and can break rendering instead of just showing an empty last-turn list. Consider using ObservablePromise(...).promiseResult and mapping errors to an empty array/undefined (optionally logging), or otherwise catching promise rejection so UI stays functional.
			if (!repository || !headCommit) {
				return constObservable(undefined);
			}

			return new ObservablePromise(repository.diffBetweenWithStats(`${headCommit}^`, headCommit)).resolvedValue;

@lszomoru lszomoru merged commit 755a419 into main Mar 11, 2026
24 checks passed
@lszomoru lszomoru deleted the lszomoru/curious-albatross branch March 11, 2026 13:10
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