PicoBot/web/src/components/Chat/ChatContainer.tsx
oudecheng cb0d3d932d feat: TodoPanel 改为常驻右边栏并支持点击跳转
- TodoPanel 移除浮动定位与拖动逻辑,改为常驻右边栏
- 右边栏与左边栏对称的折叠/展开逻辑,localStorage 持久化
- 待办/记忆/技能三 Tab 切换
- 点击已完成 todo 滚动并高亮对应 tool 消息
- 修复 MessageBubble isMergedTool 分支缺失 data-message-id 导致跳转失效
- ChatContainer 移除 todoPanel prop
2026-07-03 19:32:46 +08:00

48 lines
1.4 KiB
TypeScript

import { MessageList } from './MessageList'
import { MessageInput } from './MessageInput'
import type { ChatMessage, Attachment } from '../../types/protocol'
interface ChatContainerProps {
messages: ChatMessage[]
isLoading: boolean
isReadOnly?: boolean
channelName?: string
onSendMessage: (content: string, attachments: Attachment[]) => void
onNavigateToSubAgent?: (taskId: string, description: string, subagentType?: string) => void
onStop?: () => void
showThinking?: boolean
/** 视图标识,用于保存/恢复滚动位置 */
viewKey?: string
/** 高亮的消息 ID */
highlightedMessageId?: string | null
}
export function ChatContainer({
messages,
isLoading,
isReadOnly = false,
channelName,
onSendMessage,
onNavigateToSubAgent,
onStop,
showThinking = true,
viewKey,
highlightedMessageId,
}: ChatContainerProps) {
return (
<div className="flex h-full flex-col relative">
<div className="flex-1 overflow-hidden relative">
<MessageList messages={messages} onNavigateToSubAgent={onNavigateToSubAgent} showThinking={showThinking} viewKey={viewKey} highlightedMessageId={highlightedMessageId} />
</div>
<MessageInput
onSend={onSendMessage}
onStop={onStop}
disabled={isLoading}
isLoading={isLoading}
isReadOnly={isReadOnly}
channelName={channelName}
/>
</div>
)
}