Skip to content

feat: turn the macOS menu bar's auto-hide on or off from Settings - #340

Merged
M4n0x merged 1 commit into
feat/332-uninstallfrom
feat/210-menu-bar-auto-hide
Oct 26, 2026
Merged

M4n0x merged 1 commit into
feat/332-uninstallfrom
feat/210-menu-bar-auto-hide

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

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

  • Settings → General → Native menu bar → Automatically hide the menu bar (MenuBarAutoHideSettings.swift, GeneralSettingsView.swift). A switch above Reveal delay and Always hide, which only matter while auto-hide is on.
    • It changes the macOS setting through System Events, like setup, and leaves the bar's offset alone.
    • It rereads the setting when StableBar becomes active, so a change made in System Settings shows up.
    • A failure appears under the row; a refused Automation request points to Privacy & Security.
  • Keeping the record (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's turnedOnByStableBar(after:wasOn:wasStableBars:). Uninstall still turns off the auto-hide StableBar turned on, whether setup or this switch did it.
  • Search. The Native menu bar entry is found by "auto-hide" and "automatically hide".
  • Docs.
    • 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.
    • The Uninstall sheet and README say "StableBar turned on" rather than "setup".

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:

    • turning auto-hide on in Settings records it;
    • turning it off clears the record;
    • a failed System Events call leaves the record unchanged;
    • search finds the switch.

    The tests use a fake setter and their own UserDefaults suite, 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, as LoginItemSettings does.

  • 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.

Before After
Light
Dark

Merging

One commit on top of #339. Keep each commit (merge commit or rebase) so both feat entries reach the changelog.

Claude Opus 5.5 via Claude Code

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
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 26, 2026 17:44
@M4n0x
M4n0x merged commit 49ec5c5 into feat/332-uninstall Oct 26, 2026
7 checks passed
@M4n0x
M4n0x deleted the feat/210-menu-bar-auto-hide branch October 26, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant