diff --git a/webui/proposals/automation-chat/BindingControls.tsx b/webui/proposals/automation-chat/BindingControls.tsx index 1a119fffd..f472efeaf 100644 --- a/webui/proposals/automation-chat/BindingControls.tsx +++ b/webui/proposals/automation-chat/BindingControls.tsx @@ -1,10 +1,12 @@ import { createContext, useContext, useEffect, useRef, useState, type ReactNode } from 'react'; -import { ArrowLeft, Check, Users } from 'lucide-react'; +import { ChevronDown, MoreHorizontal, Users } from 'lucide-react'; import { ChannelLogo } from '@/components/settings/channels/ChannelIdentity'; import { Button } from '@/components/ui/button'; import { DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog'; import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@/components/ui/select'; import { Textarea } from '@/components/ui/textarea'; +import { Disclosure } from '@/components/ui/disclosure'; +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; import type { NanobotFeatureInfo, SessionAutomationJob } from '@/lib/types'; export const targets = { @@ -36,12 +38,28 @@ export function ConversationIdentity({ target }: { target: Target }) { {target === 'webui' ? : } - - {item.name}{item.platform} + + {item.name}{item.platform} ; } +function ChatPicker({ value, disabled, onChange, detail = false }: { + value: Target; disabled: boolean; onChange: (target: Target) => void; detail?: boolean; +}) { + return ; +} + // One original dialog owns the complete interaction. The page never unmounts. export function BindingDialogFrame({ job, children }: { job: SessionAutomationJob; children: ReactNode }) { const preview = useContext(PreviewContext)!; @@ -49,7 +67,6 @@ export function BindingDialogFrame({ job, children }: { job: SessionAutomationJo const [draft, setDraft] = useState(saved); const [reviewing, setReviewing] = useState(false); const [message, setMessage] = useState(job.payload.message); - const [ack, setAck] = useState(false); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); const [notice, setNotice] = useState(''); @@ -65,46 +82,51 @@ export function BindingDialogFrame({ job, children }: { job: SessionAutomationJo }, [reviewing]); const back = () => { returning.current = true; setReviewing(false); }; const save = async () => { - if (!ack || !message.trim() || saving || locked) return; + if (draft === saved || !message.trim() || saving || locked) return; setSaving(true); setError(''); try { await preview.save(job, draft, message); - setNotice('已更换,下次执行时使用这个聊天。'); back(); - } catch { setError('没有保存:任务已被其他操作修改。原设置没变,你填写的内容也还在。'); } + setNotice('已更换,下次执行生效。'); back(); + } catch { setError('任务已被修改,未保存。原聊天未变,草稿已保留。'); } finally { setSaving(false); } }; if (preview.mode === 'current') return children; return { if (target === saved || locked) return; - setDraft(target); setNotice(''); setAck(false); setError(''); setReviewing(true); + setDraft(target); setNotice(''); setError(''); setReviewing(true); }, }}> {!reviewing ? children : <> - 确认更换聊天 + 更换聊天 -
-
-
现在
-
改为
+
+
+ { setDraft(target); setError(''); }} /> +

原聊天:{targets[saved].name} · {targets[saved].platform}

+

后续任务会使用新聊天的记录,结果也默认发到这里。

-

下次执行时,nanobot 会参考新聊天的记录,并默认把结果发到那里。

-

原来的聊天记录不会带过去。执行时间不变,也不会马上运行。

- {targets[draft].group ?

这是群聊,群里的人可能看到任务涉及的内容和结果。

: null} -