Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/vs/sessions/browser/menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const Menus = {
TitleBarSessionTitle: new MenuId('SessionsTitleBarSessionTitle'),
TitleBarSessionMenu: new MenuId('SessionsTitleBarSessionMenu'),
TitleBarAccessibility: new MenuId('SessionsTitleBarAccessibility'),
TitleBarUpdate: new MenuId('SessionsTitleBarUpdate'),
BlockedSessionsHeader: new MenuId('SessionsBlockedSessionsHeader'),
BlockedSessionsItem: new MenuId('SessionsBlockedSessionsItem'),
TitleBarRightLayout: new MenuId('SessionsTitleBarRightLayout'),
Expand Down
4 changes: 0 additions & 4 deletions src/vs/sessions/browser/parts/media/titlebarpart.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@
align-items: center;
}

.monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right > .titlebar-update-container:not(.has-no-actions) {
margin-right: var(--vscode-spacing-size40);
}

.monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right > .titlebar-screen-reader-container:not(.has-no-actions) {
margin-right: var(--vscode-spacing-size40);
}
Expand Down
10 changes: 0 additions & 10 deletions src/vs/sessions/browser/parts/titlebarPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,6 @@ export class TitlebarPart extends Part implements ITitlebarPart {
toolbarOptions: { primaryGroup: () => true },
}));

// Update toolbar (leftmost in the right-side controls)
const updateToolBarElement = prepend(this.rightContent, $('div.titlebar-actions-container.titlebar-update-container'));
const updateToolBar = this._register(this.instantiationService.createInstance(MenuWorkbenchToolBar, updateToolBarElement, Menus.TitleBarUpdate, {
contextMenu: Menus.TitleBarContext,
hiddenItemStrategy: HiddenItemStrategy.NoHide,
telemetrySource: 'titlePart.update',
toolbarOptions: { primaryGroup: () => true },
}));

