[PR #12275] [MERGED] Fix broken reset button on some profile settings #28944

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12275
Author: @carlos-zamora
Created: 1/27/2022
Status: Merged
Merged: 1/28/2022
Merged by: @undefined

Base: mainHead: dev/cazamor/bugfix-sui-mvvm-reset-btn


📝 Commits (2)

  • ce33661 Fix broken reset button on some profile settings
  • aac7bb8 fix unreferenced formal param

📊 Changes

8 files changed (+56 additions, -57 deletions)

View changed files

📝 src/cascadia/TerminalSettingsEditor/Appearances.h (+3 -3)
📝 src/cascadia/TerminalSettingsEditor/GlobalAppearance.h (+2 -2)
📝 src/cascadia/TerminalSettingsEditor/Interaction.h (+2 -2)
📝 src/cascadia/TerminalSettingsEditor/Launch.h (+3 -3)
📝 src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp (+16 -0)
📝 src/cascadia/TerminalSettingsEditor/ProfileViewModel.h (+6 -6)
📝 src/cascadia/TerminalSettingsEditor/Profiles.cpp (+1 -18)
📝 src/cascadia/TerminalSettingsEditor/Utils.h (+23 -23)

📄 Description

Summary of the Pull Request

This fixes a bug where several settings would not show the reset button. The root cause of this issue is two fold:

  1. Hooking up CurrentXXX
    • GETSET_BINDABLE_ENUM_SETTING was hooked up to the settings model profile object instead of the view model profile object. Since the settings model has no PropertyChanged system, any changes were directly being applied to the setting, but not notifying the view model (and thus, the view, by extension) to update themselves.
    • This fix required me to slightly modify the macro. Rather than using two parameters (object and function name), I used one parameter (path to getter/setter).
  2. Responding to the PropertyChanged notifications
    • Now that we're actually dispatching the PropertyChanged notifications, we need to actually respond to them. This behavior was defined in Profiles::OnNavigatedTo() in the PropertyChanged() handler. Funny enough, that code was still there, it just didn't do anything because it was trying to notify that Profiles::CurrentXXX changed. This is invalid because CurrentXXX got moved to ProfileViewModel.
    • The fix here was pretty easy. Just move the property changed handler to ProfileViewModel's PropertyChanged handler that is defined in the ctor.

References

Bug introduced in #11877

Validation Steps Performed

Profile termination behavior
Bell notification style
Text antialiasing
Scrollbar visibility


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/12275 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 1/27/2022 **Status:** ✅ Merged **Merged:** 1/28/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/bugfix-sui-mvvm-reset-btn` --- ### 📝 Commits (2) - [`ce33661`](https://github.com/microsoft/terminal/commit/ce336617157a4026be7ba7fc8ec2566ee4f63511) Fix broken reset button on some profile settings - [`aac7bb8`](https://github.com/microsoft/terminal/commit/aac7bb8f84c8aa6f7e1a10b4eec015e22861b628) fix unreferenced formal param ### 📊 Changes **8 files changed** (+56 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalSettingsEditor/Appearances.h` (+3 -3) 📝 `src/cascadia/TerminalSettingsEditor/GlobalAppearance.h` (+2 -2) 📝 `src/cascadia/TerminalSettingsEditor/Interaction.h` (+2 -2) 📝 `src/cascadia/TerminalSettingsEditor/Launch.h` (+3 -3) 📝 `src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp` (+16 -0) 📝 `src/cascadia/TerminalSettingsEditor/ProfileViewModel.h` (+6 -6) 📝 `src/cascadia/TerminalSettingsEditor/Profiles.cpp` (+1 -18) 📝 `src/cascadia/TerminalSettingsEditor/Utils.h` (+23 -23) </details> ### 📄 Description ## Summary of the Pull Request This fixes a bug where several settings would not show the reset button. The root cause of this issue is two fold: 1. Hooking up `CurrentXXX` - `GETSET_BINDABLE_ENUM_SETTING` was hooked up to the **settings** model profile object instead of the **view** model profile object. Since the settings model has no `PropertyChanged` system, any changes were directly being applied to the setting, but not notifying the view model (and thus, the view, by extension) to update themselves. - This fix required me to slightly modify the macro. Rather than using two parameters (object and function name), I used one parameter (path to getter/setter). 2. Responding to the `PropertyChanged` notifications - Now that we're actually dispatching the `PropertyChanged` notifications, we need to actually respond to them. This behavior was defined in `Profiles::OnNavigatedTo()` in the `PropertyChanged()` handler. Funny enough, that code was still there, it just didn't do anything because it was trying to notify that `Profiles::CurrentXXX` changed. This is invalid because `CurrentXXX` got moved to `ProfileViewModel`. - The fix here was pretty easy. Just move the property changed handler to `ProfileViewModel`'s `PropertyChanged` handler that is defined in the ctor. ## References Bug introduced in #11877 ## Validation Steps Performed ✅ Profile termination behavior ✅ Bell notification style ✅ Text antialiasing ✅ Scrollbar visibility --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:31:47 +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#28944