feat: Notch Overflow — access menu bar icons hidden behind the camera notch#350
feat: Notch Overflow — access menu bar icons hidden behind the camera notch#350mehmetnadir wants to merge 1 commit intodwarvesf:developfrom
Conversation
…otch On Macs with a camera notch, menu bar icons that overflow past the notch become inaccessible. This feature uses the Accessibility API to enumerate all menu bar extras and their positions, then presents hidden items in a dropdown menu. Access methods: - Global hotkey: Cmd+Shift+B (shows menu at cursor position) - Right-click the expand/collapse button → "Show Notch Items" - Right-click the separator → "Show Notch Items" Features: - Detects notch presence via NSScreen.safeAreaInsets (macOS 12+) - Enumerates all menu bar extras via AXUIElement API - Classifies items as hidden (behind notch) or visible by position - Hidden items displayed in orange for visual distinction - Clicking an item triggers AXPress on the original menu extra - Info label in Preferences window explains available shortcuts - Only activates on Macs with a notch; no-op on other models New files: - hidden/Features/NotchOverflow/NotchOverflowController.swift Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
laveez
left a comment
There was a problem hiding this comment.
Few comments.
Also: the approach on this PR also triggers an Accessibility permission prompt on first use: should we have a way to enable/disable this feature manually?
| private var notchRightEdge: CGFloat { | ||
| guard let screen = NSScreen.main else { return 972 } | ||
| let notchWidth = screen.frame.width / 8 | ||
| return screen.frame.width / 2 + notchWidth / 2 | ||
| } |
There was a problem hiding this comment.
The notch width is estimated as screen.frame.width / 8, but it might vary by model?
safeAreaInsets is already used for hasNotch a few lines below, maybe use it here too for the actual notch boundary
|
|
||
| func setupNotchOverflowHotKey() { | ||
| guard NotchOverflowController.hasNotch else { return } | ||
| // Cmd+Shift+B (keyCode 11 = B) |
There was a problem hiding this comment.
Cmd+Shift+B conflicts with common shortcuts (e.g. Chrome's bookmarks bar). We already have an user-configurable hotkey system (Preferences.globalKey / GlobalKeybindPreferences), this should go through the same system
| // Right-click or Opt+click: show context menu | ||
| self.showExpandButtonMenu() |
There was a problem hiding this comment.
Right-click / option-click on the expand button used to toggle separators directly, now it shows a menu. This changes behavior for all users, not just those with a notch. Could the notch item be added to the existing separator context menu instead or something else?
| img.lockFocus() | ||
| self.draw(in: NSRect(origin: .zero, size: target), | ||
| from: NSRect(origin: .zero, size: self.size), | ||
| operation: .sourceOver, fraction: tinted ? 0.5 : 1.0) | ||
| img.unlockFocus() |
There was a problem hiding this comment.
I think lockFocus() / unlockFocus() has been deprecated since macOS 10.14.
| img.unlockFocus() | ||
| return img | ||
| } | ||
| } |
There was a problem hiding this comment.
All strings are hardcoded English (in this and other files). The project uses .localized extension, these strings should go through the same system, no?
Summary
On Macs with a camera notch (MacBook Pro 14"/16", MacBook Air M2+), when there are many menu bar icons, some get pushed behind the notch and become completely inaccessible. This PR adds a Notch Overflow feature that lets users access those hidden icons.
How it works
NSScreen.safeAreaInsets(macOS 12+) to detect if the Mac has a notchAXUIElement)AXPresson the original menu bar extraAccess methods
Screenshots
The overflow menu classifies items:
Technical details
hidden/Features/NotchOverflow/NotchOverflowController.swiftNotchOverflowController.hasNotchreturns false)Test plan
🤖 Generated with Claude Code