Skip to content

feat: Notch Overflow — access menu bar icons hidden behind the camera notch#350

Open
mehmetnadir wants to merge 1 commit intodwarvesf:developfrom
mehmetnadir:feature/notch-overflow
Open

feat: Notch Overflow — access menu bar icons hidden behind the camera notch#350
mehmetnadir wants to merge 1 commit intodwarvesf:developfrom
mehmetnadir:feature/notch-overflow

Conversation

@mehmetnadir
Copy link
Copy Markdown

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

  • Uses NSScreen.safeAreaInsets (macOS 12+) to detect if the Mac has a notch
  • Enumerates all menu bar extras from all running apps via the Accessibility API (AXUIElement)
  • Compares each item's screen position against the notch boundary to classify as hidden or visible
  • Presents a dropdown menu with all items — hidden ones highlighted in orange
  • Clicking an item triggers AXPress on the original menu bar extra

Access methods

Method Description
⌘⇧B Global hotkey — shows overflow menu at cursor (works anywhere)
Right-click ‹ Right-click the expand/collapse button → "Show Notch Items"
Right-click ǀ Right-click the separator → "Show Notch Items"

Screenshots

The overflow menu classifies items:

  • 🟠 Orange = hidden behind the notch
  • Normal = visible in the menu bar

Technical details

  • New file: hidden/Features/NotchOverflow/NotchOverflowController.swift
  • Uses HotKey framework (already a dependency) for the global shortcut
  • Zero impact on non-notch Macs (NotchOverflowController.hasNotch returns false)
  • Requires Accessibility permission (prompted on first use)
  • 429 lines added, 15 modified across 8 files

Test plan

  • Verify on a notch Mac: ⌘⇧B opens overflow menu at cursor
  • Verify hidden items shown in orange, visible in normal color
  • Verify clicking a menu item activates the original menu bar extra
  • Verify right-click on expand button shows "Show Notch Items"
  • Verify right-click on separator shows "Show Notch Items"
  • Verify on a non-notch Mac: no UI changes, no overhead
  • Verify Accessibility permission prompt appears on first use

🤖 Generated with Claude Code

…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>
Copy link
Copy Markdown

@laveez laveez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines +31 to +35
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
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread hidden/AppDelegate.swift

func setupNotchOverflowHotKey() {
guard NotchOverflowController.hasNotch else { return }
// Cmd+Shift+B (keyCode 11 = B)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +142 to +143
// Right-click or Opt+click: show context menu
self.showExpandButtonMenu()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines +272 to +276
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()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think lockFocus() / unlockFocus() has been deprecated since macOS 10.14.

img.unlockFocus()
return img
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All strings are hardcoded English (in this and other files). The project uses .localized extension, these strings should go through the same system, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants