Skip to content

fix: restore menu-bar hiding on macOS 27 (#360) - #396

Closed
skuthus wants to merge 1 commit into
consolelabs:developfrom
skuthus:bugfix/macos27-menu-bar
Closed

skuthus wants to merge 1 commit into
consolelabs:developfrom
skuthus:bugfix/macos27-menu-bar

Conversation

@skuthus

@skuthus skuthus commented Sep 15, 2026

Copy link
Copy Markdown

Fixes #360. Icon hiding stopped working entirely on macOS 27; this restores it using the existing length-inflation mechanism, adapted for the new menu bar.

What's this PR do?

  • Sizes each collapsed status item to just under half the narrowest attached screen on macOS 27+, instead of twice the widest screen.
  • Adds zero-length spacer items between the separator and the arrow. On collapse they inflate to the same unit, so the total span covers wide and mixed-width displays. On expand they are hidden with isVisible, which keeps their slot in the layout table.
  • Displaced icons go into macOS 27's native overflow menu («) rather than off-screen.
  • Suppresses the separator's | glyph while collapsed on macOS 27+, where the item's span is on-screen.
  • Registers items under _v27 autosave names so spacers land between the arrow and the separator. Upgraders ⌘-drag icons past the separator once, as on a fresh install.
  • Retries the launch collapse until item frames exist in the shared menu-bar window (macOS 27 may not have them for a beat after start).
  • macOS 26 and earlier are unchanged (#available gated), including the existing widest-screen rule and 10,000pt bound.

Root cause. macOS 27 discards a status item whose length reaches half the display width, where macOS 26 and earlier clamped it. Hidden Bar inflated the separator to widestScreen * 2, which is over that limit on every Mac, so on 27 the separator was dropped outright: it displaced no icons and its own glyph vanished.

A single sub-half-width item is enough on typical laptop displays because macOS 27 owns overflow. Wide and mixed-width setups need more span than one item can hold, so spacers sit to the right of the separator (between it and the arrow). macOS overflows from the left, so real icons go first and surplus spacers overflow themselves.

Builds on the measurements in #382 and the spacer approach in #392 (closed).

What are the relevant Git tickets?

Verification

Measured and click-tested on macOS 27.0 (26A428), 1512pt built-in display:

  • Collapse hides icons to the left of the separator (they leave the bar / enter native overflow).
  • Expand restores the Hidden Bar controls to ~20pt slots; icons to the right of the separator stay visible throughout.
  • Repeated toggling works. Launch collapse is retried if frames are not ready yet.

Not verified on this machine: multi-display and notched-only layouts (spacer count is sized from #392's 1800+3008pt measurements).

Known limitation, unchanged from #392: the always-hidden separator still inflates as a single unit, so with the regular section expanded its icons can show on a very wide display.

Any background context you want to provide?

  • No new dependencies, and no project, entitlement, or preference changes.
  • Existing features on the pre-27 path are #available-gated and take the original code path.

macOS 27 discards a status item whose length reaches half the display
width instead of clamping it, and the menu bar is now one window with a
native overflow. Inflating the separator to twice the widest screen
dropped the item outright, so nothing hid.

Size each collapse unit just under half the narrowest attached display,
and add spacer items between the separator and the arrow so the total
span still covers wide and mixed-width setups. Displaced icons go into
the system overflow menu. Suppress the separator glyph while collapsed
because that span is now on-screen. Retry the launch collapse until
item frames exist in the shared menu-bar window.

Verified on macOS 27.0 (26A428): collapse hides icons left of the
separator; expand restores them.
@aryanmendpara

Copy link
Copy Markdown

this aint working on mine bruh

HalmSascha added a commit to HalmSascha/hidden that referenced this pull request Sep 15, 2026
Builds the app (ad-hoc signed, Release) on macos-latest via xcodebuild
and uploads it as an artifact, so the macOS 27 fix from PR consolelabs#396 can be
built reproducibly on our own CI/CD pipeline, not just locally.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
HalmSascha added a commit to HalmSascha/hidden that referenced this pull request Sep 15, 2026
PR consolelabs#396 hardcoded 6 spacer items, sized for its own dual-monitor test
case (5800pt next to 1800pt). On a single, more modest display that
massively over-inflates: on this machine's single 3840pt screen it
requested ~7 * 1856pt =~ 13,000pt against a 3840pt-wide bar, which
broke layout instead of cleanly collapsing (confirmed visually via a
capture of the real Menubar WindowServer window, not just Accessibility
geometry: real icons and the separator glyph ended up scattered instead
of the hidden zone being empty).

spacerCount now derives from the widest attached screen divided by
collapseUnit, rounded up. This reduces to the PR's own tested value in
its tested scenario (5800/836 -> 6 spacers) and gives 2 on a single
3840pt screen instead of 6 -- verified end-to-end on this machine:
clean collapse (empty hidden zone, pinned icons stay visible) and
expand (previously-hidden icon reappears), confirmed via direct
screenshots of the WindowServer Menubar window, not just Accessibility
state.

Also gitignore local build/dist artifacts and the App Store backup app
copy -- they were accidentally staged in a prior commit attempt and
don't belong in the repo (the backup in particular embeds Apple's own
signed binary and MAS receipt).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@PauloPintor

Copy link
Copy Markdown

Still doesn't work

@xvoland

xvoland commented Sep 15, 2026

Copy link
Copy Markdown

This fixes the problem for macOS 27 Golden Gate. I created a fork and tested it.
https://github.com/xvoland/hidden/releases

@rocky-zh

Copy link
Copy Markdown

This fixes the problem for macOS 27 Golden Gate. I created a fork and tested it. https://github.com/xvoland/hidden/releases
It's still not robust enough; the width calculation can still be incorrect.

@xvoland

xvoland commented Sep 15, 2026

Copy link
Copy Markdown

@rocky-zh Try it out in real-world conditions; this was also fixed here https://github.com/xvoland/hidden/releases

@ripley

ripley commented Sep 16, 2026

Copy link
Copy Markdown

@rocky-zh Try it out in real-world conditions; this was also fixed here https://github.com/xvoland/hidden/releases

It worked, but the behavior is a bit odd. When toggling the hidden status all hidden items fly out to the left of the status bar.

@rocky-zh

Copy link
Copy Markdown

@rocky-zh Try it out in real-world conditions; this was also fixed here https://github.com/xvoland/hidden/releases

It worked, but the behavior is a bit odd. When toggling the hidden status all hidden items fly out to the left of the status bar.

you can try fix it again

@rocky-zh

Copy link
Copy Markdown

it worked with 4k display.good job

@wowhooni

Copy link
Copy Markdown

Thanks for working on Golden Gate support!

I tested both v1.11.4-goldengate-test and v1.11.5-goldengate-test from xvoland’s fork, and the same issue occurs in both versions.

When I click the Hidden Bar toggle to hide the menu bar icons, they shift to the left but remain visible instead of disappearing.

error_5k

My setup:

  • macOS Golden Gate
  • External monitor: Dell U4025QW
  • Selected scaled resolution in macOS Display Settings: 3840 × 1620

I suspect this may be related to my display resolution or scaling, but I haven’t confirmed that. The wider-display fix in 1.11.5 doesn’t seem to resolve the issue on my setup.

I’ve attached screenshots showing the behavior and my display settings. Please let me know if any additional information would help diagnose this.

Thanks!

@rocky-zh

Copy link
Copy Markdown

Hidden-Bar-v1.11.1-macos can't work in 4k display monitor.
all icons is invisible and control panel has disappear, quit by activity monitor.
pls fixed it.

@tieubao

tieubao commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Heads-up: the hiding path this PR modifies was refactored and superseded by the native menu-bar engine that landed in #402/#403 and shipped in v1.11.1 (MenuBarEngine / NativeVisibilityEngine, direct build). The StatusBarController changes here conflict with that refactor and can't be merged as-is.

Recommend closing; remaining macOS 27 regressions are tracked in #409–#414 and belong in the new engine's code path, not the old length-based one.

@skuthus

skuthus commented Sep 19, 2026

Copy link
Copy Markdown
Author

Heads-up: the hiding path this PR modifies was refactored and superseded by the native menu-bar engine that landed in #402/#403 and shipped in v1.11.1 (MenuBarEngine / NativeVisibilityEngine, direct build). The StatusBarController changes here conflict with that refactor and can't be merged as-is.

Recommend closing; remaining macOS 27 regressions are tracked in #409–#414 and belong in the new engine's code path, not the old length-based one.

Thank you @tieubao !

@skuthus skuthus closed this Sep 19, 2026
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.

Osx 27 broken hidden bar

8 participants