Skip to content

Fix sticky 'Finding apphosts' notification in VS Code extension - #16664

Merged
Adam Ratzman (adamint) merged 1 commit into
microsoft:mainfrom
adamint:dev/adamint/fix-finding-apphosts-sticky-toast
May 1, 2026
Merged

Adam Ratzman (adamint) merged 1 commit into
microsoft:mainfrom
adamint:dev/adamint/fix-finding-apphosts-sticky-toast

Conversation

@adamint

Copy link
Copy Markdown
Member

Description

When the CLI runs inside the VS Code extension, ProjectLocator.FindAppHostProjectFilesAsync displayed a "🔍 Finding apphosts..." message via interactionService.DisplayMessage. The extension renders displayMessage as vscode.window.showInformationMessage, which is a sticky toast with no programmatic dismissal — so the notification stayed up indefinitely after the search completed.

The same method was already inside an ShowStatusAsync block whose status text was the more generic "Searching...". ShowStatusAsync is rendered by the extension as a vscode.window.withProgress notification that the CLI dismisses via Backchannel.ShowStatusAsync(null, ...) in the finally block of ExtensionInteractionService.ShowStatusAsync.

This change folds the "Finding AppHosts..." text into the existing ShowStatusAsync call and removes the redundant DisplayMessage, so the user sees a single progress notification that auto-dismisses when the search completes.

Console UX is unchanged in spirit: previously users saw a Searching... spinner plus a persistent 🔍 Finding apphosts... line; now they see only the spinner labeled Finding AppHosts....

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • No — existing ProjectLocatorTests and ExecCommandTests (which asserts on FindingAppHosts) cover the relevant paths and continue to pass. No new behavior to assert.
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

The 'Finding apphosts' message was displayed via DisplayMessage, which
the extension renders as a sticky vscode.window.showInformationMessage
toast that has no programmatic dismissal. Fold it into the surrounding
ShowStatusAsync status text so it rides on the existing progress
notification (auto-dismissed via the finally block) instead.
@adamint

Copy link
Copy Markdown
Member Author

/backport to release/13.3

@github-actions

github-actions Bot commented May 1, 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 -- 16664

Or

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

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

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

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 fixes a UX issue when the Aspire CLI runs inside the VS Code extension: it removes a sticky “information message” toast during AppHost discovery by using the existing ShowStatusAsync progress mechanism for the “Finding AppHosts...” text instead of emitting a separate DisplayMessage.

Changes:

  • Updated AppHost discovery status text to use InteractionServiceStrings.FindingAppHosts in the ShowStatusAsync progress scope.
  • Removed the redundant interactionService.DisplayMessage(... FindingAppHosts) call that caused an undismissable VS Code notification.

@IEvangelist David Pine (IEvangelist) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed; no issues found.

@adamint
Adam Ratzman (adamint) merged commit a6d6086 into microsoft:main May 1, 2026
567 of 572 checks passed
@github-actions github-actions Bot added this to the 13.4 milestone May 1, 2026
Nell Shamrell-Harrington (nellshamrell) pushed a commit to nellshamrell/aspire that referenced this pull request May 18, 2026
…osoft#16664)

The 'Finding apphosts' message was displayed via DisplayMessage, which
the extension renders as a sticky vscode.window.showInformationMessage
toast that has no programmatic dismissal. Fold it into the surrounding
ShowStatusAsync status text so it rides on the existing progress
notification (auto-dismissed via the finally block) instead.
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants