Skip to content

Fix dashboard shortcut availability - #20413

Merged
David Pine (IEvangelist) merged 1 commit into
mainfrom
fix/dashboard-shortcut-availability
Sep 24, 2026
Merged

David Pine (IEvangelist) merged 1 commit into
mainfrom
fix/dashboard-shortcut-availability

Conversation

@JamesNK

@JamesNK James Newton-King (JamesNK) commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Description

In standalone dashboard configurations without the resource service, the help dialog advertised shortcuts to unavailable Resources and Console Logs pages, and those keys still attempted navigation. The help dialog now lists only available page and terminal shortcuts, and the layout ignores resource-page shortcuts when the resource service is disabled. Contextual panel shortcuts remain listed even when no panel is active.

Availability follows the registered dashboard shortcuts so the help dialog stays consistent with the running configuration. No new dependencies are required.

User-facing usage

Press ? to open dashboard help. Without a resource service, r (Resources) and c (Console Logs) are no longer listed or actionable. Panel controls (+, -, Shift+R, Shift+T, Shift+X) remain listed on every page. The terminal dock shortcut is listed only when the terminal dock is available.

Screenshots / Recordings

Both screenshots show the help dialog from this branch's local dashboard build. The right-hand dashboard was launched by a connected local AppHost.

Without resource service With resource service
Standalone help dialog shows panel shortcuts but not Resources, Console Logs, or terminal shortcuts Connected AppHost help dialog shows panel shortcuts and Resources, Console Logs, and terminal shortcuts

Validation: Focused dashboard component shortcut tests passed (5/5); git diff --check passed. Visually verified both help dialogs in the browser.

Fixes # (issue)

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

Hide unavailable page and terminal shortcuts from help, while keeping contextual panel shortcuts listed and blocking disabled resource navigation.

Co-authored-by: Copilot <[email protected]>
@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 -- 20413

Or

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

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.

Copilot review overview

🟢 Approval recommended

The implementation is consistent with registered shortcut behavior and includes focused regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Filters dashboard shortcuts by runtime availability and blocks resource navigation when the resource service is disabled.

Changes:

  • Adds shortcut availability querying and conditional resource subscriptions.
  • Filters help-dialog shortcuts while retaining contextual panel controls.
  • Adds focused component tests for disabled navigation and shortcut visibility.
File Description
src/​Aspire.Dashboard/​ShortcutManager.cs Reports registered shortcut availability.
src/​Aspire.Dashboard/​Components/​Layout/​MainLayout.razor.cs Disables resource shortcuts without the resource service.
src/​Aspire.Dashboard/​Components/​Dialogs/​KeyboardShortcut.cs Associates display entries with shortcut identifiers.
src/​Aspire.Dashboard/​Components/​Dialogs/​HelpDialog.razor.cs Filters unavailable shortcuts and empty categories.
tests/​Aspire.Dashboard.Components.Tests/​Shared/​TestGlobalKeydownListener.cs Adds a reusable shortcut-listener test fake.
tests/​Aspire.Dashboard.Components.Tests/​Layout/​MainLayoutTests.cs Tests disabled resource navigation.
tests/​Aspire.Dashboard.Components.Tests/​Dialogs/​HelpDialogTests.cs Tests shortcut visibility and panel controls.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

13 / 99 PR test projects · 2 PR jobs, from 7 changed files.

Selected PR test projects (13 / 99)

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

⚠️ 11 of the 13 selected test projects come from a single change — src/Aspire.Dashboard/Components/Dialogs/HelpDialog.razor.cs.

🔧 src/Aspire.Dashboard/Components/Dialogs/HelpDialog.razor.cs (changed source)
→ 11 via the project graph: 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

🧪 tests/Aspire.Dashboard.Components.Tests/Dialogs/HelpDialogTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Layout/MainLayoutTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Shared/TestGlobalKeydownListener.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/Components/Dialogs/HelpDialog.razor.cs, src/Aspire.Dashboard/Components/Dialogs/KeyboardShortcut.cs, src/Aspire.Dashboard/Components/Layout/MainLayout.razor.cs, src/Aspire.Dashboard/ShortcutManager.cs
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit 3ff64a2.

@IEvangelist
David Pine (IEvangelist) merged commit 76e76c5 into main Sep 24, 2026
158 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 14.0 milestone Sep 24, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1742

Generated by PR Documentation Check · copilot · auto · 46.3 AIC · ⌖ 13.3 AIC · ⊞ 18.7K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1742 targeting release/13.6.

Signals triggered (3)

  • new_public_type: KeyboardShortcut record gained an AspireKeyboardShortcut Shortcut field (src/Aspire.Dashboard/Components/Dialogs/KeyboardShortcut.cs).
  • pr_body_has_user_facing_section: PR body's "User-facing usage" section explains the new dialog behavior.
  • pr_body_has_cli_flag_mention: matched incidentally on prose ("git diff --check"); not an actual CLI flag change, but the accompanying pr_body_has_user_facing_section signal is genuinely user-facing.

Change summary

Fixes the dashboard Help dialog (? / Shift+?) so it only lists shortcuts for pages/features that are actually available. In a standalone dashboard without a connected resource service, r (Resources) and c (Console Logs) are no longer listed or actionable; panel shortcuts (+, -, Shift+R, Shift+T, Shift+X) remain listed on every page; the terminal dock shortcut only appears when the terminal dock is available. Availability is now driven by ShortcutManager.IsShortcutAvailable, checked against components' registered SubscribedShortcuts.

Docs change

Updated src/frontend/src/content/docs/dashboard/explore.mdx ("Dashboard shortcuts" section) with a note clarifying that navigation shortcuts (Resources, Console Logs, terminal dock) are conditionally listed based on availability, while Panel shortcuts always appear. No existing doc previously covered this nuance, so the docs_required recommendation applies fully (not the "already documented by name" exception).

Note

This draft PR needs human review before merging.

@JamesNK

Copy link
Copy Markdown
Member Author

/backport to release/13.6

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/13.6 (link to workflow run)

Jose Perez Rodriguez (joperezr) pushed a commit that referenced this pull request Sep 24, 2026
Backport of #20413 to release/13.6

/cc @JamesNK

## Customer Impact

Standalone dashboards without the resource service advertise and execute
shortcuts for unavailable Resources and Console Logs pages, while
shortcut help can disagree with the running configuration.

## Testing

Focused dashboard component shortcut tests passed (5/5); `git diff
--check` passed; both standalone and AppHost-connected help dialogs were
visually verified.

## Risk

Medium. The fix changes shared shortcut registration, help-dialog
filtering, and keyboard navigation behavior across standalone and
AppHost-connected dashboard configurations.

## Regression?

No

Co-authored-by: James Newton-King <[email protected]>
Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants