mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 20:50:34 +00:00
Add Interactive Approval Mode Dialog (#1012)
This commit is contained in:
parent
0752a31e1e
commit
160b64523e
16 changed files with 397 additions and 909 deletions
|
|
@ -6,13 +6,20 @@
|
|||
|
||||
import { useCallback } from 'react';
|
||||
import { SettingScope } from '../../config/settings.js';
|
||||
import type { AuthType } from '@qwen-code/qwen-code-core';
|
||||
import type { AuthType, ApprovalMode } from '@qwen-code/qwen-code-core';
|
||||
|
||||
export interface DialogCloseOptions {
|
||||
// Theme dialog
|
||||
isThemeDialogOpen: boolean;
|
||||
handleThemeSelect: (theme: string | undefined, scope: SettingScope) => void;
|
||||
|
||||
// Approval mode dialog
|
||||
isApprovalModeDialogOpen: boolean;
|
||||
handleApprovalModeSelect: (
|
||||
mode: ApprovalMode | undefined,
|
||||
scope: SettingScope,
|
||||
) => void;
|
||||
|
||||
// Auth dialog
|
||||
isAuthDialogOpen: boolean;
|
||||
handleAuthSelect: (
|
||||
|
|
@ -57,6 +64,12 @@ export function useDialogClose(options: DialogCloseOptions) {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (options.isApprovalModeDialogOpen) {
|
||||
// Mimic ESC behavior: onSelect(undefined, selectedScope) - keeps current mode
|
||||
options.handleApprovalModeSelect(undefined, SettingScope.User);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (options.isEditorDialogOpen) {
|
||||
// Mimic ESC behavior: call onExit() directly
|
||||
options.exitEditorDialog();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue