Skip to content

Commit 5b6beca

Browse files
authored
Merge pull request #300591 from microsoft/copilot/sub-pr-300560-another-one
Compact agent status: fix review feedback
2 parents 7fffb1b + a09dc29 commit 5b6beca

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,14 @@ export class ToggleAgentStatusAction extends Action2 {
132132

133133
run(accessor: ServicesAccessor): void {
134134
const configService = accessor.get(IConfigurationService);
135-
const mode = getAgentControlMode(configService.getValue(ChatConfiguration.AgentStatusEnabled));
136-
// Toggle between 'compact' (default) and 'hidden'
137-
configService.updateValue(ChatConfiguration.AgentStatusEnabled, mode === 'hidden' ? 'compact' : 'hidden');
135+
const rawValue = configService.getValue(ChatConfiguration.AgentStatusEnabled);
136+
const mode = getAgentControlMode(rawValue);
137+
if (mode === 'hidden') {
138+
// Restore to previous non-hidden mode; if the raw value was 'badge', restore 'badge', otherwise use 'compact'
139+
configService.updateValue(ChatConfiguration.AgentStatusEnabled, rawValue === 'badge' ? 'badge' : 'compact');
140+
} else {
141+
configService.updateValue(ChatConfiguration.AgentStatusEnabled, 'hidden');
142+
}
138143
}
139144
}
140145

src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,9 @@ export class AgentTitleBarStatusWidget extends BaseActionViewItem {
847847
// Only show status indicators if chat.viewSessions.enabled is true
848848
const viewSessionsEnabled = this.configurationService.getValue<boolean>(ChatConfiguration.ChatViewSessionsEnabled) !== false;
849849

850-
// When both unified agents bar and agent status are enabled, show status indicators
851-
// before the sparkle button: [active, unread, sparkle] (populating inward)
852-
// Otherwise, keep original order: [sparkle, unread, active]
850+
// When compact mode is active, show status indicators before the sparkle button:
851+
// [needs-input, active, unread, sparkle] (populating inward)
852+
// Otherwise, keep original order: [sparkle, unread, active, needs-input]
853853
const agentControlModeForBadge = getAgentControlMode(this.configurationService.getValue(ChatConfiguration.AgentStatusEnabled));
854854
const reverseOrder = agentControlModeForBadge === 'compact';
855855

@@ -902,7 +902,11 @@ export class AgentTitleBarStatusWidget extends BaseActionViewItem {
902902

903903
// Needs-input section - shows sessions requiring user attention (approval/confirmation/input)
904904
if (viewSessionsEnabled && hasAttentionNeeded) {
905+
const { isFilteredToInProgress } = this._getCurrentFilterState();
905906
needsInputSection = $('span.agent-status-badge-section.active.needs-input');
907+
if (isFilteredToInProgress) {
908+
needsInputSection.classList.add('filtered');
909+
}
906910
needsInputSection.setAttribute('role', 'button');
907911
needsInputSection.tabIndex = 0;
908912
const needsInputIcon = $('span.agent-status-icon');

src/vs/workbench/contrib/chat/browser/chat.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ configurationRegistry.registerConfiguration({
236236
nls.localize('chat.agentsControl.badge', "Shows the agent status as a badge next to the command center."),
237237
nls.localize('chat.agentsControl.compact', "Replaces the command center search box with a compact agent status indicator and unified chat widget."),
238238
],
239-
markdownDescription: nls.localize('chat.agentsControl.enabled', "Controls whether the 'Agent Status' indicator is shown in the title bar command center. Enabling this setting will automatically enable {0}. The unread/in-progress session indicators require {1} to be enabled.", '`#window.commandCenter#`', '`#chat.viewSessions.enabled#`'),
239+
markdownDescription: nls.localize('chat.agentsControl.enabled', "Controls how the 'Agent Status' indicator appears in the title bar command center. When set to `hidden`, the indicator is not shown. Other values show the indicator and automatically enable {0}. The unread and in-progress session indicators require {1} to be enabled.", '`#window.commandCenter#`', '`#chat.viewSessions.enabled#`'),
240240
default: 'compact',
241241
tags: ['experimental']
242242
},

src/vs/workbench/contrib/chat/common/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function getAgentControlMode(value: unknown): AgentControlMode {
2525
if (value === 'compact') {
2626
return 'compact';
2727
}
28-
// New installs get the string default 'compact' from the setting definition
28+
// Fallback to the configuration schema default 'compact' for any other or missing value
2929
return 'compact';
3030
}
3131

0 commit comments

Comments
 (0)