feat(bootstrap): add friendly macos defaults#10398
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds structured macOS "friendly" TOML tables ( ChangesFriendly macOS Defaults Feature
Sequence DiagramsequenceDiagram
participant UserConfig as User Config
participant Agg as defaults_from_config
participant Mapper as Friendly Mapper
participant Raw as Raw Defaults Parser
participant Merge as Merge Handler
participant Result as Final Defaults Map
UserConfig->>Agg: provide TOML with friendly sections + raw defaults
Agg->>Mapper: parse dock/finder/keyboard/trackpad entries
Mapper->>Mapper: validate keys/types and map to (domain,key)->value
Agg->>Raw: collect entries from [bootstrap.macos.defaults]
Mapper->>Merge: emit friendly-derived entries
Raw->>Merge: emit raw entries
Merge->>Result: merge with raw overriding friendly
Result->>UserConfig: return final defaults map
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Greptile SummaryAdds curated
Confidence Score: 5/5Safe to merge — the friendly sections are purely additive, all compilation and merge logic is well-tested, and the existing raw defaults path is unchanged. The per-file merge loop correctly resolves raw-over-friendly within a file and local-over-global across files. Multi-domain trackpad keys emit only one warning. The OCI entry count is deduplicated. Unit and e2e tests cover the happy path, invalid enum/type values, unknown keys, and the local-friendly-overrides-global-raw precedence scenario. No files require special attention. Important Files Changed
Reviews (6): Last reviewed commit: "fix(oci): reject friendly macos defaults" | Re-trigger Greptile |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/system/mod.rs (1)
236-257:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPreserve config-layer precedence when applying raw-over-friendly merge.
The current flow aggregates all friendly entries and all raw entries across all files, then overlays raw once at the end. That allows a global raw value to override a more-local friendly value for the same
(domain, key), which breaks the stated global→local precedence behavior in this function.Suggested fix (merge per config file, then apply global→local override)
pub fn defaults_from_config(config: &Config) -> Vec<DefaultsRequest> { - let mut friendly: IndexMap<(String, String), toml::Value> = IndexMap::new(); - let mut raw: IndexMap<(String, String), toml::Value> = IndexMap::new(); + let mut merged: IndexMap<(String, String), toml::Value> = IndexMap::new(); // config_files is ordered local -> global; reverse for global -> local for cf in config.config_files.values().rev() { if let Some(sys) = cf.bootstrap_config() { - merge_friendly_macos_defaults(&mut friendly, &sys.macos); + let mut friendly: IndexMap<(String, String), toml::Value> = IndexMap::new(); + let mut raw: IndexMap<(String, String), toml::Value> = IndexMap::new(); + + merge_friendly_macos_defaults(&mut friendly, &sys.macos); for (domain, entries) in sys.macos.defaults { match entries { toml::Value::Table(entries) => { for (key, value) in entries { raw.insert((domain.clone(), key), value); } } _ => warn!( "[bootstrap.macos.defaults]: expected a table of key/value pairs for domain '{domain}'" ), } } + + for (key, value) in merge_raw_over_friendly_macos_defaults(friendly, raw) { + merged.insert(key, value); + } } } - let merged = merge_raw_over_friendly_macos_defaults(friendly, raw); let mut out = vec![]; for ((domain, key), value) in merged {Also applies to: 270-278
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/system/mod.rs` around lines 236 - 257, The code currently collects all friendly and raw macOS defaults across files then applies raw-over-friendly once, which lets a global raw override a more-local friendly; instead, inside the loop over config.config_files.values().rev() you should merge per-file: call merge_friendly_macos_defaults(&mut friendly, &sys.macos) and then immediately incorporate that file's raw entries into friendly (i.e., apply the raw overlay for that file before continuing) rather than accumulating raw separately; concretely, stop building the separate raw IndexMap and instead for each sys.macos.defaults entry insert into a local raw map and call merge_raw_over_friendly_macos_defaults (or perform the same overlay logic inline) to update friendly before the next config file, preserving global→local precedence for (domain,key) pairs while keeping existing functions merge_friendly_macos_defaults and merge_raw_over_friendly_macos_defaults.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/system/mod.rs`:
- Around line 236-257: The code currently collects all friendly and raw macOS
defaults across files then applies raw-over-friendly once, which lets a global
raw override a more-local friendly; instead, inside the loop over
config.config_files.values().rev() you should merge per-file: call
merge_friendly_macos_defaults(&mut friendly, &sys.macos) and then immediately
incorporate that file's raw entries into friendly (i.e., apply the raw overlay
for that file before continuing) rather than accumulating raw separately;
concretely, stop building the separate raw IndexMap and instead for each
sys.macos.defaults entry insert into a local raw map and call
merge_raw_over_friendly_macos_defaults (or perform the same overlay logic
inline) to update friendly before the next config file, preserving global→local
precedence for (domain,key) pairs while keeping existing functions
merge_friendly_macos_defaults and merge_raw_over_friendly_macos_defaults.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6b1ff676-ccaf-4f4f-a680-b12d6f7777e7
📒 Files selected for processing (6)
docs/bootstrap.mddocs/bootstrap/macos-defaults.mddocs/tips-and-tricks.mde2e/cli/test_system_defaultssrc/config/config_file/mise_toml.rssrc/system/mod.rs
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.6 x -- echo |
18.0 ± 0.7 | 16.5 | 21.8 | 1.00 |
mise x -- echo |
18.5 ± 1.9 | 17.0 | 55.9 | 1.03 ± 0.11 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.6 env |
18.0 ± 0.8 | 16.3 | 20.9 | 1.00 |
mise env |
18.4 ± 0.8 | 17.0 | 24.0 | 1.02 ± 0.06 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.6 hook-env |
18.5 ± 0.8 | 16.9 | 23.7 | 1.00 |
mise hook-env |
19.0 ± 0.7 | 17.3 | 22.2 | 1.03 ± 0.06 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.6 ls |
14.9 ± 0.6 | 13.6 | 19.2 | 1.00 |
mise ls |
15.7 ± 0.7 | 14.2 | 20.5 | 1.05 ± 0.07 |
xtasks/test/perf
| Command | mise-2026.6.6 | mise | Variance |
|---|---|---|---|
| install (cached) | 130ms | 134ms | -2% |
| ls (cached) | 57ms | 58ms | -1% |
| bin-paths (cached) | 62ms | 65ms | -4% |
| task-ls (cached) | 124ms | 125ms | +0% |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/bootstrap/macos-defaults.md (1)
36-36: 💤 Low valueHyphenate the compound noun "raw-default" for clarity.
The phrase "a global raw default" should use a hyphen to clarify it is a compound noun: "a global raw-default". This improves readability and grammatical precision, especially since "raw-defaults" is used as a section/domain term elsewhere in the document.
✏️ Proposed fix
-override a global raw default for the same pair. +override a global raw-default for the same pair.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/bootstrap/macos-defaults.md` at line 36, Change the phrase "a global raw default" to the hyphenated compound "a global raw-default" in the sentence shown (to match the term "raw-defaults" used elsewhere); replace the unhyphenated instance so the document consistently uses the compound noun "raw-default".Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@docs/bootstrap/macos-defaults.md`:
- Line 36: Change the phrase "a global raw default" to the hyphenated compound
"a global raw-default" in the sentence shown (to match the term "raw-defaults"
used elsewhere); replace the unhyphenated instance so the document consistently
uses the compound noun "raw-default".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a8d6e422-2909-4399-96bb-4eb5211659d5
📒 Files selected for processing (2)
docs/bootstrap/macos-defaults.mdsrc/system/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- src/system/mod.rs
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4148c1f. Configure here.
11771e5 to
fac98df
Compare

Summary
[bootstrap.macos.dock],[bootstrap.macos.finder],[bootstrap.macos.keyboard], and[bootstrap.macos.trackpad]sectionsTests
cargo test -q macos_defaultscargo test -q test_bootstrap_macos_defaultsmise run test:e2e cli/test_system_defaultsThis PR was generated by an AI coding assistant.
Note
Low Risk
Experimental bootstrap/macOS defaults only; no auth or data-path changes. Main risk is surprising override behavior when mixing friendly and raw defaults in layered configs.
Overview
Introduces friendly macOS bootstrap sections so common Dock, Finder, keyboard, and trackpad preferences can be declared with short keys (e.g.
show_all_files,tap_to_click) instead of rawdefaultsdomains.Those sections are compiled into the same
DefaultsRequestpipeline used bymise bootstrap macos-defaults status/apply; the apply backend is unchanged. Merge rules: within one config file,[bootstrap.macos.defaults]wins over the(domain, key)produced by a friendly key; across files, usual global→local precedence still applies. Invalid friendly keys, enum values, or types warn and are skipped.Docs and
schema/mise.jsondocument supported keys; OCI build now counts friendly entries viamacos_defaults_entry_countand rejects any[bootstrap.macos.*]defaults in project configs.Reviewed by Cursor Bugbot for commit fac98df. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Documentation
Tests
Schema
Bug Fixes