mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
feat: subagent phase 2 implementation
This commit is contained in:
@@ -144,8 +144,10 @@ describe('useSlashCommandProcessor', () => {
|
||||
mockSetQuittingMessages,
|
||||
vi.fn(), // openPrivacyNotice
|
||||
vi.fn(), // openSettingsDialog
|
||||
vi.fn(), // openSubagentCreateDialog
|
||||
vi.fn(), // toggleVimEnabled
|
||||
setIsProcessing,
|
||||
vi.fn(), // setGeminiMdFileCount
|
||||
),
|
||||
);
|
||||
|
||||
@@ -894,11 +896,11 @@ describe('useSlashCommandProcessor', () => {
|
||||
vi.fn(), // toggleCorgiMode
|
||||
mockSetQuittingMessages,
|
||||
vi.fn(), // openPrivacyNotice
|
||||
|
||||
vi.fn(), // openSettingsDialog
|
||||
vi.fn(), // openSubagentCreateDialog
|
||||
vi.fn(), // toggleVimEnabled
|
||||
vi.fn().mockResolvedValue(false), // toggleVimEnabled
|
||||
vi.fn(), // setIsProcessing
|
||||
vi.fn(), // setGeminiMdFileCount
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ export const useSlashCommandProcessor = (
|
||||
setQuittingMessages: (message: HistoryItem[]) => void,
|
||||
openPrivacyNotice: () => void,
|
||||
openSettingsDialog: () => void,
|
||||
openSubagentCreateDialog: () => void,
|
||||
toggleVimEnabled: () => Promise<boolean>,
|
||||
setIsProcessing: (isProcessing: boolean) => void,
|
||||
setGeminiMdFileCount: (count: number) => void,
|
||||
@@ -379,6 +380,9 @@ export const useSlashCommandProcessor = (
|
||||
case 'settings':
|
||||
openSettingsDialog();
|
||||
return { type: 'handled' };
|
||||
case 'subagent_create':
|
||||
openSubagentCreateDialog();
|
||||
return { type: 'handled' };
|
||||
case 'help':
|
||||
return { type: 'handled' };
|
||||
default: {
|
||||
@@ -553,6 +557,7 @@ export const useSlashCommandProcessor = (
|
||||
openEditorDialog,
|
||||
setQuittingMessages,
|
||||
openSettingsDialog,
|
||||
openSubagentCreateDialog,
|
||||
setShellConfirmationRequest,
|
||||
setSessionShellAllowlist,
|
||||
setIsProcessing,
|
||||
|
||||
26
packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
Normal file
26
packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Qwen
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { useState, useCallback } from 'react';
|
||||
|
||||
export function useSubagentCreateDialog() {
|
||||
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] =
|
||||
useState(false);
|
||||
|
||||
const openSubagentCreateDialog = useCallback(() => {
|
||||
setIsSubagentCreateDialogOpen(true);
|
||||
}, []);
|
||||
|
||||
const closeSubagentCreateDialog = useCallback(() => {
|
||||
setIsSubagentCreateDialogOpen(false);
|
||||
}, []);
|
||||
|
||||
return {
|
||||
isSubagentCreateDialogOpen,
|
||||
openSubagentCreateDialog,
|
||||
closeSubagentCreateDialog,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user