[PR #8844] Fix the Profiles pivot selection, again #27312

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

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

State: closed
Merged: Yes


This reverts the revert in #8838.

The problem was that the Profile in the singleton nav state would be
updated before the binding fired, so we'd end up modifying the new
profile, because both the old page and the new page would be pointing at
the new profile already.

Instead of using a singleton instance of the profile nav state, we'll
create a new one each time. The new nav state attempt to steal the
selected pivot from the last instance of the nav state, if the profiles
are the same. This means that

This means that we won't end up modifying the new profile. The old
page's nav state will still have the old profile, so it'll still end up
modifying the old ProfileViewModel.

PR Checklist

  • I work here
  • Tested manually
  • Fixes the first point in #8769, again
**Original Pull Request:** https://github.com/microsoft/terminal/pull/8844 **State:** closed **Merged:** Yes --- This reverts the revert in #8838. The problem was that the `Profile` in the singleton nav state would be updated before the binding fired, so we'd end up modifying the _new_ profile, because both the old page and the new page would be pointing at the _new_ profile already. Instead of using a singleton instance of the profile nav state, we'll create a new one each time. The new nav state attempt to steal the selected pivot from the last instance of the nav state, if the profiles are the same. This means that This means that we won't end up modifying the new profile. The old page's nav state will still have the old profile, so it'll still end up modifying the old `ProfileViewModel`. ## PR Checklist * [x] I work here * [x] Tested manually * [x] Fixes the first point in #8769, again
claunia added the pull-request label 2026-01-31 09:21:16 +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#27312