mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 07:10:55 +00:00
Merge branch 'main' into feature/extension-management-tui
This commit is contained in:
commit
2699b88661
282 changed files with 21375 additions and 6462 deletions
|
|
@ -100,8 +100,6 @@ import { t } from '../i18n/index.js';
|
|||
import { useWelcomeBack } from './hooks/useWelcomeBack.js';
|
||||
import { useDialogClose } from './hooks/useDialogClose.js';
|
||||
import { useInitializationAuthError } from './hooks/useInitializationAuthError.js';
|
||||
import { type VisionSwitchOutcome } from './components/ModelSwitchDialog.js';
|
||||
import { processVisionSwitchOutcome } from './hooks/useVisionAutoSwitch.js';
|
||||
import { useSubagentCreateDialog } from './hooks/useSubagentCreateDialog.js';
|
||||
import { useAgentsManagerDialog } from './hooks/useAgentsManagerDialog.js';
|
||||
import { useExtensionsManagerDialog } from './hooks/useExtensionsManagerDialog.js';
|
||||
|
|
@ -502,18 +500,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
closeExtensionsManagerDialog,
|
||||
} = useExtensionsManagerDialog();
|
||||
|
||||
// Vision model auto-switch dialog state (must be before slashCommandActions)
|
||||
const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] =
|
||||
useState(false);
|
||||
const [visionSwitchResolver, setVisionSwitchResolver] = useState<{
|
||||
resolve: (result: {
|
||||
modelOverride?: string;
|
||||
persistSessionModel?: string;
|
||||
showGuidance?: boolean;
|
||||
}) => void;
|
||||
reject: () => void;
|
||||
} | null>(null);
|
||||
|
||||
const slashCommandActions = useMemo(
|
||||
() => ({
|
||||
openAuthDialog,
|
||||
|
|
@ -571,6 +557,7 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
historyManager.loadHistory,
|
||||
refreshStatic,
|
||||
toggleVimEnabled,
|
||||
isProcessing,
|
||||
setIsProcessing,
|
||||
setGeminiMdFileCount,
|
||||
slashCommandActions,
|
||||
|
|
@ -579,32 +566,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
logger,
|
||||
);
|
||||
|
||||
// Vision switch handlers
|
||||
const handleVisionSwitchRequired = useCallback(
|
||||
async (_query: unknown) =>
|
||||
new Promise<{
|
||||
modelOverride?: string;
|
||||
persistSessionModel?: string;
|
||||
showGuidance?: boolean;
|
||||
}>((resolve, reject) => {
|
||||
setVisionSwitchResolver({ resolve, reject });
|
||||
setIsVisionSwitchDialogOpen(true);
|
||||
}),
|
||||
[],
|
||||
);
|
||||
|
||||
const handleVisionSwitchSelect = useCallback(
|
||||
(outcome: VisionSwitchOutcome) => {
|
||||
setIsVisionSwitchDialogOpen(false);
|
||||
if (visionSwitchResolver) {
|
||||
const result = processVisionSwitchOutcome(outcome);
|
||||
visionSwitchResolver.resolve(result);
|
||||
setVisionSwitchResolver(null);
|
||||
}
|
||||
},
|
||||
[visionSwitchResolver],
|
||||
);
|
||||
|
||||
// onDebugMessage should log to debug logfile, not update footer debugMessage
|
||||
const onDebugMessage = useCallback(
|
||||
(message: string) => {
|
||||
|
|
@ -676,6 +637,7 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
pendingHistoryItems: pendingGeminiHistoryItems,
|
||||
thought,
|
||||
cancelOngoingRequest,
|
||||
retryLastPrompt,
|
||||
handleApprovalModeChange,
|
||||
activePtyId,
|
||||
loopDetectionConfirmationRequest,
|
||||
|
|
@ -695,11 +657,9 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
setModelSwitchedFromQuotaError,
|
||||
refreshStatic,
|
||||
() => cancelHandlerRef.current(),
|
||||
settings.merged.experimental?.visionModelPreview ?? false, // visionModelPreviewEnabled
|
||||
setEmbeddedShellFocused,
|
||||
terminalWidth,
|
||||
terminalHeight,
|
||||
handleVisionSwitchRequired, // onVisionSwitchRequired
|
||||
);
|
||||
|
||||
// Track whether suggestions are visible for Tab key handling
|
||||
|
|
@ -854,7 +814,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
!isThemeDialogOpen &&
|
||||
!isEditorDialogOpen &&
|
||||
!showWelcomeBackDialog &&
|
||||
!isVisionSwitchDialogOpen &&
|
||||
welcomeBackChoice !== 'restart' &&
|
||||
geminiClient?.isInitialized?.()
|
||||
) {
|
||||
|
|
@ -870,7 +829,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
isThemeDialogOpen,
|
||||
isEditorDialogOpen,
|
||||
showWelcomeBackDialog,
|
||||
isVisionSwitchDialogOpen,
|
||||
welcomeBackChoice,
|
||||
geminiClient,
|
||||
]);
|
||||
|
|
@ -1342,7 +1300,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
isThemeDialogOpen ||
|
||||
isSettingsDialogOpen ||
|
||||
isModelDialogOpen ||
|
||||
isVisionSwitchDialogOpen ||
|
||||
isPermissionsDialogOpen ||
|
||||
isAuthDialogOpen ||
|
||||
isAuthenticating ||
|
||||
|
|
@ -1455,8 +1412,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
extensionsUpdateState,
|
||||
activePtyId,
|
||||
embeddedShellFocused,
|
||||
// Vision switch dialog
|
||||
isVisionSwitchDialogOpen,
|
||||
// Welcome back dialog
|
||||
showWelcomeBackDialog,
|
||||
welcomeBackInfo,
|
||||
|
|
@ -1549,8 +1504,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
activePtyId,
|
||||
historyManager,
|
||||
embeddedShellFocused,
|
||||
// Vision switch dialog
|
||||
isVisionSwitchDialogOpen,
|
||||
// Welcome back dialog
|
||||
showWelcomeBackDialog,
|
||||
welcomeBackInfo,
|
||||
|
|
@ -1593,9 +1546,8 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
onSuggestionsVisibilityChange: setHasSuggestionsVisible,
|
||||
refreshStatic,
|
||||
handleFinalSubmit,
|
||||
handleRetryLastPrompt: retryLastPrompt,
|
||||
handleClearScreen,
|
||||
// Vision switch dialog
|
||||
handleVisionSwitchSelect,
|
||||
// Welcome back dialog
|
||||
handleWelcomeBackSelection,
|
||||
handleWelcomeBackClose,
|
||||
|
|
@ -1640,8 +1592,8 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||
handleEscapePromptChange,
|
||||
refreshStatic,
|
||||
handleFinalSubmit,
|
||||
retryLastPrompt,
|
||||
handleClearScreen,
|
||||
handleVisionSwitchSelect,
|
||||
handleWelcomeBackSelection,
|
||||
handleWelcomeBackClose,
|
||||
// Subagent dialogs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue