Skip to content

fix: keep the bar above the menu bar strip when a full-screen window sits at the menu bar level - #730

Merged
Seb-GRAF merged 1 commit into
stablebox:mainfrom
alexandrebucci:fix/728-menu-bar-strip-full-screen-window
Nov 16, 2026
Merged

Seb-GRAF merged 1 commit into
stablebox:mainfrom
alexandrebucci:fix/728-menu-bar-strip-full-screen-window

Conversation

@alexandrebucci

Copy link
Copy Markdown
Contributor

Problem

On macOS 27 with a notched display and the menu bar hidden, a window that another app keeps at the main menu level over the whole display (here, one screencaptureui left behind) counted as a shown menu bar. The bar then stayed at .floating, below MenuBarAgent's reveal strip, so clicks on its top 33 pt showed the macOS menu bar instead of reaching widgets.

Fixes #728

Changes

MenuBarStripState counts a window at the main menu level as a shown menu bar only when it is menu-bar sized (less than a quarter of the display's height), the same limit the strip check already uses. The real menu bar, shown or sliding in, still counts, so a revealed menu bar still covers the bar.

Testing

  • Added menuBarStripRaisesTheBarAboveAFullScreenWindowAtTheMenuBarLevel: a full-screen screencaptureui window at layer 24 beside a hidden menu bar leaves the bar raised.
  • My local Xcode (26.1.1) can't build current main (unrelated type-check errors in FeltPen.swift and SetupTour.swift), so I couldn't run swift test. I compiled MenuBarStripState on its own with the new case and the existing shown, sliding and hidden cases: the new case failed before the change and all pass after it. CI runs the full suite.
  • On the affected Mac, removing the stray screencaptureui window made the running bar rise to layer 26 and take clicks again, which confirms the cause.
  • npx commitlint --from origin/main passes.

Merging

One commit; any merge method works.

Claude Opus 5.5 via Claude Code

…sits at the menu bar level

A window at the main menu level that covers the whole display, such as one screencaptureui
left behind, counted as a shown menu bar. The bar then stayed below MenuBarAgent's strip on a
notched display, and clicks on its top half showed the menu bar instead of reaching widgets.

Count only a window of the menu bar's size as a shown menu bar, as the strip check already does.

Fixes stablebox#728
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Menu bar detection now applies a display-height limit to windows considered visible menu bars. A test checks that a full-display Screenshot window does not prevent the bar from being raised when the menu bar is hidden.

Changes: Menu bar detection

Layer / File(s) Summary
Window detection threshold
Sources/StableBar/MenuBarStrip.swift, Tests/StableBarTests/MenuBarStripTests.swift
Menu bar and strip detection now require a window to be shorter than one quarter of the display height. A test verifies that a full-display screencaptureui window does not prevent the bar from being raised.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 3f069

This change stops a full-screen non-menu-bar window at the menu bar's level from being treated as a visible menu bar. That lets clicks reach the bar's widgets again when the menu bar is hidden. A real menu bar, including one sliding into view, is still detected. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 3

Check name Status Explanation
Description check Passed The description follows the repository template. It has Problem, Changes, Testing, and Merging sections, and it ends with the model and harness line. The Problem section states the bug and links Fixes…
Linked Issues check Passed Issue #728 requires that a full-screen non-menu-bar window at layer 24 not count as a shown menu bar, while a real visible menu bar still keeps the bar below it. At head, MenuBarStripState.init (Sou…
Out of Scope Changes check Passed The whole-PR diff (merge base 095b059 to head 3f069d5) changes only Sources/StableBar/MenuBarStrip.swift (+4/-2) and adds one test in Tests/StableBar/MenuBarStripTests.swift (+9). The source change ad…
Full details: Description check

Explanation

The description follows the repository template. It has Problem, Changes, Testing, and Merging sections, and it ends with the model and harness line. The Problem section states the bug and links Fixes #728. The Changes section explains the menu-bar-sized limit and why the real menu bar still counts. The Testing section names the new test, gives the reason swift test could not run, reports a manual check on the affected Mac, and reports commitlint. The Merging section says one commit and any merge method works. Minor gap: the Testing section does not include a screens bot image or scene update, and the template asks for one when a visible change exists. This change alters window detection logic, not visible UI, so the gap is not critical.

Full details: Linked Issues check

Explanation

Issue #728 requires that a full-screen non-menu-bar window at layer 24 not count as a shown menu bar, while a real visible menu bar still keeps the bar below it. At head, MenuBarStripState.init (Sources/StableBar/MenuBarStrip.swift) adds let barSized = bounds.height < display.height / 4 and requires barSized before inserting into shownMenuBars at menuBarLevel. The stray screencaptureui window spans the full display height (982 pt on a 982 pt display), so it fails barSized and no longer raises a shown menu bar. The real menu bar is about 33 to 40 pt high, which passes the check, so a visible or sliding-in menu bar still counts. The bar therefore gets .aboveMenuBarStrip when a MenuBarAgent strip exists and the menu bar is hidden, which is the expected behavior in the issue. The issue names a height limit as an acceptable approach. The PR adds test menuBarStripRaisesTheBarAboveAFullScreenWindowAtTheMenuBarLevel for this case. I read the test through the summary only, not the file. Residual risk: a small non-menu-bar window at layer 24 touching the top edge, under a quarter of display height, would still count. The issue does not require excluding that case. The MenuBarAgent strip check now uses the same barSized condition with the same threshold, so its behavior is unchanged.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff (merge base 095b059 to head 3f069d5) changes only Sources/StableBar/MenuBarStrip.swift (+4/-2) and adds one test in Tests/StableBar/MenuBarStripTests.swift (+9). The source change adds the barSized condition to the menu-bar detection and reuses it for the existing strip check, which is the change described in issue #728. The test covers the same scenario. No unrelated files or behavior changes appear in the summaries or in the source diff I read.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 10eb8dd and 3f069d5.

Files selected for processing: 2

  • Sources/StableBar/MenuBarStrip.swift
  • Tests/StableBarTests/MenuBarStripTests.swift

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

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Before and after

main at 10eb8dd → this pull request at 3f069d5 · 0 screens drawn in one CI job · 0 changed

Couldn't draw:

  • app: Build release ended with cancelled, so Draw screens didn't run.

Visual review: Drawing the screens failed, see above.

@Seb-GRAF
Seb-GRAF merged commit bc01211 into stablebox:main Nov 16, 2026
13 of 15 checks passed
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.17.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.

Clicks on the top of the bar show the menu bar when a full-screen Screenshot window sits at the menu bar level

2 participants