Repository navigation
Fix dashboard shortcut availability - #20413
Conversation
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]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20413Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20413" |
There was a problem hiding this comment.
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.
Tests selector13 / 99 PR test projects · 2 PR jobs, from 7 changed files. Selected PR test projects (13 / 99)
Selected PR jobs (2)
How these were chosen — grouped by what changed
🔧 📦 affected project 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Pull request created: #1742
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1742 targeting Signals triggered (3)
Change summaryFixes the dashboard Help dialog ( Docs changeUpdated Note This draft PR needs human review before merging. |
|
/backport to release/13.6 |
|
Started backporting to |
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]>
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) andc(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.
Validation: Focused dashboard component shortcut tests passed (5/5);
git diff --checkpassed. Visually verified both help dialogs in the browser.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?