VS Code extension: Improve gutter, code lens, and tree view resource state indicators#15688
VS Code extension: Improve gutter, code lens, and tree view resource state indicators#15688adamint wants to merge 3 commits intomicrosoft:mainfrom
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15688Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15688" |
There was a problem hiding this comment.
Pull request overview
Updates the Aspire VS Code extension’s editor and tree view resource-state visuals to be more distinguishable and informative (especially around unhealthy/waiting/not-started and exit-code scenarios), and documents the new editor indicators in the walkthrough.
Changes:
- Replaces gutter dot decorations with distinct SVG icon shapes (plus a “completed” variant) and refines state classification (e.g., Waiting spins; NotStarted does not).
- Enhances code lens state labeling with Waiting/Not Started labels, exit code display, and health check count/tooltip details.
- Improves tree view icons/tooltips to better reflect unhealthy/exit-code states and show per-check health report details; updates walkthrough documentation.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| extension/walkthrough/runApp.md | Adds “Editor indicators” documentation and screenshot reference. |
| extension/src/views/AspireAppHostTreeProvider.ts | Updates tree icons for unhealthy/exit-code states and expands tooltip with health report details. |
| extension/src/views/AppHostDataRepository.ts | Extends ResourceJson with healthReports and exitCode fields. |
| extension/src/editor/AspireGutterDecorationProvider.ts | Replaces colored dot gutter icons with distinct SVG shapes and adds “completed” category. |
| extension/src/editor/AspireCodeLensProvider.ts | Adds Waiting/Not Started labels, exit-code aware stopped labels, and health report counts/details in code lens. |
| extension/src/loc/strings.ts | Adds localized strings for new code lens labels (waiting/not-started/exit-code variants). |
| extension/src/test/codeLens.test.ts | Updates and extends tests for new state labels and exit-code behavior. |
| extension/src/test/appHostTreeView.test.ts | Updates and extends tests for new tree icon behavior and spinner distinctions. |
d3b82a6 to
7c0a86b
Compare
…state indicators - NotStarted resources show grey idle icon instead of loading spinner - Waiting resources show 'Waiting' label distinct from 'Starting' - Unhealthy health status shows yellow/warning instead of red/error - Successfully completed resources show pale green gutter dot and green tree icon - Non-zero exit codes show as error in gutter and tree view - Exit codes displayed in code lens for stopped resources - Health check details shown in code lens (e.g. 'Unhealthy 1/3') and tree tooltip - Added healthReports and exitCode to ResourceJson TypeScript interface - Added walkthrough section explaining editor indicators Fixes microsoft#15667 Related to microsoft#15577
7c0a86b to
f7faa2f
Compare
- Localize hardcoded 'Health:' and 'Exit Code:' strings in
buildResourceDescription via vscode.l10n.t() wrappers
- Make Stopping state consistent: show spinner/Starting label in code
lens (matches gutter hourglass and tree view spinner)
- Fix healthCheckDescription from no-op '{0}' to 'Status: {0}'
- Fix weak test assertion: assert 'Exit Code: 1' instead of just '1'
- Fix fragile raw-newline tooltip markdown to use explicit \n\n
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Check stateStyle Error before Unhealthy in getResourceIcon to match gutter classifyState ordering (error takes precedence over warning) - Use HealthStatus constants instead of hardcoded strings in tooltip - Sort health report entries by name for stable tooltip ordering Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
screenshot? |
delta wifi blocks uploading screenshots to github, for some reason |
|
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.
|
| case ResourceState.NotStarted: | ||
| return codeLensResourceStarting; | ||
| return codeLensResourceNotStarted; | ||
| case ResourceState.FailedToStart: |
There was a problem hiding this comment.
Bug: Stopping reuses codeLensResourceStarting, which renders as "$(loading~spin) Starting". When a resource is actively stopping, users will see "Starting" — the opposite of what's happening. The spinner icon is appropriate, but the text should say "Stopping". Consider adding a codeLensResourceStopping string (e.g., $(loading~spin) Stopping).
The test at line 95 ('Stopping returns starting label') asserts this incorrect behavior too.
| this.contextValue = 'healthChecksGroup'; | ||
| const reports = resource.healthReports; | ||
| if (reports) { | ||
| const total = Object.keys(reports).length; |
There was a problem hiding this comment.
Nit: This defaults to Expanded, which means every resource with health checks will always show the full health check list in the tree. For an app with many resources each having multiple health checks, this significantly inflates the tree on every refresh.
Consider using Collapsed here — the parent ResourceItem description already includes the health summary (e.g., "Health: 1/2"), so users get the key info at a glance and can expand for details when needed.
| const reports = resource.healthReports; | ||
| const exitCode = resource.exitCode; | ||
| if (reports && Object.keys(reports).length > 0) { | ||
| const total = Object.keys(reports).length; |
There was a problem hiding this comment.
Nit: This shows exit code unconditionally when non-null, including exit code 0. A successful exit produces "Project · Finished · Exit Code: 0" in the tree description and "Stopped (Exit Code: 0)" in the code lens. Exit code 0 is the normal/expected case — surfacing it the same way as non-zero codes adds visual noise without much value. Consider only showing exit code when exitCode !== 0.
Description
Improves the VS Code extension's resource state indicators in the gutter, code lens, and tree view to provide clearer, more informative feedback about resource status.
Changes
Gutter & Code Lens
NotStartedresources no longer show a loading spinner — onlyWaitingresources spin (in aspire panel, limit loading state for not started resources to resources actually waiting #15667)Unhealthyhealth status now show yellow warning indicators instead of red errorStoppedstate (previously fell through to defaults) in gutter, code lens, and tree iconStoppingnow shows a spinner/starting indicator consistently across gutter (hourglass), tree view (spinner), and code lens (Starting label)Tree View Panel
Unhealthy→ warning icon,NotStarted→ record (no spinner), successful exit → green pass, non-zero exit → errorLocalization
vscode.l10n.t()instrings.tsWalkthrough
Fixes #15667
Fixes #15577
Checklist