Skip to content

fix: keep the native menu bar hidden when opening Control Center - #622

Merged
Seb-GRAF merged 1 commit into
mainfrom
fix/menu-bar-press-fade
Nov 13, 2026
Merged

Seb-GRAF merged 1 commit into
mainfrom
fix/menu-bar-press-fade

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Problem

Opening Control Center from StableBar on macOS 27 can reveal the native menu bar behind the bar. The item's Accessibility frame can stay on-screen while the native menu bar is hidden, so the press path skips its temporary fade.

Fixes #620.

Changes

Use the existing window-list menu-bar detection before pressing an item and while waiting for it to hide. Require two consecutive hidden observations before restoring opacity so the brief reveal-to-panel handoff does not show the native bar.

This changes no configuration, system preference, permission, or private API.

Testing

  • scripts/check.sh --quick passes on current main plus this change.
  • swift test --skip-build --filter 'menuBar|MenuBar|NativePresentationTests|ArchitectureRulesTests': 105 Swift Testing tests pass.
  • git diff --check and commitlint pass.
  • A signed combined trial with this fix and the separate window-clearance fix is running locally and responds to its query without errors.
  • Not verified: a fresh before/after Control Center recording, multiple displays, or older macOS versions. Screenshots and recordings were explicitly waived by the maintainer for this PR. Offscreen scenes do not exercise macOS's native menu-bar visibility or Accessibility press timing.

Merging

One commit; use the repository's default merge commit. Independent of the window-clearance PR. This does not include the discarded reserved-space experiment or the unfinished window-manager gap warning.

gpt-6-astra via Codex in T3 Code

@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The menu bar press flow now checks visibility on the target display. It uses that check when deciding whether to press directly, when waiting for the revealed menu bar, and when confirming that the menu bar has hidden.

Changes: Menu bar press visibility

Layer / File(s) Summary
Visibility-aware menu bar press
Sources/StableBar/MenuBarDelay.swift, Sources/StableBar/AppMenu.swift
menuBarShows(on:) evaluates menu bar visibility for a display. pressInMenuBar uses the result for its direct-press branch, reveal polling, and post-hide polling. The reveal flow also checks the item-frame threshold, and the hide flow waits for two consecutive hidden checks.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to c73e9

The change makes the menu bar press flow use window-list visibility so Control Center opens without flashing the native menu bar. No concrete merge-blocking risk was found. Native recording and multi-display validation remain pending, as the author states.

Security architecture risk: Low · up to c73e9

No expanded permissions or new externally reachable action were identified. The remaining risk is recovery: restoring menu-bar opacity now depends on a visibility signal whose behavior during real transitions has not been verified.

Retained concerns

  • Low · reliability · inferred: Restoration now depends exclusively on two hidden window-list observations. If that detector continues reporting a shown bar after the target item disappears, the former item-geometry condition could complete while the new condition cannot: opacity remains suppressed and revealedPresses continues preventing item refresh. The unbounded wait predates this PR; the newly introduced concern is its replacement completion dependency, not a demonstrated native failure.
Security review details

Security Blast Radius

  • inferred — The identified failure-containment scope is the current graphical session's menu-bar presentation and StableBar's item refresh. Visibility overrides target one display, but the opacity helper has no display argument, so restoration consequences are not necessarily confined to the initiating display.

Trust Boundaries and Controls

  • observed — Window metadata now influences branch selection and completion timing, but does not supply a new action target or grant Accessibility authority. Existing private-API capability and connection guards remain in the opacity and visibility helpers.

Resilience and Maintainability Implications

  • observed — Existing fixtures demonstrate that modeled shown, sliding, and hidden menu-bar windows produce the expected parser states. They provide counterevidence to an inherently nonterminating predicate, but do not demonstrate cleanup during real AX and window-server transitions.
Pre-merge checks: Passed 3

Check name Status Explanation
Description check Passed The description follows the template's Problem, Changes, Testing, and Merging sections and ends with a model/harness attribution line. Problem states the issue (macOS 27 Control Center reveals the nat…
Linked Issues check Passed Directly linked issue #620 requires that Control Center opening from StableBar keep the native menu bar hidden when auto-hide is on and the Always hide option is off. The reviewed head (c73e928) chang…
Out of Scope Changes check Passed The changes stay in the menu-bar press path. They touch pressInMenuBar in Sources/StableBar/AppMenu.swift and add a small visibility helper menuBarShows(on:) in Sources/StableBar/MenuBarDelay.swift, w…
Full details: Description check

Explanation

The description follows the template's Problem, Changes, Testing, and Merging sections and ends with a model/harness attribution line. Problem states the issue (macOS 27 Control Center reveals the native menu bar) and links Fixes #620. Changes explains the use of the window-list menu-bar check and the two-observation requirement. Testing lists the commands run, their results, and what was not verified (multi-display, older macOS, fresh recording). Merging states one commit, a default merge commit, and independence from the window-clearance PR. The last line names the model and harness (gpt-6-astra via Codex in T3 Code). The template's HTML comments are not an issue. The Testing section says the maintainer waived screenshots and recordings, which is acceptable. Minor gap: the Changes section does not explain why the Accessibility frame check was replaced, beyond the Problem section. Overall the description is mostly complete.

