Repository navigation
Add sidebar.leftMinWidth to cmux.json - #14875
teamleaderleo wants to merge 11 commits into
Conversation
The left sidebar's drag floor was only reachable through the sidebarMinimumWidth UserDefaults key. It is now a first-class setting: sidebar.leftMinWidth in cmux.json, a Sidebar Minimum Width slider in Settings > Sidebar, schema and search entries. Values are clamped to the existing 120-260 range, the default stays 240, and the historical UserDefaults key is kept so existing overrides keep working. The layout already observes the key, so edits apply to open windows immediately. Adapted from the approach in manaflow-ai#6875. Co-authored-by: Austin Wang <austinwang115@gmail.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Austin Wang <austinwang115@gmail.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
|
/catch-up |
|
Catch-up only runs on branches in this repository for now, so I left this one alone. A maintainer can merge main in by hand. |
Catch-up merge by scripts/ci/catch_up_pr.py (RFC manaflow-ai#14631). Merged by scripts/merge-main.sh: mf/main at 8c9d2c9, the newest commit with green CI fast guards (2 newer skipped). Resolved generated files: - Resources/Localizable.xcstrings: xcstrings key-level union - Packages/macOS/CmuxFoundation/Sources/CmuxFoundation/ConfigValidation/CmuxConfigSchema.generated.swift: generate-cmux-config-schema.py, regenerated from the merged schema Catch-up-previous-head: d190c06 Catch-up-base: 8c9d2c9
|
Deployment failed for project cmux with the following error: |
Catch-up merge by scripts/ci/catch_up_pr.py (RFC manaflow-ai#14631). Merged by scripts/merge-main.sh: mf/main at 4d3385b. Resolved generated files: - Resources/Localizable.xcstrings: xcstrings key-level union Catch-up-previous-head: 3519c24 Catch-up-base: 4d3385b
Catch-up merge by scripts/ci/catch_up_pr.py (RFC manaflow-ai#14631). Merged by scripts/merge-main.sh: origin/main at 6431ac2. Resolved generated files: - Resources/Localizable.xcstrings: xcstrings key-level union - Packages/macOS/CmuxFoundation/Sources/CmuxFoundation/ConfigValidation/CmuxConfigSchema.generated.swift: generate-cmux-config-schema.py, regenerated from the merged schema Catch-up-previous-head: 05ef27b Catch-up-base: 6431ac2
`defaults write <bundle> sidebarMinimumWidth 180` (without -float) stores a string. The session sanitizer already parsed it, but the typed settings key and the Settings slider did not. Rewrite such a value as a number at launch so every reader agrees. Unparseable strings are left alone and resolve to the default. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tore Move the string-to-number rewrite of sidebarMinimumWidth ahead of the settings file store, so a cmux.json backup of the user's earlier value is the normalized number, and drop unparseable strings instead of letting the backup record them as 0. Cover an earlier defaults value (number and string) surviving cmux.json setting and then removing sidebar.leftMinWidth. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s in the test Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…width-setting # Conflicts: # CHANGELOG.md # Packages/macOS/CmuxFoundation/Sources/CmuxFoundation/ConfigValidation/CmuxConfigSchema.generated.swift
CI failure attributionCI passes on Written by |
…width-setting Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
An earlier merge on this branch reshuffled the whole string catalog, so the pull request diff showed about 3,000 changed lines for 4 new keys. This restores main's copy and re-inserts only the sidebar.leftMinWidth keys. The key set is unchanged: main's 7,160 keys plus the same 4, and no existing key's value differs from main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Review: read the whole diff with correctness first, and the shape is right. Two things I checked specifically, because they are where this kind of change usually goes wrong. The legacy-value normalization is correct and it is ordered correctly. The clamp is in one place. Fixed: nothing needed fixing in this pass. The earlier rounds had already dealt with the ambiguous Left: two red checks, and both trace to one commit rather than to the change itself.
The cheapest resolution I can see, and the one I would recommend, is to associate Staying a draft until one of those lands. Nothing about the code is waiting on review. |
38830bb to
0b38921
Compare
|
Superseded by #15349, which is the same change with the same setting and default: Nothing here was wrong. The problem was where the branch lived. The #15349's body records what happened to the history, so the force-push that dropped a stray commit is on the record there rather than only here. Closing in favour of that one. Thanks for the patience on this :) |
The left sidebar's drag floor could only be changed with
defaults write <bundle> sidebarMinimumWidth -float N. It's now a regular setting:sidebar.leftMinWidthincmux.json, and a Sidebar Minimum Width slider in Settings > Sidebar.{ "sidebar": { "leftMinWidth": 160 } }sidebarMinimumWidthUserDefaults key, so existingdefaults writeoverrides keep working.ContentViewalready observed that key (@AppStorage+onChange→clampSidebarWidthIfNeeded), so acmux.jsonsave applies to open windows. Raising the floor widens a narrower sidebar; lowering it lets you drag narrower.cmux.jsonrestores the previous value, through the usual managed-defaults backup.CmuxSettings.LeftSidebarWidthSettingspolicy, which mirrorsRightSidebarWidthSettings. The catalog key, thecmux.jsonparser, the Settings row andSessionPersistencePolicyall read it.all-keys.md, localized Settings strings (9 locales) and a localized docs description (20 web locales) are included.This builds on @austinywang's approach in #6875, which has gone stale against main (it also lowered the floor to 100). Austin is credited as co-author.
defaults write <bundle> sidebarMinimumWidth 180, stored as a string without-float) is rewritten as a number at launch, before cmux.json applies. Every reader and the cmux.json backup then see the same value. An unparseable string is removed and resolves to the default.Verification
cmuxTests/SidebarWidthPolicyTestscovers thecmux.jsonapply, clamping in both directions, restoring on unset, the legacy string rewrite, and an earlierdefaultsvalue (number or string) survivingcmux.jsonsetting and then removing the key.CmuxSettingsTests/LeftSidebarWidthSettingsTestscovers the policy and the catalog key.SettingsRowAnchorResolutionTests.scripts/ci/guards-local.sh(64 steps),scripts/localization_catalog.py checkandscripts/lint-xcstrings.py.SidebarWidthPolicyTests, and they passed.LeftSidebarWidthSettingsandSettingsRowAnchorResolutionsuites, and they passed.scripts/merge-main.shat 6431ac2, with guards green.Dogfood
a755a3954e059b2df9a04b9c, tagpr-14875-sidebar-min-width-v2, built from faf5805 on cmuxs-Mac-mini (artifactsha256:6f17a1a8…). The app code is identical at 2ecedb9, which only drops a test import.--backend-mode local, because the dev backend VM isn't reachable from this machine. The change doesn't touch the backend.publish-hqrefuses local-backend artifacts, so there is no HQ link.tag:cmux-loadernode never became visible on this identity's tailnet, so SSH and cua-ssh couldn't reach it.sidebar.leftMinWidth, both in cmux.json and with the slider.🤖 Generated with Claude Code