Skip to content

Dismiss the workspace menu when showing the delete confirmation - #20648

Open
bucketbase26 (ayush-singh-0601) wants to merge 1 commit into
microsoft:mainfrom
ayush-singh-0601:dev/ayush/close-workspace-menu-on-delete
Open

Dismiss the workspace menu when showing the delete confirmation#20648
bucketbase26 (ayush-singh-0601) wants to merge 1 commit into
microsoft:mainfrom
ayush-singh-0601:dev/ayush/close-workspace-menu-on-delete

Conversation

@ayush-singh-0601

Copy link
Copy Markdown

Summary of the Pull Request

Right-clicking a saved workspace and choosing delete leaves the workspace dropdown open on top of the confirmation dialog. This closes the menu (and the little delete flyout) before we show that dialog.

References and Relevant Issues

Closes #20636

Detailed Description of the Pull Request / Additional comments

The workspace list is a MenuFlyout on the titlebar button. Delete is not a regular item in that menu — it is an attached context flyout on each saved workspace row (FlyoutBase::SetAttachedFlyout + ShowAttachedFlyout on ContextRequested).

Clicking an item in that attached flyout only dismisses the attached flyout. The parent workspace menu stays open. The confirmation is a ContentDialog, which is its own popup, so clicking around in it also does not light-dismiss the menu. That is the screenshot in #20636: the dropdown still sitting there while you try to confirm or cancel.

This is the same thing we already do before the close-window warning (CloseWindow hides the new-tab flyout and tab context menus first). Here we Hide() the attached delete flyout and _workspaceFlyout before ShowDialog. After that, cancel just leaves you back in the window, and confirm still removes the workspace from ApplicationState like before.

Validation Steps Performed

I don't have a Windows build environment on this machine, so this is a code-path check rather than a deployed Dev package:

  • _PopulateWorkspaceFlyout is the only place that builds the delete confirmation, so this is the only entry point for The workspace menu stays open if I interact with the delete dialog #20636.
  • MenuFlyout.Hide() is already how we dismiss the new-tab flyout and tab context menus before other dialogs (CloseWindow, TitlebarClicked).
  • After a confirmed delete we still call _PopulateWorkspaceFlyout(). That is a no-op visually once the flyout is closed; Opening rebuilds the list the next time the button is clicked.
  • Cancel does not delete anything; we only RemoveWorkspace on ContentDialogResult::Primary, same as before.

PR Checklist

No test added. This is a flyout vs. ContentDialog popup interaction in the XAML island, and UnitTests_TerminalApp does not host that tree. Catching it means opening the workspace button, right-clicking a saved workspace, choosing delete, and confirming the menu is gone before you hit the dialog.

The delete action lives on an attached context flyout, so choosing it
does not close the parent workspace menu. The confirmation dialog is a
separate popup and does not light-dismiss that menu either, which left
it sitting over the dialog.

Close both flyouts before ShowDialog so the confirmation is the only
thing on screen.

Closes microsoft#20636
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The workspace menu stays open if I interact with the delete dialog

1 participant