Dismiss the workspace menu when showing the delete confirmation - #20648
Open
bucketbase26 (ayush-singh-0601) wants to merge 1 commit into
Open
Conversation
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: There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
MenuFlyouton 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+ShowAttachedFlyoutonContextRequested).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 (
CloseWindowhides the new-tab flyout and tab context menus first). Here weHide()the attached delete flyout and_workspaceFlyoutbeforeShowDialog. After that, cancel just leaves you back in the window, and confirm still removes the workspace fromApplicationStatelike 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:
_PopulateWorkspaceFlyoutis 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)._PopulateWorkspaceFlyout(). That is a no-op visually once the flyout is closed;Openingrebuilds the list the next time the button is clicked.RemoveWorkspaceonContentDialogResult::Primary, same as before.PR Checklist
No test added. This is a flyout vs.
ContentDialogpopup interaction in the XAML island, andUnitTests_TerminalAppdoes 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.