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 bar above the black band on full-screen Spaces with a notch - #966
With bar.showOnFullScreen on, a full-screen app on a display with a notch shows a black band across the top, and the bar sits under it: only its bottom edge shows. macOS keeps the hidden menu bar's window at the top of a full-screen Space as that band, and the bar took it for a shown menu bar.
Window level:MenuBarStrip raised the bar above MenuBarAgent's strip (level 26) only while no menu-bar window reached below the display's top. On a full-screen Space the band is such a window, so the bar went down to .floating (3), under it. MenuBarAgent takes its strip away whenever the menu bar shows, on the desktop and on a full-screen Space. So a strip under a menu bar window resting at the top now means hidden, and the bar goes back above it.
Only once it lasts: on the desktop, the strip comes back about 7 ms before the hiding menu bar starts sliding up (measured every 5 ms on macOS 27.2). One reading can't tell that moment from the band, so the bar rises only after the reading has lasted 0.1 s, and stays under a menu bar that's sliding.
The full-screen menu bar: MenuBarAgent shows a full-screen Space's menu bar once the pointer rests about 0.1 s anywhere on the band (its log gives the whole 39 pt band, against the top 4 pt on the desktop), so also on the bar. The bar now stays above a menu bar shown that way, and steps aside once the pointer reaches the top edge, as on the desktop, until the menu bar hides. A menu bar the bar finds showing with the pointer off the band comes over it. With a reveal delay, the bar steps aside after the delay, which holds the pointer 6 pt below the edge.
After a Space slides in: for about 0.6 s no window spans the display's top. A check then lowered the bar, which stayed under the band until the next check, up to 2 s later. After the strip goes while the menu bar hides, the bar now reads the window list closely for 1 s.
State machine: these decisions remember earlier readings, so per AGENTS.md they move into MenuBarStripLevels, a StateMachine, with the sets of displays with a strip and with a shown menu bar. MenuBarStripState gains slidingMenuBars and where the pointer is, and loses raisesBar(on:).
Polling: a menu bar shown over a strip kept the window-list check at 30 per second, so a full-screen Space kept it for as long as it was in front; now it's every 2 s, as on the desktop. Two cases already on main are fixed too: a pointer resting on the bar stopped the 2 s check altogether, and a menu bar that stays shown, as once automatic hiding is off, kept the 30 per second reads for as long as it showed. Now the check runs at least every 2 s, close reads of a shown menu bar stop after 10 s, and the pointer at the top edge makes the bar read the window list only while the bar sits above the strip.
Stacked displays: a pointer on a display above the laptop counted as at the laptop's top edge.
MenuBarStripTests replays readings recorded on a MacBook (macOS 27.2): the desktop reveal and hide, the full-screen band, revealing from the band and from the top edge, a reveal while the band settles, a reveal with the pointer off the band, a Space sliding in, a strip that stays away, a menu bar that stays shown, stacked displays, when a check reads the window list, and the earlier screencaptureui case.
swift test --filter for the strip, menu bar, app menu, full-screen and architecture tests: 164 pass. scripts/check.sh --quick passes. 5 BarContextMenuTests fail on this Mac on unchanged main too (feat: keep the bar on full-screen Spaces with bar.showOnFullScreen #964); CI runs the whole suite.
Live on the MacBook's built-in display (1800×1169, 38 pt band) with a 32 pt scratch bar from this branch, in a blank app in native full screen, with the window list sampled every 10 ms:
The bar stays above the band. When a check caught the Space sliding in, it went back above 0.17 s after the strip returned (1.7 s before).
Pointer resting on the bar: the menu bar shows under it and the bar stays on top.
Pointer at the top edge: the bar steps aside 0.58 s later, after the 0.5 s reveal delay set on the bar that was running beside it. Moving down into the menu bar keeps it aside.
Pointer away: the bar is back above 0.16 s after the menu bar hides.
GPT-6.2 Astra (high) reviewed the change twice. Its findings are fixed in the second and third commits, except two it accepted leaving: a desktop reading in the 7 ms before the slide, taken for a band, keeps the bar above a menu bar that is already sliding away (avoiding that would flash the band for 0.1 s on entering full screen), and the Menu bar items widget below.
Before, the top 70 pt, bar 52 pt tall:
After, the top 55 pt:
The left half, with the pointer resting on the bar, at the top edge, and away again:
Not checked:
macOS 26 and earlier. They have no strip, so the bar most likely stays at .floating, under the band.
A menu bar shown from the keyboard on a full-screen Space: ⌃F2 didn't show it in the live test, so only the tests cover it.
Mission Control and other displays with a notch.
menuBarShows(on:), which the Menu bar items widget uses before clicking an item, still reads the band as a shown menu bar. That's unchanged here.
…otch
On a full-screen Space of a display with a notch, macOS keeps the hidden menu bar's window at the
top as a black band. The bar took it for a shown menu bar and went down to the floating level,
under the band, and the window list was read 30 times a second while that Space was in front.
MenuBarAgent takes its strip away whenever the menu bar shows. A strip under a menu bar resting at
the top now means hidden once it lasts 0.1 s; on the desktop it lasts about 7 ms, then the menu
bar slides away. The decision moves into a state machine, MenuBarStripLevels.
Closes#965
…aches the top
On a full-screen Space, macOS shows the menu bar while the pointer rests anywhere on the band, so
also on the bar, and the bar stepped aside under it up to 2 s later. The bar now stays above a
menu bar shown with the pointer on the band, and steps aside once the pointer reaches the top
edge, as on the desktop. A menu bar shown with the pointer elsewhere comes over the bar at once.
After the strip goes while the menu bar hides, as while a Space slides in, the bar reads the
window list closely for a second, so it goes back above the band without waiting up to 2 s.
Also:
- A pointer on a display above the laptop no longer counts as at the laptop's top edge.
- A pointer resting on the bar no longer stops the two-second check.
- A menu bar that stays shown, as once automatic hiding is off, is read closely for 10 s rather
than for as long as it shows.
Refs #965
… the strip
With automatic hiding turned off, a pointer parked at the top edge of a bar under the menu bar
kept the window list read 30 times a second. Reading there matters only while the bar sits above
the strip, where it then steps aside for the menu bar.
The guide no longer says the bar steps aside at once for a full-screen menu bar shown with the
pointer off the band: the bar finds it at its next check.
Refs #965
No actionable comments were generated in the recent review.
Walkthrough
MenuBarStrip now uses pointer-aware state and timed placement transitions to position the bar around menu bars and full-screen bands. It adjusts window-list polling based on strip and menu bar state. Tests cover placement and polling transitions, and the guide describes full-screen behavior.
Changes: Menu bar placement and polling
Layer / File(s)
Summary
Pointer-aware bar placement Sources/StableBar/MenuBar/MenuBarStrip.swift, Sources/StableBar/MenuBar/MenuBarStripLevels.swift, Tests/StableBarTests/MenuBarStripTests.swift, docs/getting-started.md
MenuBarStripState detects pointer positions relative to display edges and menu bars. MenuBarStripLevels defines timed placement transitions. Tests cover placement as menu bars appear, slide, and hide. The guide describes full-screen behavior.
Timed reads and controller integration Sources/StableBar/MenuBar/MenuBarStrip.swift, Sources/StableBar/MenuBar/MenuBarStripLevels.swift, Tests/StableBarTests/MenuBarStripTests.swift
MenuBarStripLevels tracks missing strips and shown menu bars over time and returns placement effects. MenuBarStrip applies those effects and schedules reads based on level state. Tests cover read intervals and strip and menu bar timing.
Severity of issue fixed: Medium
Merge Risk: Minimal · up to 752fe
The change adjusts where the bar sits in full-screen Spaces on notched displays and how often it checks the window list. No concrete merge-blocking risk was identified; the author lists untested macOS versions and configurations.
Architecture risk: Low · up to 752fe
The change affects 3 source areas.
Changed areas:Sources, docs, Tests
Review details
Systems and components
observed — 2 changed files mapped to Sources.
observed — 1 changed file mapped to docs.
observed — 1 changed file mapped to Tests.
Pre-merge checks: 3
Check name
Status
Explanation
Description check
The description follows the template's Problem, Changes, Testing, and Merging sections, and it names the issue (Fixes #965). It explains the root cause, the window-level and polling changes, the state…
Linked Issues check
[#965] Requirement: with bar.showOnFullScreen on, the bar draws over the black band on a notched display in a full-screen Space, and goes under the menu bar while macOS shows it.
Implementation at th…
Out of Scope Changes check
The changes stay within #965 and its listed background. The MenuBarStrip.swift changes replace raisesBar(on:) with the MenuBarStripLevels state machine. This is the mechanism that fixes the band diagn…
Full details: Description check
Explanation
The description follows the template's Problem, Changes, Testing, and Merging sections, and it names the issue (Fixes #965). It explains the root cause, the window-level and polling changes, the state machine move, and the stacked-display fix. It gives concrete test evidence: the replay tests, the 164 passing filtered tests, the check script result, and the live MacBook run with timings and screenshots. It lists untested areas (macOS 26 and earlier, keyboard-revealed menu bars, Mission Control, other notched displays, and menuBarShows(on:)). The Merging section states that three commits can be squashed or merged. The last line names the model and harness, as the template requires. The template's Merging guidance asks the author to say which merge method is needed. The author says 'squash or merge', which leaves the choice open rather than naming one. This is a minor gap and does not make the description incomplete.
Full details: Linked Issues check
Explanation
[#965] Requirement: with bar.showOnFullScreen on, the bar draws over the black band on a notched display in a full-screen Space, and goes under the menu bar while macOS shows it.
Implementation at the reviewed head: MenuBarStripLevels.swift (new) defines the placement rules. A strip under a menu bar window that rests at the top is treated as hidden only after settleTime (0.1 s). This separates the lasting full-screen band from the 7 ms desktop reading. The state .aboveBand places the bar above the band. The state .aboveShownMenuBar keeps the bar above a menu bar that macOS shows over the band, and .underMenuBar applies when the menu bar shows at the top edge. The polling logic (reads(withPointerAtTopOf:), readsClosely, returnTime, shownTime) limits the 30 Hz reads that #965 reports.
The PR description reports replayed recorded readings in MenuBarStripTests and a live test on the built-in display. I confirmed the state machine code. I did not run the tests, so the test results rest on the author's report.
No unmet coding requirement appears in the reviewed code. Remaining gaps are stated in the PR: macOS 26 and earlier, keyboard-revealed menu bars, Mission Control, and the menuBarShows(on:) read used by the Menu bar items widget. #965 does not require these.
Full details: Out of Scope Changes check
Explanation
The changes stay within #965 and its listed background. The MenuBarStrip.swift changes replace raisesBar(on:) with the MenuBarStripLevels state machine. This is the mechanism that fixes the band diagnosis, so the change is in scope. The polling changes (2 s minimum interval, 10 s limit for close reads of a shown menu bar, top-edge reads only while the bar is raised) address the 30 Hz window-list reads that #965 identifies. The pointer-position change for stacked displays is needed by the new pointer-at-top logic. The tests in MenuBarStripTests.swift exercise these same paths. The docs/getting-started.md edit describes the new full-screen menu-bar behavior, which supports the change. No change at the reviewed head was found to be unrelated to the linked issue.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
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 666866d and 752fe85.
Files selected for processing: 1
docs/getting-started.md
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Architecture findings (1)
Advisory architecture findings (1)
Trivial — Once close polling expires, the new raised-over-menu state can miss a brief top-edge visit and keep the interactive StableBar panel above the native menu bar. A later read does not restore access while the native menu still appears to be resting and the pointer is no longer at the edge. The base did not require a pointer sample to yield after detecting a shown menu bar.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Additional comments: 1
docs/getting-started.md-85-85: 1
85-85: Minor · Functional Correctness · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Qualify the menu-bar reveal for a configured delay.
With a nonzero reveal delay, StableBar holds the pointer six points below the top edge until the delay expires. The pointer can therefore rest in the notch band without macOS showing the menu bar immediately. Note the delay exception here, consistent with the description on Line 135.
As per path instructions, “Point out instructions that this pull request's code contradicts.”
Reviewing files that changed from the base of the PR and between 666866d and a871735.
Files selected for processing: 1
docs/getting-started.md
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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
deep-reviewCodeRabbit reviews this pull request: big or risky changes
1 participant
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
With
bar.showOnFullScreenon, a full-screen app on a display with a notch shows a black band across the top, and the bar sits under it: only its bottom edge shows. macOS keeps the hidden menu bar's window at the top of a full-screen Space as that band, and the bar took it for a shown menu bar.Fixes #965
Changes
MenuBarStripraised the bar above MenuBarAgent's strip (level 26) only while no menu-bar window reached below the display's top. On a full-screen Space the band is such a window, so the bar went down to.floating(3), under it. MenuBarAgent takes its strip away whenever the menu bar shows, on the desktop and on a full-screen Space. So a strip under a menu bar window resting at the top now means hidden, and the bar goes back above it.MenuBarStripLevels, aStateMachine, with the sets of displays with a strip and with a shown menu bar.MenuBarStripStategainsslidingMenuBarsand where the pointer is, and losesraisesBar(on:).mainare fixed too: a pointer resting on the bar stopped the 2 s check altogether, and a menu bar that stays shown, as once automatic hiding is off, kept the 30 per second reads for as long as it showed. Now the check runs at least every 2 s, close reads of a shown menu bar stop after 10 s, and the pointer at the top edge makes the bar read the window list only while the bar sits above the strip.Testing
MenuBarStripTestsreplays readings recorded on a MacBook (macOS 27.2): the desktop reveal and hide, the full-screen band, revealing from the band and from the top edge, a reveal while the band settles, a reveal with the pointer off the band, a Space sliding in, a strip that stays away, a menu bar that stays shown, stacked displays, when a check reads the window list, and the earlier screencaptureui case.swift test --filterfor the strip, menu bar, app menu, full-screen and architecture tests: 164 pass.scripts/check.sh --quickpasses. 5BarContextMenuTestsfail on this Mac on unchangedmaintoo (feat: keep the bar on full-screen Spaces with bar.showOnFullScreen #964); CI runs the whole suite.Before, the top 70 pt, bar 52 pt tall:
After, the top 55 pt:
The left half, with the pointer resting on the bar, at the top edge, and away again:
Not checked:
.floating, under the band.menuBarShows(on:), which the Menu bar items widget uses before clicking an item, still reads the band as a shown menu bar. That's unchanged here.Merging
Three commits; squash or merge.
Claude Opus 5.5 via Claude Code