Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.67 OS Version: macOS 12.3.1 (21E258) using the button the button again to close it but cannot close it3. <img width="1076" alt="a" src="https://user-" Its always running show method, so I think it should have an open/close state to manage it.
Try clicking here: !
Thank you for the comment. Yes, I know I can close it by clicking the button, but it would be nice to close it by clicking the original button.
please improve the issue title, which currently states that you "cannot close" it.
My bad. I'll fix it now
for UX guidance here. when actions open quick picks we don't tend to have an inverse action if its still open. this is not usually the case because it is closed when focus is lost, but not something we can rely on here.
Thank you Even if the focus is lost, the action view won't be closed on Mac. Also, other buttons allow us to open and close by clicking, so it should be consistent. I often click the button by accident and need to move cursor to close the view. That would be nice to have a toggle feature on the button too.
Maybe use the setting which removes the button completely?
We don't currently hide any of the quick picks with other actions or clicking the same action (changing focus would actually close it). I think given that we have the key and the close button in the top right of the quick pick, I don't think we'd be able to do anything else.

Discussion:
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { ContextKeyExpr, ContextKeyExpression, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IViewDescriptorService, IViewsService, ViewContainerLocation, IViewDescriptor, ViewContainerLocationToString } from 'vs/workbench/common/views'; <del> import { QuickPickItem, IQuickInputService, IQuickPickItem, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput'; </del> <ins> import { QuickPickItem, IQuickInputService, IQuickPickItem, IQuickPickSeparator, IQuickPick } from 'vs/platform/quickinput/common/quickInput'; </ins> import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; import { ToggleAuxiliaryBarAction } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions';

} registerAction2(class CustomizeLayoutAction extends Action2 { <ins> private _currentQuickPick?: IQuickPick<IQuickPickItem>; </ins> constructor() { super({ id: 'workbench.action.customizeLayout',

} run(accessor: ServicesAccessor): void { <ins> if (this._currentQuickPick) { this._currentQuickPick.hide(); return; } </ins> const contextKeyService = accessor.get(IContextKeyService); const commandService = accessor.get(ICommandService); const quickInputService = accessor.get(IQuickInputService); const quickPick = quickInputService.createQuickPick(); <ins> this._currentQuickPick = quickPick; </ins> quickPick.items = this.getItems(contextKeyService); quickPick.ignoreFocusOut = true; quickPick.hideInput = true;

quickPick.hide(); }); <del> quickPick.onDispose(() => disposables.dispose()); </del> <ins> quickPick.onDidHide(() => { quickPick.dispose(); }); quickPick.onDispose(() => { this._currentQuickPick = undefined; disposables.dispose(); }); </ins> quickPick.show(); }