Settings profile base option#52456
Merged
JosephTLyons merged 22 commits intomainfrom Apr 2, 2026
Merged
Conversation
bc7b4a2 to
64f0bd7
Compare
📏 PR Size: 425 lines changed (Size L)Please note: this PR exceeds the 400 LOC soft limit.
|
MrSubidubi
approved these changes
Mar 25, 2026
Member
MrSubidubi
left a comment
There was a problem hiding this comment.
As for the naming of base: An idea that came to mind is that we could instead name that enum UserSettings, DefaultSettings for it to be more clear. Another idea would be something like "application" which could then be accumulative or exclusive, naming very much to be discussed (and still think I like your current approach more).
This changes the structure of settings profiles to include a 'settings' key
and adds an optional 'base' field that controls what settings the profile
starts from:
- 'user' (default): Apply profile on top of user's settings
- 'default': Apply profile on top of Zed's defaults, ignoring user settings
New JSON format:
{
"profiles": {
"Presenting": {
"settings": { "buffer_font_size": 20.0 }
},
"Clean Slate": {
"base": "default",
"settings": { "theme": "Ayu Dark" }
}
}
}
Both fields now use #[serde(default)], so profiles can omit either: - base defaults to 'user' - settings defaults to empty
- Move tests from settings_store.rs to settings_profile_selector.rs so they go through the picker like production code - Refactor init_test to accept full user settings JSON instead of just profiles, making each test explicit about its setup - Expand test_settings_profile_with_default_base to verify profile settings apply on top of factory defaults
Wraps old profile settings in a 'settings' key:
Before: { "Presenting": { "buffer_font_size": 20 } }
After: { "Presenting": { "settings": { "buffer_font_size": 20 } } }
Also updates migrate_settings and migrate_language_setting helpers to
handle both old and new profile formats, so migrations registered
before and after this one both work correctly.
Profiles with a 'base' key but no 'settings' key are already in the new format. Without this check, the migration incorrectly wraps the base key into settings, breaking the profile behavior.
Each profile row now displays a small muted label indicating its base type (User or Default) with a tooltip explaining the behavior.
Just doesn't feel good
4020865 to
45ae503
Compare
piper-of-dawn
pushed a commit
to piper-of-dawn/zed
that referenced
this pull request
Apr 25, 2026
## Context This PR introduces a `base` field for settings profiles to allow profiles to either overlay `user` settings or to overlay `default`, which is simply zed's defaults (user settings are skipped). I'm not entirely sure I love `default` because it's a bit confusing (there's a setting called `default` but the default is `user`). Another idea I had was `factory` (`user` (default) or `factory`) - curious to hear from the reviewers. This will be useful for those of us who need to quickly flip to a default state, or a default state with some customizations on top. Additionally, from what I can tell, VS Code's profile system is more in line with what this PR is offering in Zed - profiles overlay the default settings, not the user's customization layer. So this will be familiar for those users. I've had no issue with the migrator, code is pretty simple there, but would love for @smitbarmase to review the migration to make sure I'm not missing something. ## Self-Review Checklist <!-- Check before requesting review: --> - [X] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [X] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Improved the flexibility of settings profiles by offering a way for profiles to lay atop of zed defaults, skipping user settings all together. Settings Profiles now take the following form. ```json5 "Your Profile": { "base": "user" // or "default" "settings": { // ... }, }, ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
This PR introduces a
basefield for settings profiles to allow profiles to either overlayusersettings or to overlaydefault, which is simply zed's defaults (user settings are skipped). I'm not entirely sure I lovedefaultbecause it's a bit confusing (there's a setting calleddefaultbut the default isuser). Another idea I had wasfactory(user(default) orfactory) - curious to hear from the reviewers. This will be useful for those of us who need to quickly flip to a default state, or a default state with some customizations on top. Additionally, from what I can tell, VS Code's profile system is more in line with what this PR is offering in Zed - profiles overlay the default settings, not the user's customization layer. So this will be familiar for those users.I've had no issue with the migrator, code is pretty simple there, but would love for @smitbarmase to review the migration to make sure I'm not missing something.
Self-Review Checklist
Release Notes: