[PR #12800] [MERGED] Deduplicate identical inbox color schemes to heal user settings #29244

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12800
Author: @DHowett
Created: 3/31/2022
Status: Merged
Merged: 2/27/2024
Merged by: @DHowett

Base: mainHead: dev/duhowett/fhl-202203/color-scheme-healing


📝 Commits (10+)

  • 924906a It works?
  • a31b089 Move to FixupUserSettings, add a bunch of tests
  • 56fad52 Migrate spelling-0.0.21 changes from main
  • 29ff259 Merge remote-tracking branch 'origin/main' into dev/duhowett/fhl-202203/color-scheme-healing
  • 8931ccf Merge remote-tracking branch 'origin/main' into dev/duhowett/fhl-202203/color-scheme-healing
  • 00a3f6e Fix for main
  • 6763baa Merge remote-tracking branch 'origin/main' into dev/duhowett/fhl-202203/color-scheme-healing
  • 1af99be Merge remote-tracking branch 'origin/main' into dev/duhowett/fhl-202203/color-scheme-healing
  • 2ada4fc Force users to duplicate inbox schemes; make duplicate work
  • 9086e69 Fix tests, Modified->modified

📊 Changes

23 files changed (+1235 additions, -97 deletions)

View changed files

📝 .github/actions/spelling/allow/allow.txt (+2 -0)
📝 src/cascadia/LocalTests_SettingsModel/ColorSchemeTests.cpp (+683 -25)
📝 src/cascadia/LocalTests_SettingsModel/SerializationTests.cpp (+306 -0)
📝 src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.cpp (+13 -0)
📝 src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h (+2 -1)
📝 src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl (+2 -1)
📝 src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp (+19 -15)
📝 src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.h (+1 -0)
📝 src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.idl (+1 -0)
📝 src/cascadia/TerminalSettingsEditor/EditColorScheme.cpp (+0 -9)
📝 src/cascadia/TerminalSettingsEditor/EditColorScheme.xaml (+14 -12)
📝 src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw (+12 -0)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.h (+5 -0)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp (+109 -12)
📝 src/cascadia/TerminalSettingsModel/ColorScheme.cpp (+11 -1)
📝 src/cascadia/TerminalSettingsModel/ColorScheme.h (+3 -0)
📝 src/cascadia/TerminalSettingsModel/ColorScheme.idl (+3 -1)
📝 src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp (+24 -7)
📝 src/cascadia/TerminalSettingsModel/GlobalAppSettings.h (+1 -0)
📝 src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl (+1 -0)

...and 3 more files

📄 Description

Up until now, we have treated inbox, fragment and user color schemes the
same: we load them all into one big map and when we save the settings
file we write them all out. It's been a big annoyance pretty much
forever.

In addition to cluttering the user's settings file, it prevents us from
making changes to the stock color schemes (like to change the cursor
color, or to adjust the colors in Tango Dark, or what have you) because
they're already copied in full in the user settings. It also means that
we need some special UI affordances for color schemes that you are
allowed to view but not to delete or rename.

We also have a funny hardcoded list of color scheme names and we use
that to determine whether they're "inbox" for UI purposes.

Because of all that, we are hesitant to add more color schemes to the
default set.

This pull request resolves all of those issues at once.

It:

  • Adds an "origin" to color schemes indicating where they're from
    (Inbox, Fragment, User, ...)
  • Replaces the Edit UI with a much simpler version that pretty much only
    has a "duplicate this color scheme to start editing it" button
  • Deletes color schemes that we consider to be equivalent to inbox ones;
    this allows us to finally disentangle the user's preferences from the
    terminal's.
  • Migrates all user settings that referred to schemes they may have
    modified (even implicitly!) to their modified versions.

The equivalence check intentionally leaves out the cursor and selection
colors, so that we have the freedom to change them in the future.

The Origin is part of a new interface, ISettingsModelObject, which we
can use in the future for things like Themes and Actions.


🔄 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/12800 **Author:** [@DHowett](https://github.com/DHowett) **Created:** 3/31/2022 **Status:** ✅ Merged **Merged:** 2/27/2024 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/duhowett/fhl-202203/color-scheme-healing` --- ### 📝 Commits (10+) - [`924906a`](https://github.com/microsoft/terminal/commit/924906ae76d9de9f48e81d462204fbd90955bab9) It works? - [`a31b089`](https://github.com/microsoft/terminal/commit/a31b0892dc01c61dc090e86eeebb2aa877b87777) Move to FixupUserSettings, add a bunch of tests - [`56fad52`](https://github.com/microsoft/terminal/commit/56fad52bb81ef884004f26f116e0e31822891443) Migrate spelling-0.0.21 changes from main - [`29ff259`](https://github.com/microsoft/terminal/commit/29ff2599a46e02117bc1f8aa74b98d7656f5b323) Merge remote-tracking branch 'origin/main' into dev/duhowett/fhl-202203/color-scheme-healing - [`8931ccf`](https://github.com/microsoft/terminal/commit/8931ccf42b3677d6f11c5619926f7dae79bd9ae6) Merge remote-tracking branch 'origin/main' into dev/duhowett/fhl-202203/color-scheme-healing - [`00a3f6e`](https://github.com/microsoft/terminal/commit/00a3f6e4d34758b6eaf801adbd27ed2cc31963d3) Fix for main - [`6763baa`](https://github.com/microsoft/terminal/commit/6763baab1cbaf530c2560cfb476162a54d600e5e) Merge remote-tracking branch 'origin/main' into dev/duhowett/fhl-202203/color-scheme-healing - [`1af99be`](https://github.com/microsoft/terminal/commit/1af99be813e8fc0acb4a02c5a202b08a7bf17c75) Merge remote-tracking branch 'origin/main' into dev/duhowett/fhl-202203/color-scheme-healing - [`2ada4fc`](https://github.com/microsoft/terminal/commit/2ada4fc52e3b4b91cf0796b4a45390ea6b7c7d84) Force users to duplicate inbox schemes; make duplicate work - [`9086e69`](https://github.com/microsoft/terminal/commit/9086e699c8502584740bc94c894774d1288cae3c) Fix tests, Modified->modified ### 📊 Changes **23 files changed** (+1235 additions, -97 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/allow.txt` (+2 -0) 📝 `src/cascadia/LocalTests_SettingsModel/ColorSchemeTests.cpp` (+683 -25) 📝 `src/cascadia/LocalTests_SettingsModel/SerializationTests.cpp` (+306 -0) 📝 `src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.cpp` (+13 -0) 📝 `src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h` (+2 -1) 📝 `src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl` (+2 -1) 📝 `src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp` (+19 -15) 📝 `src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.idl` (+1 -0) 📝 `src/cascadia/TerminalSettingsEditor/EditColorScheme.cpp` (+0 -9) 📝 `src/cascadia/TerminalSettingsEditor/EditColorScheme.xaml` (+14 -12) 📝 `src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw` (+12 -0) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.h` (+5 -0) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp` (+109 -12) 📝 `src/cascadia/TerminalSettingsModel/ColorScheme.cpp` (+11 -1) 📝 `src/cascadia/TerminalSettingsModel/ColorScheme.h` (+3 -0) 📝 `src/cascadia/TerminalSettingsModel/ColorScheme.idl` (+3 -1) 📝 `src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp` (+24 -7) 📝 `src/cascadia/TerminalSettingsModel/GlobalAppSettings.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl` (+1 -0) _...and 3 more files_ </details> ### 📄 Description Up until now, we have treated inbox, fragment and user color schemes the same: we load them all into one big map and when we save the settings file we write them *all* out. It's been a big annoyance pretty much forever. In addition to cluttering the user's settings file, it prevents us from making changes to the stock color schemes (like to change the cursor color, or to adjust the colors in Tango Dark, or what have you) because they're already copied in full in the user settings. It also means that we need some special UI affordances for color schemes that you are allowed to view but not to delete or rename. We also have a funny hardcoded list of color scheme names and we use that to determine whether they're "inbox" for UI purposes. Because of all that, we are hesitant to add *more* color schemes to the default set. This pull request resolves all of those issues at once. It: - Adds an "origin" to color schemes indicating where they're from (Inbox, Fragment, User, ...) - Replaces the Edit UI with a much simpler version that pretty much only has a "duplicate this color scheme to start editing it" button - Deletes color schemes that we consider to be equivalent to inbox ones; this allows us to finally disentangle the user's preferences from the terminal's. - Migrates all user settings that referred to schemes they may have modified (even implicitly!) to their modified versions. The equivalence check intentionally leaves out the cursor and selection colors, so that we have the freedom to change them in the future. The Origin is part of a new interface, `ISettingsModelObject`, which we can use in the future for things like Themes and Actions. --- <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:33:42 +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#29244