Skip to content

Omnibar: add pressed state for the Help and Notifications buttons - #113305

Open
fushar wants to merge 1 commit into
trunkfrom
update/omnibar-pressed-state
Open

Omnibar: add pressed state for the Help and Notifications buttons#113305
fushar wants to merge 1 commit into
trunkfrom
update/omnibar-pressed-state

Conversation

@fushar

@fushar fushar commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

Support pressed state in omnibar menu, and then apply it to notification and help center nodes.

Why are these changes being made?

We want to match React omnibar with PHP admin bar behavior.

Testing Instructions

Test with dashboard/omnibar-radical flag turned on.

Click notification / help center; verify they are still in pressed state when the panels are still open.

image image

Introduce an `isActive` flag on `OmnibarNode` and render leaf nodes with
`is-active` plus `aria-pressed`, then wire the help center and
notifications plugins to it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@fushar fushar self-assigned this Aug 5, 2026
@fushar
fushar marked this pull request as ready for review August 5, 2026 12:47
@fushar
fushar requested a review from a team as a code owner August 5, 2026 12:47
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 5, 2026
@arthur791004

Copy link
Copy Markdown
Contributor

Do we need pressed state? I checked WP Admin, and it didn't have it 🤔

@fushar

fushar commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

I see it on wp-admin's notification. The button stays at pressed state if our mouse pointer is still inside notification panel:

image

We didn't have one for Help center, though 🤔 but maybe it will be useful later if we want to consolidate the panel design between notifications and help center.

@arthur791004

Copy link
Copy Markdown
Contributor

Yes, but I think it's the hover state rather than the pressed state, since it looks the same when you hover over it.

@fushar

fushar commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Interesting.... then how do you think we should move forward? I'm not sure if I can trigger hover state on the menu when we're inside the panel, without hacks 🥹

@arthur791004

Copy link
Copy Markdown
Contributor

Opened #113332. What do you think? There is an edge case where hovering over a dropdown at the top of the panel (e.g., the Notifications shortcut) does not work. But I guess it's acceptable.

@fushar

fushar commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Opened #113332. What do you think?

Thanks, I checked that. It seems it just makes thing more complicated 🤔 the logic already knows that the panel is open (via notificationsOpen event and isHelpCenterShown), exactly like in this PR, but that PR adds additional "is hovered" logic 🙈 I'm not sure why that's better?

@arthur791004

Copy link
Copy Markdown
Contributor

It's just aligned with the existing logic on wp-admin 😂

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

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants