Merge pull request #291593 from microsoft/benibenj/frozen-lamprey

Agent status and unified agents bar respect command center setting
This commit is contained in:
Benjamin Christopher Simmonds
2026-01-29 15:22:04 +01:00
committed by GitHub
3 changed files with 11 additions and 13 deletions
+3 -3
View File
@@ -117,6 +117,7 @@ interface IInitialEditorsState {
const COMMAND_CENTER_SETTINGS = [
'chat.agentsControl.enabled',
'chat.unifiedAgentsBar.enabled',
'workbench.navigationControl.enabled',
'workbench.experimental.share.enabled',
];
@@ -396,10 +397,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
].some(setting => e.affectsConfiguration(setting))) {
// Show Command Center if command center actions enabled
const shareEnabled = e.affectsConfiguration('workbench.experimental.share.enabled') && this.configurationService.getValue<boolean>('workbench.experimental.share.enabled');
const navigationControlEnabled = e.affectsConfiguration('workbench.navigationControl.enabled') && this.configurationService.getValue<boolean>('workbench.navigationControl.enabled');
const enabledCommandCenterAction = COMMAND_CENTER_SETTINGS.some(setting => e.affectsConfiguration(setting) && this.configurationService.getValue<boolean>(setting) === true);
if (shareEnabled || navigationControlEnabled) {
if (enabledCommandCenterAction) {
if (this.configurationService.getValue<boolean>(LayoutSettings.COMMAND_CENTER) === false) {
this.configurationService.updateValue(LayoutSettings.COMMAND_CENTER, true);
return; // onDidChangeConfiguration will be triggered again
@@ -101,7 +101,8 @@ export class ToggleAgentStatusAction extends ToggleTitleBarConfigAction {
ContextKeyExpr.and(
ChatContextKeys.enabled,
IsCompactTitleBarContext.negate(),
ChatContextKeys.supported
ChatContextKeys.supported,
ContextKeyExpr.has('config.window.commandCenter')
)
);
}
@@ -120,7 +121,8 @@ export class ToggleUnifiedAgentsBarAction extends ToggleTitleBarConfigAction {
ContextKeyExpr.and(
ChatContextKeys.enabled,
IsCompactTitleBarContext.negate(),
ChatContextKeys.supported
ChatContextKeys.supported,
ContextKeyExpr.has('config.window.commandCenter'),
)
);
}
@@ -1244,20 +1244,16 @@ export class AgentTitleBarStatusRendering extends Disposable implements IWorkben
// Add/remove CSS classes on workbench based on settings
// Force enable command center and disable chat controls when agent status or unified agents bar is enabled
const updateClass = () => {
const enabled = configurationService.getValue<boolean>(ChatConfiguration.AgentStatusEnabled) === true;
const enhanced = configurationService.getValue<boolean>(ChatConfiguration.UnifiedAgentsBar) === true;
const commandCenterEnabled = configurationService.getValue<boolean>(LayoutSettings.COMMAND_CENTER) === true;
const enabled = configurationService.getValue<boolean>(ChatConfiguration.AgentStatusEnabled) === true && commandCenterEnabled;
const enhanced = configurationService.getValue<boolean>(ChatConfiguration.UnifiedAgentsBar) === true && commandCenterEnabled;
mainWindow.document.body.classList.toggle('agent-status-enabled', enabled);
mainWindow.document.body.classList.toggle('unified-agents-bar', enhanced);
// Force enable command center when agent status or unified agents bar is enabled
if ((enabled || enhanced) && configurationService.getValue<boolean>(LayoutSettings.COMMAND_CENTER) !== true) {
configurationService.updateValue(LayoutSettings.COMMAND_CENTER, true);
}
};
updateClass();
this._register(configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(ChatConfiguration.AgentStatusEnabled) || e.affectsConfiguration(ChatConfiguration.UnifiedAgentsBar)) {
if (e.affectsConfiguration(ChatConfiguration.AgentStatusEnabled) || e.affectsConfiguration(ChatConfiguration.UnifiedAgentsBar) || e.affectsConfiguration(LayoutSettings.COMMAND_CENTER)) {
updateClass();
}
}));