Repository navigation
feat: turn the macOS menu bar's auto-hide on or off from Settings - #340
Merged
Merged
Conversation
Only setup could change the menu bar's auto-hide, so after choosing the top edge the menu bar stayed hidden unless setup ran again or the setting was found in System Settings. Settings, General, Native menu bar now has Automatically hide the menu bar, which changes the macOS setting through System Events and keeps StableBar's record, so Uninstall still knows to turn off the auto-hide StableBar turned on. Fixes #210
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.
Problem
Only setup changes the macOS menu bar's auto-hide. After choosing Top edge, Replace the menu bar or the Notch preset, the menu bar stays hidden unless you rerun setup or find the setting in System Settings. Fixes #210.
Stacked on #339, which this PR targets. Merge #339 first; GitHub then moves this PR onto
main.Changes
MenuBarAutoHideSettings.swift,GeneralSettingsView.swift). A switch above Reveal delay and Always hide, which only matter while auto-hide is on.MenuBarAutoHide.change). Turning auto-hide on from a visible menu bar records it as StableBar's, and turning it off clears the record, using feat: uninstall StableBar and turn off the menu bar auto-hide it turned on #339'sturnedOnByStableBar(after:wasOn:wasStableBars:). Uninstall still turns off the auto-hide StableBar turned on, whether setup or this switch did it.docs/getting-started.md: the setup paragraph points to the switch; "Hide the native menu bar" explains it, including that it outlasts quitting; the Uninstall section says "setup or Settings".docs/settings.md: the General paragraph lists Native menu bar.There's no configuration property, because the value is the Mac's own setting, so decoding, the schema, layers and configuration edits don't apply.
Testing
swift test --filter 'MenuBarAutoHideTests|UninstallTests': 28 tests. The 4 new ones cover:The tests use a fake setter and their own
UserDefaultssuite, so they never touch the menu bar.swift test: 294 XCTest and 507 Swift Testing tests pass.Passing a method reference as
Binding's setter crashed the Swift 6 compiler in IR generation (an@isolated(any)thunk), so the switch uses a closure, asLoginItemSettingsdoes.Not checked live: flipping the switch, because it changes the developer's own menu bar setting. The System Events command is the one setup has used since feat: lead setup to replace the macOS menu bar #198.
Offscreen renders of General. The switch shows on because auto-hide is on for the Mac that drew them.
Merging
One commit on top of #339. Keep each commit (merge commit or rebase) so both
featentries reach the changelog.Claude Opus 5.5 via Claude Code