Skip to content

fix(native): open Notification Center from the clock while a notification shows - #537

Merged
tieubao merged 1 commit into
developfrom
fix/notification-center
Nov 17, 2026
Merged

tieubao merged 1 commit into
developfrom
fix/notification-center

Conversation

@tieubao

@tieubao tieubao commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

What

On macOS 27 (direct build), clicking the clock while the bar is collapsed did nothing when a notification was still on screen. Report (email, Nov 5): "Hidden Bar prevents the macOS notification center from displaying when icons are hidden."

Cause

A notification that stays up across a collapse (reproduced with macOS's "App Background Activity" notification at login) keeps up the same Notification Center window the panel uses: same owner, layer 21, screen-tall bounds, same window number. SystemMenuBarClock decided "panel open" from the window list alone, so:

  1. the mouse-down check dropped the click (it guards against reopening a panel the click closes), and
  2. a replay would have reported .panelShown without pressing.

MenuBarAgent ignores the clock under the restriction (assessment mode), so nothing opened.

Fix

NotificationCenterPanel.isOpen keeps the window-list read and, only while a window is up, reads Notification Center's AXIdentifiers: the panel has widget-editor-button (Edit Widgets), a notification alone never does (trees measured on 27.0.1). If Accessibility cannot be read, the window alone decides, as before.

Evidence (hb-macos2701, macOS 27.0.1)

Before: 1.13.0, click on the clock, nothing opens After: this branch, same state, panel opens
before after

Closing the panel collapses the bar again: closed

Open and close were repeated twice on the fixed build; the AX tree showed the panel controls after each open and none after each close.

Tests

  • New NotificationCenterPanelTests (5 cases). Red before the fix: testANotificationOnScreenIsNotThePanel failed.
  • scripts/test.sh in the mac-ui VM: direct 693 passed, App Store 459 passed, 0 failed.
  • Negative control (negctl): fix reverted to the window-only answer, testANotificationOnScreenIsNotThePanel fails, restore green. Verdict: PASS.

Not covered

  • Banners that arrive while collapsed still do not show: assessment mode holds them, and they wait in Notification Center. That is macOS, not this change.
  • Not checked on 27.2+ or with a notification other than the login "App Background Activity" one.

…tion shows

On macOS 27 a notification left on screen across a collapse keeps up the
same Notification Center window the panel uses (same owner, layer and
screen-tall bounds). The window-list check took it for an open panel, so a
click on the clock was never replayed and the replay reported the panel
shown without pressing. Reproduced on 27.0.1 with 1.13.0 and the login
"App Background Activity" notification.

The panel check now also asks Accessibility for the panel's Edit Widgets
control (widget-editor-button) while a window is up, and falls back to the
window alone when Accessibility cannot be read.
@tieubao
tieubao force-pushed the fix/notification-center branch from ed7b22d to 2cfd2ea Compare November 17, 2026 14:30
@tieubao
tieubao marked this pull request as ready for review November 17, 2026 14:30
@tieubao
tieubao merged commit 1c85db2 into develop Nov 17, 2026
3 checks passed
@tieubao
tieubao deleted the fix/notification-center branch November 17, 2026 14:33
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.

1 participant