Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 21, 2025

Summary

This PR replaces the blocking modal confirmation dialog with a non-blocking quick pick interface in the Aspire VS Code extension's interaction service. This provides a more consistent and less intrusive user experience.

Changes

Core Implementation

Modified the confirm() method in extension/src/server/interactionService.ts to use vscode.window.showQuickPick instead of vscode.window.showInformationMessage with a modal dialog.

Before:

const result = await vscode.window.showInformationMessage(
    formatText(promptText),
    { modal: true },  // Blocking modal in center of screen
    yes,
    no
);

After:

const choices = [yes, no];

const result = await vscode.window.showQuickPick(choices, {
    placeHolder: formatText(promptText),
    canPickMany: false,
    ignoreFocusOut: true  // Won't dismiss on focus loss
});

Test Coverage

Added comprehensive test coverage in extension/src/test/rpc/interactionServiceTests.test.ts:

  • Verifies "Yes" selection returns true
  • Verifies "No" selection returns false
  • Verifies cancellation returns null
  • Validates correct options passed to showQuickPick

Benefits

  1. 🎯 Better UX: Quick pick appears at the top of the screen instead of a blocking center modal, providing a less intrusive experience
  2. 🔄 Consistency: Now matches the pattern used by promptForSelection() and promptForSelections() methods
  3. ⚡ Non-blocking: Users can still interact with VS Code while the prompt is displayed (though it won't auto-dismiss due to ignoreFocusOut: true)
  4. ⌨️ Keyboard-friendly: Standard arrow keys + Enter navigation
  5. ✅ Backward Compatible: Maintains the same API contract (returns true/false/null)

Visual Comparison

Before (Modal) After (Quick Pick)
Center of screen Top of screen
Blocks entire window Non-blocking
Information icon with buttons List-style selection
Interrupts workflow Minimal interruption

All selection methods in the InteractionService now use a unified quick pick pattern, creating a predictable and consistent user experience across all prompts.

Original prompt

This section details on the original issue you should resolve

<issue_title>change vs code confirmation message to a quick pick in interaction service</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #12251


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Change VS Code confirmation message to a quick pick Change VS Code confirmation message to quick pick in interaction service Oct 21, 2025
Copilot AI requested a review from adamint October 21, 2025 22:36
Copilot finished work on behalf of adamint October 21, 2025 22:36
@adamint adamint marked this pull request as ready for review October 22, 2025 15:44
@Copilot Copilot AI review requested due to automatic review settings October 22, 2025 15:44
@github-actions
Copy link
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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12263

Or

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

Copy link
Contributor

Copilot AI left a comment

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 replaces the modal confirmation dialog with a quick pick interface in the VS Code extension's interaction service, providing a less intrusive user experience while maintaining backward compatibility.

Key changes:

  • Modified confirm() method to use showQuickPick instead of showInformationMessage with modal
  • Added comprehensive test coverage for all confirmation scenarios (Yes/No/Cancel)

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
extension/src/server/interactionService.ts Replaced modal dialog with quick pick for confirmation prompts
extension/src/test/rpc/interactionServiceTests.test.ts Added three test cases covering Yes/No/Cancel scenarios and validation of quick pick options
Files not reviewed (1)
  • extension/package-lock.json: Language not supported

Comment on lines +88 to +94

// Verify options passed to showQuickPick
const callArgs = showQuickPickStub.getCall(0).args;
assert.deepStrictEqual(callArgs[0], ['Yes', 'No'], 'should show Yes and No choices');
assert.strictEqual(callArgs[1]?.canPickMany, false, 'canPickMany should be false');
assert.strictEqual(callArgs[1]?.ignoreFocusOut, true, 'ignoreFocusOut should be true');

Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

Remove the blank line 88 before the comment. According to the .editorconfig formatting guidelines, unnecessary blank lines should be avoided within test method bodies.

Suggested change
// Verify options passed to showQuickPick
const callArgs = showQuickPickStub.getCall(0).args;
assert.deepStrictEqual(callArgs[0], ['Yes', 'No'], 'should show Yes and No choices');
assert.strictEqual(callArgs[1]?.canPickMany, false, 'canPickMany should be false');
assert.strictEqual(callArgs[1]?.ignoreFocusOut, true, 'ignoreFocusOut should be true');
// Verify options passed to showQuickPick
const callArgs = showQuickPickStub.getCall(0).args;
assert.deepStrictEqual(callArgs[0], ['Yes', 'No'], 'should show Yes and No choices');
assert.strictEqual(callArgs[1]?.canPickMany, false, 'canPickMany should be false');
assert.strictEqual(callArgs[1]?.ignoreFocusOut, true, 'ignoreFocusOut should be true');

Copilot uses AI. Check for mistakes.
assert.deepStrictEqual(callArgs[0], ['Yes', 'No'], 'should show Yes and No choices');
assert.strictEqual(callArgs[1]?.canPickMany, false, 'canPickMany should be false');
assert.strictEqual(callArgs[1]?.ignoreFocusOut, true, 'ignoreFocusOut should be true');

Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

Remove the blank line 94 before showQuickPickStub.restore(). The extra whitespace is inconsistent with the other test methods in this file (see lines 103-104 and 112-113 where restore() follows immediately after the assertion).

Suggested change

Copilot uses AI. Check for mistakes.
Copy link
Member

@adamint adamint left a comment

Choose a reason for hiding this comment

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

Tested locally. this is good

@adamint adamint enabled auto-merge (squash) October 22, 2025 18:49
@adamint adamint merged commit 29130bf into main Oct 22, 2025
594 of 597 checks passed
@adamint adamint deleted the copilot/change-confirmation-message-quick-pick branch October 22, 2025 18:56
@dotnet-policy-service dotnet-policy-service bot added this to the 13.0 milestone Oct 22, 2025
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.

change vs code confirmation message to a quick pick in interaction service

3 participants