Skip to content
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

Add support for "User Default" settings II #3892

Merged
7 commits merged into from
Dec 11, 2019

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

This is attempt 2 at this feature. The original PR can be found at #3369.

These are settings that apply to every profile, before user customizations.

If the user wants to add "default profile settings", they can make the "profiles" property an object, instead of a list, and add "defaults" key underneath that object. The users list of profiles should then be under the list property of the profiles object.

References

#2515, #2603, #3369, #3569

PR Checklist

Detailed Description of the Pull Request / Additional comments

Discussion in #2325 itself serves as the "spec" for this task. I thought we'd need more discussion on the topic, but it ended up being pretty straightforward.

I should not have said that in the original PR. We've had a better spec review now that I think we're happier with.

Validation Steps Performed

ran the tests

@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. labels Dec 9, 2019
Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the layering code, looks god. Haven’t looked at tests or schema yet, so I’m holding my green Chex mix

doc/user-docs/UsingJsonSettings.md Outdated Show resolved Hide resolved
doc/user-docs/UsingJsonSettings.md Outdated Show resolved Hide resolved

What if I wanted a profile to have a different value for a property other than
the default? Simply set the property in the profile's entry to override the
value from `defaults`. Let's say you want the `cmd` profile to have `Consolas`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent formatting for font names. Shall we split the difference and always italicize them?

zadjii-msft and others added 4 commits December 9, 2019 16:39
Co-Authored-By: Dustin L. Howett (MSFT) <duhowett@microsoft.com>
…bjectifying-settings

# Conflicts:
#	src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp
@zadjii-msft zadjii-msft added the Needs-Second It's a PR that needs another sign-off label Dec 9, 2019

// Remove the `guid` member from the default settings. That'll
// hyper-explode, so just don't let them do that.
_userDefaultProfileSettings.removeMember({ "guid" });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also remove hidden?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, people could totally just hide all their profiles though, right? Then only unhide profiles if they want them visible (i.e hide all WSL profiles, and only re-enable the cmd profile)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i honestly think that's fine

@carlos-zamora carlos-zamora added the AutoMerge Marked for automatic merge by the bot when requirements are met label Dec 11, 2019
@ghost
Copy link

ghost commented Dec 11, 2019

Hello @carlos-zamora!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 3ccc999 into master Dec 11, 2019
@ghost ghost deleted the dev/migrie/f/2325-objectifying-settings branch December 11, 2019 00:39
zadjii-msft pushed a commit that referenced this pull request Dec 30, 2019
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
Adds proper `type` for `ProfilesObject` definition to avoid warnings about matches of multiple schemas.

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References
Original issue: #3909
Related PR: #3892
Relates VSCode issue: microsoft/vscode#86738

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [X] Closes #3909
* [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] No new tests ~Tests added/passed~
* [ ] No docs update needed ~Requires documentation to be updated~
* [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: #3909 (marked as help wanted)

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
1. Download `doc/cascadia/profiles.schema.json` locally
1. Open `profiles.json` from WT in VSCode
1. Replace `$schema` value with path to local copy (verified that all errors are still in place and validations works as before)
1. Update it with `type` on `ProfilesObject`
1. Check that `Matches multiple schemas when only one must validate` warning is fixed
@ghost
Copy link

ghost commented Jan 14, 2020

🎉Windows Terminal Preview v0.8.10091.0 has been released which incorporates this pull request.:tada:

Handy links:

Rican7 added a commit to Rican7/dotfiles that referenced this pull request Jan 15, 2020
configurations thanks to the new "profile defaults" feature

(See microsoft/terminal#3892)
Rican7 added a commit to Rican7/dotfiles that referenced this pull request Feb 10, 2024
configurations thanks to the new "profile defaults" feature

(See microsoft/terminal#3892)
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal AutoMerge Marked for automatic merge by the bot when requirements are met Needs-Second It's a PR that needs another sign-off Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default Profile for Common Profile Settings
3 participants