Skip to content

Conversation

@joshspicer
Copy link
Member

@joshspicer joshspicer commented Jan 14, 2026

Copilot AI review requested due to automatic review settings January 14, 2026 05:52
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

This pull request adds an "Agent Session Projection" feature that provides a focused workspace view when selecting an agent session. The feature displays artifact changes in a multi-diff editor and adds a specialized UI control in the title bar to indicate focus mode.

Changes:

  • Adds new focus view service to manage projection mode state and editor working sets
  • Introduces agents control UI widget in the command center showing agent session status
  • Adds configuration setting and context key for the experimental feature
  • Integrates with existing agent sessions, chat, and titlebar infrastructure

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/actions/chatContextKeys.ts Adds inFocusViewMode context key for tracking focus view state
src/vs/workbench/contrib/chat/browser/chat.contribution.ts Adds experimental configuration setting for agent session projection
src/vs/workbench/contrib/chat/browser/agentSessions/media/focusView.css Defines styling for focus view mode border and agents control UI
src/vs/workbench/contrib/chat/browser/agentSessions/focusViewService.ts Implements service for managing focus view mode, editor working sets, and session state
src/vs/workbench/contrib/chat/browser/agentSessions/focusViewActions.ts Defines actions for entering/exiting focus view and related commands
src/vs/workbench/contrib/chat/browser/agentSessions/agentsControl.ts Implements custom titlebar control widget displaying agent session status
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.ts Updates session opener to route to focus view when enabled
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.ts Registers services, actions, and custom rendering for agents control
src/vs/workbench/contrib/chat/browser/actions/chatNewActions.ts Integrates new chat action with focus view exit behavior
src/vs/workbench/contrib/chat/browser/actions/chatActions.ts Hides chat command center button when agents control is active
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts Adds support for custom command center controls based on context
src/vs/workbench/browser/parts/titlebar/commandCenterControlRegistry.ts Implements registry pattern for custom command center controls
src/vs/platform/actions/common/actions.ts Adds AgentsControlMenu menu ID
Comments suppressed due to low confidence (7)

src/vs/workbench/contrib/chat/browser/agentSessions/focusViewActions.ts:112

  • The OpenInChatPanelAction menu registration is missing a when clause to gate on ChatContextKeys.enabled. AI/chat features should respect the global AI feature toggle by including ChatContextKeys.enabled in their menu registrations.
			menu: [{
				id: MenuId.AgentSessionsContext,
				group: '1_open',
				order: 1,
			}]
		});

src/vs/workbench/contrib/chat/browser/agentSessions/focusViewActions.ts:147

  • The ToggleAgentsControl action uses ChatContextKeys.supported instead of ChatContextKeys.enabled. According to coding guidelines, AI features should be gated on ChatContextKeys.enabled to ensure they respect when users have disabled AI features.

Change ChatContextKeys.supported to ChatContextKeys.enabled in the precondition.

			ContextKeyExpr.and(
				IsCompactTitleBarContext.negate(),
				ChatContextKeys.supported
			)
		);

src/vs/workbench/contrib/chat/browser/agentSessions/media/focusView.css:95

  • Hardcoded color values violate theming best practices. The active state styling uses hardcoded RGBA values for the blue color instead of VS Code theme color variables. This prevents proper theming support.

Use VS Code theme color variables instead, such as --vscode-textLink-foreground or --vscode-button-background, to ensure the UI adapts correctly to different themes.

.agents-control-pill.chat-input-mode.has-active {
	background-color: rgba(0, 120, 212, 0.15);
	border: 1px solid rgba(0, 120, 212, 0.5);
}

.agents-control-pill.chat-input-mode.has-active:hover {
	background-color: rgba(0, 120, 212, 0.25);
	border-color: rgba(0, 120, 212, 0.7);
}

src/vs/workbench/contrib/chat/browser/agentSessions/media/focusView.css:118

  • Hardcoded color values in session mode styling prevent proper theming. Using hardcoded RGBA values instead of theme variables means the UI won't adapt to different color themes.

Replace with VS Code theme color variables for proper theming support across all VS Code themes.

.agents-control-pill.session-mode {
	background-color: rgba(0, 120, 212, 0.15);
	border: 1px solid rgba(0, 120, 212, 0.5);
	padding: 0 12px;
}

.agents-control-pill.session-mode:hover {
	background-color: rgba(0, 120, 212, 0.25);
	border-color: rgba(0, 120, 212, 0.7);
}

src/vs/workbench/contrib/chat/browser/agentSessions/agentsControl.ts:198

  • Missing aria-label for the session mode pill button. While the pill in session mode shows a session title, it should have an aria-label that describes the overall purpose of the element for screen reader users, not just the visible title text.

Add an appropriate aria-label that describes the interactive element's purpose in the context of the agent session projection mode.

		const pill = $('div.agents-control-pill.session-mode');
		this._container.appendChild(pill);

src/vs/workbench/contrib/chat/browser/agentSessions/focusViewActions.ts:36

  • The EnterFocusViewAction is not properly gated on ChatContextKeys.enabled. According to coding guidelines, AI/chat features must be gated on ChatContextKeys.enabled so they don't show up when users have disabled AI features.

The precondition should include ChatContextKeys.enabled in addition to the existing checks.

			precondition: ContextKeyExpr.and(
				ContextKeyExpr.has('config.chat.agentSessionProjection.enabled'),
				ChatContextKeys.inFocusViewMode.negate()
			),
		});

src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.ts:204

  • This menu item is not properly gated on ChatContextKeys.enabled. When adding AI/chat features, they must be gated on ChatContextKeys.enabled to ensure they don't show up when users have disabled AI features.

The when clause should include ChatContextKeys.enabled in addition to checking 'config.chat.agentSessionProjection.enabled'.

MenuRegistry.appendMenuItem(MenuId.AgentsControlMenu, {
	command: {
		id: 'workbench.action.chat.toggle',
		title: localize('openChat', "Open Chat"),
	},
	when: ContextKeyExpr.has('config.chat.agentSessionProjection.enabled'),
});

@joshspicer joshspicer marked this pull request as ready for review January 14, 2026 06:14
@joshspicer joshspicer enabled auto-merge (squash) January 14, 2026 06:14
@vs-code-engineering
Copy link

📬 CODENOTIFY

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

@bpasero

Matched files:

  • src/vs/workbench/browser/parts/titlebar/commandCenterControlRegistry.ts
  • src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
  • src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.ts
  • src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.ts
  • src/vs/workbench/contrib/chat/browser/agentSessions/agentsControl.ts
  • src/vs/workbench/contrib/chat/browser/agentSessions/focusViewActions.ts
  • src/vs/workbench/contrib/chat/browser/agentSessions/focusViewService.ts
  • src/vs/workbench/contrib/chat/browser/agentSessions/media/focusView.css

@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 14, 2026
@joshspicer joshspicer merged commit 38682c2 into main Jan 14, 2026
22 checks passed
@joshspicer joshspicer deleted the joshspicer/astral-projection branch January 14, 2026 06:38
eli-w-king pushed a commit that referenced this pull request Jan 14, 2026
* checkpoint: glow

* checkpoint 2

* checkpoint title bar

* stash a bit of tidy

* checkpoint status bar UI

* x button

* polish

* polish

* tweaks

* gate on chatenabled
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