diff --git a/web/src/App.tsx b/web/src/App.tsx index 91ef78e..28d43a2 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -324,8 +324,8 @@ function App() { ) const handleNavigateToSubAgent = useCallback( - (taskId: string, description: string) => { - const cmd = enterSubAgentView(taskId, description) + (taskId: string, description: string, subagentType?: string) => { + const cmd = enterSubAgentView(taskId, description, subagentType) handleCommand(cmd) sendMessage({ type: 'command', payload: JSON.stringify(cmd) }) }, diff --git a/web/src/components/Chat/ChatContainer.tsx b/web/src/components/Chat/ChatContainer.tsx index 30dda64..c4b77bd 100644 --- a/web/src/components/Chat/ChatContainer.tsx +++ b/web/src/components/Chat/ChatContainer.tsx @@ -8,7 +8,7 @@ interface ChatContainerProps { isReadOnly?: boolean channelName?: string onSendMessage: (content: string, attachments: Attachment[]) => void - onNavigateToSubAgent?: (taskId: string, description: string) => void + onNavigateToSubAgent?: (taskId: string, description: string, subagentType?: string) => void onStop?: () => void showThinking?: boolean /** 浮动待办面板,绝对定位在消息区域上方 */ diff --git a/web/src/components/Chat/MessageBubble.tsx b/web/src/components/Chat/MessageBubble.tsx index 2f5343e..0c9b9bd 100644 --- a/web/src/components/Chat/MessageBubble.tsx +++ b/web/src/components/Chat/MessageBubble.tsx @@ -58,7 +58,7 @@ function StatusIcon({ status, size = 14 }: { status: 'calling' | 'result' | 'pen interface MessageBubbleProps { message: ChatMessage - onNavigateToSubAgent?: (taskId: string, description: string) => void + onNavigateToSubAgent?: (taskId: string, description: string, subagentType?: string) => void showThinking?: boolean } @@ -477,7 +477,7 @@ export function MessageBubble({ message, onNavigateToSubAgent, showThinking = tr - )} - {showScrollToBottom && ( + {/* 回到底部 */} - )} - + + )} ) } diff --git a/web/src/components/Panel/TodoPanel.tsx b/web/src/components/Panel/TodoPanel.tsx index bb3d1eb..83c5b71 100644 --- a/web/src/components/Panel/TodoPanel.tsx +++ b/web/src/components/Panel/TodoPanel.tsx @@ -236,7 +236,8 @@ export function TodoPanel({ todos, requestTodoList, sendCommand }: TodoPanelProp {!isCollapsed && (
{items.map(item => ( -
+
+ {item.content} diff --git a/web/src/hooks/useChat.ts b/web/src/hooks/useChat.ts index ccf9d3e..0aeb2dc 100644 --- a/web/src/hooks/useChat.ts +++ b/web/src/hooks/useChat.ts @@ -85,7 +85,7 @@ interface UseChatReturn { selectSession: (sessionId: string) => void // 子智能体导航方法 - enterSubAgentView: (taskId: string, description: string) => Command + enterSubAgentView: (taskId: string, description: string, subagentType?: string) => Command exitSubAgentView: () => void navigateToSubAgentLevel: (index: number) => void @@ -857,11 +857,11 @@ export function useChat(): UseChatReturn { selectedTopicRef.current = selectedTopic }, [selectedTopic]) - const enterSubAgentView = useCallback((taskId: string, description: string): Command => { + const enterSubAgentView = useCallback((taskId: string, description: string, subagentType?: string): Command => { const newView: SubAgentView = { taskId, description, - subagentType: '', + subagentType: subagentType || '', status: 'loading', messages: [], }