-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement MVVM for Color Schemes #13179
Conversation
src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp
Outdated
Show resolved
Hide resolved
Known issue:
EDIT: Fixed now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I think this is a good split for MVVM. I'm trying my best to figure out what is reasonably in scope for this PR and what isn't. Here's what I've kinda decided on...
- in scope:
- move
IsRenaming
- fix up & polish notification system
- fix some of the names on these classes/members. Curious what other reviewers suggest for names because some of these are hard haha.
- move
- follow-up:
- changing
CanDelete
andCanRename
functionality to operate without having to check a list ofInBoxSchemes
names. This should just be a property off of theColorSchemeViewModel
.
- changing
src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp
Outdated
Show resolved
Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp
Outdated
Show resolved
Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp
Outdated
Show resolved
Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp
Outdated
Show resolved
Hide resolved
## Summary of the Pull Request - When 'discard changes' is hit, we re-initialize our list of color scheme view models but forgot to tell xaml about it, this commit fixes that. - Make sure to exit rename mode when 'update settings' gets called ## References color schemes mvvm added in #13179 ## PR Checklist * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Validation Steps Performed Hitting discard changes doesn't cause an inconsistency with the currently selected scheme anymore
Due to the way our localization pipeline works, we cannot delete resources in main until the resources in question are totally flushed out of the active-servicing release branches. Unfortunately, in #13179, we _did_ remove resource keys. Because the Color Schemes page in 1.14 and 1.15 uses the resources directly (rather than by way of x:Uid), it is easier for us to backport the resource changes now than to reintroduce the old keys on main. Closes #13606
Due to the way our localization pipeline works, we cannot delete resources in main until the resources in question are totally flushed out of the active-servicing release branches. Unfortunately, in #13179, we _did_ remove resource keys. Because the Color Schemes page in 1.14 and 1.15 uses the resources directly (rather than by way of x:Uid), it is easier for us to backport the resource changes now than to reintroduce the old keys on main. Closes #13606
🎉 Handy links: |
…oft#13712) Due to the way our localization pipeline works, we cannot delete resources in main until the resources in question are totally flushed out of the active-servicing release branches. Unfortunately, in microsoft#13179, we _did_ remove resource keys. Because the Color Schemes page in 1.14 and 1.15 uses the resources directly (rather than by way of x:Uid), it is easier for us to backport the resource changes now than to reintroduce the old keys on main. Closes microsoft#13606
…oft#13712) Due to the way our localization pipeline works, we cannot delete resources in main until the resources in question are totally flushed out of the active-servicing release branches. Unfortunately, in microsoft#13179, we _did_ remove resource keys. Because the Color Schemes page in 1.14 and 1.15 uses the resources directly (rather than by way of x:Uid), it is easier for us to backport the resource changes now than to reintroduce the old keys on main. Closes microsoft#13606 (cherry picked from commit 6933429) Service-Card-Id: 84870299 Service-Version: 1.14
ColorScheme MVVM was implemented in #13179. This PR updates the ProfileViewModel/AppearanceViewModels to use color scheme view models instead of the raw settings model objects. * [x] Updates ProfileViewModel/AppearanceViewModel to use ColorSchemesPageViewModel/ColorSchemeViewModel implemented in #13179 * [x] Removes ProfilePageNavigationState ## Validation Steps Performed Settings UI still works (we _probably_ want to bug bash this at some point though as with all SUI changes)
Summary of the Pull Request
Implements the MVVM style for the Color Schemes editor
PR Checklist
Detailed Description of the Pull Request / Additional comments
Introduces:
ColorSchemesPageViewModel
: The view model responsible for the entire color schemes page. Handles what the current scheme is, adding/deleting/renaming schemesColorSchemeViewModel
: A view model class for individual color schemesValidation Steps Performed
Manually tested: