fix: recover the status item when the menu bar parks it under the notch#994
Draft
maxmilian wants to merge 1 commit into
Draft
fix: recover the status item when the menu bar parks it under the notch#994maxmilian wants to merge 1 commit into
maxmilian wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Thanks for the PR! OpenUsage reviews external PRs only when they implement an issue a maintainer has already approved with the approved label. Please open an issue, wait for approval, then reopen this (or open a focused PR) linking it with Fixes #<issue>. Happy to take a look once it's linked to an approved issue.
Powered by Cursor Automations
Sent by Cursor Automation: OpenUsage PR Gatekeeper
On a notched MacBook with a crowded menu bar, macOS pushes the leftmost third-party status item underneath the notch: the app logs "Status item ready" but nothing is visible or clickable anywhere. Detect that state (pure geometry over auxiliaryTop*Area, >=75% hidden) and recover in layers: rewrite the item's preferred position and bounce autosaveName so it re-lands right of the notch; if that doesn't stick, show a small surrogate button below the menu bar that opens the dashboard; and anchor the panel at the nearest visible notch edge whenever it opens while the item is hidden. Fixes robinebers#993 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019dpF8491eHK8reiuJ8vMxB
maxmilian
force-pushed
the
fix/notch-occlusion-fallback
branch
from
July 18, 2026 12:28
be33283 to
af2c476
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


TL;DR
When a crowded menu bar pushes the status item under the MacBook notch, OpenUsage becomes invisible and unclickable while its log reports "Status item ready". This PR detects that state and recovers: it moves the item back into the visible menu bar, falls back to a small surrogate button if the move doesn't stick, and anchors the panel beside the notch instead of under it.
Closes #993 (opened first per the issue-first flow; measurements and dead-end analysis live there).
What was happening
Status item ready (button: true, …), so to the user OpenUsage "never launched", and relaunching lands it in the same spot.NSStatusItem.What this changes
NotchGeometry(new, pure) — computes the notch rect fromauxiliaryTop*Area, how much of the button it hides (occluded at ≥75%), and the fallback panel anchor. Mirrors thePanelGeometrypattern; unit-tested with the real measured fixtures.StatusItemController.repositionStatusItemRightOfNotch()rewrites the item's remembered position (the sameNSStatusItem Preferred Positiondefault that ⌘-dragging maintains) and bouncesautosaveNameso AppKit re-reads it; the item re-lands just right of the notch. Verified live on macOS 26.5.2: a 99%-hidden item moved to the visible menu bar.StatusItemOcclusionMonitor(new) — checks after launch, on screen-parameter changes, and on a slow 30 s poll. One rescue per occlusion episode; it re-measures afterwards and only if the item is still hidden shows a surrogate button (borderless non-activating panel, icon-only) just below the menu bar at the nearest visible notch edge — click opens the dashboard, drag to move, right-click → Hide Until Relaunch. Hidden while the dashboard is open, and removed automatically the moment the real item is visible again.showPanel()anchors at the nearest visible notch edge whenever the button is effectively hidden, so the panel never opens centered under the notch.docs/menu-bar.mdgains a short "The notch" section.Heads-up
auxiliaryTop*Areaisnil, every new path is inert, zero behavior change.statusItem.autosaveNamedirectly writes a key literally named… Optional("Item-0")that AppKit never reads.Tests
NotchGeometryTests(8 cases) — fixtures are the real AX measurements from the reproducing machine (screen 1800×1169, notch 791–1012, item frames 767×170 / 902×36).maincheckout.anchoring the panel at x=1012in the log).Screenshots
Status item rescued back into the visible menu bar (Claude/Codex/Z.ai strip, right of the notch):
Surrogate button (fallback path) below the menu bar at the notch's right edge:
🤖 Generated with Claude Code
https://claude.ai/code/session_019dpF8491eHK8reiuJ8vMxB