const screenReaderToolBarElement = prepend(this.rightContent, $('div.titlebar-actions-container.titlebar-screen-reader-container'));
const screenReaderButtonBar = this._register(this.instantiationService.createInstance(MenuWorkbenchButtonBar, screenReaderToolBarElement, Menus.TitleBarAccessibility, {
telemetrySource: 'titlePart.accessibility',
Expand All @@ -287,7 +278,6 @@ export class TitlebarPart extends Part implements ITitlebarPart {
this.registerOverflowManagedToolBar(centerNavContainer, centerNavToolBar);
this.registerOverflowManagedToolBar(rightToolbarContainer, rightToolBar);
this.registerOverflowManagedToolBar(sessionActionsContainer, sessionActionsToolBar);
this.registerOverflowManagedToolBar(updateToolBarElement, updateToolBar);

// Context menu on the titlebar
this._register(addDisposableListener(this.rootContainer, EventType.CONTEXT_MENU, e => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { HoverPosition } from '../../../../base/browser/ui/hover/hoverWidget.js'
import { ThemeIcon } from '../../../../base/common/themables.js';
import { getAccountProfileImageUrl, getAccountTitleBarBadgeKey, getAccountTitleBarState, IAccountTitleBarState, resolveAccountInfo } from '../../../browser/accountTitleBarState.js';
import { observeAllowSignedOutWhenUsable } from '../../../browser/sessionsAuthGate.js';
import { IsPhoneLayoutContext, SessionHasChangesContext, SessionIsCreatedContext, SessionsWelcomeVisibleContext, SinglePaneLayoutEnabledContext } from '../../../common/contextkeys.js';
import { IsPhoneLayoutContext, SessionsWelcomeVisibleContext } from '../../../common/contextkeys.js';
import { IsAuxiliaryWindowContext } from '../../../../workbench/common/contextkeys.js';
import { IAuthenticationAccessService } from '../../../../workbench/services/authentication/browser/authenticationAccessService.js';
import { IAuthenticationUsageService } from '../../../../workbench/services/authentication/browser/authenticationUsageService.js';
Expand Down Expand Up @@ -75,18 +75,13 @@ export function shouldShowAccountPanelSummary(state: Pick<IAccountTitleBarState,
return !hasCopilotDashboard && !isAccountLoading && !(state.source === 'copilot' && state.kind === 'prominent');
}

const sessionsChangesPrimaryActionVisible = ContextKeyExpr.and(
SinglePaneLayoutEnabledContext,
SessionIsCreatedContext,
SessionHasChangesContext
)!;

// Register the shared VS Code update entry at the leading edge of the Agents titlebar actions.
registerUpdateTitleBarMenuPlacement(Menus.TitleBarUpdate, {
// Register the shared VS Code update entry in the Agents left titlebar actions.
registerUpdateTitleBarMenuPlacement(Menus.TitleBarLeftLayout, {
Comment thread
dmitrivMS marked this conversation as resolved.
group: 'navigation',
order: 2,
when: ContextKeyExpr.and(
IsAuxiliaryWindowContext.toNegated(),
SessionsWelcomeVisibleContext.toNegated(),
sessionsChangesPrimaryActionVisible.negate()
SessionsWelcomeVisibleContext.toNegated()
Comment thread
dmitrivMS marked this conversation as resolved.
),
});

Expand Down
13 changes: 7 additions & 6 deletions src/vs/workbench/contrib/update/browser/updateTitleBarEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class UpdateTitleBarContribution extends Disposable implements IWorkbench
this._register(actionViewItemService.register(
MenuId.TitleBarUpdate,
UPDATE_TITLE_BAR_ACTION_ID,
(action, options) => this.createEntry(instantiationService, action, options)
(action, options) => this.createEntry(instantiationService, action, options, AnchorAlignment.RIGHT)
));

if (additionalMenuPlacement) {
Expand All @@ -140,15 +140,15 @@ export class UpdateTitleBarContribution extends Disposable implements IWorkbench
this._register(actionViewItemService.register(
menuId,
UPDATE_TITLE_BAR_ACTION_ID,
(action, options) => this.createEntry(instantiationService, action, options)
(action, options) => this.createEntry(instantiationService, action, options, AnchorAlignment.LEFT)
));
}

void this.onStateChange(true);
}

private createEntry(instantiationService: IInstantiationService, action: IAction, options: IBaseActionViewItemOptions): UpdateTitleBarEntry {
this.entry = instantiationService.createInstance(UpdateTitleBarEntry, action, options, this.tooltip, focus => {
private createEntry(instantiationService: IInstantiationService, action: IAction, options: IBaseActionViewItemOptions, anchorAlignment: AnchorAlignment): UpdateTitleBarEntry {
this.entry = instantiationService.createInstance(UpdateTitleBarEntry, action, options, anchorAlignment, this.tooltip, focus => {
this.tooltipVisible = true;
this.tooltipFocused = focus;
}, () => {
Expand Down Expand Up @@ -239,6 +239,7 @@ export class UpdateTitleBarEntry extends BaseActionViewItem {
constructor(
action: IAction,
options: IBaseActionViewItemOptions,
private readonly anchorAlignment: AnchorAlignment,
private readonly tooltip: UpdateTooltip,
private readonly onDidShowTooltip: (focus: boolean) => void,
private readonly onUserDismissedTooltip: () => void,
Expand Down Expand Up @@ -291,7 +292,7 @@ export class UpdateTitleBarEntry extends BaseActionViewItem {
},
persistence: { sticky: true },
appearance: { showPointer: true, compact: true },
position: { anchorAlignment: AnchorAlignment.RIGHT },
position: { anchorAlignment: this.anchorAlignment },
trapFocus: focus,
}, focus);

Expand All @@ -311,7 +312,7 @@ export class UpdateTitleBarEntry extends BaseActionViewItem {
}

protected override getHoverOptions(): IManagedHoverOptions {
return { position: { anchorAlignment: AnchorAlignment.RIGHT } };
return { position: { anchorAlignment: this.anchorAlignment } };
}

private async runAction() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import assert from 'assert';
import { mainWindow } from '../../../../../base/browser/window.js';
import { Action } from '../../../../../base/common/actions.js';
import { Emitter, Event } from '../../../../../base/common/event.js';
import { AnchorAlignment } from '../../../../../base/common/layout.js';
import { toDisposable } from '../../../../../base/common/lifecycle.js';
import { isMacintosh, isWeb } from '../../../../../base/common/platform.js';
import { IHoverOptions, IHoverWidget } from '../../../../../base/browser/ui/hover/hover.js';
Expand Down Expand Up @@ -48,10 +49,10 @@ class TestHoverWidget implements IHoverWidget {
}

class TestHoverService extends mock<IHoverService>() {
readonly showRequests: { readonly focus: boolean; readonly trapFocus: boolean }[] = [];
readonly showRequests: { readonly focus: boolean; readonly trapFocus: boolean; readonly anchorAlignment: AnchorAlignment | undefined }[] = [];

override showInstantHover(options: IHoverOptions, focus?: boolean): IHoverWidget {
this.showRequests.push({ focus: !!focus, trapFocus: !!options.trapFocus });
this.showRequests.push({ focus: !!focus, trapFocus: !!options.trapFocus, anchorAlignment: options.position?.anchorAlignment });
return new TestHoverWidget();
}
}
Expand All @@ -76,6 +77,7 @@ suite('UpdateTitleBarEntry', () => {
const entry = store.add(new UpdateTitleBarEntry(
action,
{},
AnchorAlignment.LEFT,
new class extends mock<UpdateTooltip>() {
override readonly domNode = mainWindow.document.createElement('div');
},
Expand All @@ -101,7 +103,7 @@ suite('UpdateTitleBarEntry', () => {
hoverShowRequests: hoverService.showRequests,
}, {
tabDefaultPrevented: false,
hoverShowRequests: [{ focus: true, trapFocus: true }],
hoverShowRequests: [{ focus: true, trapFocus: true, anchorAlignment: AnchorAlignment.LEFT }],
});
});
});
Expand Down
Loading