[PR #9079] [MERGED] Introduce setting override tracking and update SettingContainer #27414

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9079
Author: @carlos-zamora
Created: 2/9/2021
Status: Merged
Merged: 2/19/2021
Merged by: @undefined

Base: mainHead: dev/cazamor/sui/inheritance-hyperlinks


📝 Commits (10+)

  • dd764a8 TSM: add getter for source object
  • 4c2f59a TSM: implement tagging mechanism for profiles
  • 309746b fix TSM
  • 576a3f0 TSE: implement message generation
  • 64c776e working prototype
  • ac9b549 polish; ready for review
  • 4f3ca9a Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
  • a99afb6 fix build; update TerminalSettings
  • 1ba476e Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
  • 08e1050 code format

📊 Changes

21 files changed (+504 additions, -515 deletions)

View changed files

📝 src/cascadia/TerminalApp/TerminalSettings.h (+42 -48)
📝 src/cascadia/TerminalSettingsEditor/MainPage.cpp (+5 -0)
📝 src/cascadia/TerminalSettingsEditor/MainPage.xaml (+1 -0)
📝 src/cascadia/TerminalSettingsEditor/Profiles.idl (+42 -38)
📝 src/cascadia/TerminalSettingsEditor/Profiles.xaml (+39 -13)
📝 src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw (+8 -11)
📝 src/cascadia/TerminalSettingsEditor/SettingContainer.cpp (+80 -55)
📝 src/cascadia/TerminalSettingsEditor/SettingContainer.h (+3 -1)
📝 src/cascadia/TerminalSettingsEditor/SettingContainer.idl (+3 -0)
📝 src/cascadia/TerminalSettingsEditor/SettingContainerStyle.xaml (+0 -8)
📝 src/cascadia/TerminalSettingsEditor/ViewModelHelpers.h (+3 -3)
📝 src/cascadia/TerminalSettingsEditor/ViewModelHelpers.idl.h (+13 -7)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp (+10 -0)
📝 src/cascadia/TerminalSettingsModel/DefaultProfileUtils.cpp (+5 -4)
📝 src/cascadia/TerminalSettingsModel/GlobalAppSettings.h (+28 -28)
📝 src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl (+32 -115)
📝 src/cascadia/TerminalSettingsModel/IInheritable.h (+77 -2)
src/cascadia/TerminalSettingsModel/IInheritable.idl.h (+16 -0)
📝 src/cascadia/TerminalSettingsModel/Profile.cpp (+1 -0)
📝 src/cascadia/TerminalSettingsModel/Profile.h (+41 -39)

...and 1 more files

📄 Description

This PR adds improved override message generation for inheritance in
SUI. The settings model now has an OriginTag to be able to denote
where a Profile came from. This tag is used in the SettingContainer
to generate a more specific override message.

References

#6800 - SUI Epic
#8919 - SUI Inheritance PR
#8804 - SUI Inheritance (old issue)

Detailed Description of the Pull Request / Additional comments

  • Terminal Settings Model
    • Introduced PROJECTED_SETTING as a macro to more easily declare the
      functions for each setting
    • Introduced <setting>OverrideSource which finds the Profile that
      has <setting> defined
    • Introduced OriginTag Profile::Origin {Custom, InBox, Generated} to
      trace where a profile came from
    • DefaultProfileUtils creates profiles for profile generators. So
      that now sets the Origin tag to Generated
    • CascadiaSettings::LoadDefaults() tags all profiles created as
      InBox.
    • The view model had to ingest the API change to be able to interact
      with <setting>OverrideSource
  • Override Message Generation
    • The reset button now has a more specific tooltip
    • The reset button now only appears if base layer is being overridden
    • We use the settings model changes to determine the message to
      display for the target

Validation Steps Performed

Tested the following cases:

  • overrides nothing (inherited setting)
  • overrides value inherited from...
    • base layer
    • a profile generator
    • in-box profile
  • global settings should not have this feature

🔄 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/9079 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 2/9/2021 **Status:** ✅ Merged **Merged:** 2/19/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/sui/inheritance-hyperlinks` --- ### 📝 Commits (10+) - [`dd764a8`](https://github.com/microsoft/terminal/commit/dd764a8f2729930567f3cf594e601aed383a05fc) TSM: add getter for source object - [`4c2f59a`](https://github.com/microsoft/terminal/commit/4c2f59a0126f7794cec8ddcd2b68a764da735ca7) TSM: implement tagging mechanism for profiles - [`309746b`](https://github.com/microsoft/terminal/commit/309746b8d1d661b92887abae144b4a5694c5d573) fix TSM - [`576a3f0`](https://github.com/microsoft/terminal/commit/576a3f0900db857680475bd855440a74d1afaf35) TSE: implement message generation - [`64c776e`](https://github.com/microsoft/terminal/commit/64c776ee61e97b22570a672763ebf60e31bda07b) working prototype - [`ac9b549`](https://github.com/microsoft/terminal/commit/ac9b5498f6c3d90c9c653bd894b834abfcbedbfa) polish; ready for review - [`4f3ca9a`](https://github.com/microsoft/terminal/commit/4f3ca9a7396ac9e3594f0024b82b45d1c5140f23) Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks - [`a99afb6`](https://github.com/microsoft/terminal/commit/a99afb6f9d57b72a9966e4508680708a3c5e4cdd) fix build; update TerminalSettings - [`1ba476e`](https://github.com/microsoft/terminal/commit/1ba476e09c02f592b8a6e1bd5bedad887ae7ec46) Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks - [`08e1050`](https://github.com/microsoft/terminal/commit/08e1050cd4e19cae991938aaf4fc3f9d07123408) code format ### 📊 Changes **21 files changed** (+504 additions, -515 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/TerminalSettings.h` (+42 -48) 📝 `src/cascadia/TerminalSettingsEditor/MainPage.cpp` (+5 -0) 📝 `src/cascadia/TerminalSettingsEditor/MainPage.xaml` (+1 -0) 📝 `src/cascadia/TerminalSettingsEditor/Profiles.idl` (+42 -38) 📝 `src/cascadia/TerminalSettingsEditor/Profiles.xaml` (+39 -13) 📝 `src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw` (+8 -11) 📝 `src/cascadia/TerminalSettingsEditor/SettingContainer.cpp` (+80 -55) 📝 `src/cascadia/TerminalSettingsEditor/SettingContainer.h` (+3 -1) 📝 `src/cascadia/TerminalSettingsEditor/SettingContainer.idl` (+3 -0) 📝 `src/cascadia/TerminalSettingsEditor/SettingContainerStyle.xaml` (+0 -8) 📝 `src/cascadia/TerminalSettingsEditor/ViewModelHelpers.h` (+3 -3) 📝 `src/cascadia/TerminalSettingsEditor/ViewModelHelpers.idl.h` (+13 -7) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp` (+10 -0) 📝 `src/cascadia/TerminalSettingsModel/DefaultProfileUtils.cpp` (+5 -4) 📝 `src/cascadia/TerminalSettingsModel/GlobalAppSettings.h` (+28 -28) 📝 `src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl` (+32 -115) 📝 `src/cascadia/TerminalSettingsModel/IInheritable.h` (+77 -2) ➕ `src/cascadia/TerminalSettingsModel/IInheritable.idl.h` (+16 -0) 📝 `src/cascadia/TerminalSettingsModel/Profile.cpp` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/Profile.h` (+41 -39) _...and 1 more files_ </details> ### 📄 Description This PR adds improved override message generation for inheritance in SUI. The settings model now has an `OriginTag` to be able to denote where a `Profile` came from. This tag is used in the `SettingContainer` to generate a more specific override message. ## References #6800 - SUI Epic #8919 - SUI Inheritance PR #8804 - SUI Inheritance (old issue) ## Detailed Description of the Pull Request / Additional comments - **Terminal Settings Model** - Introduced `PROJECTED_SETTING` as a macro to more easily declare the functions for each setting - Introduced `<setting>OverrideSource` which finds the `Profile` that has \<setting\> defined - Introduced `OriginTag Profile::Origin {Custom, InBox, Generated}` to trace where a profile came from - `DefaultProfileUtils` creates profiles for profile generators. So that now sets the `Origin` tag to `Generated` - `CascadiaSettings::LoadDefaults()` tags all profiles created as `InBox`. - The view model had to ingest the API change to be able to interact with `<setting>OverrideSource` - **Override Message Generation** - The reset button now has a more specific tooltip - The reset button now only appears if base layer is being overridden - We use the settings model changes to determine the message to display for the target ## Validation Steps Performed Tested the following cases: - overrides nothing (inherited setting) - overrides value inherited from... - base layer - a profile generator - in-box profile - global settings should not have this feature --- <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:21:50 +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#27414