From fea130899cbc59df6a67d4f94b1daa48be668669 Mon Sep 17 00:00:00 2001 From: cwebster-99 Date: Fri, 27 Mar 2026 15:41:55 -0500 Subject: [PATCH] polish --- .../chatSetup/chatSetupContributions.ts | 31 ++++++++++++++----- .../browser/chatStatus/chatStatusEntry.ts | 2 +- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.ts b/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.ts index 4c3da763421..0bd14a6f7c3 100644 --- a/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.ts +++ b/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.ts @@ -9,7 +9,6 @@ import { IAction, WorkbenchActionExecutedClassification, WorkbenchActionExecuted import { Event } from '../../../../../base/common/event.js'; import { Lazy } from '../../../../../base/common/lazy.js'; import { Disposable, DisposableStore, markAsSingleton, MutableDisposable } from '../../../../../base/common/lifecycle.js'; -import { isWeb } from '../../../../../base/common/platform.js'; import Severity from '../../../../../base/common/severity.js'; import { equalsIgnoreCase } from '../../../../../base/common/strings.js'; import { ThemeIcon } from '../../../../../base/common/themables.js'; @@ -23,6 +22,7 @@ import { Action2, MenuId, MenuRegistry, registerAction2 } from '../../../../../p import { CommandsRegistry, ICommandService } from '../../../../../platform/commands/common/commands.js'; import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js'; import { ContextKeyExpr, IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; +import { IsWebContext } from '../../../../../platform/contextkey/common/contextkeys.js'; import { IDialogService } from '../../../../../platform/dialogs/common/dialogs.js'; import { IEnvironmentService } from '../../../../../platform/environment/common/environment.js'; import { ExtensionIdentifier } from '../../../../../platform/extensions/common/extensions.js'; @@ -382,6 +382,7 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr id: MenuId.TitleBarAdjacentCenter, order: 0, // same position as the update button when: ContextKeyExpr.and( + IsWebContext.negate(), ContextKeyExpr.has(`config.${ChatConfiguration.SignInTitleBarEnabled}`), ChatContextKeys.Entitlement.signedOut, ChatContextKeys.Setup.hidden.negate(), @@ -598,10 +599,6 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr } private registerSignInTitleBarEntry(actionViewItemService: IActionViewItemService): void { - if (isWeb) { - return; // Electron only - } - this._register(actionViewItemService.register( MenuId.TitleBarAdjacentCenter, SIGN_IN_TITLE_BAR_ACTION_ID, @@ -826,10 +823,12 @@ export function refreshTokens(commandService: ICommandService): void { /** * Custom action view item that renders a "Sign In" button - * reusing the update indicator's prominent styling. + * in the title bar with prominent button styling. */ class SignInTitleBarEntry extends BaseActionViewItem { + private label: HTMLElement | undefined; + constructor( action: IAction, options: IBaseActionViewItemOptions, @@ -840,10 +839,26 @@ class SignInTitleBarEntry extends BaseActionViewItem { public override render(container: HTMLElement) { super.render(container); + container.setAttribute('role', 'button'); container.setAttribute('aria-label', this.action.label); const content = dom.append(container, dom.$('.update-indicator.prominent')); - const label = dom.append(content, dom.$('.indicator-label')); - label.textContent = this.action.label; + this.label = dom.append(content, dom.$('.indicator-label')); + this.label.textContent = this.action.label; + } + + protected override updateLabel(): void { + if (this.label) { + this.label.textContent = this.action.label; + } + if (this.element) { + this.element.setAttribute('aria-label', this.action.label); + } + } + + protected override updateEnabled(): void { + if (this.element) { + this.element.classList.toggle('disabled', !this.action.enabled); + } } } diff --git a/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.ts b/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.ts index 53854d53db0..38ce308a1a1 100644 --- a/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.ts +++ b/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.ts @@ -154,7 +154,7 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu text = `$(copilot) ${signIn}`; ariaLabel = signIn; } else { - const signedOut = localize('notSignedIn', "Signed Out"); + const signedOut = localize('notSignedIn', "Signed out"); text = `${this.chatEntitlementService.anonymous ? '$(copilot)' : '$(copilot-not-connected)'} ${signedOut}`; ariaLabel = signedOut; kind = 'prominent';