Skip to content

[release/17.0] Avoid highlighting dashboard menu items on pointer open - #22388

Merged
Jose Perez Rodriguez (joperezr) merged 1 commit into
release/17.0from
jamesnk/dashboard-menu-pointer-focus
Nov 20, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 1 commit into
release/17.0from
jamesnk/dashboard-menu-pointer-focus

Conversation

@JamesNK

Copy link
Copy Markdown
Member

Description

The first item in a dashboard context menu looked hovered as soon as the menu opened, even when the pointer was elsewhere. The dashboard now leaves that item unhighlighted on pointer open. The menu still moves focus to the first enabled item, so keyboard navigation works as before.

The hover-color rule keeps :hover, :state(active), and :focus-visible. Removing plain :focus from the rule added in #21943 prevents programmatic focus alone from applying the hover color.

Fixes # (issue)

User-facing usage

Right-click a resource row in the dashboard. With the pointer outside the menu items, View JSON should have the same background as the other items. Hover an item or press an arrow key to see the highlight. Opening the context menu with Shift+F10 still makes the first item's keyboard focus visible.

Screenshots / Recordings

Both screenshots in each row show the TestShop frontend context menu opened by right-click, with the pointer outside the items. The before screenshots restore only the original :focus selector in the browser.

Theme Before After
Light Light theme before: View JSON is highlighted Light theme after: no item is highlighted
Dark Dark theme before: View JSON is highlighted Dark theme after: no item is highlighted

Validation

  • Rebuilt the dashboard resource in the running TestShop AppHost; the build completed with no warnings or errors.
  • Verified in Playwright in both themes that right-clicking leaves the first item focused without highlighting it, while hover and Arrow Down still highlight items. Also verified that opening with Shift+F10 shows visible keyboard focus.
  • git diff --cached --check passed before committing. No unit tests were added for this CSS-only change.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22388

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22388"

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 18, 2026 15:18
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the menu-item focus styling change.

No open issues 🎉

What changed in this PR

This PR adjusts dashboard menu styling so programmatic focus no longer highlights the first item when a menu opens by pointer, while preserving keyboard-focus highlighting.

Changes:

  • Removes plain :focus from the menu-item highlight rule, retaining :hover, :state(active), and :focus-visible.
  • Updates the CSS comment to explain the intended pointer-open behavior.
File Description
src/​Aspire.Dashboard/​wwwroot/​css/​controls.css Refines menu-item highlight selectors and documents pointer-open behavior.

Review effort: Balanced

@JamesNK James Newton-King (JamesNK) changed the title Avoid highlighting dashboard menu items on pointer open [release/17.0] Avoid highlighting dashboard menu items on pointer open Nov 18, 2026
@sebastienros

Copy link
Copy Markdown
Contributor

Before approving (change is good) don't you want to target main, and then we cherry pick the PRs we want to backport (maybe in blocks), there are other changes we'll apply. Otherwise you'll depend on the reverse merge which might take longer or be blocked, and if the answer to that is to create another PR then it would be the same as starting with main anyway.

@JamesNK

Copy link
Copy Markdown
Member Author

Before approving (change is good) don't you want to target main, and then we cherry pick the PRs we want to backport (maybe in blocks), there are other changes we'll apply. Otherwise you'll depend on the reverse merge which might take longer or be blocked, and if the answer to that is to create another PR then it would be the same as starting with main anyway.

main is way behind release on dashboard at the moment. I'll ensure it gets to both.

Once main has caught up then will go back to normal backport pattern.

@joperezr

Copy link
Copy Markdown
Member

closing and reopening as this as CI didn't run

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

13 / 101 PR test projects · 2 PR jobs, from 1 changed file.

Selected PR test projects (13 / 101)

Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (2)

extension-e2e, native-dashboard-validation


How these were chosen — grouped by what changed

⚠️ 12 of the 13 selected test projects come from a single change — src/Aspire.Dashboard/wwwroot/css/controls.css.

🔧 src/Aspire.Dashboard/wwwroot/css/controls.css (changed source)
→ 12 via the project graph: Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/wwwroot/css/controls.css
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit b9feb5e.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@joperezr
Jose Perez Rodriguez (joperezr) merged commit bc48a93 into release/17.0 Nov 20, 2026
622 of 634 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 20, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

excluded → base_branch_is_release, title_release_prefix. This is a backport ([release/17.0] title, release base); docs belong with the forward PR. Triggered signals (pr_body_has_cli_flag_mention, pr_body_has_user_facing_section) are weak body-text matches; the change is a dashboard CSS hover-style fix with no docs impact.

@JamesNK

Copy link
Copy Markdown
Member Author

/backport to main

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to main (link to workflow run)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants