[PR #13702] [MERGED] Stop writing optional theme fields #29719

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13702
Author: @lhecker
Created: 8/9/2022
Status: Merged
Merged: 8/10/2022
Merged by: @undefined

Base: mainHead: dev/lhecker/13544-theme-optionals


📝 Commits (1)

  • 9610ac8 Stop writing all optional theme fields

📊 Changes

2 files changed (+34 additions, -30 deletions)

View changed files

📝 src/cascadia/TerminalSettingsModel/Theme.cpp (+30 -13)
📝 src/cascadia/TerminalSettingsModel/Theme.h (+4 -17)

📄 Description

Other settings model classes call JsonUtils::SetValueForKey with the
private _##value member as the value. Since _##value is an optional,
this prevented writing out unset, optional fields. The new Themes class
deviated from this and this commit brings it back in line with the others.

Closes #13544

Validation Steps Performed

  • Create a { "name": "test" } theme
  • Save settings via the UI
  • Optional/Defaulted fields aren't written

🔄 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/13702 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 8/9/2022 **Status:** ✅ Merged **Merged:** 8/10/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/13544-theme-optionals` --- ### 📝 Commits (1) - [`9610ac8`](https://github.com/microsoft/terminal/commit/9610ac817b9b03414ba11b2480ba94e12e0e8b11) Stop writing all optional theme fields ### 📊 Changes **2 files changed** (+34 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalSettingsModel/Theme.cpp` (+30 -13) 📝 `src/cascadia/TerminalSettingsModel/Theme.h` (+4 -17) </details> ### 📄 Description Other settings model classes call `JsonUtils::SetValueForKey` with the private `_##value` member as the value. Since `_##value` is an optional, this prevented writing out unset, optional fields. The new `Themes` class deviated from this and this commit brings it back in line with the others. Closes #13544 ## Validation Steps Performed * Create a `{ "name": "test" }` theme * Save settings via the UI * Optional/Defaulted fields aren't written ✅ --- <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:36:30 +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#29719