Skip to content

Make dashboard launch opt-in by default#18361

Draft
adamint wants to merge 19 commits into
microsoft:mainfrom
adamint:issue17923-dashboard-launch
Draft

Make dashboard launch opt-in by default#18361
adamint wants to merge 19 commits into
microsoft:mainfrom
adamint:issue17923-dashboard-launch

Conversation

@adamint

@adamint adamint commented Jun 20, 2026

Copy link
Copy Markdown
Member

Description

Make the VS Code extension stop opening the Aspire Dashboard automatically by default. Starting an AppHost still prints the dashboard URL and keeps the dashboard available from the Aspire panel, but users now opt into notifications, an external browser, the integrated browser, or browser-debug launches.

This also adds a per-launch dashboardBrowser debug configuration property and updates Configure launch.json to prompt for the launch behavior. Explicit legacy aspire.enableAspireDashboardAutoLaunch settings are preserved so existing users who configured notification, off, or launch keep the same effective behavior. Explicit new aspire.dashboardBrowser none or notification values win. Otherwise, legacy notification and off override browser-opening choices, and legacy launch uses aspire.dashboardBrowser when configured or falls back to VS Code's integrated browser for compatibility.

Fixes #17923

User-facing usage

Users can set the global behavior with:

{
  "aspire.dashboardBrowser": "none"
}

Or override it per launch configuration:

{
  "type": "aspire",
  "request": "launch",
  "name": "Aspire: Launch default AppHost",
  "program": "${workspaceFolder}",
  "dashboardBrowser": "notification"
}

Supported values are none, notification, openExternalBrowser, integratedBrowser, debugChrome, debugEdge, and debugFirefox.

Screenshots / Recordings

No static screenshot uploaded. The changed UI is the Configure launch.json quick pick; local Extension Host E2E drove that command, selected Do not open the dashboard, and verified launch.json contained dashboardBrowser: "none". The E2E harness only captured failure screenshots for unrelated browser startup failures, so the useful proof here is the command transcript/state evidence in the automated testing comment.

Validation

  • corepack yarn run compile-tests
  • corepack yarn run compile
  • corepack yarn run lint
  • corepack yarn run compile-e2e
  • Focused VS Code unit test: corepack yarn vscode-test --config .test-artifacts/vscode-test-short.mjs --grep "configureLaunchJsonCommand|displayDashboardUrls" — 15 passing
  • Focused command-palette Extension Host E2E with ASPIRE_EXTENSION_E2E_TEMP_ROOT=../../e2e18361, ASPIRE_EXTENSION_E2E_SHARD=commandPalette-fix, ASPIRE_EXTENSION_E2E_SPEC='out/test-e2e/test-e2e/commandPalette.e2e.test.js', ASPIRE_EXTENSION_E2E_SKIP_RESTORE_PREWARM=true: 3 passing / 1 pending before an unrelated multiple-AppHost discovery timeout. The passed path includes Aspire: Configure launch.json file writing dashboardBrowser: "none".
  • Focused edge-cases Extension Host E2E built and installed the PR VSIX, then blocked before tests started with SessionNotCreatedError: DevToolsActivePort file doesn't exist. The edge-case source now removes any launch.json left by earlier specs before driving Configure launch.json.

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

Stop opening the Aspire Dashboard automatically by default from the VS Code extension while preserving notification, browser, and debug-browser launch behaviors. Add a launch.json dashboardBrowser override and prompt for it from the Configure launch.json command.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 03:20
@github-actions

github-actions Bot commented Jun 20, 2026

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 -- 18361

Or

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

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.

Pull request overview

