Fix context menu crash after split pane submenu - #20612
Fix context menu crash after split pane submenu#20612OmarMashal (OmarMashal0) wants to merge 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
| const auto& subMenu, | ||
| auto& targetMenu) { | ||
| AppBarButton button{}; | ||
| auto makeMenuFlyoutItem = [&makeCallback](const winrt::hstring& label, |
There was a problem hiding this comment.
Your AI wrote this PR, right? Can you ask it to minimize the diff please? It's a bug fix after all. 🙂
There was a problem hiding this comment.
Thanks for the feedback, I agree the diff was a bit large for a bug fix
I had an idea about what was causing the crash and used AI to help me implement it, then reviewed and tested the changes carefully
I tried a few ways to reduce the production changes, but the nested CommandBarFlyouts need to become MenuFlyouts, so some of the code has to change because the APIs are different. I mainly reduced the diff by removing the extra structural test
If you see a smaller or cleaner approach, I’d really appreciate your guidance. I’d be happy to update it again if you have any suggestions
658b5bd to
96db85f
Compare
Summary of the Pull Request
Fixes the context menu crash reported in #20570 after interacting with the Split pane submenu and collapsing/re-expanding the root menu.
This replaces the nested
CommandBarFlyoutchild menus with standardMenuFlyoutcontrols.References and Relevant Issues
Closes #20570
Related: #20332
The repro from #20332 also no longer occurs on the patched build.
Detailed Description of the Pull Request / Additional comments
CommandBarFlyoutmenus withMenuFlyout.MenuFlyoutSubItemfor duplicate/profile split entries, with an explicitAutomaticoption followed by the directional split options.CommandBarFlyout.Automaticlabel.Validation Steps Performed
ContextMenuUsesMenuFlyoutsForSplitAndSwapPane: 1 passed, 0 failed.TabTests: 22 passed, 0 failed, 0 blocked, 0 skipped.CascadiaPackageDebug x64: built successfully (0 errors).CascadiaPackageRelease x64: built successfully (0 errors).Video
issues_20570_20332.mp4
PR Checklist