From 301506a3b1978ea474a259dc3f3f0667b6832750 Mon Sep 17 00:00:00 2001 From: oudecheng <13802883547@139.com> Date: Thu, 18 Jun 2026 15:34:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(chat):=20=E6=94=AF=E6=8C=81=E5=AD=90?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E5=AF=BC=E8=88=AA=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AD=90=E6=99=BA=E8=83=BD=E4=BD=93=E7=B1=BB=E5=9E=8B=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 扩展 enterSubAgentView 方法,新增 subagentType 可选参数 - 更新相关回调 onNavigateToSubAgent,添加 subagentType 参数支持 - 调整 MessageBubble 组件触发子智能体导航时传递 subagentType - 优化 MessageList 组件显示新消息计数及底部导航按钮交互 - 美化底部浮动导航按钮样式,增加新消息数字提示和动画 - TodoPanel 添加状态点样式,消息内容排版更紧凑 - 维护滚动位置状态,改进滚动时新消息计数逻辑 --- web/src/App.tsx | 4 +- web/src/components/Chat/ChatContainer.tsx | 2 +- web/src/components/Chat/MessageBubble.tsx | 10 ++-- web/src/components/Chat/MessageList.tsx | 71 +++++++++++------------ web/src/components/Panel/TodoPanel.tsx | 3 +- web/src/hooks/useChat.ts | 6 +- 6 files changed, 48 insertions(+), 48 deletions(-) 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: [], }