Add 'Open Aspire Dashboard' to Command Palette#15499
Conversation
- Enable openDashboard command in Command Palette when app hosts are running - Rename command from 'Open Dashboard' to 'Open Aspire Dashboard' - Show quick pick selector when multiple app hosts have dashboards (global mode) - Strip resource-specific query from workspace dashboard URL to open base dashboard - Add selectDashboardPlaceholder localized string
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15499Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15499" |
There was a problem hiding this comment.
Pull request overview
Adds an “Open Aspire Dashboard” command to the VS Code Command Palette, making the dashboard easier to open outside the tree-view inline action while improving behavior in multi-apphost (global) scenarios and avoiding resource-specific dashboard URLs in workspace mode.
Changes:
- Exposes
aspire-vscode.openDashboardin the Command Palette when at least one app host is running (!aspire.noRunningAppHosts). - Updates the command title to “Open Aspire Dashboard” and adds a Quick Pick chooser when multiple dashboard URLs are available in global mode.
- Normalizes workspace-mode dashboard URLs to open the base dashboard (strips
/?resource=suffix).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| extension/src/views/AspireAppHostTreeProvider.ts | Makes openDashboard async, adds multi-dashboard Quick Pick in global mode, and strips resource-specific suffixes for workspace dashboard URLs. |
| extension/src/loc/strings.ts | Adds localized placeholder text for the dashboard Quick Pick. |
| extension/package.nls.json | Renames the command display string and adds a localization entry for the new placeholder. |
| extension/package.json | Enables the dashboard command in the Command Palette when app hosts are running. |
| extension/loc/xlf/aspire-vscode.xlf | Updates localization units for the renamed command and new placeholder string. |
| function getBaseDashboardUrl(resourceDashboardUrl: string | null): string | null { | ||
| if (!resourceDashboardUrl) { | ||
| return null; | ||
| } | ||
| const idx = resourceDashboardUrl.indexOf('/?resource='); | ||
| return idx >= 0 ? resourceDashboardUrl.substring(0, idx) : resourceDashboardUrl; | ||
| } |
There was a problem hiding this comment.
New behavior in openDashboard now depends on URL normalization (getBaseDashboardUrl) and multi-apphost selection via Quick Pick, but there are no unit tests covering these cases. Consider extracting/exporting getBaseDashboardUrl (or moving it to a small util) and adding tests that verify: (1) resource URLs with /?resource= are stripped correctly, and (2) in global mode with multiple dashboard URLs a selection is required/cancel is handled.
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
Description
Add "Open Aspire Dashboard" to the VS Code extension Command Palette.
Previously, the
openDashboardcommand was only accessible from the tree view inline button. This change:!aspire.noRunningAppHosts)/?resource=suffix from workspace dashboard URLs so the base dashboard opens instead of a resource-specific viewFixes #15445
Checklist