[PR #8773] Fix refresh-related crashes in Settings UI #27287

Open
opened 2026-01-31 09:21:07 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


Removes the visibility hack in UpdateSettings where we were hiding
Profile menu items instead of removing them. This hack was removed using
ReplaceAll. For an unknown reason, calling Remove() would result in
an out-of-bounds error in XAML code.

The "Discard" button would improperly refresh the Settings UI. Both of
the bugs were caused by holding a reference to a hidden menu item then
trying to set the SelectedItem to that menu item.

Additionally, 9283375 adds a check for the selected item in
SettingsNav_ItemInvoked(). This prevents navigation to an already
selected item. This was the heuristic used by the XAML Controls Gallery.

References #6800 - Settings UI Epic

Validation Steps Performed

(Repeated for each menu item)

  1. Select the menu item
  2. click "Discard changes"
  3. Verify navigated to same page

Also performed repro steps for #8747 and #8748.

Closes #8747
Closes #8748

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8773 **State:** closed **Merged:** Yes --- Removes the visibility hack in `UpdateSettings` where we were hiding Profile menu items instead of removing them. This hack was removed using `ReplaceAll`. For an unknown reason, calling `Remove()` would result in an out-of-bounds error in XAML code. The "Discard" button would improperly refresh the Settings UI. Both of the bugs were caused by holding a reference to a hidden menu item then trying to set the `SelectedItem` to that menu item. Additionally, 9283375 adds a check for the selected item in `SettingsNav_ItemInvoked()`. This prevents navigation to an already selected item. This was the heuristic used by the XAML Controls Gallery. References #6800 - Settings UI Epic ## Validation Steps Performed (Repeated for each menu item) 1. Select the menu item 2. click "Discard changes" 3. Verify navigated to same page Also performed repro steps for #8747 and #8748. Closes #8747 Closes #8748
claunia added the pull-request label 2026-01-31 09:21:07 +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#27287