Full details: Linked Issues check

Explanation

Directly linked issue #620 requires that Control Center opening from StableBar keep the native menu bar hidden when auto-hide is on and the Always hide option is off. The reviewed head (c73e928) changes AppMenu.pressInMenuBar in Sources/StableBar/AppMenu.swift. The fast path now calls menuBarShows(on: display), a window-list check, before pressing directly. When the menu bar is hidden, the reveal-and-press flow waits for both menuBarShows(on:) and the item frame minY threshold before pressing. After the press, it requires two consecutive hidden observations before restoring opacity. This addresses the issue's diagnosis that the Accessibility frame does not reliably track menu-bar visibility. The restore path still honors hidesMenuBar, so the Always hide setting is preserved. The helper menuBarShows(on:) in Sources/StableBar/MenuBarDelay.swift was read only from the AI-generated summary, because its diff blob was unavailable. The PR adds no automated test for this path. The issue does not require one. Runtime behavior on macOS 27 is not verified by the PR, and the issue lists a before/after recording and multi-display check as pending. Those are non-coding or runtime checks outside this code assessment.

Full details: Out of Scope Changes check

Explanation

The changes stay in the menu-bar press path. They touch pressInMenuBar in Sources/StableBar/AppMenu.swift and add a small visibility helper menuBarShows(on:) in Sources/StableBar/MenuBarDelay.swift, which reuses the existing MenuBarStripState window-list check. The PR states that it changes no configuration, system preference, permission, or private API, and the reviewed AppMenu.swift content shows no such changes. The PR description says the discarded reserved-space experiment and the window-manager gap warning are excluded. No unrelated change was found in the inspected content. Limit: the MenuBarDelay.swift diff could not be read directly, so its content rests on the summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9d60793 and c73e928.

Files selected for processing: 2

  • Sources/StableBar/AppMenu.swift
  • Sources/StableBar/MenuBarDelay.swift

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@Seb-GRAF

Copy link
Copy Markdown
Collaborator Author

I checked the retained cleanup concern in the review summary. The unbounded wait already existed; this change replaces the completion signal because macOS 27 can keep the item's Accessibility frame on-screen after the menu bar hides. Reintroducing that frame as the primary completion condition would preserve the reported failure.

There is no demonstrated case here where the menu-bar window remains reported as shown after it actually hides. I am keeping the change scoped rather than adding an arbitrary timeout that could restore opacity while a long-lived panel is still open. The PR already records the missing live-transition and multi-display validation. No configuration or private API changes are involved.

@Seb-GRAF
Seb-GRAF merged commit 846f353 into main Nov 13, 2026
14 checks passed
@Seb-GRAF
Seb-GRAF deleted the fix/menu-bar-press-fade branch November 13, 2026 13:11
stablebar-releases Bot pushed a commit that referenced this pull request Nov 14, 2026
## [0.15.0](v0.14.0...v0.15.0) (2026-11-14)

### Features

* keep widgets in place while editing the bar and scroll a crowded side by @Seb-GRAF ([b78a1a0](b78a1a0))
* let themes set how far the focused window's box reaches past the icon by @M4n0x ([5d7985a](5d7985a)), closes [#627](#627)
* retire the bar's per-display scale and keep files that set it by @Seb-GRAF ([fa80a7c](fa80a7c))
* show each app's Dock badge on its workspace icon ([#607](#607)) by @Jonathanm10 ([8bb0a8f](8bb0a8f))
* show the icons macOS 27 shows beside app menu items by @Seb-GRAF ([947ebd2](947ebd2))
* show which window has focus in workspace widgets ([#611](#611)) by @Jonathanm10 ([ba83a11](ba83a11)), closes [#610](#610)
* show who made each change in the update popup and release notes ([#614](#614)) by @Seb-GRAF ([8c5c56e](8c5c56e))

### Bug Fixes

* don't crash when macOS lists the same app twice ([#617](#617)) by @Jonathanm10 ([2789ecd](2789ecd))
* draw a crowded edit bar without a notch from its left edge by @Seb-GRAF ([137014f](137014f))
* keep blocking work off Swift's shared thread pool by @M4n0x ([6bd7a6b](6bd7a6b)), closes [#618](#618)
* keep the edit bar's drop targets, scrolling and notch edges within each side by @Seb-GRAF ([38bd53d](38bd53d))
* keep the focused window's box steady on hover without magnification by @M4n0x ([944eacd](944eacd)), closes [#626](#626)
* keep the native menu bar hidden when opening Control Center ([#622](#622)) by @Seb-GRAF ([846f353](846f353))
* keep the Settings search field clear of the tabs ([#609](#609)) by @Jonathanm10 ([25ebac4](25ebac4))
* keep windows clear after repeated moves to the same position ([#623](#623)) by @Seb-GRAF ([9f5c967](9f5c967))
* name Time Machine and show its symbol in the Menu bar items row ([#615](#615)) by @Seb-GRAF ([9d60793](9d60793))
* stop the edit bar crashing when a widget comes back on another display by @M4n0x ([78b073d](78b073d)), closes [#636](#636)
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.15.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opening Control Center reveals the native menu bar on macOS 27

1 participant