mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-07-10 01:29:17 +00:00
Keep auth quick inputs open across focus changes (#6274)
VS Code dismisses QuickPick and InputBox prompts on focus loss unless ignoreFocusOut is enabled, which breaks the multi-step auth flow when users switch windows to copy provider details. Constraint: VS Code extension API defaults ignoreFocusOut to false for quick inputs Confidence: high Scope-risk: narrow Tested: npm test --workspace=packages/vscode-ide-companion -- src/webview/handlers/AuthMessageHandler.test.ts Tested: npm run check-types --workspace=packages/vscode-ide-companion Tested: npm run lint --workspace=packages/vscode-ide-companion Tested: npm run build --workspace=packages/vscode-ide-companion Tested: git diff --check
This commit is contained in:
parent
9b2fb30cb0
commit
3282c17b1c
2 changed files with 9 additions and 0 deletions
|
|
@ -41,6 +41,10 @@ describe('AuthMessageHandler', () => {
|
|||
|
||||
await handler.handle({ type: 'auth' });
|
||||
|
||||
expect(mockShowQuickPick).toHaveBeenCalledWith(
|
||||
expect.any(Array),
|
||||
expect.objectContaining({ ignoreFocusOut: true }),
|
||||
);
|
||||
expect(sendToWebView).toHaveBeenCalledWith({ type: 'authCancelled' });
|
||||
});
|
||||
|
||||
|
|
@ -65,6 +69,9 @@ describe('AuthMessageHandler', () => {
|
|||
|
||||
await handler.handle({ type: 'auth' });
|
||||
|
||||
expect(mockShowInputBox).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ ignoreFocusOut: true }),
|
||||
);
|
||||
expect(sendToWebView).toHaveBeenCalledWith({ type: 'authCancelled' });
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ export class AuthMessageHandler extends BaseMessageHandler {
|
|||
const choice = await vscode.window.showQuickPick(items, {
|
||||
title,
|
||||
placeHolder,
|
||||
ignoreFocusOut: true,
|
||||
});
|
||||
if (!choice || choice.kind === vscode.QuickPickItemKind.Separator) {
|
||||
this.notifyAuthCancelled();
|
||||
|
|
@ -145,6 +146,7 @@ export class AuthMessageHandler extends BaseMessageHandler {
|
|||
placeHolder: opts.placeHolder,
|
||||
value: opts.value,
|
||||
password: opts.password ?? false,
|
||||
ignoreFocusOut: true,
|
||||
validateInput: opts.required
|
||||
? (v) => (!v?.trim() ? 'This field is required' : null)
|
||||
: undefined,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue