From 0727c803a450e5318100da9747d4cde87a563f1f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 05:46:46 +0000 Subject: [PATCH 1/2] Initial plan From 5fe7bd3ab0eacc46a59dea661e7dc5e78bc28897 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 06:17:13 +0000 Subject: [PATCH 2/2] fix: derive action widget container from anchor element for auxiliary window support When the ActionWidgetService shows a picker without an explicit container, it now derives the container from the anchor element's window via ILayoutService.getContainer(). This ensures pickers (model picker, mode picker, etc.) render in the correct window when used in auxiliary windows, fixing the issue where chat pickers in new windows failed to open. Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/d6150146-30eb-4c8e-a86d-9417a253dd3e Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com> --- src/vs/platform/actionWidget/browser/actionWidget.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vs/platform/actionWidget/browser/actionWidget.ts b/src/vs/platform/actionWidget/browser/actionWidget.ts index 32af92b7733ac..fb4f7dc8b72fa 100644 --- a/src/vs/platform/actionWidget/browser/actionWidget.ts +++ b/src/vs/platform/actionWidget/browser/actionWidget.ts @@ -17,6 +17,7 @@ import { IContextViewService } from '../../contextview/browser/contextView.js'; import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js'; import { createDecorator, IInstantiationService, ServicesAccessor } from '../../instantiation/common/instantiation.js'; import { KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js'; +import { ILayoutService } from '../../layout/browser/layoutService.js'; import { inputActiveOptionBackground, registerColor } from '../../theme/common/colorRegistry.js'; import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js'; import { IListAccessibilityProvider } from '../../../base/browser/ui/list/listWidget.js'; @@ -56,7 +57,8 @@ class ActionWidgetService extends Disposable implements IActionWidgetService { constructor( @IContextViewService private readonly _contextViewService: IContextViewService, @IContextKeyService private readonly _contextKeyService: IContextKeyService, - @IInstantiationService private readonly _instantiationService: IInstantiationService + @IInstantiationService private readonly _instantiationService: IInstantiationService, + @ILayoutService private readonly _layoutService: ILayoutService, ) { super(); } @@ -64,6 +66,13 @@ class ActionWidgetService extends Disposable implements IActionWidgetService { show(user: string, supportsPreview: boolean, items: readonly IActionListItem[], delegate: IActionListDelegate, anchor: HTMLElement | StandardMouseEvent | IAnchor, container: HTMLElement | undefined, actionBarActions?: readonly IAction[], accessibilityProvider?: Partial>>, listOptions?: IActionListOptions): void { const visibleContext = ActionWidgetContextKeys.Visible.bindTo(this._contextKeyService); + // When no container is specified but the anchor is an HTMLElement, + // derive the container from the anchor's window so that the widget + // renders in the correct window (e.g. auxiliary windows). + if (!container && dom.isHTMLElement(anchor)) { + container = this._layoutService.getContainer(dom.getWindow(anchor)); + } + const list = this._instantiationService.createInstance(ActionList, user, supportsPreview, items, delegate, accessibilityProvider, listOptions, anchor); this._contextViewService.showContextView({ getAnchor: () => anchor,