[PR #14630] Rebuild the profile nav via MenuItemsSource; mitigate a crash #30170

Closed
opened 2026-01-31 09:39:05 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/14630

State: closed
Merged: Yes


Directly manipulating the NavigationView::MenuItems vector is bad. If you do that, you're gonna get crashes, in WinUI code for Measure. However, a WinUI PR (below) gave me an idea: Changing NavigationView::MenuItemsSource will wholly invalidate the entirety of the nav view items, and that will avoid the crash.

This code does that. It's a wee bit janky, but it works.

Closes #13673

might affect #12333, need to try and repro.

See also:

**Original Pull Request:** https://github.com/microsoft/terminal/pull/14630 **State:** closed **Merged:** Yes --- Directly manipulating the `NavigationView::MenuItems` vector is bad. If you do that, you're gonna get crashes, in WinUI code for `Measure`. However, a WinUI PR (below) gave me an idea: Changing `NavigationView::MenuItemsSource` will wholly invalidate the entirety of the nav view items, and that will avoid the crash. This code does that. It's a wee bit janky, but it works. Closes #13673 _might_ affect #12333, need to try and repro. See also: * #9273 * #10390 * https://github.com/microsoft/microsoft-ui-xaml/issues/6302 * https://github.com/microsoft/microsoft-ui-xaml/pull/3138, which was the fix for https://github.com/microsoft/microsoft-ui-xaml/issues/2818
claunia added the pull-request label 2026-01-31 09:39:05 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30170