You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: keep the native menu bar hidden when opening Control Center - #622
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.
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.
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: 3
Check name
Status
Explanation
Description check
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
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
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
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.
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.
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
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
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 --quickpasses on current main plus this change.swift test --skip-build --filter 'menuBar|MenuBar|NativePresentationTests|ArchitectureRulesTests': 105 Swift Testing tests pass.git diff --checkand commitlint pass.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