This PR makes the Aspire VS Code extension stop opening the Aspire Dashboard automatically by default (resolving #17923). Starting an AppHost still prints the dashboard URL and keeps it available from the Aspire panel, but the dashboard launch now defaults to none. Users opt back in via the global aspire.dashboardBrowser setting (now extended with none/notification) or a new per-launch dashboardBrowser debug-configuration property, and the Configure launch.json command prompts for the behavior. Existing users who explicitly set the legacy aspire.enableAspireDashboardAutoLaunch (launch/notification/off) keep their effective behavior, and a one-time notification informs unconfigured users of the default change.

Changes:

  • Centralizes dashboard-launch resolution in InteractionService.getDashboardLaunchBehavior, layering per-launch debug config → explicit global setting → legacy setting → new none default, plus a one-time "default changed" notification gated on globalState.
  • Adds a per-launch dashboardBrowser debug property and a quick-pick prompt in Configure launch.json, with new localized strings across strings.ts, package.nls.json, package.json, and the regenerated .xlf.
  • Updates and adds tests (interactionServiceTests, new configureLaunchJson.test.ts) and a CHANGELOG entry.
Show a summary per file
File Description
extension/src/server/interactionService.ts New precedence/normalization helpers, behavior resolution, and one-time changed-default notification
extension/src/server/rpcClient.ts Threads globalState into InteractionService
extension/src/extension.ts Passes context.globalState when creating the RPC client
extension/src/debugger/AspireDebugSession.ts Adds DashboardLaunchBehavior type union
extension/src/dcp/types.ts Adds dashboardBrowser to AspireExtendedDebugConfiguration
extension/src/commands/configureLaunchJson.ts Prompts for launch behavior and writes dashboardBrowser into generated config
extension/src/loc/strings.ts New localized strings for the prompt and notification
extension/package.nls.json / extension/package.json New setting/enum values, default changes (enableAspireDashboardAutoLaunchoff, dashboardBrowsernone), debug property
extension/loc/xlf/aspire-vscode.xlf Regenerated translation source
extension/CHANGELOG.md Documents the behavior change
extension/src/test/rpc/interactionServiceTests.test.ts Updated/added tests with createAspireConfiguration helper
extension/src/test/configureLaunchJson.test.ts New tests for the prompt flow

Copilot's findings

  • Files reviewed: 13/13 changed files
  • Comments generated: 2

Comment thread extension/src/server/interactionService.ts Outdated
Comment thread extension/src/server/interactionService.ts Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@adamint

adamint commented Jun 20, 2026

Copy link
Copy Markdown
Member Author

(automated comment)

Edge-case review + standard path proof after ec0e17a295:

  • The per-launch dashboardBrowser: "none" case is now source-aware, so it no longer shows the one-time migration notification. The notification only appears for the actual unconfigured default path.
  • Notification settings actions now open the setting that actually controls the behavior: debug configuration for launch.json, legacy setting for legacy behavior, and aspire.dashboardBrowser for global/default behavior.
  • The Copilot comments are addressed: removed the stale DashboardBrowserType import and wired a real Memento into the RPC test harness so the one-time notification path is actually tested.
  • The failing standard E2E paths were updated to handle the new Configure launch.json quick pick. Local proof: command-palette shard had 4 passing / 1 pending, edge-cases shard had 3 passing, and debug-dashboard shard had 5 passing. The combined command-palette+edge-cases local wrapper hit a cleanup-only failure after both shards passed.
  • Architecture review raised a non-blocking design option to add a “use global setting” quick-pick choice for Configure launch.json. I’m leaving that out of this PR because the current command explicitly asks for the launch configuration behavior and writes the selected per-launch behavior; unset already remains the semantic “use global” state for hand-authored/debug configs.

Panel used: architecture (reviewing-aspire-architecture, GPT-5.5 high), edge/regression (code-review, GPT-5.5 high), domain (code-review, GPT-5.5 high, still running at the time of this comment), PR tester (task, GPT-5.5 high; initial result was blocked by the now-fixed compile error, then I reran the targeted local paths above).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 04:38
@adamint

adamint commented Jun 20, 2026

Copy link
Copy Markdown
Member Author

(automated comment)

CI follow-up: the Windows debug-dashboard failure was a test race, not a dashboard-launch regression. The AppHost had stopped, but the test was waiting to observe the transient stoppingPaths state and missed it before the state file settled back to no running AppHost.

I pushed 70e571d348 to make those two stop tests assert the durable result instead: debug sessions are gone and the AppHost is no longer running. Local focused proof: ASPIRE_EXTENSION_E2E_SHARD=debug-dashboard ASPIRE_EXTENSION_E2E_SPEC='out/test-e2e/test-e2e/debugDashboard.e2e.test.js' corepack yarn run test:e2e passed with 5 passing.

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's findings

  • Files reviewed: 16/16 changed files
  • Comments generated: 0 new

@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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@adamint

adamint commented Jun 20, 2026

Copy link
Copy Markdown
Member Author

(automated comment)

Follow-up on the repeated Windows debug-dashboard shard: the second run showed the real issue. The first test opted into integratedBrowser, then teardown cleared aspire.dashboardBrowser, so the rest of this shard ran under the new default none. These tests are specifically the debug-dashboard/browser path, so they need to opt in before every test.

I pushed 533036da1b to set aspire.dashboardBrowser = integratedBrowser in the suite setup instead of only in the first test. compile-tests, compile, and lint passed. The local focused E2E attempt got through packaging/VS Code install and then hung before Mocha started, so I’m leaving final proof to the Windows shard that caught this.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 06:31

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's findings

  • Files reviewed: 19/19 changed files
  • Comments generated: 1

Comment thread extension/src/loc/strings.ts Outdated
@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.

Adam Ratzman and others added 2 commits June 20, 2026 03:39
Limit the integrated browser dashboard opt-in to the E2E that actually verifies dashboard launch behavior. The other debug-dashboard tests now run under the new default so repeated Windows debug stop checks do not keep Simple Browser sessions open unnecessarily.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The E2E harness seeds dashboard launch globally for legacy coverage, so clearing the workspace value still left the stop-focused tests opted in. Explicitly opt the suite out by default and only override the dashboard-opening test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 07:53

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's findings

  • Files reviewed: 19/19 changed files
  • Comments generated: 2

Comment thread extension/src/loc/strings.ts Outdated
Comment thread extension/README.md Outdated
@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.

Adam Ratzman and others added 3 commits June 20, 2026 04:26
VS Code's active debug session can be a child session during extension E2E tests. Dispose the extension's tracked Aspire sessions before calling stopDebugging so AppHost child sessions are stopped deterministically.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
No code changes; this forces GitHub Actions to run against the latest PR head after a stale rerun remained on the previous commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…d-launch

# Conflicts:
#	extension/src/extension.ts
Copilot AI review requested due to automatic review settings June 20, 2026 08:45

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's findings

  • Files reviewed: 19/19 changed files
  • Comments generated: 1

Comment thread extension/src/loc/strings.ts Outdated
@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.

Adam Ratzman and others added 2 commits June 20, 2026 05:22
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the E2E stop control pending until VS Code has stopped the tracked Aspire debug sessions and the extension state no longer reports running or stopping AppHosts. This prevents the debug-dashboard tests from asserting against stale state after the control bridge returns.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 09:35
Adam Ratzman and others added 2 commits June 20, 2026 05:40
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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's findings

  • Files reviewed: 21/21 changed files
  • Comments generated: 2

Comment thread extension/src/loc/strings.ts Outdated
Comment thread extension/README.md Outdated
@adamint adamint marked this pull request as ready for review June 20, 2026 10:10
Copilot AI review requested due to automatic review settings June 20, 2026 10:10

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's findings

  • Files reviewed: 21/21 changed files
  • Comments generated: 1

Comment thread extension/README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 17:43
@adamint adamint marked this pull request as draft June 20, 2026 17:43

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's findings

  • Files reviewed: 21/21 changed files
  • Comments generated: 0 new

@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.

Adam Ratzman and others added 2 commits June 20, 2026 15:00
Clarify legacy dashboard setting precedence in localized metadata and treat canceled Configure launch.json selection as command cancellation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make the README and localized setting description match the exact precedence between explicit new settings and legacy values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 19:18

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's findings

  • Files reviewed: 21/21 changed files
  • Comments generated: 0 new

Remove any launch.json left by earlier E2E specs before exercising Configure launch.json in the CLI-unavailable edge case.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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.

@adamint

adamint commented Jun 20, 2026

Copy link
Copy Markdown
Member Author

(automated comment)

Final review-fix pass after eebff31a2f:

  • Resolved all review threads. The Memento/globalState notification coverage, dashboardLaunchBehaviorChanged string alignment, and legacy precedence wording are now addressed.
  • Pushed three follow-ups: cancellation from Configure launch.json now propagates as vscode.CancellationError, the legacy setting docs/package.nls/xlf text matches the actual precedence, and the edge-cases E2E clears any launch.json left by earlier specs before driving Configure launch.json.
  • PR body is updated with the current summary and validation.

Validation/proof:

  • corepack yarn run compile-tests
  • corepack yarn run compile
  • corepack yarn run lint
  • corepack yarn run compile-e2e
  • Focused VS Code unit test with short user-data dirs: configureLaunchJsonCommand|displayDashboardUrls — 15 passing ✅
  • Real Extension Host proof: commandPalette-fix E2E got through VSIX packaging/install and the Aspire: Configure launch.json file path passed, with aspire-vscode.configureLaunchJson recorded as success and dashboardBrowser: "none" verified. Artifacts: extension/.test-results/e2e/commandPalette-fix/{mocha.json,extension-state.json,extension-control.json} and extension/.test-artifacts/aspire-extension-e2e.vsix.
  • E2E gaps: the same command-palette run later timed out in the unrelated multiple-AppHost candidate test, and the edge-cases E2E attempt was blocked before tests by SessionNotCreatedError: DevToolsActivePort file doesn't exist. No useful screenshot was produced; the strongest artifact is the E2E state/transcript evidence above.

Review orchestration lanes (all actual task invocations used GPT-5.5, high reasoning):

  • Architecture/simplicity: no remaining issues after final precedence wording.
  • Edge cases/regressions: found the cross-spec launch.json isolation issue; fixed in eebff31a2f, then reran the lane with no remaining issue.
  • Aspire domain code review: no significant issues in final state.
  • PR tester proof: source/build/unit proof passed; E2E partially verified with the blockers noted above.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make VS Code dashboard launch behavior less obtrusive by default

2 participants