Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
Merge origin/main:整合引用回复(#5976)到群聊发件箱
Dash9a9a557d3a68
diff --cc apps/desktop/src/renderer/features/bots/BotGroupChatView.tsxindex 181b6f0dfe,eaa4713efb..bfd98effbf--- a/apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx+++ b/apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx@@@ -225,12 -243,14 +262,17 @@@ function BotGroupChatContent({ groupIdolder: [],olderPlans: [],olderHasMore: result.group.hasMoreBefore,+ readToken,},);+ const shown = stateRef.current;+ if (shown.kind === 'ready') {+ const targets = quotedOlderOriginals(shown.older, result.group.messages);+ if (targets.length > 0) void recheckQuotedOriginals(api, targets, isCurrent);+ }} else if (result.errorCode === 'NOT_FOUND') {+ // Gone for this account (deleted, archived or left): nothing of it is left to send.+ discardBotGroupOutbox(groupId);setState({ kind: 'missing' });} else {// Keep a timeline that is already on screen; only a first read fails loudly.@@@ -271,22 -329,11 +352,27 @@@() => (state.kind === 'ready' ? projectBotGroupExecutionFailures(mergeBotGroupMessages(state.older, state.group.messages), state.group.executionFailures) : []),[state],);+ // Settle receipts only once the read that shows them is on screen, so a pending bubble+ // never disappears a frame before its real message appears. Older pages count too: a+ // message pushed off the latest page settles its previews once 查看更早的消息 shows it.+ useLayoutEffect(() => {+ if (state.kind === 'ready') noteBotGroupTimeline(groupId, mergeBotGroupMessages(state.older, state.group.messages), state.readToken);+ }, [groupId, state]);+ const outbox = useBotGroupOutbox(groupId);+ const { pending: pendingSends, localAttachments } = useMemo(+ () => projectBotGroupOutbox(outbox, messages, getBotGroupOutboxClaims(groupId), getBotGroupOutboxPreviews(groupId)),+ [groupId, messages, outbox],+ );+ // A receipt the timeline does not show yet: read again so the real message takes its place.+ const unreadReceipts = pendingSends.flatMap((entry) => (entry.status === 'sent' && entry.messageId ? [entry.messageId] : [])).join(',');+ useEffect(() => {+ if (unreadReceipts) loadRef.current();+ }, [unreadReceipts]);+ // Quotes resolve against verified copies only; an unverified original falls back to the snapshot.+ const quoteSources = useMemo(+ () => (unverifiedOriginals.size > 0 ? messages.filter((message) => !unverifiedOriginals.has(message.id)) : messages),+ [messages, unverifiedOriginals],+ );const acknowledge = useCallback(() => {if (!isDataOwnerGenerationCurrent(readOwner.current) || !stickToBottomRef.current || document.visibilityState !== 'visible' || !document.hasFocus()) return;const at = messages.reduce((latest, message) => message.kind === 'message' && (message.authorKind === 'bot' || message.isSelf === false)@@@ -754,19 -889,6 +934,23 @@@</div>);})}+ {pendingSends.map((entry) => {+ const groupTime = timeGroups.get(outboxKey(entry));+ return (+ <div key={outboxKey(entry)} className="flex flex-col gap-4">+ {groupTime !== undefined ? (+ <p className="select-none text-center text-12 text-[var(--text-tertiary)]">+ {formatBotMessageGroupTime(groupTime, i18n.language)}+ </p>+ ) : null}- <BotGroupOutboxItem entry={entry} mentionLabels={mentionLabels} />++ <BotGroupOutboxItem entry={entry} mentionLabels={mentionLabels}++ quote={entry.quote ? (++ <BotGroupQuoteBlock display={resolveBotGroupQuote(entry.quote, quoteSources)}++ onLocate={() => void locateQuoted(entry.quote!)} align="right" />++ ) : null} />+ </div>+ );+ })}{openPlan && followUp ? (<BotGroupPlanFollowUpRowfollowUp={followUp}@@@ -804,8 -926,11 +988,10 @@@attachments={attachmentState}attachmentScope={attachmentScope}dragOver={dragOver}+ quote={quoteDraft ? { view: quoteDraft, display: resolveBotGroupQuote(quoteDraft, quoteSources) } : null}+ onQuoteChange={setQuoteDraft}- onSent={() => {+ onSending={() => {stickToBottomRef.current = true;- loadRef.current();}}/>}{group.migrationPending && <p role="status" className="px-4 py-2 text-13 text-[var(--text-secondary)]">{t('bots.groupChat.migrationPending')}</p>}@@@ -922,9 -1054,29 +1113,10 @@@ function BotGroupTimelineItem(<article {...{ [SHARE_SESSION_ATTR]: shareScope, [SHARE_MESSAGE_ATTR]: message.id }}className={`relative flex justify-end ${sharing ? 'ml-10' : ''}`}>{sharing && <ShareMessageCheckbox clientId={message.id} />}- <BotGroupSelfBubble content={message.content} attachments={message.attachments} mentionLabels={mentionLabels}>- <div className="flex min-w-0 max-w-[72%] flex-col items-end gap-2">- {quoteDisplay ? <BotGroupQuoteBlock display={quoteDisplay} onLocate={onLocateQuote} align="right" /> : null}- <BotGroupUserAttachments attachments={message.attachments} />- {hasText ? (- <div- className={`max-w-full whitespace-pre-wrap break-words rounded-xl border border-[var(--msg-user-border)] bg-[var(--msg-user-bg)] px-3.5 py-2.5 text-[var(--msg-user-text)] ${CHAT_BODY_CLASS}`}- >- {splitBotGroupMentionSegments(message.content, mentionLabels).map((segment, index) =>- segment.mention ? (- <span- key={index}- className="rounded-full bg-[var(--surface-chip)] px-1.5 font-medium"- >- {segment.text}- </span>- ) : (- <span key={index}>{segment.text}</span>- ),- )}- </div>- ) : null}++ <BotGroupSelfBubble content={message.content} attachments={message.attachments} mentionLabels={mentionLabels}++ quote={quoteDisplay ? <BotGroupQuoteBlock display={quoteDisplay} onLocate={onLocateQuote} align="right" /> : null}>{actions}- </div>+ </BotGroupSelfBubble></article>);}@@@ -978,111 -1131,6 +1171,117 @@@);}+/** The current user's own message: attachments, then the text bubble, then what goes under it. */+function BotGroupSelfBubble({+ content,+ attachments,+ mentionLabels,++ quote,+ children,+}: {+ content: string;+ attachments: readonly BotGroupAttachment[];+ mentionLabels: readonly string[];++ /** The 引用回复 block above the message. */++ quote?: ReactNode;+ children?: ReactNode;+}) {+ // An attachment-only message shows just its attachments, without an empty bubble.+ const hasText = content.trim().length > 0;+ return (+ <div className="flex min-w-0 max-w-[72%] flex-col items-end gap-2">++ {quote}+ <BotGroupUserAttachments attachments={attachments} />+ {hasText ? (+ <div+ className={`max-w-full whitespace-pre-wrap break-words rounded-xl border border-[var(--msg-user-border)] bg-[var(--msg-user-bg)] px-3.5 py-2.5 text-[var(--msg-user-text)] ${CHAT_BODY_CLASS}`}+ >+ {splitBotGroupMentionSegments(content, mentionLabels).map((segment, index) =>+ segment.mention ? (+ <span+ key={index}+ className="rounded-full bg-[var(--surface-chip)] px-1.5 font-medium"+ >+ {segment.text}+ </span>+ ) : (+ <span key={index}>{segment.text}</span>+ ),+ )}+ </div>+ ) : null}+ {children}+ </div>+ );+}++function outboxKey(entry: BotGroupOutboxEntry): string {+ return `outbox:${entry.input.clientId}`;+}++/** Wait this long before saying 发送中, so a quick send never flashes a status. */+const BOT_GROUP_SENDING_HINT_DELAY_MS = 600;++/**+ * A message the user just sent, shown before main has it in the timeline. Not yet a+ * timeline message: no share checkbox, reply or reactions until the real one replaces it.+ */+function BotGroupOutboxItem({+ entry,+ mentionLabels,++ quote,+}: {+ entry: BotGroupOutboxEntry;+ mentionLabels: readonly string[];++ quote?: ReactNode;+}) {+ const { t } = useTranslation();+ const sending = entry.status === 'sending';+ const [slow, setSlow] = useState(false);+ useEffect(() => {+ if (!sending) {+ setSlow(false);+ return;+ }+ const timer = window.setTimeout(() => setSlow(true), BOT_GROUP_SENDING_HINT_DELAY_MS);+ return () => window.clearTimeout(timer);+ }, [sending]);+ return (+ <article data-testid="bot-group-outbox" data-status={entry.status} className="relative flex justify-end">- <BotGroupSelfBubble content={entry.input.text} attachments={entry.attachments} mentionLabels={mentionLabels}>++ <BotGroupSelfBubble content={entry.input.text} attachments={entry.attachments} mentionLabels={mentionLabels} quote={quote}>+ {sending && slow ? (+ <p role="status" className="select-none text-12 leading-[1.33] text-[var(--text-tertiary)]">+ {t('bots.groupChat.outbox.sending')}+ </p>+ ) : null}+ {entry.status === 'failed' ? (+ <div role="alert" className="flex flex-wrap items-center justify-end gap-2">+ <span className="flex select-none items-center gap-1 text-12 leading-[1.33] text-[var(--text-danger)]">+ <CircleAlert size={13} aria-hidden className="shrink-0" />+ {t('bots.groupChat.outbox.failed')}+ </span>+ <Button+ variant="secondary"+ size="sm"+ compact+ type="button"+ onClick={() => {+ if (!editBotGroupSend(entry.input.groupId, entry.input.clientId)) toast.warning(t('bots.groupChat.outbox.editBlocked'));+ }}+ >+ {t('bots.groupChat.outbox.edit')}+ </Button>+ <Button variant="secondary" size="sm" compact type="button" onClick={() => retryBotGroupSend(entry.input.groupId, entry.input.clientId)}>+ <RefreshCcw size={13} />+ {t('bots.retry')}+ </Button>+ </div>+ ) : null}+ </BotGroupSelfBubble>+ </article>+ );+}+/*** A user message's images and files, drawn like a task's user bubble: each image as the* same attached-image view (click for the lightbox, right-click to copy or reveal), filesdiff --cc apps/desktop/src/renderer/features/bots/BotGroupComposer.tsxindex 17e2fac28b,17c3f67771..2db5c95519--- a/apps/desktop/src/renderer/features/bots/BotGroupComposer.tsx+++ b/apps/desktop/src/renderer/features/bots/BotGroupComposer.tsx@@@ -17,10 -12,14 +17,14 @@@* 负责人出安排(`division: true`),发出后标签清掉。安排进行中或等继续时不能再安排新的,* 菜单项置灰并说明原因。占位文字跟随未结束的安排,告诉用户这时说的话会交给谁。*+ * 「引用回复」(§10):页面持有当前群的待发引用,输入框上方显示紧凑的引用块,× 或 Esc+ * 只取消引用、不动正文。引用随发送一起交给 main(只带消息 id,摘要由 main 从服务器读),+ * 也是幂等键的一部分;发送失败时与正文一同放回,原消息已不可用时只放回正文。+ ** 附件(§3.1)与普通聊天同一套:托盘状态来自页面持有的 `useAttachments`(整页拖入也能* 加),缩略图与拒收提示复用 ComposerAttachments;「+」→「添加文件、图片或视频…」、粘贴- * 文件或截图都进托盘。有附件时可以不写字。发送前烧录图片标注,发出去之后才从托盘移走- * 这一批;没发出去就原样留着。+ * 文件或截图都进托盘。有附件时可以不写字。发送时这一批随消息离开托盘+ * (不删除文件),发件箱提交前烧录图片标注;没发出去就随消息放回。*/import {useEffect,@@@ -62,9 -63,12 +66,12 @@@ importBOT_GROUP_ATTACHMENTS_MAX,BOT_GROUP_MESSAGE_MAX_CHARS,type BotGroupMemberView,+ type BotGroupQuoteDisplay,+ type BotGroupQuoteView,} from '../../../shared/botGroupChat';import { BotAvatar } from './BotAvatar';+ import { BotGroupQuotePreview } from './BotGroupQuote';-import { botGroupAttachmentSignature, toBotGroupAttachmentInputs } from './botGroupAttachments';+import { botGroupAttachmentSignature } from './botGroupAttachments';import {filterBotGroupMentionCandidates,findBotGroupMentionQuery,@@@ -120,7 -124,9 +127,9 @@@ export function BotGroupComposer(attachments: attachmentState,attachmentScope,dragOver = false,+ quote = null,+ onQuoteChange,- onSent,+ onSending,}: {groupId: string;members: readonly BotGroupMemberView[];@@@ -132,8 -138,11 +141,11 @@@attachmentScope: string;/** Files are being dragged over the page: the card shows the same drop hint as a task's. */dragOver?: boolean;+ /** 引用回复 waiting to go with the next message, and how its original reads right now. */+ quote?: { view: BotGroupQuoteView; display: BotGroupQuoteDisplay } | null;+ onQuoteChange?: (quote: BotGroupQuoteView | null) => void;- /** Called after main accepted the message, so the view can re-read at once. */- onSent: () => void;+ /** Called when a message enters the outbox, so the view can follow it to the bottom. */+ onSending: () => void;}) {const { t } = useTranslation();const listboxId = useId();@@@ -163,13 -174,22 +175,16 @@@const selectionRef = useRef({ start: 0, end: 0 });const attachmentsRef = useRef(attachmentState.attachments);attachmentsRef.current = attachmentState.attachments;+ const quoteRef = useRef(quote?.view ?? null);+ quoteRef.current = quote?.view ?? null;+ const quotedMessageId = quote?.view.messageId ?? null;const focusInputOnMenuCloseRef = useRef(false);const pendingCaretRef = useRef<number | null>(null);- const sendingRef = useRef(false);const stoppingRef = useRef(false);- /** Idempotency key for the text, targets and attachments currently being (re)sent. */- const attemptRef = useRef<{- text: string;- clientId: string;- division: boolean;- attachments: string;- mentionSignature: string;- quoteId: string | null;- } | null>(null);+ const divisionRef = useRef(division);+ divisionRef.current = division;+ /** The failed send last put back into the input: an unchanged resend reuses its clientId. */+ const attemptRef = useRef<{ clientId: string; signature: string } | null>(null);const activeMembers = useMemo(() => members.filter(isActiveBotGroupMember), [members]);const allLabel = t('bots.groupChat.mention.all');@@@ -234,38 -259,10 +254,45 @@@textareaRef.current?.focus();};- const send = async () => {- if (!canSend || sendingRef.current) return;- const api = botGroupApi();- if (!api) {+ // A message that did not go out comes back only into an empty input: never over new+ // text, a new tag or files added meanwhile. Pressing send again reuses its clientId.+ // Registered once per group (mount / group change): re-registering on every render would+ // pull a failed message back in the moment the user clears the input.+ const restoreAttachmentsRef = useRef(attachmentState.restoreFiles);+ restoreAttachmentsRef.current = attachmentState.restoreFiles;+ const tRef = useRef(t);+ tRef.current = t;++ const onQuoteChangeRef = useRef(onQuoteChange);++ onQuoteChangeRef.current = onQuoteChange;+ useEffect(+ () =>+ registerBotGroupComposer(groupId, {+ restore: (entry) => {+ if (textRef.current || attachmentsRef.current.length > 0 || divisionRef.current) return false;+ attemptRef.current = { clientId: entry.input.clientId, signature: entry.signature };+ textRef.current = entry.draft;+ setText(entry.draft);+ setTracked([...entry.tracked]);+ const restoredDivision = entry.input.division === true;+ divisionRef.current = restoredDivision;+ if (restoredDivision) setDivision(true);++ // A quote picked meanwhile wins.++ if (entry.quote && !quoteRef.current) {++ quoteRef.current = entry.quote;++ onQuoteChangeRef.current?.(entry.quote);++ }+ if (entry.files.length > 0) attachmentsRef.current = restoreAttachmentsRef.current(entry.files);+ return true;+ },+ notifyFailed: (errorKey) => toast.error(tRef.current(errorKey)),+ }),+ [groupId],+ );++ const send = () => {+ // A second Enter before the cleared input has rendered must not send the same draft twice.+ if (!canSend || textRef.current !== text || attachmentsRef.current !== attachmentState.attachments) return;+ if (!botGroupApi()) {toast.error(t('bots.groupChat.composer.sendFailed'));return;}@@@ -275,28 -275,88 +302,47 @@@allLabels: [allLabel],tracked,});- const mentionSignature = JSON.stringify([mentions.all, mentions.botIds]);+ // Every field main gets is part of the attempt's identity (the tag changes what main does- // with the text), and so are the attachments that go with it.- const fields = { groupId, text: trimmed, mentions, ...(division ? { division: true } : {}) };++ // with the text, the quote is part of the message), and so are the attachments that go with it.+ const sentQuote = quoteRef.current;- const quoteId = sentQuote?.messageId ?? null;- const attempt =- attemptRef.current?.text === trimmed &&- attemptRef.current.division === division &&- attemptRef.current.attachments === signature &&- attemptRef.current.mentionSignature === mentionSignature &&- attemptRef.current.quoteId === quoteId- ? attemptRef.current- : { text: trimmed, clientId: crypto.randomUUID(), division, attachments: signature, mentionSignature, quoteId };- attemptRef.current = attempt;- const draft = text;- sendingRef.current = true;- setSending(true);- // Clear at once like any chat; a failed send puts the draft back if the- // user has not started typing something else meanwhile. Attachments stay in- // the tray until main has them.++ const fields = {++ groupId,++ text: trimmed,++ mentions,++ ...(division ? { division: true } : {}),++ ...(sentQuote ? { quote: { messageId: sentQuote.messageId } } : {}),++ };+ const signature = botGroupSendSignature({ ...fields, clientId: '' }, botGroupAttachmentSignature(files));+ const clientId = attemptRef.current?.signature === signature ? attemptRef.current.clientId : crypto.randomUUID();+ // The outbox owns this attempt now; a failure hands it back through `restore`.+ attemptRef.current = null;- enqueueBotGroupSend({ input: { ...fields, clientId }, signature, draft: text, tracked, files, attachmentScope });++ enqueueBotGroupSend({++ input: { ...fields, clientId },++ signature,++ draft: text,++ tracked,++ quote: sentQuote,++ files,++ attachmentScope,++ });+ // Clear at once like any chat, so the next message can be written while this one+ // goes out. The batch leaves the tray without deleting its files: the message has them.+ textRef.current = '';setText('');setCaret(0);setTracked([]);setDismissedStart(null);setDivision(false);- if (sentQuote) onQuoteChange?.(null);- const owner = getDataOwnerGeneration();- const restore = (keepQuote = true) => {- // The tag and the quote come back only with their own draft, never onto newly typed- // text; a quote picked meanwhile wins, and an unavailable original is not put back.- if (!textRef.current) {- if (attempt.division) setDivision(true);- setTracked(tracked);- if (keepQuote && sentQuote && !quoteRef.current) onQuoteChange?.(sentQuote);- }- setText((current) => (current ? current : draft));- };- try {- // Drawn annotations are burned in first, as in a task; a failure keeps everything for a retry.- const prepared =- files.length > 0- ? ((await materializeAnnotatedAttachmentsForSend(files, attachmentScope, { burnFailure: 'abort' })) ?? [])- : [];- const result = await api.sendBotGroupMessage({- groupId,- text: attempt.text,- mentions,- clientId: attempt.clientId,- ...(attempt.division ? { division: true } : {}),- ...(sentQuote ? { quote: { messageId: sentQuote.messageId } } : {}),- ...(prepared.length > 0 ? { attachments: toBotGroupAttachmentInputs(prepared) } : {}),- });- if (!isDataOwnerGenerationCurrent(owner)) return;- if (!result.ok) {- restore(result.errorCode !== 'QUOTE_UNAVAILABLE');- toast.error(- t(- result.errorCode === 'INVALID_PARAMS' && prepared.length > 0- ? 'bots.groupChat.composer.attachmentsFailed'- : botGroupErrorKey(result.errorCode, 'bots.groupChat.composer.sendFailed'),- ),- );- return;- }- attemptRef.current = null;- if (files.length > 0) {- // Main now holds these files; take only this batch out of the tray (never delete- // them) and keep anything added while the message was on its way.- const sentIds = new Set(files.map((file) => file.id));- const remaining = attachmentsRef.current.filter((file) => !sentIds.has(file.id));- attachmentState.clearFiles();- attachmentState.restoreFiles(remaining);- }- onSent();- } catch (error) {- if (!isDataOwnerGenerationCurrent(owner)) return;- restore();- toast.error(- t(isAnnotationBurnInError(error) ? 'chat.media.annotateBurnFailedNotSent' : 'bots.groupChat.composer.sendFailed'),- );- } finally {- sendingRef.current = false;- setSending(false);+ divisionRef.current = false;++ if (sentQuote) {++ quoteRef.current = null;++ onQuoteChange?.(null);++ }+ if (files.length > 0) {+ attachmentState.clearFiles();+ attachmentsRef.current = [];}+ onSending();};/** Files copied in a file manager attach by path; a screenshot or copied image attaches as an image. */@@@ -514,9 -585,15 +569,15 @@@return;}}+ // Esc takes the quote off before anything else it would close; the text stays.+ if (event.key === 'Escape' && quote && onQuoteChange) {+ event.preventDefault();+ onQuoteChange(null);+ return;+ }if (event.key === 'Enter' && !event.shiftKey) {event.preventDefault();- void send();+ send();return;}// Backspace at the very start of an empty input takes the 「分工」 tag off.diff --cc apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsxindex 000f096d1e,d1a192e7ef..066493db79--- a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsx+++ b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsx@@@ -1186,278 -1186,328 +1188,612 @@@ describe('BotGroupChatView', () =>expect(await screen.findByText('bots.groupChat.unavailableTitle')).toBeTruthy();});+ describe('乐观显示', () => {+ /** A send main has not answered yet; the test decides when and how. */+ function pendingSend() {+ let resolve!: (result: unknown) => void;+ const promise = new Promise((res) => {+ resolve = res;+ });+ mocks.sendBotGroupMessage.mockImplementationOnce(() => promise);+ return { resolve: (result: unknown) => act(async () => { resolve(result); await promise; }) };+ }+ const outboxItems = () => screen.queryAllByTestId('bot-group-outbox');+ const withSelf = (id: string, sequence: number, content: string) =>+ detail({ messages: [...detail().messages, msg({ id, sequence, content })] });+ const pushMessages = (groupId = 'g1') =>+ act(() => mocks.pushes.forEach((push) => push({ groupId, change: 'messages' })));++ it('shows the message as soon as it is sent and swaps in the real one without a duplicate', async () => {+ const send = pendingSend();+ renderView();+ const input = (await screen.findByRole('textbox')) as HTMLTextAreaElement;+ fireEvent.change(input, { target: { value: '@咪咪 慢一点', selectionStart: 7 } });+ fireEvent.keyDown(input, { key: 'Enter' });++ expect(input.value).toBe('');+ expect(outboxItems()).toHaveLength(1);+ expect(outboxItems()[0]!.textContent).toContain('慢一点');+ // The mention keeps its chip in the pending bubble too.+ expect(within(outboxItems()[0]!).getByText('@咪咪')).toBeTruthy();+ expect(within(outboxItems()[0]!).queryByRole('status')).toBeNull();+ expect(await screen.findByText('bots.groupChat.outbox.sending', {}, { timeout: 2000 })).toBeTruthy();+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(1));++ mocks.getBotGroup.mockResolvedValue({ ok: true, group: withSelf('u2', 5, '@咪咪 慢一点') });+ await send.resolve({ ok: true, messageId: 'u2' });+ pushMessages();+ await waitFor(() => expect(outboxItems()).toHaveLength(0));+ expect(screen.getAllByText('慢一点')).toHaveLength(1);+ expect(screen.queryByText('bots.groupChat.outbox.sending')).toBeNull();+ });++ it('does not show the message twice when a push re-read lands before the receipt', async () => {+ const send = pendingSend();+ renderView();+ const input = (await screen.findByRole('textbox')) as HTMLTextAreaElement;+ fireEvent.change(input, { target: { value: '早到的推送' } });+ fireEvent.keyDown(input, { key: 'Enter' });+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(1));++ mocks.getBotGroup.mockResolvedValue({ ok: true, group: withSelf('u2', 5, '早到的推送') });+ pushMessages();+ await waitFor(() => expect(mocks.getBotGroup).toHaveBeenCalledTimes(2));+ await waitFor(() => expect(outboxItems()).toHaveLength(0));+ expect(screen.getAllByText('早到的推送')).toHaveLength(1);++ await send.resolve({ ok: true, messageId: 'u2' });+ pushMessages();+ await waitFor(() => expect(mocks.getBotGroup).toHaveBeenCalledTimes(3));+ expect(screen.getAllByText('早到的推送')).toHaveLength(1);+ expect(outboxItems()).toHaveLength(0);+ });++ it('takes the next message while the first is still out, and sends them in order', async () => {+ const first = pendingSend();+ renderView();+ const input = (await screen.findByRole('textbox')) as HTMLTextAreaElement;+ fireEvent.change(input, { target: { value: '同一句' } });+ fireEvent.keyDown(input, { key: 'Enter' });+ fireEvent.change(input, { target: { value: '同一句' } });+ fireEvent.keyDown(input, { key: 'Enter' });++ expect(outboxItems().map((item) => item.textContent)).toEqual(['同一句', '同一句']);+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(1));+ mocks.sendBotGroupMessage.mockResolvedValueOnce({ ok: true, messageId: 'u3' });+ await first.resolve({ ok: true, messageId: 'u2' });+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(2));+ const [firstSend, secondSend] = mocks.sendBotGroupMessage.mock.calls.map(([call]) => call as Record<string, unknown>);+ // Same text, two messages: each keeps its own identity.+ expect(firstSend!.clientId).not.toBe(secondSend!.clientId);++ mocks.getBotGroup.mockResolvedValue({+ ok: true,+ group: detail({ messages: [...detail().messages, msg({ id: 'u2', sequence: 5, content: '同一句' }), msg({ id: 'u3', sequence: 6, content: '同一句' })] }),+ });+ pushMessages();+ await waitFor(() => expect(outboxItems()).toHaveLength(0));+ expect(screen.getAllByText('同一句')).toHaveLength(2);+ });++ it('keeps a failed message in place while new text is in the input; 重试 reuses its clientId and 编辑 waits for an empty input', async () => {+ const send = pendingSend();+ renderView();+ const input = (await screen.findByRole('textbox')) as HTMLTextAreaElement;+ fireEvent.change(input, { target: { value: '第一条' } });+ fireEvent.keyDown(input, { key: 'Enter' });+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(1));+ fireEvent.change(input, { target: { value: '正在写的' } });+ await send.resolve({ ok: false, errorCode: 'INTERNAL', message: '' });++ expect(mocks.toastError).toHaveBeenCalledWith('bots.groupChat.composer.sendFailed');+ expect(input.value).toBe('正在写的');+ const failed = await screen.findByTestId('bot-group-outbox');+ expect(failed.getAttribute('data-status')).toBe('failed');+ expect(within(failed).getByText('bots.groupChat.outbox.failed')).toBeTruthy();+ // Nothing goes out again on its own.+ expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(1);++ fireEvent.click(within(failed).getByRole('button', { name: 'bots.groupChat.outbox.edit' }));+ expect(mocks.toastWarning).toHaveBeenCalledWith('bots.groupChat.outbox.editBlocked');+ expect(input.value).toBe('正在写的');++ mocks.sendBotGroupMessage.mockResolvedValueOnce({ ok: false, errorCode: 'INTERNAL', message: '' });+ fireEvent.click(within(failed).getByRole('button', { name: /bots\.retry/ }));+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(2));+ const [firstAttempt, retry] = mocks.sendBotGroupMessage.mock.calls.map(([call]) => call as Record<string, unknown>);+ expect(retry!.clientId).toBe(firstAttempt!.clientId);+ await waitFor(() => expect(screen.getByTestId('bot-group-outbox').getAttribute('data-status')).toBe('failed'));++ fireEvent.change(input, { target: { value: '' } });+ fireEvent.click(screen.getByRole('button', { name: 'bots.groupChat.outbox.edit' }));+ expect(input.value).toBe('第一条');+ expect(outboxItems()).toHaveLength(0);+ mocks.sendBotGroupMessage.mockResolvedValueOnce({ ok: true, messageId: 'u2' });+ fireEvent.keyDown(input, { key: 'Enter' });+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(3));+ expect(lastSend().clientId).toBe(firstAttempt!.clientId);+ });++ it('keeps the local image on screen while the server copy of a confirmed message is still loading', async () => {+ const send = pendingSend();+ renderView();+ await screen.findByRole('textbox');+ pickFiles([diskFile('photo.png', 'image/png')]);+ await screen.findByAltText('photo.png');+ fireEvent.click(screen.getByRole('button', { name: 'bots.send' }));+ // Out of the tray and into the pending bubble at once.+ expect(within(outboxItems()[0]!).getByAltText('photo.png')).toBeTruthy();+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(1));++ const image = { id: 's1', name: 'photo.png', category: 'image' as const, mimeType: 'image/png', size: 7 };+ mocks.getBotGroup.mockResolvedValue({+ ok: true,+ group: detail({ messages: [...detail().messages, msg({ id: 'u2', sequence: 5, attachments: [{ ...image, url: null, path: null }] })] }),+ });+ await send.resolve({ ok: true, messageId: 'u2' });+ pushMessages();+ await waitFor(() => expect(outboxItems()).toHaveLength(0));+ expect(screen.getAllByAltText('photo.png')).toHaveLength(1);+ expect(screen.getByAltText('photo.png').getAttribute('src')).toContain('photo.png');++ mocks.getBotGroup.mockResolvedValue({+ ok: true,+ group: detail({ messages: [...detail().messages, msg({ id: 'u2', sequence: 5, attachments: [{ ...image, url: 'cindy-media://blobs/server.png', path: null }] })] }),+ });+ pushMessages();+ await waitFor(() => expect(screen.getByAltText('photo.png').getAttribute('src')).toContain('server.png'));+ expect(screen.getAllByAltText('photo.png')).toHaveLength(1);+ });++ it('puts a message that failed while the group was closed back into its empty composer on return', async () => {+ const send = pendingSend();+ const view = renderView();+ const tree = () => (+ <Tooltip.Provider>+ <FeatureSidebarSlotProvider isCollapsed={false}>+ <HeaderSlot />+ <BotGroupChatView />+ </FeatureSidebarSlotProvider>+ </Tooltip.Provider>+ );+ const input = (await screen.findByRole('textbox')) as HTMLTextAreaElement;+ fireEvent.change(input, { target: { value: '离开时失败的' } });+ fireEvent.keyDown(input, { key: 'Enter' });+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(1));+ mocks.groupId = 'g2';+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: detail({ id: 'g2', name: '另一个群' }) });+ view.rerender(tree());+ await screen.findByText('另一个群');+ await send.resolve({ ok: false, errorCode: 'INTERNAL', message: '' });+ // Nothing of g1 shows here, and g2's composer is not touched.+ expect(outboxItems()).toHaveLength(0);+ expect((screen.getByRole('textbox') as HTMLTextAreaElement).value).toBe('');++ mocks.groupId = 'g1';+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: detail() });+ view.rerender(tree());+ await screen.findByText('周六 8:10 有票');+ await waitFor(() => expect((screen.getByRole('textbox') as HTMLTextAreaElement).value).toBe('离开时失败的'));+ expect(outboxItems()).toHaveLength(0);+ expect(mocks.toastError).toHaveBeenCalledWith('bots.groupChat.composer.sendFailed');+ // Sending it again is the same attempt.+ mocks.sendBotGroupMessage.mockResolvedValueOnce({ ok: true, messageId: 'u2' });+ fireEvent.keyDown(screen.getByRole('textbox'), { key: 'Enter' });+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(2));+ expect(mocks.sendBotGroupMessage.mock.calls[1]![0].clientId).toBe(mocks.sendBotGroupMessage.mock.calls[0]![0].clientId);+ });++ it('settles the local preview of a message pushed off the latest page once an older page shows it', async () => {+ const send = pendingSend();+ renderView();+ await screen.findByRole('textbox');+ pickFiles([diskFile('photo.png', 'image/png')]);+ await screen.findByAltText('photo.png');+ fireEvent.click(screen.getByRole('button', { name: 'bots.send' }));+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(1));+ // The receipt comes back; the next read's latest page no longer holds the message.+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: detail({ hasMoreBefore: true }) });+ await send.resolve({ ok: true, messageId: 'u-old' });+ pushMessages();+ await waitFor(() => expect(getBotGroupOutbox('g1')).toEqual([]));+ expect(getBotGroupOutboxPreviews('g1').size).toBe(1);++ const image = { id: 's1', name: 'photo.png', category: 'image' as const, mimeType: 'image/png', size: 7, url: 'cindy-media://blobs/server.png', path: null };+ mocks.getBotGroup.mockResolvedValueOnce({+ ok: true,+ group: detail({ messages: [msg({ id: 'u-old', sequence: 0, attachments: [image] })], hasMoreBefore: false }),+ });+ fireEvent.click(await screen.findByRole('button', { name: 'bots.groupChat.timeline.loadEarlier' }));+ await waitFor(() => expect(getBotGroupOutboxPreviews('g1').size).toBe(0));+ });++ it('drops the outbox of a group that reads as gone', async () => {+ renderView();+ const input = (await screen.findByRole('textbox')) as HTMLTextAreaElement;+ mocks.sendBotGroupMessage.mockResolvedValueOnce({ ok: false, errorCode: 'INTERNAL', message: '' });+ fireEvent.change(input, { target: { value: '没发出去' } });+ fireEvent.keyDown(input, { key: 'Enter' });+ fireEvent.change(input, { target: { value: '正在写' } });+ await waitFor(() => expect(getBotGroupOutbox('g1').map((entry) => entry.status)).toEqual(['failed']));+ mocks.getBotGroup.mockResolvedValue({ ok: false, errorCode: 'NOT_FOUND', message: '' });+ pushMessages();+ expect(await screen.findByText('bots.groupChat.unavailableTitle')).toBeTruthy();+ expect(getBotGroupOutbox('g1')).toEqual([]);+ });++ it('keeps a late receipt out of the next group and shows the message when coming back', async () => {+ const send = pendingSend();+ const view = renderView();+ const input = (await screen.findByRole('textbox')) as HTMLTextAreaElement;+ fireEvent.change(input, { target: { value: '离开前发的' } });+ fireEvent.keyDown(input, { key: 'Enter' });+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledTimes(1));++ mocks.groupId = 'g2';+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: detail({ id: 'g2', name: '另一个群' }) });+ view.rerender(+ <Tooltip.Provider>+ <FeatureSidebarSlotProvider isCollapsed={false}>+ <HeaderSlot />+ <BotGroupChatView />+ </FeatureSidebarSlotProvider>+ </Tooltip.Provider>,+ );+ await screen.findByText('另一个群');+ await send.resolve({ ok: true, messageId: 'u2' });+ expect(outboxItems()).toHaveLength(0);+ expect(screen.queryByText('离开前发的')).toBeNull();++ mocks.groupId = 'g1';+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: withSelf('u2', 5, '离开前发的') });+ view.rerender(+ <Tooltip.Provider>+ <FeatureSidebarSlotProvider isCollapsed={false}>+ <HeaderSlot />+ <BotGroupChatView />+ </FeatureSidebarSlotProvider>+ </Tooltip.Provider>,+ );+ await waitFor(() => expect(screen.getAllByText('离开前发的')).toHaveLength(1));+ expect(outboxItems()).toHaveLength(0);+ });+ });++ describe('引用回复', () => {+ const quoteOf = (messageId: string, overrides: Partial<NonNullable<BotGroupMessageView['quote']>> = {}) => ({+ messageId, authorName: '小满', authorKind: 'bot' as const, excerpt: '周六 8:10 有票', attachmentCount: 0, attachmentName: null, sequence: 2, ...overrides,+ });+ const quoteButton = async (id = 'b1') => {+ await screen.findByText('周六 8:10 有票');+ const row = document.querySelector(`[data-bot-group-message-id="${id}"]`) as HTMLElement;+ return within(row).getByRole('button', { name: 'bots.groupChat.server.quoteReply' });+ };+ beforeEach(() => {+ vi.stubGlobal('ResizeObserver', class { observe() {} disconnect() {} });+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: detail({ serverBacked: true }) });+ });+ afterEach(() => { vi.unstubAllGlobals(); });++ it('quotes into the composer without opening a 话题, and removing it keeps the text', async () => {+ const user = userEvent.setup();+ renderView();+ await user.click(await quoteButton());+ const preview = screen.getByTestId('bot-group-quote-preview');+ expect(preview.textContent).toContain('bots.groupChat.quote.replyingTo:小满');+ expect(preview.textContent).toContain('周六 8:10 有票');+ expect(screen.queryByRole('complementary')).toBeNull();+ const composer = screen.getByRole('textbox', { name: 'bots.groupChat.composer.label' });+ expect(document.activeElement).toBe(composer);+ await user.type(composer, '那就这班');+ await user.click(within(preview).getByRole('button', { name: 'bots.groupChat.quote.remove' }));+ expect(screen.queryByTestId('bot-group-quote-preview')).toBeNull();+ expect((composer as HTMLTextAreaElement).value).toBe('那就这班');+ expect(document.activeElement).toBe(composer);+ });++ it('Esc takes the quote off before anything else and keeps the draft', async () => {+ const user = userEvent.setup();+ renderView();+ await user.click(await quoteButton());+ await user.keyboard('草稿{Escape}');+ expect(screen.queryByTestId('bot-group-quote-preview')).toBeNull();+ expect((screen.getByRole('textbox', { name: 'bots.groupChat.composer.label' }) as HTMLTextAreaElement).value).toBe('草稿');+ });++ it('sends only the quoted id in the current timeline, with a new idempotency key per quote', async () => {+ const user = userEvent.setup();+ mocks.sendBotGroupMessage.mockResolvedValueOnce({ ok: false, errorCode: 'SERVICE_ERROR' }).mockResolvedValue({ ok: true, messageId: 'u2' });+ renderView();+ await user.click(await quoteButton());+ await user.keyboard('就这班{Enter}');+ expect(lastSend()).toMatchObject({ groupId: 'g1', text: '就这班', quote: { messageId: 'b1' }, mentions: { all: false, botIds: [] } });+ // A failed send puts the quote back with the text; the retry reuses the attempt.+ await waitFor(() => expect(screen.getByTestId('bot-group-quote-preview')).toBeTruthy());+ const failedId = lastSend().clientId;+ await user.keyboard('{Enter}');+ expect(lastSend()).toMatchObject({ clientId: failedId, quote: { messageId: 'b1' } });+ await waitFor(() => expect(screen.queryByTestId('bot-group-quote-preview')).toBeNull());+ // The same words quoting another message are a different send.+ await user.click(await quoteButton('u1'));+ await user.keyboard('就这班{Enter}');+ expect(lastSend()).toMatchObject({ quote: { messageId: 'u1' } });+ expect(lastSend().clientId).not.toBe(failedId);+ });++ it('never attaches a failed send\'s quote to text typed while it was on its way', async () => {+ const user = userEvent.setup();+ let fail!: () => void;+ mocks.sendBotGroupMessage.mockImplementation(() => new Promise((resolve) => {+ fail = () => resolve({ ok: false, errorCode: 'SERVICE_ERROR' });+ }));+ renderView();+ await user.click(await quoteButton());+ await user.keyboard('就这班{Enter}');+ await waitFor(() => expect(mocks.sendBotGroupMessage).toHaveBeenCalledOnce());+ const composer = screen.getByRole('textbox', { name: 'bots.groupChat.composer.label' }) as HTMLTextAreaElement;+ await user.type(composer, '另一件事');+ await act(async () => fail());+ expect(composer.value).toBe('另一件事');+ expect(screen.queryByTestId('bot-group-quote-preview')).toBeNull();+ });+++ it('shows the quote on the message while it is still on its way', async () => {++ const user = userEvent.setup();++ mocks.sendBotGroupMessage.mockImplementation(() => new Promise(() => undefined));++ renderView();++ await user.click(await quoteButton());++ await user.keyboard('就这班{Enter}');++ const pending = await screen.findByTestId('bot-group-outbox');++ expect(within(pending).getByTestId('bot-group-quote').textContent).toContain('周六 8:10 有票');++ expect(pending.textContent).toContain('就这班');++ expect(screen.queryByTestId('bot-group-quote-preview')).toBeNull();++ });+++ it('puts the text back without an unavailable quote', async () => {+ const user = userEvent.setup();+ mocks.sendBotGroupMessage.mockResolvedValue({ ok: false, errorCode: 'QUOTE_UNAVAILABLE' });+ renderView();+ await user.click(await quoteButton());+ await user.keyboard('就这班{Enter}');+ await waitFor(() => expect(mocks.toastError).toHaveBeenCalledWith('bots.groupChat.errors.quoteUnavailable'));+ expect((screen.getByRole('textbox', { name: 'bots.groupChat.composer.label' }) as HTMLTextAreaElement).value).toBe('就这班');+ expect(screen.queryByTestId('bot-group-quote-preview')).toBeNull();+ });++ it('offers no 引用回复 on a local group, a notice or a round divider', async () => {+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: detail() });+ renderView();+ await screen.findByText('周六 8:10 有票');+ expect(screen.queryAllByRole('button', { name: 'bots.groupChat.server.quoteReply' })).toHaveLength(0);+ cleanup();+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: detail({ serverBacked: true }) });+ renderView();+ await screen.findByText('周六 8:10 有票');+ // Only the two chat messages; the notice and the divider have no toolbar.+ expect(screen.getAllByRole('button', { name: 'bots.groupChat.server.quoteReply' })).toHaveLength(2);+ });++ it('jumps to and highlights a loaded original', async () => {+ const user = userEvent.setup();+ const base = detail({ serverBacked: true });+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: { ...base, messages: [...base.messages,+ msg({ id: 'q1', sequence: 5, content: '那就这班', quote: quoteOf('b1', { excerpt: 'snapshot text' }) })] } });+ renderView();+ const block = await screen.findByRole('button', { name: 'bots.groupChat.quote.jumpLabel:小满' });+ // The loaded original wins over the stored snapshot.+ expect(block.textContent).toContain('周六 8:10 有票');+ expect(block.textContent).not.toContain('snapshot text');+ await user.click(block);+ const target = document.querySelector('[data-bot-group-message-id="b1"]') as HTMLElement;+ await waitFor(() => expect(target.className).toContain('search-match-bg'));+ expect(document.activeElement).toBe(target);+ expect(screen.queryByRole('complementary')).toBeNull();+ });++ it('shows a deleted original without its snapshot and never jumps', async () => {+ const base = detail({ serverBacked: true });+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: { ...base, messages: [+ msg({ id: 'b1', sequence: 2, authorKind: 'bot', authorBotId: 'xiaoman', authorName: '小满', deleted: true, content: '(消息已删除)' }),+ msg({ id: 'q1', sequence: 5, content: '那就这班', quote: quoteOf('b1', { excerpt: '私密的原文' }) })] } });+ renderView();+ const block = await screen.findByTestId('bot-group-quote');+ expect(block.getAttribute('data-quote-state')).toBe('deleted');+ expect(block.tagName).toBe('DIV');+ expect(block.textContent).toContain('bots.groupChat.quote.deleted');+ expect(document.body.textContent).not.toContain('私密的原文');+ });++ it('pages back to an original that is not loaded yet', async () => {+ const user = userEvent.setup();+ const base = detail({ serverBacked: true, hasMoreBefore: true });+ mocks.getBotGroup.mockImplementation(async (_id: string, options?: { beforeSequence?: number }) => options?.beforeSequence+ ? { ok: true, group: { ...base, hasMoreBefore: false, messages: [msg({ id: 'old1', sequence: 1, authorKind: 'bot', authorBotId: 'xiaoman', authorName: '小满', content: '很早的原文' })] } }+ : { ok: true, group: { ...base, messages: [msg({ id: 'q1', sequence: 50, content: '那就这班', quote: quoteOf('old1', { excerpt: '很早的原文', sequence: 1 }) })] } });+ renderView();+ await user.click(await screen.findByRole('button', { name: 'bots.groupChat.quote.jumpLabel:小满' }));+ await waitFor(() => expect((document.querySelector('[data-bot-group-message-id="old1"]') as HTMLElement | null)?.className).toContain('search-match-bg'));+ expect(mocks.getBotGroup).toHaveBeenCalledWith('g1', expect.objectContaining({ beforeSequence: 50 }));+ });++ it('re-reads an original on an older page before jumping, and stops when it was deleted meanwhile', async () => {+ const user = userEvent.setup();+ const base = detail({ serverBacked: true, hasMoreBefore: true });+ const original = msg({ id: 'old1', sequence: 1, authorKind: 'bot', authorBotId: 'xiaoman', authorName: '小满', content: '很早的原文' });+ let deleted = false;+ mocks.getBotGroup.mockImplementation(async (_id: string, options?: { beforeSequence?: number }) => options?.beforeSequence+ ? { ok: true, group: { ...base, hasMoreBefore: false, messages: [deleted ? { ...original, deleted: true, content: '(消息已删除)' } : original] } }+ : { ok: true, group: { ...base, messages: [msg({ id: 'q1', sequence: 50, content: '那就这班', quote: quoteOf('old1', { excerpt: '很早的原文', sequence: 1 }) })] } });+ renderView();+ await user.click(await screen.findByRole('button', { name: 'bots.groupChat.quote.jumpLabel:小满' }));+ await waitFor(() => expect((document.querySelector('[data-bot-group-message-id="old1"]') as HTMLElement | null)?.className).toContain('search-match-bg'));+ // Deleted on another client after it was paged in: the push re-read leaves older pages as they were.+ deleted = true;+ await user.click(screen.getByRole('button', { name: 'bots.groupChat.quote.jumpLabel:小满' }));+ await waitFor(() => expect(mocks.toastInfo).toHaveBeenCalledWith('bots.groupChat.quote.deleted'));+ expect(mocks.getBotGroup).toHaveBeenLastCalledWith('g1', expect.objectContaining({ beforeSequence: 2 }));+ expect(screen.getByTestId('bot-group-quote').getAttribute('data-quote-state')).toBe('deleted');+ expect(document.body.textContent).not.toContain('很早的原文');+ });++ describe('quoted originals on older pages after a push', () => {+ const original = msg({ id: 'old1', sequence: 1, authorKind: 'bot', authorBotId: 'xiaoman', authorName: '小满', content: '很早的原文' });+ const latest = msg({ id: 'q1', sequence: 50, content: '那就这班', quote: quoteOf('old1', { excerpt: '快照摘要', sequence: 1 }) });+ /** The server's current page for `beforeSequence`, and a way to run the page loader. */+ function serve(older: () => Promise<BotGroupMessageView[]>) {+ const base = detail({ serverBacked: true, hasMoreBefore: true });+ mocks.getBotGroup.mockImplementation(async (_id: string, options?: { beforeSequence?: number }) => options?.beforeSequence+ ? { ok: true, group: { ...base, hasMoreBefore: false, messages: await older() } }+ : { ok: true, group: { ...base, messages: [latest] } });+ }+ const quoteState = () => screen.getByTestId('bot-group-quote').getAttribute('data-quote-state');+ const push = () => act(async () => { mocks.pushes.forEach((listener) => listener({ groupId: 'g1', change: 'messages' })); });++ it('drops a deleted original from the quote on a push, without a click', async () => {+ const user = userEvent.setup();+ let server = [original];+ serve(async () => server);+ renderView();+ await user.click(await screen.findByRole('button', { name: 'bots.groupChat.timeline.loadEarlier' }));+ await waitFor(() => expect(screen.getByTestId('bot-group-quote').textContent).toContain('很早的原文'));+ expect(quoteState()).toBe('live');+ server = [{ ...original, deleted: true, content: '(消息已删除)' }];+ await push();+ await waitFor(() => expect(quoteState()).toBe('deleted'));+ expect(document.body.textContent).not.toContain('很早的原文');+ expect(mocks.getBotGroup).toHaveBeenLastCalledWith('g1', { beforeSequence: 2 });+ });++ it('follows an edited original on a push', async () => {+ const user = userEvent.setup();+ let server = [original];+ serve(async () => server);+ renderView();+ await user.click(await screen.findByRole('button', { name: 'bots.groupChat.timeline.loadEarlier' }));+ await waitFor(() => expect(screen.getByTestId('bot-group-quote').textContent).toContain('很早的原文'));+ server = [{ ...original, content: '改过的原文' }];+ await push();+ await waitFor(() => expect(screen.getByTestId('bot-group-quote').textContent).toContain('改过的原文'));+ expect(quoteState()).toBe('live');+ });++ it('falls back to the snapshot and never jumps when the original cannot be re-read', async () => {+ const user = userEvent.setup();+ let fail = false;+ serve(async () => { if (fail) throw new Error('offline'); return [original]; });+ renderView();+ await user.click(await screen.findByRole('button', { name: 'bots.groupChat.timeline.loadEarlier' }));+ await waitFor(() => expect(quoteState()).toBe('live'));+ fail = true;+ await push();+ await waitFor(() => expect(quoteState()).toBe('snapshot'));+ expect(screen.getByTestId('bot-group-quote').textContent).toContain('快照摘要');+ await user.click(screen.getByTestId('bot-group-quote'));+ await waitFor(() => expect(mocks.toastError).toHaveBeenCalledWith('bots.groupChat.timeline.loadEarlierFailed'));+ expect(document.querySelector('[class*="search-match-bg"]')).toBeNull();+ });++ it('re-checks every quoted original across all opened pages on a single push', async () => {+ const user = userEvent.setup();+ const originals = [400, 300, 200, 100].map((sequence, index) => msg({ id: `o${index}`, sequence, authorKind: 'bot',+ authorBotId: 'xiaoman', authorName: '小满', content: `原文${index}` }));+ const quotes = originals.map((original, index) => msg({ id: `q${index}`, sequence: 501 + index, content: `回复${index}`,+ quote: quoteOf(original.id, { excerpt: `快照${index}`, sequence: original.sequence }) }));+ let server = originals;+ const base = detail({ serverBacked: true, hasMoreBefore: true });+ // One message per page, so each original sits on its own opened page.+ mocks.getBotGroup.mockImplementation(async (_id: string, options?: { beforeSequence?: number }) => {+ if (!options?.beforeSequence) return { ok: true, group: { ...base, messages: quotes } };+ const page = server.filter((message) => message.sequence < options.beforeSequence!).slice(0, 1);+ return { ok: true, group: { ...base, hasMoreBefore: page[0]!.sequence > 100, messages: page } };+ });+ renderView();+ for (let page = 0; page < 4; page += 1) {+ await user.click(await screen.findByRole('button', { name: 'bots.groupChat.timeline.loadEarlier' }));+ await screen.findByText(`原文${page}`, { selector: '[data-markdown]' });+ }+ server = originals.map((original, index) => index % 2 === 0+ ? { ...original, deleted: true, content: '(消息已删除)' } : { ...original, content: `改过${index}` });+ mocks.getBotGroup.mockClear();+ await push();+ await waitFor(() => expect(screen.getAllByTestId('bot-group-quote').map((block) => block.getAttribute('data-quote-state')))+ .toEqual(['deleted', 'live', 'deleted', 'live']));+ const blocks = screen.getAllByTestId('bot-group-quote');+ expect(blocks[1]!.textContent).toContain('改过1');+ expect(blocks[3]!.textContent).toContain('改过3');+ expect(document.body.textContent).not.toMatch(/原文0|原文2/);+ // One read for the latest page, then one per original's page; nothing beyond what was opened.+ expect(mocks.getBotGroup.mock.calls.map(([, options]) => options?.beforeSequence).filter(Boolean)).toEqual([401, 301, 201, 101]);+ });++ it('shows a 话题 root\'s quote from the same verified messages', async () => {+ const user = userEvent.setup();+ let server = [original];+ serve(async () => server);+ mocks.thread.mockImplementation(async () => ({ ok: true, root: latest, replies: [], hasMore: false }));+ renderView();+ await user.click(await screen.findByRole('button', { name: 'bots.groupChat.timeline.loadEarlier' }));+ await waitFor(() => expect(quoteState()).toBe('live'));+ server = [{ ...original, deleted: true, content: '(消息已删除)' }];+ await push();+ await waitFor(() => expect(quoteState()).toBe('deleted'));+ const row = document.querySelector('[data-bot-group-message-id="q1"]') as HTMLElement;+ await user.click(within(row).getByRole('button', { name: 'bots.groupChat.server.startTopic' }));+ const panel = await screen.findByRole('complementary');+ await waitFor(() => expect(within(panel).getByTestId('bot-group-quote').getAttribute('data-quote-state')).toBe('deleted'));+ expect(panel.textContent).not.toContain('快照摘要');+ });++ it('lets a newer push win over an older re-read that answers late', async () => {+ const user = userEvent.setup();+ const pending: Array<(page: BotGroupMessageView[]) => void> = [];+ let paging = true;+ serve(() => paging ? Promise.resolve([original]) : new Promise((resolve) => pending.push(resolve)));+ renderView();+ await user.click(await screen.findByRole('button', { name: 'bots.groupChat.timeline.loadEarlier' }));+ await waitFor(() => expect(quoteState()).toBe('live'));+ paging = false;+ await push();+ await waitFor(() => expect(pending).toHaveLength(1));+ await push();+ await waitFor(() => expect(pending).toHaveLength(2));+ await act(async () => pending[1]!([{ ...original, deleted: true, content: '(消息已删除)' }]));+ await waitFor(() => expect(quoteState()).toBe('deleted'));+ // The superseded read arrives last with the pre-deletion copy; it must not bring the text back.+ await act(async () => pending[0]!([original]));+ expect(quoteState()).toBe('deleted');+ expect(document.body.textContent).not.toContain('很早的原文');+ });+ });++ it('says the original is out of reach instead of jumping elsewhere', async () => {+ const user = userEvent.setup();+ const base = detail({ serverBacked: true, hasMoreBefore: true });+ mocks.getBotGroup.mockImplementation(async (_id: string, options?: { beforeSequence?: number }) => options?.beforeSequence+ ? { ok: true, group: { ...base, hasMoreBefore: false, messages: [msg({ id: 'other', sequence: 3, content: '别的消息' })] } }+ : { ok: true, group: { ...base, messages: [msg({ id: 'q1', sequence: 50, content: '那就这班', quote: quoteOf('gone', { excerpt: '看不到的原文', sequence: 2 }) })] } });+ renderView();+ await user.click(await screen.findByRole('button', { name: 'bots.groupChat.quote.jumpLabel:小满' }));+ await waitFor(() => expect(mocks.toastInfo).toHaveBeenCalledWith('bots.groupChat.quote.unavailable'));+ expect(document.querySelector('[class*="search-match-bg"]')).toBeNull();+ });++ it('keeps a quote draft inside its own group', async () => {+ const user = userEvent.setup();+ let view = renderView();+ await user.click(await quoteButton());+ expect(screen.getByTestId('bot-group-quote-preview')).toBeTruthy();+ view.unmount();+ mocks.groupId = 'g2';+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: detail({ id: 'g2', serverBacked: true }) });+ view = renderView();+ await screen.findByText('周六 8:10 有票');+ expect(screen.queryByTestId('bot-group-quote-preview')).toBeNull();+ await user.keyboard('x');+ expect(screen.queryByTestId('bot-group-quote-preview')).toBeNull();+ });+ });+describe('分工', () => {it('shows the organizer’s plan card and starts or skips the open plan', async () => {mocks.getBotGroup.mockResolvedValue({ ok: true, group: withPlan(plan()) });diff --cc apps/desktop/src/renderer/features/bots/botGroupOutbox.tsindex 0d6677505d,0000000000..8b0ccd26bcmode 100644,000000..100644--- a/apps/desktop/src/renderer/features/bots/botGroupOutbox.ts+++ b/apps/desktop/src/renderer/features/bots/botGroupOutbox.ts@@@ -1,643 -1,0 +1,648 @@@+/**+ * 群聊发件箱:用户点发送后立即在时间线末尾显示自己的消息,不等 main / 服务器回执。+ *+ * 只是 renderer 内存里的展示状态,不持久化,也不替代 main 的幂等与服务器的权威时间线:+ * - 每条消息保存 composer 交来的完整发送输入(`BotGroupSendInput`,附件除外——附件在+ * 入队时就开始烧录标注,提交时序列化),提交与重试都原样发出,这里不挑字段;新增发送字段只需+ * composer 放进 `input`,显示、回执与重试自动带上。+ * - `input.clientId` 是身份,失败重试沿用同一个 clientId,main 与服务器据此去重,+ * 所以这里绝不自动重发。+ * - 同一个群的提交按发出顺序一条一条交给 main,保持用户看到的先后。+ * - 回执带回的 `messageId` 是替换依据:时间线读到这条消息就收起临时气泡;回执之后开始的+ * 一次重读即使没读到(被挤出最新一页),也说明它已进历史,同样收起。+ * - 推送重读可能先于回执到达。此时只对正在提交的那一条(同群同时最多一条)做显示上的+ * 去重:基线之后出现、未被任何回执认领、正文与附件数一致的自己的消息视为它,回执到达后+ * 仍以 messageId 为准。+ * - 附件:临时消息从输入的附件生成列表;带手绘标注的图片烧录完成后改用烧录后的本地预览+ * (同一份烧录结果也用于提交与重试,不重复烧录;放回输入框的仍是带笔迹的原件)。真实消息到了+ * 而服务器副本还没下载好(没有 url / path,或旧版干脆还没出现在列表里)时,按同一 messageId+ * 把本地预览接到真实消息上,直到副本可用(见 `mergeBotGroupLocalAttachments`)。+ * - 离开输入框的附件不再受草稿保护:发件箱条目持有的图片地址(含标注原图与烧录副本)登记进+ * 存储清理的保护清单,条目移除时同步撤下;已确认消息的本地预览不登记——发送时 main 已在群的+ * `bot-group-attachment` 引用下固定这些图片。尚未进入消息的暂存文件按归属回收:还没开始提交的条目+ * (排队中、已失败)归发件箱,群被删除(含不在当前页的群:列表里消失且读取确认已不存在)时+ * 立即回收;已开始提交的条目归它的那次请求,条目在烧录期间被丢弃就不再发出并回收,+ * 已交给 main 的等结果——成功(已进入消息)不碰,失败才回收。main 的发送在 IPC 返回前读完+ * 全部本地文件,失败时不留任何引用暂存路径的本地记录(服务端只引用已上传的副本)。+ * 切换账号时同样按此发出回收,但 main 只删当前账号暂存目录里的副本,而 renderer 看到切换时+ * main 已在新账号(或边界)下:前一账号的副本留在它自己的暂存目录,renderer 无法再删,+ * 不在发件箱范围内(main 的暂存副本按账号划界)。+ * - 失败时交还输入框(输入框空着才交还,见 `registerBotGroupComposer`),否则留在时间线上+ * 显示没发出去,可重试或编辑;失败时输入框不在(切群、分享模式),回来注册输入框时同样交还。+ * - 切换到另一个账号时整体清空,旧账号的迟到回执一律丢弃;同账号的 generation 修复、认证边界+ * 短暂发布的 null、退出后重新登录同一账号都不清空。群被删除时丢弃该群的条目。+ */+import { useCallback, useSyncExternalStore } from 'react';++import { getDataOwnerGeneration, isDataOwnerGenerationCurrent } from '@/contexts/dataOwnerGeneration';+import { isAnnotationBurnInError, materializeAnnotatedAttachmentsForSend } from '@/lib/annotationBurnIn';+import { cleanupStagedChatAttachmentFiles } from '@/lib/chatAttachmentStageCleanup';+import { setBotGroupOutboxAttachmentUrls } from '@/lib/composerDraftStore';+import type { AttachedFile } from '@/lib/fileTypes';+import type {+ BotGroupAttachment,+ BotGroupMessageView,++ BotGroupQuoteView,+ BotGroupSendInput,+ BotGroupSendResult,+} from '../../../shared/botGroupChat';+import { toBotGroupAttachmentInputs } from './botGroupAttachments';+import type { BotGroupTrackedMention } from './botGroupMentions';+import { botGroupErrorKey } from './botGroupPresentation';+import { botGroupApi, getBotGroupListSnapshot, subscribeBotGroups } from './botGroupStore';++export type BotGroupOutboxStatus = 'sending' | 'sent' | 'failed';++/** The send as main receives it; attachments are prepared from `files` (see `prepared`). */+export type BotGroupOutboxSendInput = Omit<BotGroupSendInput, 'attachments'>;++/** What the composer hands over when the user presses send. */+export interface BotGroupOutboxDraft {+ /** Sent unchanged on every (re)try; `groupId` and `clientId` identify the entry. */+ input: BotGroupOutboxSendInput;+ /** Same-attempt identity from `botGroupSendSignature`: a changed field means a new clientId. */+ signature: string;+ /** The composer text as typed, put back on failure. */+ draft: string;+ /** Composer-only state put back with the draft (which typed @ picked which teammate). */+ tracked: readonly BotGroupTrackedMention[];++ /** The 引用回复 picked for this message, put back with the draft; `input.quote` is what goes out. */++ quote?: BotGroupQuoteView | null;+ files: readonly AttachedFile[];+ /** Scope for burning drawn annotations into images (see botGroupAttachmentScope). */+ attachmentScope: string;+}++/**+ * Identity of one send attempt: every field of the input except the clientId, plus the+ * attachments. A failed send may reuse its clientId only while this is unchanged.+ */+export function botGroupSendSignature(input: BotGroupOutboxSendInput, attachmentSignature: string): string {+ return JSON.stringify([{ ...input, clientId: undefined }, attachmentSignature]);+}++export interface BotGroupOutboxEntry extends BotGroupOutboxDraft {+ status: BotGroupOutboxStatus;+ createdAt: number;+ /** The attachments as the timeline shows them (the burned-in copies once `prepared`). */+ attachments: readonly BotGroupAttachment[];+ /** `files` with drawn annotations burned in; reused by every (re)try. */+ prepared?: readonly AttachedFile[];+ /** From the receipt. */+ messageId?: string;+ /** Order of the receipt against timeline reads (see `beginBotGroupTimelineRead`). */+ receiptTick?: number;+ /** Highest timeline sequence known when this entry's request started; set only while in flight. */+ baseline?: number;+ /** i18n key explaining a failure. */+ errorKey?: string;+}++/** The mounted composer of a group: takes a failed message back into the input when it is empty. */+export interface BotGroupComposerHandle {+ restore: (entry: BotGroupOutboxEntry) => boolean;+ notifyFailed: (errorKey: string) => void;+}++interface GroupOutbox {+ entries: readonly BotGroupOutboxEntry[];+ chain: Promise<void>;+ /** Recent receipt ids: a re-read can never mistake them for the message still in flight. */+ claimed: string[];+ latestSequence: number;+ /** Local attachment previews of confirmed messages, by messageId, until the server copy is usable. */+ previews: ReadonlyMap<string, readonly BotGroupAttachment[]>;+}++const CLAIMED_LIMIT = 64;+const NO_PREVIEWS: ReadonlyMap<string, readonly BotGroupAttachment[]> = new Map();+const EMPTY: readonly BotGroupOutboxEntry[] = [];++/**+ * The account the outbox holds messages for: the last non-null data owner. Only a different+ * account replaces it — not a same-owner generation repair, not the null an auth boundary+ * publishes for a moment, not signing back in to the same account.+ */+let account = getDataOwnerGeneration().dataOwnerId;++function accountChanged(): boolean {+ const current = getDataOwnerGeneration().dataOwnerId;+ return current !== null && current !== account;+}+let generation = 0;+let tick = 0;+const groups = new Map<string, GroupOutbox>();+const composers = new Map<string, BotGroupComposerHandle>();+const listeners = new Set<() => void>();+/** One burn-in per message, shared by the bubble and its submission. */+const preparing = new Map<string, Promise<readonly AttachedFile[]>>();++/**+ * Media only this outbox still refers to; storage cleanup must not sweep it. Previews of+ * confirmed messages are not listed: the send pinned those images under the group's+ * `bot-group-attachment` reference in main.+ */+function protectHeldMedia(): void {+ const urls: string[] = [];+ const add = (file: { url?: string | null; annotationSourceUrl?: string }) => {+ if (file.url) urls.push(file.url);+ if (file.annotationSourceUrl) urls.push(file.annotationSourceUrl);+ };+ for (const group of groups.values()) {+ for (const entry of group.entries) {+ entry.files.forEach(add);+ entry.prepared?.forEach(add);+ }+ }+ setBotGroupOutboxAttachmentUrls(urls);+}++function emit(): void {+ protectHeldMedia();+ for (const listener of listeners) listener();+}++/** Staged copies only a message that never reached a message still points at. */+function releaseStaged(files: readonly AttachedFile[]): void {+ if (files.length > 0) cleanupStagedChatAttachmentFiles(files);+}++/** Entries whose `submit` has started: that request owns their files until it settles. */+const submitting = new Set<string>();+const entryKey = (groupId: string, clientId: string) => `${groupId}\n${clientId}`;++/** Drop entries the outbox still owns; a request in progress settles its own (see `submit`). */+function releaseUnsubmitted(groupId: string, entries: readonly BotGroupOutboxEntry[]): void {+ for (const entry of entries) {+ if (entry.status !== 'sent' && !submitting.has(entryKey(groupId, entry.input.clientId))) releaseStaged(entry.files);+ }+}++function ensureOwner(): void {+ if (!accountChanged()) return;+ const previous = account;+ account = getDataOwnerGeneration().dataOwnerId;+ // Nothing was held for another account yet: whatever is here was written for this one.+ if (previous === null) return;+ generation += 1;+ // The previous account's queued and failed sends go with it; one being submitted settles itself.+ for (const [groupId, group] of groups) releaseUnsubmitted(groupId, group.entries);+ groups.clear();+ preparing.clear();+ protectHeldMedia();+}++function groupOf(groupId: string): GroupOutbox {+ ensureOwner();+ watchGroupList();+ let group = groups.get(groupId);+ if (!group) {+ group = { entries: EMPTY, chain: Promise.resolve(), claimed: [], latestSequence: 0, previews: NO_PREVIEWS };+ groups.set(groupId, group);+ }+ return group;+}++function update(groupId: string, clientId: string, patch: Partial<BotGroupOutboxEntry>): BotGroupOutboxEntry | null {+ const group = groups.get(groupId);+ const index = group?.entries.findIndex((entry) => entry.input.clientId === clientId) ?? -1;+ if (!group || index < 0) return null;+ const next = { ...group.entries[index]!, ...patch };+ group.entries = group.entries.map((entry, at) => (at === index ? next : entry));+ emit();+ return next;+}++function remove(groupId: string, clientId: string): void {+ const group = groups.get(groupId);+ if (!group || !group.entries.some((entry) => entry.input.clientId === clientId)) return;+ group.entries = group.entries.filter((entry) => entry.input.clientId !== clientId);+ emit();+}++function displayAttachments(files: readonly AttachedFile[]): BotGroupAttachment[] {+ return toBotGroupAttachmentInputs(files).map((file) => ({+ id: file.id,+ name: file.name,+ category: file.category,+ mimeType: file.mimeType,+ size: file.size ?? 0,+ url: file.url ?? null,+ path: file.path || null,+ ...(file.annotated ? { annotated: true } : {}),+ }));+}++/** Show the message at once and queue it behind the group's earlier sends. */+export function enqueueBotGroupSend(draft: BotGroupOutboxDraft): void {+ const { groupId, clientId } = draft.input;+ const group = groupOf(groupId);+ const entry: BotGroupOutboxEntry = {+ ...draft,+ input: { ...draft.input },+ files: [...draft.files],+ tracked: [...draft.tracked],+ attachments: displayAttachments(draft.files),+ status: 'sending',+ createdAt: Date.now(),+ };+ group.entries = [...group.entries.filter((existing) => existing.input.clientId !== clientId), entry];+ emit();+ schedule(groupId, clientId);+ // Burn annotations in now, not when the message's turn comes: the bubble shows the result.+ if (entry.files.length > 0) void prepare(groupId, clientId).catch(() => undefined);+}++/** The message's files with annotations burned in, once; a failure is retried by the next call. */+function prepare(groupId: string, clientId: string): Promise<readonly AttachedFile[]> {+ const entry = groups.get(groupId)?.entries.find((candidate) => candidate.input.clientId === clientId);+ if (!entry) return Promise.reject(new Error('OUTBOX_ENTRY_GONE'));+ if (entry.prepared) return Promise.resolve(entry.prepared);+ if (entry.files.length === 0) return Promise.resolve([]);+ const key = `${groupId}\n${clientId}`;+ const existing = preparing.get(key);+ if (existing) return existing;+ const requestGeneration = generation;+ const pending = materializeAnnotatedAttachmentsForSend(entry.files, entry.attachmentScope, { burnFailure: 'abort' })+ .then((files) => {+ const prepared = files ?? [];+ if (requestGeneration === generation) {+ update(groupId, clientId, { prepared, attachments: displayAttachments(prepared) });+ }+ return prepared;+ })+ .finally(() => {+ if (preparing.get(key) === pending) preparing.delete(key);+ });+ preparing.set(key, pending);+ return pending;+}++/** 重试 on a message that did not go out: the same clientId, so main returns any copy it already has. */+export function retryBotGroupSend(groupId: string, clientId: string): void {+ ensureOwner();+ const entry = groups.get(groupId)?.entries.find((candidate) => candidate.input.clientId === clientId);+ if (!entry || entry.status !== 'failed') return;+ update(groupId, clientId, { status: 'sending', errorKey: undefined });+ schedule(groupId, clientId);+}++/** 编辑: hand a message that did not go out back to the composer. False when the input is busy. */+export function editBotGroupSend(groupId: string, clientId: string): boolean {+ ensureOwner();+ const entry = groups.get(groupId)?.entries.find((candidate) => candidate.input.clientId === clientId);+ const composer = composers.get(groupId);+ if (!entry || entry.status !== 'failed' || !composer?.restore(entry)) return false;+ remove(groupId, clientId);+ return true;+}++function schedule(groupId: string, clientId: string): void {+ const group = groupOf(groupId);+ const requestGeneration = generation;+ // Kept by the request itself: after an account switch the entry is gone but its files are not.+ const files = group.entries.find((entry) => entry.input.clientId === clientId)?.files ?? [];+ group.chain = group.chain.then(() => submit(groupId, clientId, requestGeneration, files)).catch(() => undefined);+}++async function submit(+ groupId: string,+ clientId: string,+ requestGeneration: number,+ files: readonly AttachedFile[],+): Promise<void> {+ // An account switch nothing else noticed yet (no group open) settles the outbox here.+ ensureOwner();+ const isCurrent = () => requestGeneration === generation && !accountChanged();+ // Dropped before its turn (account switch, deleted group): whoever dropped it released its files.+ if (!isCurrent()) return;+ const group = groups.get(groupId);+ const entry = group?.entries.find((candidate) => candidate.input.clientId === clientId);+ if (!group || !entry || entry.status !== 'sending') return;+ // From here this request owns the files. Still the outbox's message: same account, still listed.+ const owned = () =>+ isCurrent() && (groups.get(groupId)?.entries.some((candidate) => candidate.input.clientId === clientId) ?? false);+ const key = entryKey(groupId, clientId);+ submitting.add(key);+ try {+ await submitOwned(group, entry, owned, files);+ } finally {+ submitting.delete(key);+ }+}++async function submitOwned(+ group: GroupOutbox,+ entry: BotGroupOutboxEntry,+ owned: () => boolean,+ files: readonly AttachedFile[],+): Promise<void> {+ const { groupId, clientId } = entry.input;+ update(groupId, clientId, { baseline: group.latestSequence });+ const api = botGroupApi();+ let errorKey = 'bots.groupChat.composer.sendFailed';+ try {+ if (!api) throw new Error('HOST_NOT_READY');+ // Drawn annotations are burned in first, as in a task; a failure keeps everything for a retry.+ const prepared = await prepare(groupId, clientId);+ // Dropped while annotations were burning in: it never reaches main.+ if (!owned()) {+ releaseStaged(files);+ return;+ }+ const result: BotGroupSendResult = await api.sendBotGroupMessage({+ ...entry.input,+ ...(prepared.length > 0 ? { attachments: toBotGroupAttachmentInputs(prepared) } : {}),+ });+ if (!owned()) {+ // A late answer for a dropped message: keep what went out, release what did not. Main has+ // read the files by the time it answers.+ if (!result.ok) releaseStaged(files);+ return;+ }+ if (result.ok) {+ group.claimed = [...group.claimed, result.messageId].slice(-CLAIMED_LIMIT);+ update(groupId, clientId, { status: 'sent', messageId: result.messageId, receiptTick: ++tick, baseline: undefined });+ return;+ }++ // An original that is no longer available is not put back with the draft.++ if (result.errorCode === 'QUOTE_UNAVAILABLE') update(groupId, clientId, { quote: null });+ errorKey =+ result.errorCode === 'INVALID_PARAMS' && prepared.length > 0+ ? 'bots.groupChat.composer.attachmentsFailed'+ : botGroupErrorKey(result.errorCode, 'bots.groupChat.composer.sendFailed');+ } catch (error) {+ // Burn-in failed (never sent) or the call failed without an answer from main's handler.+ if (!owned()) {+ releaseStaged(files);+ return;+ }+ if (isAnnotationBurnInError(error)) errorKey = 'chat.media.annotateBurnFailedNotSent';+ }+ const failed = update(groupId, clientId, { status: 'failed', errorKey, baseline: undefined });+ if (!failed) return;+ const composer = composers.get(groupId);+ if (composer?.restore(failed)) remove(groupId, clientId);+ composer?.notifyFailed(errorKey);+}++/** Mark the start of a timeline read; pass the token to `noteBotGroupTimeline` when it lands. */+export function beginBotGroupTimelineRead(): number {+ return ++tick;+}++/**+ * A timeline read for this group succeeded. Receipts it contains, or that came back before+ * the read started, are settled: the server timeline now speaks for them.+ */+export function noteBotGroupTimeline(groupId: string, messages: readonly BotGroupMessageView[], readToken: number): void {+ const group = groupOf(groupId);+ group.latestSequence = messages.reduce((latest, message) => Math.max(latest, message.sequence), group.latestSequence);+ const byId = new Map(messages.map((message) => [message.id, message]));+ const settled = (entry: BotGroupOutboxEntry) =>+ entry.status === 'sent' &&+ ((entry.messageId !== undefined && byId.has(entry.messageId)) || (entry.receiptTick ?? Infinity) < readToken);+ const previews = new Map(group.previews);+ let changed = false;+ // A settled message keeps its local previews until the timeline has a usable copy of each.+ for (const entry of group.entries) {+ if (settled(entry) && entry.messageId && entry.attachments.length > 0) previews.set(entry.messageId, entry.attachments);+ }+ for (const [messageId, local] of previews) {+ const message = byId.get(messageId);+ if (message && botGroupLocalAttachmentsSettled(message.attachments, local)) previews.delete(messageId);+ }+ if (previews.size !== group.previews.size || [...previews].some(([id, value]) => group.previews.get(id) !== value)) {+ group.previews = previews;+ changed = true;+ }+ if (group.entries.some(settled)) {+ group.entries = group.entries.filter((entry) => !settled(entry));+ changed = true;+ }+ if (changed) emit();+}++/** A server attachment that can be shown: an image with its address or a file on this computer. */+function isUsable(attachment: BotGroupAttachment): boolean {+ return Boolean(attachment.url || attachment.path);+}++/**+ * Pair the server's attachments of a message with the local ones it was sent with. The server+ * keeps the order they were sent in, so equal counts pair by position. An older server lists a+ * copy only once it is downloaded; then pair by name in that same order, so two files with the+ * same name never swap. Local names are the burned-in ones (see `prepared`), as on the server.+ * Returns, for each local attachment, the server copy it matches (or undefined), plus the+ * server attachments nothing local matched.+ */+function pairLocalAttachments(server: readonly BotGroupAttachment[], local: readonly BotGroupAttachment[]) {+ if (server.length === local.length) return { pairs: [...server], extra: [] as BotGroupAttachment[] };+ const used = new Set<number>();+ let next = 0;+ const pairs: Array<BotGroupAttachment | undefined> = local.map((file) => {+ for (let at = next; at < server.length; at += 1) {+ if (server[at]!.name !== file.name) continue;+ used.add(at);+ next = at + 1;+ return server[at];+ }+ return undefined;+ });+ return { pairs, extra: server.filter((_, at) => !used.has(at)) };+}++/**+ * What a confirmed message shows: each attachment's server copy once it is usable, the local+ * preview until then (under the server's id when known), in the order the user sent them.+ */+export function mergeBotGroupLocalAttachments(+ server: readonly BotGroupAttachment[],+ local: readonly BotGroupAttachment[],+): BotGroupAttachment[] {+ const { pairs, extra } = pairLocalAttachments(server, local);+ return [+ ...local.map((file, at) => {+ const echo = pairs[at];+ if (!echo) return file;+ return isUsable(echo) ? echo : { ...file, id: echo.id };+ }),+ ...extra,+ ];+}++/** Every local attachment has a usable server copy: the preview is no longer needed. */+function botGroupLocalAttachmentsSettled(+ server: readonly BotGroupAttachment[],+ local: readonly BotGroupAttachment[],+): boolean {+ return pairLocalAttachments(server, local).pairs.every((echo) => echo !== undefined && isUsable(echo));+}++/**+ * The group was deleted: nothing of it is left to send or show. Staged copies of files that+ * never reached a message go too; the draft no longer lists them, so nothing else would.+ */+export function discardBotGroupOutbox(groupId: string): void {+ ensureOwner();+ const group = groups.get(groupId);+ if (!group) return;+ groups.delete(groupId);+ releaseUnsubmitted(groupId, group.entries);+ emit();+}++let unwatchGroupList: (() => void) | null = null;+const verifying = new Set<string>();+const retryTimers = new Set<ReturnType<typeof setTimeout>>();+/** A read that was not definite (thrown, or a failure other than NOT_FOUND) is tried again. */+export const BOT_GROUP_GONE_RETRY_MS = [5_000, 30_000, 120_000] as const;++/**+ * Groups deleted while their page is closed (or from another device) send no event this+ * outbox sees. The group list does: a group that drops out of it is read once more, and only+ * a definite NOT_FOUND discards its outbox (a legacy id still resolves). A read that fails is+ * retried a few times on its own: the event that dropped the group may never come again.+ */+function watchGroupList(): void {+ if (unwatchGroupList) return;+ unwatchGroupList = subscribeBotGroups(() => {+ for (const groupId of groups.keys()) verifyGroupGone(groupId, 0);+ });+}++function verifyGroupGone(groupId: string, attempt: number): void {+ if (verifying.has(groupId)) return;+ const group = groups.get(groupId);+ if (!group || (group.entries.length === 0 && group.previews.size === 0)) return;+ const list = getBotGroupListSnapshot();+ if (!list.loaded || list.groups.some((listed) => listed.id === groupId)) return;+ const api = botGroupApi();+ if (!api) return;+ const requestGeneration = generation;+ // A read that spans an owner change (same-account repair, an auth boundary's null) is no answer.+ const requestOwner = getDataOwnerGeneration();+ let definite = false;+ verifying.add(groupId);+ void api+ .getBotGroup(groupId)+ .then((result) => {+ if (!isDataOwnerGenerationCurrent(requestOwner)) return;+ definite = result.ok || result.errorCode === 'NOT_FOUND';+ if (requestGeneration === generation && !result.ok && result.errorCode === 'NOT_FOUND') discardBotGroupOutbox(groupId);+ })+ .catch(() => undefined)+ .finally(() => {+ verifying.delete(groupId);+ const delay = BOT_GROUP_GONE_RETRY_MS[attempt];+ if (definite || delay === undefined || requestGeneration !== generation) return;+ const timer = setTimeout(() => {+ retryTimers.delete(timer);+ if (requestGeneration === generation) verifyGroupGone(groupId, attempt + 1);+ }, delay);+ retryTimers.add(timer);+ });+}++/**+ * The group's composer is on screen. A message that failed while it was away (another group,+ * share mode) comes back into it now, the same way as a failure seen in place.+ */+export function registerBotGroupComposer(groupId: string, handle: BotGroupComposerHandle): () => void {+ composers.set(groupId, handle);+ const failed = groups.get(groupId)?.entries.find((entry) => entry.status === 'failed');+ if (failed && handle.restore(failed)) {+ remove(groupId, failed.input.clientId);+ handle.notifyFailed(failed.errorKey ?? 'bots.groupChat.composer.sendFailed');+ }+ return () => {+ if (composers.get(groupId) === handle) composers.delete(groupId);+ };+}++export interface BotGroupOutboxProjection {+ /** Entries still shown under the timeline. */+ pending: BotGroupOutboxEntry[];+ /** Local attachment previews to lay over timeline messages, by message id. */+ localAttachments: ReadonlyMap<string, readonly BotGroupAttachment[]>;+}++/**+ * Split the outbox against the timeline. A receipt already in the timeline is no longer+ * pending; so is the one request in flight once a re-read shows an unclaimed copy of it (see+ * above). Either way the real message keeps the local attachment previews until usable.+ */+export function projectBotGroupOutbox(+ entries: readonly BotGroupOutboxEntry[],+ messages: readonly BotGroupMessageView[],+ claimed: readonly string[],+ previews: ReadonlyMap<string, readonly BotGroupAttachment[]> = NO_PREVIEWS,+): BotGroupOutboxProjection {+ const localAttachments = new Map(previews);+ if (entries.length === 0) return { pending: [], localAttachments };+ const ids = new Set(messages.map((message) => message.id));+ const claimedIds = new Set(claimed);+ const pending = entries.filter((entry) => {+ if (entry.status === 'sent') {+ if (!(entry.messageId && ids.has(entry.messageId))) return true;+ if (entry.attachments.length > 0) localAttachments.set(entry.messageId, entry.attachments);+ return false;+ }+ if (entry.status !== 'sending' || entry.baseline === undefined) return true;+ const baseline = entry.baseline;+ const copy = messages.find(+ (message) =>+ message.kind === 'message' &&+ message.authorKind === 'user' &&+ message.isSelf !== false &&+ message.sequence > baseline &&+ !claimedIds.has(message.id) &&+ message.content.trim() === entry.input.text &&+ message.attachments.length === entry.files.length,+ );+ if (!copy) return true;+ if (entry.attachments.length > 0) localAttachments.set(copy.id, entry.attachments);+ return false;+ });+ return { pending, localAttachments };+}++function subscribe(listener: () => void): () => void {+ listeners.add(listener);+ return () => listeners.delete(listener);+}++export function getBotGroupOutbox(groupId: string): readonly BotGroupOutboxEntry[] {+ ensureOwner();+ return groups.get(groupId)?.entries ?? EMPTY;+}++export function getBotGroupOutboxClaims(groupId: string): readonly string[] {+ ensureOwner();+ return groups.get(groupId)?.claimed ?? [];+}++export function getBotGroupOutboxPreviews(groupId: string): ReadonlyMap<string, readonly BotGroupAttachment[]> {+ ensureOwner();+ return groups.get(groupId)?.previews ?? NO_PREVIEWS;+}++export function useBotGroupOutbox(groupId: string): readonly BotGroupOutboxEntry[] {+ const read = useCallback(() => getBotGroupOutbox(groupId), [groupId]);+ return useSyncExternalStore(subscribe, read, read);+}++/** Test-only reset of the module state. */+export function resetBotGroupOutboxForTests(): void {+ generation += 1;+ account = getDataOwnerGeneration().dataOwnerId;+ groups.clear();+ preparing.clear();+ verifying.clear();+ submitting.clear();+ for (const timer of retryTimers) clearTimeout(timer);+ retryTimers.clear();+ unwatchGroupList?.();+ unwatchGroupList = null;+ composers.clear();+}diff --cc apps/desktop/src/renderer/i18n/locales/en/common.jsonindex b7ec7ca665,71e3ac3c79..e1a6faea2f--- a/apps/desktop/src/renderer/i18n/locales/en/common.json+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json@@@ -8998,12 -9014,14 +9014,20 @@@"attachmentsFailed": "Attachments not sent. Check that the files still exist, or remove them and try again.","folderNotSupported": "Folders can’t be attached. Choose the files inside instead."},+ "outbox": {+ "sending": "Sending…",+ "failed": "Not sent",+ "edit": "Edit",+ "editBlocked": "Send or clear what’s in the input first, then edit this message."+ },+ "quote": {+ "replyingTo": "Quoting {{name}}",+ "remove": "Remove quote",+ "jumpLabel": "Go to {{name}}’s original message: {{summary}}",+ "deleted": "Original message was deleted",+ "unavailable": "The original message isn’t in the history you can view",+ "attachments": "{{name}} and others ({{total}} files)"+ },"timeline": {"loadEarlier": "Show Earlier Messages","loadEarlierFailed": "Couldn’t load earlier messages. Try again.",diff --cc apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex 10c086fec6,106f3c47d9..72f5ec7212--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@@ -8961,12 -8977,14 +8977,20 @@@"attachmentsFailed": "添付ファイルを送信できませんでした。ファイルが残っているか確認するか、削除してから再試行してください","folderNotSupported": "フォルダーは添付できません。中のファイルを選んでください"},+ "outbox": {+ "sending": "送信中…",+ "failed": "送信できませんでした",+ "edit": "編集",+ "editBlocked": "入力欄に内容があります。送信するか消してから、このメッセージを編集してください"+ },+ "quote": {+ "replyingTo": "{{name}} を引用",+ "remove": "引用を外す",+ "jumpLabel": "{{name}} の元のメッセージを表示:{{summary}}",+ "deleted": "元のメッセージは削除されました",+ "unavailable": "元のメッセージは閲覧できる履歴にありません",+ "attachments": "{{name}} など {{total}} 件"+ },"timeline": {"loadEarlier": "以前のメッセージを表示","loadEarlierFailed": "以前のメッセージを読み込めませんでした。もう一度お試しください",diff --cc apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex 51cfa3a248,fd874858d5..7c4034adab--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@@ -8961,12 -8977,14 +8977,20 @@@"attachmentsFailed": "첨부 파일을 보내지 못했습니다. 파일이 아직 있는지 확인하거나, 제거한 후 다시 시도하세요","folderNotSupported": "폴더는 첨부할 수 없습니다. 폴더 안의 파일을 선택하세요"},+ "outbox": {+ "sending": "보내는 중…",+ "failed": "보내지 못했습니다",+ "edit": "편집",+ "editBlocked": "입력란에 내용이 있습니다. 먼저 보내거나 지운 다음 이 메시지를 편집하세요"+ },+ "quote": {+ "replyingTo": "{{name}} 인용",+ "remove": "인용 취소",+ "jumpLabel": "{{name}}님의 원본 메시지로 이동: {{summary}}",+ "deleted": "원본 메시지가 삭제되었습니다",+ "unavailable": "볼 수 있는 기록에서 원본 메시지를 찾을 수 없습니다",+ "attachments": "{{name}} 등 {{total}}개"+ },"timeline": {"loadEarlier": "이전 메시지 보기","loadEarlierFailed": "이전 메시지를 불러오지 못했습니다. 다시 시도하세요",diff --cc apps/desktop/src/renderer/i18n/locales/zh-CN/common.jsonindex d7177c5eaf,bd91ec0c56..5004da81c2--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json@@@ -8961,12 -8977,14 +8977,20 @@@"attachmentsFailed": "附件没能发出去,请检查文件是否还在,或移除后重试","folderNotSupported": "文件夹不能作为附件,请选择其中的文件"},+ "outbox": {+ "sending": "发送中…",+ "failed": "没发出去",+ "edit": "编辑",+ "editBlocked": "输入框里还有内容,先发出或清空,再编辑这条消息"+ },+ "quote": {+ "replyingTo": "引用 {{name}}",+ "remove": "取消引用",+ "jumpLabel": "查看 {{name}} 的原消息:{{summary}}",+ "deleted": "原消息已删除",+ "unavailable": "原消息不在可查看的记录里",+ "attachments": "{{name}} 等 {{total}} 个附件"+ },"timeline": {"loadEarlier": "查看更早的消息","loadEarlierFailed": "更早的消息没能加载,请再试一次",diff --cc apps/desktop/src/renderer/i18n/locales/zh-TW/common.jsonindex 3d0f0ac26b,6104082d4f..f315e77b81--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json@@@ -8961,12 -8977,14 +8977,20 @@@"attachmentsFailed": "附件沒能送出,請檢查檔案是否還在,或移除後重試","folderNotSupported": "資料夾不能作為附件,請選擇其中的檔案"},+ "outbox": {+ "sending": "傳送中…",+ "failed": "沒有送出",+ "edit": "編輯",+ "editBlocked": "輸入框裡還有內容,先送出或清空,再編輯這則訊息"+ },+ "quote": {+ "replyingTo": "引用 {{name}}",+ "remove": "取消引用",+ "jumpLabel": "查看 {{name}} 的原訊息:{{summary}}",+ "deleted": "原訊息已刪除",+ "unavailable": "原訊息不在可查看的紀錄裡",+ "attachments": "{{name}} 等 {{total}} 個附件"+ },"timeline": {"loadEarlier": "查看更早的訊息","loadEarlierFailed": "更早的訊息沒能載入,請再試一次",diff --cc docs/design-rules/design-inventory.mdindex 22a04ac2e7,1a61db6441..217a2cb350--- a/docs/design-rules/design-inventory.md+++ b/docs/design-rules/design-inventory.md@@@ -18,7 -18,7 +18,7 @@@| `desktop.auth.add-account` | desktop | 添加账号 | hash `/add-account`(ProtectedRoute → AddAccountLoginPage) | AddAccountLoginPage | apps/desktop/src/renderer/components/login/AddAccountLoginPage.tsx, apps/desktop/src/renderer/components/login/LoginBrandStage.tsx, apps/desktop/src/renderer/components/login/LoginCaptchaOverlay.tsx, apps/desktop/src/renderer/components/login/LoginControls.tsx, apps/desktop/src/renderer/components/login/LoginPage.tsx, apps/desktop/src/renderer/components/login/loginDesignTokens.ts | 59 | 0 | 20 || `desktop.auth.legacy-migration` | desktop | 首登数据迁移弹窗 | App 顶层挂载 LegacyMigrationDialog(仅主窗;main 检测到旧版 userData 经 `legacy-migration:state` 驱动) | LegacyMigrationDialog | apps/desktop/src/renderer/components/auth/LegacyMigrationDialog.tsx | 8 | 0 | 2 || `desktop.auth.login` | desktop | 登录页 | hash `/login`(GuestRoute → LoginPage) | LoginBrandStage, LoginCaptchaOverlay, LoginControls, LoginPage | apps/desktop/src/renderer/components/login/LoginBrandStage.tsx, apps/desktop/src/renderer/components/login/LoginCaptchaOverlay.tsx, apps/desktop/src/renderer/components/login/LoginControls.tsx, apps/desktop/src/renderer/components/login/LoginPage.tsx, apps/desktop/src/renderer/components/login/loginDesignTokens.ts | 59 | 0 | 20 |- | `desktop.bots` | desktop | 伙伴(列表 / 对话 / 设置 / 历史 / 伙伴私聊 / 群聊) | hash `/bots`、`/bots/list`、`/bots/:botId`、`/bots/roster` 及伙伴当前/历史任务、伙伴私聊、伙伴群聊路由(BotsFeatureLayout) | BotBasicProfileFields, BotCollaborationCard, BotDirectMessageView, BotGroupChatView, BotGroupCreateDialog, BotGroupSettingsDrawer, BotHistorySessionView, BotLifecycleSettings, BotModelChainEditor, BotRosterView, BotSessionView, BotSettingsDrawer, BotsHomeView, BotsListView, RemoteBotSessionView | apps/desktop/src/renderer/components/chat/AgentActionRow.tsx, apps/desktop/src/renderer/components/chat/AgentActionsBlock.tsx, apps/desktop/src/renderer/components/chat/AgentOnOtherDeviceContext.tsx, apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx, apps/desktop/src/renderer/components/chat/AgentTaskLiveDetails.tsx, apps/desktop/src/renderer/components/chat/AnnotationStrokesSvg.tsx, apps/desktop/src/renderer/components/chat/AskUserQuestionBubble.tsx, apps/desktop/src/renderer/components/chat/AssistantMessage.tsx, apps/desktop/src/renderer/components/chat/AutomationOriginBadge.tsx, apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx, apps/desktop/src/renderer/components/chat/ChatDisplaySnapshotContext.tsx, apps/desktop/src/renderer/components/chat/ChatImageView.tsx, apps/desktop/src/renderer/components/chat/ChatLoadingImage.tsx, apps/desktop/src/renderer/components/chat/ChatSessionFileContext.tsx, apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx, apps/desktop/src/renderer/components/chat/ChatVideoView.tsx, apps/desktop/src/renderer/components/chat/CindyMakeDoctorCard.tsx, apps/desktop/src/renderer/components/chat/CopyAsImageBlock.tsx, apps/desktop/src/renderer/components/chat/CredentialSwitchWaitBanner.tsx, apps/desktop/src/renderer/components/chat/DiffView.tsx, apps/desktop/src/renderer/components/chat/ErrorBanner.tsx, apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsx, apps/desktop/src/renderer/components/chat/GeneratedFilesCard.tsx, apps/desktop/src/renderer/components/chat/GhostCardHostPrompts.tsx, apps/desktop/src/renderer/components/chat/GhostSummonCard.tsx, apps/desktop/src/renderer/components/chat/GhostToolCard.tsx, apps/desktop/src/renderer/components/chat/HookTaskCard.tsx, apps/desktop/src/renderer/components/chat/ImageGalleryContext.tsx, apps/desktop/src/renderer/components/chat/ImageHoverPreview.tsx, apps/desktop/src/renderer/components/chat/ImageLightbox.tsx, apps/desktop/src/renderer/components/chat/ImageMissingPlaceholder.tsx, apps/desktop/src/renderer/components/chat/InlineReferenceChip.tsx, apps/desktop/src/renderer/components/chat/InterruptedTurnBanner.tsx, apps/desktop/src/renderer/components/chat/JumpToBottomChip.tsx, apps/desktop/src/renderer/components/chat/MarkdownDiffBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownMermaidBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx, apps/desktop/src/renderer/components/chat/MermaidLightbox.tsx, apps/desktop/src/renderer/components/chat/MessageActionBar.tsx, apps/desktop/src/renderer/components/chat/MessageNavRail.tsx, apps/desktop/src/renderer/components/chat/MessageSourceLabels.tsx, apps/desktop/src/renderer/components/chat/MessageStream.tsx, apps/desktop/src/renderer/components/chat/MessageViewport.tsx, apps/desktop/src/renderer/components/chat/ModelLightbox.tsx, apps/desktop/src/renderer/components/chat/NewMessageIndicator.tsx, apps/desktop/src/renderer/components/chat/PlanReviewBubble.tsx, apps/desktop/src/renderer/components/chat/PrevMessageJumpChip.tsx, apps/desktop/src/renderer/components/chat/ProjectLinkChip.tsx, apps/desktop/src/renderer/components/chat/QuoteChip.tsx, apps/desktop/src/renderer/components/chat/RewindPreviewDialog.tsx, apps/desktop/src/renderer/components/chat/SelectionQuoteButton.tsx, apps/desktop/src/renderer/components/chat/SentAgentReferenceChip.tsx, apps/desktop/src/renderer/components/chat/SentInlineAtomBody.tsx, apps/desktop/src/renderer/components/chat/SessionHandoffCard.tsx, apps/desktop/src/renderer/components/chat/SessionLinkChip.tsx, apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx, apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx, apps/desktop/src/renderer/components/chat/SlackIcon.tsx, apps/desktop/src/renderer/components/chat/StreamFadeSpan.tsx, apps/desktop/src/renderer/components/chat/StreamingMarkdownChunk.tsx, apps/desktop/src/renderer/components/chat/SystemCard.tsx, apps/desktop/src/renderer/components/chat/TextLightbox.tsx, apps/desktop/src/renderer/components/chat/ThinkingCard.tsx, apps/desktop/src/renderer/components/chat/ThinkingText.tsx, apps/desktop/src/renderer/components/chat/TodoListCard.tsx, apps/desktop/src/renderer/components/chat/ToolCallCard.tsx, apps/desktop/src/renderer/components/chat/ToolPayloadLightbox.tsx, apps/desktop/src/renderer/components/chat/TopRightChipStack.tsx, apps/desktop/src/renderer/components/chat/TurnChangesCard.tsx, apps/desktop/src/renderer/components/chat/UnreadFailedScheduleBanner.tsx, apps/desktop/src/renderer/components/chat/UpgradeBanner.tsx, apps/desktop/src/renderer/components/chat/UserAttachmentChip.tsx, apps/desktop/src/renderer/components/chat/UserMessage.tsx, apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx, apps/desktop/src/renderer/components/chat/UserMessageUrlLink.tsx, apps/desktop/src/renderer/components/chat/VideoLightbox.tsx, apps/desktop/src/renderer/components/chat/WorkGroupBlock.tsx, apps/desktop/src/renderer/components/chat/WorktreeRestoreBanner.tsx, apps/desktop/src/renderer/components/chat/XIcon.tsx, apps/desktop/src/renderer/components/chat/activityRowChrome.ts, apps/desktop/src/renderer/components/chat/animateFocusScroll.ts, apps/desktop/src/renderer/components/chat/autoFollowIntent.ts, apps/desktop/src/renderer/components/chat/chatChrome.ts, apps/desktop/src/renderer/components/chat/errorReasonI18n.ts, apps/desktop/src/renderer/components/chat/generatedFilesProjection.ts, apps/desktop/src/renderer/components/chat/imageDisplaySize.ts, apps/desktop/src/renderer/components/chat/lightboxAnnotations.ts, apps/desktop/src/renderer/components/chat/lightboxGestures.ts, apps/desktop/src/renderer/components/chat/markdownImageTargets.ts, apps/desktop/src/renderer/components/chat/markdownMedia.ts, apps/desktop/src/renderer/components/chat/messageNavRailModel.ts, apps/desktop/src/renderer/components/chat/messageNavRailWheel.ts, apps/desktop/src/renderer/components/chat/messageNavigationProjection.ts, apps/desktop/src/renderer/components/chat/messageProjectionCache.ts, apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts, apps/desktop/src/renderer/components/chat/messageViewportCompensation.ts, apps/desktop/src/renderer/components/chat/messageViewportGeometry.ts, apps/desktop/src/renderer/components/chat/messageWorkGroups.ts, apps/desktop/src/renderer/components/chat/observeProgrammaticScroll.ts, apps/desktop/src/renderer/components/chat/rehypeFencedCodeMarker.ts, apps/desktop/src/renderer/components/chat/rehypeHighlightShared.ts, apps/desktop/src/renderer/components/chat/rehypeMathBlockMarker.ts, apps/desktop/src/renderer/components/chat/rehypeStreamWordFade.ts, apps/desktop/src/renderer/components/chat/remarkHtmlImages.ts, apps/desktop/src/renderer/components/chat/remarkLocalPathLinks.ts, apps/desktop/src/renderer/components/chat/remarkPreserveRawLocalDestinations.ts, apps/desktop/src/renderer/components/chat/remarkSessionLinks.ts, apps/desktop/src/renderer/components/chat/remarkStrictInlineMath.ts, apps/desktop/src/renderer/components/chat/remarkTruncateCjkUrls.ts, apps/desktop/src/renderer/components/chat/repairStreamingMarkdown.ts, apps/desktop/src/renderer/components/chat/scrollAnchoringDetect.ts, apps/desktop/src/renderer/components/chat/shareSelectionStore.ts, apps/desktop/src/renderer/components/chat/streamingMarkdownBlocks.tsx, apps/desktop/src/renderer/components/chat/streamingMarkdownChunks.ts, apps/desktop/src/renderer/components/chat/streamingMessageProjection.ts, apps/desktop/src/renderer/components/chat/toolLoopI18n.ts, apps/desktop/src/renderer/components/chat/unreadCount.ts, apps/desktop/src/renderer/components/chat/useAutomaticHistoryLoadBudget.ts, apps/desktop/src/renderer/components/chat/useCopyAsImage.tsx, apps/desktop/src/renderer/components/chat/useDeleteMessage.ts, apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx, apps/desktop/src/renderer/components/chat/useForkAtMessage.ts, apps/desktop/src/renderer/components/chat/useImageClipboard.ts, apps/desktop/src/renderer/components/chat/useImageLoadFailure.ts, apps/desktop/src/renderer/components/chat/useMessageViewport.ts, apps/desktop/src/renderer/components/chat/useNavigationKeyListener.ts, apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx, apps/desktop/src/renderer/components/chat/usePrevUserMessageInView.ts, apps/desktop/src/renderer/components/chat/useTurnChangeSets.ts, apps/desktop/src/renderer/components/chat/userMessageCollapse.ts, apps/desktop/src/renderer/components/chat/userMessageDisplayText.ts, apps/desktop/src/renderer/components/chat/userMessageLinkify.ts, apps/desktop/src/renderer/components/chat/viewportFillDetect.ts, apps/desktop/src/renderer/components/new-chat/AddRemoteProjectDialog.tsx, apps/desktop/src/renderer/components/new-chat/AgentSelect.tsx, apps/desktop/src/renderer/components/new-chat/AskUserQuestionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/AtMentionPanel.tsx, apps/desktop/src/renderer/components/new-chat/AttachmentTypeThumb.tsx, apps/desktop/src/renderer/components/new-chat/ChatInput.tsx, apps/desktop/src/renderer/components/new-chat/CjkPunctDecoration.ts, apps/desktop/src/renderer/components/new-chat/CjkPunctuationUtils.ts, apps/desktop/src/renderer/components/new-chat/ComposerAttachments.tsx, apps/desktop/src/renderer/components/new-chat/ComposerListIndentDecoration.ts, apps/desktop/src/renderer/components/new-chat/ComposerListNodes.ts, apps/desktop/src/renderer/components/new-chat/ComposerQuoteNode.tsx, apps/desktop/src/renderer/components/new-chat/DeviceSwitcherPill.tsx, apps/desktop/src/renderer/components/new-chat/EffortSlider.tsx, apps/desktop/src/renderer/components/new-chat/EmptyDocSelectionGuard.ts, apps/desktop/src/renderer/components/new-chat/ExtraDirsButton.tsx, apps/desktop/src/renderer/components/new-chat/FastModeToggle.tsx, apps/desktop/src/renderer/components/new-chat/FolderPickerPopover.tsx, apps/desktop/src/renderer/components/new-chat/FullAccessConfirmContent.tsx, apps/desktop/src/renderer/components/new-chat/GhostCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx, apps/desktop/src/renderer/components/new-chat/GoalIndicator.tsx, apps/desktop/src/renderer/components/new-chat/HomeUsageDashboard.tsx, apps/desktop/src/renderer/components/new-chat/ListComposerTextarea.tsx, apps/desktop/src/renderer/components/new-chat/LocalModelCatalogNotice.tsx, apps/desktop/src/renderer/components/new-chat/MentionChipNode.tsx, apps/desktop/src/renderer/components/new-chat/MentionDragCaretDecoration.ts, apps/desktop/src/renderer/components/new-chat/ModelCompatibilityNotice.tsx, apps/desktop/src/renderer/components/new-chat/ModelConfigFlyout.tsx, apps/desktop/src/renderer/components/new-chat/ModelHarnessPicker.tsx, apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx, apps/desktop/src/renderer/components/new-chat/ModelSourceDetails.tsx, apps/desktop/src/renderer/components/new-chat/NewGoalDialog.tsx, apps/desktop/src/renderer/components/new-chat/PastedTextChipNode.tsx, apps/desktop/src/renderer/components/new-chat/PendingQueuePanel.tsx, apps/desktop/src/renderer/components/new-chat/PermissionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PermissionSelector.tsx, apps/desktop/src/renderer/components/new-chat/PinnedPlanPanel.tsx, apps/desktop/src/renderer/components/new-chat/PlanActionCard.tsx, apps/desktop/src/renderer/components/new-chat/PlanModeIndicator.tsx, apps/desktop/src/renderer/components/new-chat/PlanViewerCard.tsx, apps/desktop/src/renderer/components/new-chat/PluginConnectionForm.tsx, apps/desktop/src/renderer/components/new-chat/PluginOauthDeviceCode.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupRemoteDesktopButton.tsx, apps/desktop/src/renderer/components/new-chat/PluginWriteAccessRecovery.tsx, apps/desktop/src/renderer/components/new-chat/QuickStartPillMark.ts, apps/desktop/src/renderer/components/new-chat/RemoteOauthSetupCard.tsx, apps/desktop/src/renderer/components/new-chat/SendButton.tsx, apps/desktop/src/renderer/components/new-chat/SlashCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsx, apps/desktop/src/renderer/components/new-chat/TakeoverMask.tsx, apps/desktop/src/renderer/components/new-chat/ThinkingToggle.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedFlyoutHost.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRail.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx, apps/desktop/src/renderer/components/new-chat/UsageDailyBars.tsx, apps/desktop/src/renderer/components/new-chat/UsageHeatmap.tsx, apps/desktop/src/renderer/components/new-chat/VendorSegmentedSwitcher.tsx, apps/desktop/src/renderer/components/new-chat/VoiceInputDraftDecoration.ts, apps/desktop/src/renderer/components/new-chat/WindowsSelectionReplacement.ts, apps/desktop/src/renderer/components/new-chat/WorktreeChipsRow.tsx, apps/desktop/src/renderer/components/new-chat/WorktreeCreatingOverlay.tsx, apps/desktop/src/renderer/components/new-chat/agentOptions.ts, apps/desktop/src/renderer/components/new-chat/agentSwitchConfirmation.ts, apps/desktop/src/renderer/components/new-chat/branchPick.ts, apps/desktop/src/renderer/components/new-chat/composerBlankPointerFocus.ts, apps/desktop/src/renderer/components/new-chat/composerContentSerialization.ts, apps/desktop/src/renderer/components/new-chat/composerDocState.ts, apps/desktop/src/renderer/components/new-chat/composerFrameScheduler.ts, apps/desktop/src/renderer/components/new-chat/composerHistoryProjection.ts, apps/desktop/src/renderer/components/new-chat/composerModelSelection.ts, apps/desktop/src/renderer/components/new-chat/composerPromptRecommendation.ts, apps/desktop/src/renderer/components/new-chat/composerRenderGate.ts, apps/desktop/src/renderer/components/new-chat/composerSendOwnership.ts, apps/desktop/src/renderer/components/new-chat/composerSendSnapshot.ts, apps/desktop/src/renderer/components/new-chat/effortChangeQueue.ts, apps/desktop/src/renderer/components/new-chat/extraDirsActions.ts, apps/desktop/src/renderer/components/new-chat/ghostComposerPlacement.ts, apps/desktop/src/renderer/components/new-chat/localAttachmentPicker.ts, apps/desktop/src/renderer/components/new-chat/mentionChipInsertion.ts, apps/desktop/src/renderer/components/new-chat/modelWindowErrorToast.ts, apps/desktop/src/renderer/components/new-chat/pastePipeline.ts, apps/desktop/src/renderer/components/new-chat/pathPaste.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueLocks.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowActivity.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowPresentation.ts, apps/desktop/src/renderer/components/new-chat/planModeComposerCommand.ts, apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx, apps/desktop/src/renderer/components/new-chat/remoteBrowseAdapters.ts, apps/desktop/src/renderer/components/new-chat/remoteExistingProjects.ts, apps/desktop/src/renderer/components/new-chat/restoreComposerDocument.ts, apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.ts, apps/desktop/src/renderer/components/new-chat/sourceSwitch.ts, apps/desktop/src/renderer/components/new-chat/unifiedModelSelection.ts, apps/desktop/src/renderer/components/new-chat/usagePalette.ts, apps/desktop/src/renderer/components/new-chat/useComposerSendFocusRestore.ts, apps/desktop/src/renderer/components/new-chat/useModelDiscoveryPending.ts, apps/desktop/src/renderer/components/new-chat/useProviderWeeklyQuota.ts, apps/desktop/src/renderer/components/new-chat/useUnifiedRowActions.ts, apps/desktop/src/renderer/features/bots/BotAuthorizationCard.tsx, apps/desktop/src/renderer/features/bots/BotAvatar.tsx, apps/desktop/src/renderer/features/bots/BotBasicProfileFields.tsx, apps/desktop/src/renderer/features/bots/BotCapabilitySettings.tsx, apps/desktop/src/renderer/features/bots/BotCollaborationCard.tsx, apps/desktop/src/renderer/features/bots/BotConnectionStatus.tsx, apps/desktop/src/renderer/features/bots/BotCreateMenu.tsx, apps/desktop/src/renderer/features/bots/BotDeleteDialog.tsx, apps/desktop/src/renderer/features/bots/BotDirectMessageCard.tsx, apps/desktop/src/renderer/features/bots/BotDirectMessageView.tsx, apps/desktop/src/renderer/features/bots/BotFollowMark.tsx, apps/desktop/src/renderer/features/bots/BotGenerationLabel.tsx, apps/desktop/src/renderer/features/bots/BotGroupAvatars.tsx, apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx, apps/desktop/src/renderer/features/bots/BotGroupComposer.tsx, apps/desktop/src/renderer/features/bots/BotGroupCreateDialog.tsx, apps/desktop/src/renderer/features/bots/BotGroupPendingInteraction.tsx, apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx, apps/desktop/src/renderer/features/bots/BotGroupRuntimeFailureNotice.tsx, apps/desktop/src/renderer/features/bots/BotGroupSettingsDrawer.tsx, apps/desktop/src/renderer/features/bots/BotGroupSidebarRow.tsx, apps/desktop/src/renderer/features/bots/BotHistorySessionView.tsx, apps/desktop/src/renderer/features/bots/BotImportForm.tsx, apps/desktop/src/renderer/features/bots/BotInvitationWelcome.tsx, apps/desktop/src/renderer/features/bots/BotLearningFooter.tsx, apps/desktop/src/renderer/features/bots/BotLifecycleSettings.tsx, apps/desktop/src/renderer/features/bots/BotMemorySettings.tsx, apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx, apps/desktop/src/renderer/features/bots/BotPortraitPicker.tsx, apps/desktop/src/renderer/features/bots/BotRosterView.tsx, apps/desktop/src/renderer/features/bots/BotRoutines.tsx, apps/desktop/src/renderer/features/bots/BotSessionContentHeader.tsx, apps/desktop/src/renderer/features/bots/BotSessionTaskLink.tsx, apps/desktop/src/renderer/features/bots/BotSessionTaskResultCard.tsx, apps/desktop/src/renderer/features/bots/BotSessionView.tsx, apps/desktop/src/renderer/features/bots/BotSettingsBlock.tsx, apps/desktop/src/renderer/features/bots/BotSettingsDrawer.tsx, apps/desktop/src/renderer/features/bots/BotTaskCardHeader.tsx, apps/desktop/src/renderer/features/bots/BotTaskModelEditor.tsx, apps/desktop/src/renderer/features/bots/BotTodoList.tsx, apps/desktop/src/renderer/features/bots/BotWorkbench.tsx, apps/desktop/src/renderer/features/bots/BotWorkingStatus.tsx, apps/desktop/src/renderer/features/bots/BotsFeatureLayout.tsx, apps/desktop/src/renderer/features/bots/BotsGlobalSettingsSection.tsx, apps/desktop/src/renderer/features/bots/BotsHomeView.tsx, apps/desktop/src/renderer/features/bots/BotsListView.tsx, apps/desktop/src/renderer/features/bots/BotsSidebar.tsx, apps/desktop/src/renderer/features/bots/ChatBotAccessField.tsx, apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx, apps/desktop/src/renderer/features/bots/ChatInviteDialog.tsx, apps/desktop/src/renderer/features/bots/ChatInviteHost.tsx, apps/desktop/src/renderer/features/bots/ChatServerControls.tsx, apps/desktop/src/renderer/features/bots/ChatThreadPanel.tsx, apps/desktop/src/renderer/features/bots/CindyDevicePicker.tsx, apps/desktop/src/renderer/features/bots/CindyDeviceRow.tsx, apps/desktop/src/renderer/features/bots/RemoteBotSessionView.tsx, apps/desktop/src/renderer/features/bots/RemoteBotSettings.tsx, apps/desktop/src/renderer/features/bots/WorkbenchSessionList.tsx, apps/desktop/src/renderer/features/bots/botAvatarIdentity.ts, apps/desktop/src/renderer/features/bots/botCapabilityDefaults.ts, apps/desktop/src/renderer/features/bots/botChatPresentation.ts, apps/desktop/src/renderer/features/bots/botConversationPresentation.ts, apps/desktop/src/renderer/features/bots/botConversationTimeline.ts, apps/desktop/src/renderer/features/bots/botDelegationLive.ts, apps/desktop/src/renderer/features/bots/botFollowScopes.ts, apps/desktop/src/renderer/features/bots/botGeneratedArtifacts.ts, apps/desktop/src/renderer/features/bots/botGroupAttachments.ts, apps/desktop/src/renderer/features/bots/botGroupLane.ts, apps/desktop/src/renderer/features/bots/botGroupMentions.ts, apps/desktop/src/renderer/features/bots/botGroupOutbox.ts, apps/desktop/src/renderer/features/bots/botGroupPresentation.ts, apps/desktop/src/renderer/features/bots/botGroupStore.ts, apps/desktop/src/renderer/features/bots/botListDisplay.ts, apps/desktop/src/renderer/features/bots/botNavigation.ts, apps/desktop/src/renderer/features/bots/botPronounContext.tsx, apps/desktop/src/renderer/features/bots/botReadState.ts, apps/desktop/src/renderer/features/bots/botRosterDisplay.ts, apps/desktop/src/renderer/features/bots/botSessionOwners.ts, apps/desktop/src/renderer/features/bots/botSettingsAutosave.ts, apps/desktop/src/renderer/features/bots/botStore.ts, apps/desktop/src/renderer/features/bots/botTodo.css, apps/desktop/src/renderer/features/bots/botWelcomeContext.ts, apps/desktop/src/renderer/features/bots/botWorkbenchProjection.ts, apps/desktop/src/renderer/features/bots/chatError.ts, apps/desktop/src/renderer/features/bots/cindyDeviceRoster.ts, apps/desktop/src/renderer/features/bots/remoteBotRoster.ts, apps/desktop/src/renderer/features/bots/remoteBotSettingsData.ts, apps/desktop/src/renderer/features/bots/useBotGeneratedFileDeliveries.ts, apps/desktop/src/renderer/features/bots/useBotIslandVisibleSession.ts, apps/desktop/src/renderer/features/bots/useBotSettingsAutosave.ts, apps/desktop/src/renderer/features/bots/useBotUnreadSync.ts, apps/desktop/src/renderer/features/bots/useRemoteBots.ts, apps/desktop/src/renderer/features/bots/useWorkbenchSessionPages.ts, apps/desktop/src/renderer/features/bots/useWorkingStatusCopy.ts, apps/desktop/src/renderer/features/cc-agent/CCAgentFeatureLayout.tsx, apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx | 277 | 38 | 474 |-| `desktop.bots` | desktop | 伙伴(列表 / 对话 / 设置 / 历史 / 伙伴私聊 / 群聊) | hash `/bots`、`/bots/list`、`/bots/:botId`、`/bots/roster` 及伙伴当前/历史任务、伙伴私聊、伙伴群聊路由(BotsFeatureLayout) | BotBasicProfileFields, BotCollaborationCard, BotDirectMessageView, BotGroupChatView, BotGroupCreateDialog, BotGroupSettingsDrawer, BotHistorySessionView, BotLifecycleSettings, BotModelChainEditor, BotRosterView, BotSessionView, BotSettingsDrawer, BotsHomeView, BotsListView, RemoteBotSessionView | apps/desktop/src/renderer/components/chat/AgentActionRow.tsx, apps/desktop/src/renderer/components/chat/AgentActionsBlock.tsx, apps/desktop/src/renderer/components/chat/AgentOnOtherDeviceContext.tsx, apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx, apps/desktop/src/renderer/components/chat/AgentTaskLiveDetails.tsx, apps/desktop/src/renderer/components/chat/AnnotationStrokesSvg.tsx, apps/desktop/src/renderer/components/chat/AskUserQuestionBubble.tsx, apps/desktop/src/renderer/components/chat/AssistantMessage.tsx, apps/desktop/src/renderer/components/chat/AutomationOriginBadge.tsx, apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx, apps/desktop/src/renderer/components/chat/ChatDisplaySnapshotContext.tsx, apps/desktop/src/renderer/components/chat/ChatImageView.tsx, apps/desktop/src/renderer/components/chat/ChatLoadingImage.tsx, apps/desktop/src/renderer/components/chat/ChatSessionFileContext.tsx, apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx, apps/desktop/src/renderer/components/chat/ChatVideoView.tsx, apps/desktop/src/renderer/components/chat/CindyMakeDoctorCard.tsx, apps/desktop/src/renderer/components/chat/CopyAsImageBlock.tsx, apps/desktop/src/renderer/components/chat/CredentialSwitchWaitBanner.tsx, apps/desktop/src/renderer/components/chat/DiffView.tsx, apps/desktop/src/renderer/components/chat/ErrorBanner.tsx, apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsx, apps/desktop/src/renderer/components/chat/GeneratedFilesCard.tsx, apps/desktop/src/renderer/components/chat/GhostCardHostPrompts.tsx, apps/desktop/src/renderer/components/chat/GhostSummonCard.tsx, apps/desktop/src/renderer/components/chat/GhostToolCard.tsx, apps/desktop/src/renderer/components/chat/HookTaskCard.tsx, apps/desktop/src/renderer/components/chat/ImageGalleryContext.tsx, apps/desktop/src/renderer/components/chat/ImageHoverPreview.tsx, apps/desktop/src/renderer/components/chat/ImageLightbox.tsx, apps/desktop/src/renderer/components/chat/ImageMissingPlaceholder.tsx, apps/desktop/src/renderer/components/chat/InlineReferenceChip.tsx, apps/desktop/src/renderer/components/chat/InterruptedTurnBanner.tsx, apps/desktop/src/renderer/components/chat/JumpToBottomChip.tsx, apps/desktop/src/renderer/components/chat/MarkdownDiffBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownMermaidBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx, apps/desktop/src/renderer/components/chat/MermaidLightbox.tsx, apps/desktop/src/renderer/components/chat/MessageActionBar.tsx, apps/desktop/src/renderer/components/chat/MessageNavRail.tsx, apps/desktop/src/renderer/components/chat/MessageSourceLabels.tsx, apps/desktop/src/renderer/components/chat/MessageStream.tsx, apps/desktop/src/renderer/components/chat/MessageViewport.tsx, apps/desktop/src/renderer/components/chat/ModelLightbox.tsx, apps/desktop/src/renderer/components/chat/NewMessageIndicator.tsx, apps/desktop/src/renderer/components/chat/PlanReviewBubble.tsx, apps/desktop/src/renderer/components/chat/PrevMessageJumpChip.tsx, apps/desktop/src/renderer/components/chat/ProjectLinkChip.tsx, apps/desktop/src/renderer/components/chat/QuoteChip.tsx, apps/desktop/src/renderer/components/chat/RewindPreviewDialog.tsx, apps/desktop/src/renderer/components/chat/SelectionQuoteButton.tsx, apps/desktop/src/renderer/components/chat/SentAgentReferenceChip.tsx, apps/desktop/src/renderer/components/chat/SentInlineAtomBody.tsx, apps/desktop/src/renderer/components/chat/SessionHandoffCard.tsx, apps/desktop/src/renderer/components/chat/SessionLinkChip.tsx, apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx, apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx, apps/desktop/src/renderer/components/chat/SlackIcon.tsx, apps/desktop/src/renderer/components/chat/StreamFadeSpan.tsx, apps/desktop/src/renderer/components/chat/StreamingMarkdownChunk.tsx, apps/desktop/src/renderer/components/chat/SystemCard.tsx, apps/desktop/src/renderer/components/chat/TextLightbox.tsx, apps/desktop/src/renderer/components/chat/ThinkingCard.tsx, apps/desktop/src/renderer/components/chat/ThinkingText.tsx, apps/desktop/src/renderer/components/chat/TodoListCard.tsx, apps/desktop/src/renderer/components/chat/ToolCallCard.tsx, apps/desktop/src/renderer/components/chat/ToolPayloadLightbox.tsx, apps/desktop/src/renderer/components/chat/TopRightChipStack.tsx, apps/desktop/src/renderer/components/chat/TurnChangesCard.tsx, apps/desktop/src/renderer/components/chat/UnreadFailedScheduleBanner.tsx, apps/desktop/src/renderer/components/chat/UpgradeBanner.tsx, apps/desktop/src/renderer/components/chat/UserAttachmentChip.tsx, apps/desktop/src/renderer/components/chat/UserMessage.tsx, apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx, apps/desktop/src/renderer/components/chat/UserMessageUrlLink.tsx, apps/desktop/src/renderer/components/chat/VideoLightbox.tsx, apps/desktop/src/renderer/components/chat/WorkGroupBlock.tsx, apps/desktop/src/renderer/components/chat/WorktreeRestoreBanner.tsx, apps/desktop/src/renderer/components/chat/XIcon.tsx, apps/desktop/src/renderer/components/chat/activityRowChrome.ts, apps/desktop/src/renderer/components/chat/animateFocusScroll.ts, apps/desktop/src/renderer/components/chat/autoFollowIntent.ts, apps/desktop/src/renderer/components/chat/chatChrome.ts, apps/desktop/src/renderer/components/chat/errorReasonI18n.ts, apps/desktop/src/renderer/components/chat/generatedFilesProjection.ts, apps/desktop/src/renderer/components/chat/imageDisplaySize.ts, apps/desktop/src/renderer/components/chat/lightboxAnnotations.ts, apps/desktop/src/renderer/components/chat/lightboxGestures.ts, apps/desktop/src/renderer/components/chat/markdownImageTargets.ts, apps/desktop/src/renderer/components/chat/markdownMedia.ts, apps/desktop/src/renderer/components/chat/messageNavRailModel.ts, apps/desktop/src/renderer/components/chat/messageNavRailWheel.ts, apps/desktop/src/renderer/components/chat/messageNavigationProjection.ts, apps/desktop/src/renderer/components/chat/messageProjectionCache.ts, apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts, apps/desktop/src/renderer/components/chat/messageViewportCompensation.ts, apps/desktop/src/renderer/components/chat/messageViewportGeometry.ts, apps/desktop/src/renderer/components/chat/messageWorkGroups.ts, apps/desktop/src/renderer/components/chat/observeProgrammaticScroll.ts, apps/desktop/src/renderer/components/chat/rehypeFencedCodeMarker.ts, apps/desktop/src/renderer/components/chat/rehypeHighlightShared.ts, apps/desktop/src/renderer/components/chat/rehypeMathBlockMarker.ts, apps/desktop/src/renderer/components/chat/rehypeStreamWordFade.ts, apps/desktop/src/renderer/components/chat/remarkHtmlImages.ts, apps/desktop/src/renderer/components/chat/remarkLocalPathLinks.ts, apps/desktop/src/renderer/components/chat/remarkPreserveRawLocalDestinations.ts, apps/desktop/src/renderer/components/chat/remarkSessionLinks.ts, apps/desktop/src/renderer/components/chat/remarkStrictInlineMath.ts, apps/desktop/src/renderer/components/chat/remarkTruncateCjkUrls.ts, apps/desktop/src/renderer/components/chat/repairStreamingMarkdown.ts, apps/desktop/src/renderer/components/chat/scrollAnchoringDetect.ts, apps/desktop/src/renderer/components/chat/shareSelectionStore.ts, apps/desktop/src/renderer/components/chat/streamingMarkdownBlocks.tsx, apps/desktop/src/renderer/components/chat/streamingMarkdownChunks.ts, apps/desktop/src/renderer/components/chat/streamingMessageProjection.ts, apps/desktop/src/renderer/components/chat/toolLoopI18n.ts, apps/desktop/src/renderer/components/chat/unreadCount.ts, apps/desktop/src/renderer/components/chat/useAutomaticHistoryLoadBudget.ts, apps/desktop/src/renderer/components/chat/useCopyAsImage.tsx, apps/desktop/src/renderer/components/chat/useDeleteMessage.ts, apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx, apps/desktop/src/renderer/components/chat/useForkAtMessage.ts, apps/desktop/src/renderer/components/chat/useImageClipboard.ts, apps/desktop/src/renderer/components/chat/useImageLoadFailure.ts, apps/desktop/src/renderer/components/chat/useMessageViewport.ts, apps/desktop/src/renderer/components/chat/useNavigationKeyListener.ts, apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx, apps/desktop/src/renderer/components/chat/usePrevUserMessageInView.ts, apps/desktop/src/renderer/components/chat/useTurnChangeSets.ts, apps/desktop/src/renderer/components/chat/userMessageCollapse.ts, apps/desktop/src/renderer/components/chat/userMessageDisplayText.ts, apps/desktop/src/renderer/components/chat/userMessageLinkify.ts, apps/desktop/src/renderer/components/chat/viewportFillDetect.ts, apps/desktop/src/renderer/components/new-chat/AddRemoteProjectDialog.tsx, apps/desktop/src/renderer/components/new-chat/AgentSelect.tsx, apps/desktop/src/renderer/components/new-chat/AskUserQuestionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/AtMentionPanel.tsx, apps/desktop/src/renderer/components/new-chat/AttachmentTypeThumb.tsx, apps/desktop/src/renderer/components/new-chat/ChatInput.tsx, apps/desktop/src/renderer/components/new-chat/CjkPunctDecoration.ts, apps/desktop/src/renderer/components/new-chat/CjkPunctuationUtils.ts, apps/desktop/src/renderer/components/new-chat/ComposerAttachments.tsx, apps/desktop/src/renderer/components/new-chat/ComposerListIndentDecoration.ts, apps/desktop/src/renderer/components/new-chat/ComposerListNodes.ts, apps/desktop/src/renderer/components/new-chat/ComposerQuoteNode.tsx, apps/desktop/src/renderer/components/new-chat/DeviceSwitcherPill.tsx, apps/desktop/src/renderer/components/new-chat/EffortSlider.tsx, apps/desktop/src/renderer/components/new-chat/EmptyDocSelectionGuard.ts, apps/desktop/src/renderer/components/new-chat/ExtraDirsButton.tsx, apps/desktop/src/renderer/components/new-chat/FastModeToggle.tsx, apps/desktop/src/renderer/components/new-chat/FolderPickerPopover.tsx, apps/desktop/src/renderer/components/new-chat/FullAccessConfirmContent.tsx, apps/desktop/src/renderer/components/new-chat/GhostCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx, apps/desktop/src/renderer/components/new-chat/GoalIndicator.tsx, apps/desktop/src/renderer/components/new-chat/HomeUsageDashboard.tsx, apps/desktop/src/renderer/components/new-chat/ListComposerTextarea.tsx, apps/desktop/src/renderer/components/new-chat/LocalModelCatalogNotice.tsx, apps/desktop/src/renderer/components/new-chat/MentionChipNode.tsx, apps/desktop/src/renderer/components/new-chat/MentionDragCaretDecoration.ts, apps/desktop/src/renderer/components/new-chat/ModelCompatibilityNotice.tsx, apps/desktop/src/renderer/components/new-chat/ModelConfigFlyout.tsx, apps/desktop/src/renderer/components/new-chat/ModelHarnessPicker.tsx, apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx, apps/desktop/src/renderer/components/new-chat/ModelSourceDetails.tsx, apps/desktop/src/renderer/components/new-chat/NewGoalDialog.tsx, apps/desktop/src/renderer/components/new-chat/PastedTextChipNode.tsx, apps/desktop/src/renderer/components/new-chat/PendingQueuePanel.tsx, apps/desktop/src/renderer/components/new-chat/PermissionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PermissionSelector.tsx, apps/desktop/src/renderer/components/new-chat/PinnedPlanPanel.tsx, apps/desktop/src/renderer/components/new-chat/PlanActionCard.tsx, apps/desktop/src/renderer/components/new-chat/PlanModeIndicator.tsx, apps/desktop/src/renderer/components/new-chat/PlanViewerCard.tsx, apps/desktop/src/renderer/components/new-chat/PluginConnectionForm.tsx, apps/desktop/src/renderer/components/new-chat/PluginOauthDeviceCode.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupRemoteDesktopButton.tsx, apps/desktop/src/renderer/components/new-chat/PluginWriteAccessRecovery.tsx, apps/desktop/src/renderer/components/new-chat/QuickStartPillMark.ts, apps/desktop/src/renderer/components/new-chat/RemoteOauthSetupCard.tsx, apps/desktop/src/renderer/components/new-chat/SendButton.tsx, apps/desktop/src/renderer/components/new-chat/SlashCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsx, apps/desktop/src/renderer/components/new-chat/TakeoverMask.tsx, apps/desktop/src/renderer/components/new-chat/ThinkingToggle.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedFlyoutHost.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRail.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx, apps/desktop/src/renderer/components/new-chat/UsageDailyBars.tsx, apps/desktop/src/renderer/components/new-chat/UsageHeatmap.tsx, apps/desktop/src/renderer/components/new-chat/VendorSegmentedSwitcher.tsx, apps/desktop/src/renderer/components/new-chat/VoiceInputDraftDecoration.ts, apps/desktop/src/renderer/components/new-chat/WindowsSelectionReplacement.ts, apps/desktop/src/renderer/components/new-chat/WorktreeChipsRow.tsx, apps/desktop/src/renderer/components/new-chat/WorktreeCreatingOverlay.tsx, apps/desktop/src/renderer/components/new-chat/agentOptions.ts, apps/desktop/src/renderer/components/new-chat/agentSwitchConfirmation.ts, apps/desktop/src/renderer/components/new-chat/branchPick.ts, apps/desktop/src/renderer/components/new-chat/composerBlankPointerFocus.ts, apps/desktop/src/renderer/components/new-chat/composerContentSerialization.ts, apps/desktop/src/renderer/components/new-chat/composerDocState.ts, apps/desktop/src/renderer/components/new-chat/composerFrameScheduler.ts, apps/desktop/src/renderer/components/new-chat/composerHistoryProjection.ts, apps/desktop/src/renderer/components/new-chat/composerModelSelection.ts, apps/desktop/src/renderer/components/new-chat/composerPromptRecommendation.ts, apps/desktop/src/renderer/components/new-chat/composerRenderGate.ts, apps/desktop/src/renderer/components/new-chat/composerSendOwnership.ts, apps/desktop/src/renderer/components/new-chat/composerSendSnapshot.ts, apps/desktop/src/renderer/components/new-chat/effortChangeQueue.ts, apps/desktop/src/renderer/components/new-chat/extraDirsActions.ts, apps/desktop/src/renderer/components/new-chat/ghostComposerPlacement.ts, apps/desktop/src/renderer/components/new-chat/localAttachmentPicker.ts, apps/desktop/src/renderer/components/new-chat/mentionChipInsertion.ts, apps/desktop/src/renderer/components/new-chat/modelWindowErrorToast.ts, apps/desktop/src/renderer/components/new-chat/pastePipeline.ts, apps/desktop/src/renderer/components/new-chat/pathPaste.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueLocks.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowActivity.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowPresentation.ts, apps/desktop/src/renderer/components/new-chat/planModeComposerCommand.ts, apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx, apps/desktop/src/renderer/components/new-chat/remoteBrowseAdapters.ts, apps/desktop/src/renderer/components/new-chat/remoteExistingProjects.ts, apps/desktop/src/renderer/components/new-chat/restoreComposerDocument.ts, apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.ts, apps/desktop/src/renderer/components/new-chat/sourceSwitch.ts, apps/desktop/src/renderer/components/new-chat/unifiedModelSelection.ts, apps/desktop/src/renderer/components/new-chat/usagePalette.ts, apps/desktop/src/renderer/components/new-chat/useComposerSendFocusRestore.ts, apps/desktop/src/renderer/components/new-chat/useModelDiscoveryPending.ts, apps/desktop/src/renderer/components/new-chat/useProviderWeeklyQuota.ts, apps/desktop/src/renderer/components/new-chat/useUnifiedRowActions.ts, apps/desktop/src/renderer/features/bots/BotAuthorizationCard.tsx, apps/desktop/src/renderer/features/bots/BotAvatar.tsx, apps/desktop/src/renderer/features/bots/BotBasicProfileFields.tsx, apps/desktop/src/renderer/features/bots/BotCapabilitySettings.tsx, apps/desktop/src/renderer/features/bots/BotCollaborationCard.tsx, apps/desktop/src/renderer/features/bots/BotConnectionStatus.tsx, apps/desktop/src/renderer/features/bots/BotCreateMenu.tsx, apps/desktop/src/renderer/features/bots/BotDeleteDialog.tsx, apps/desktop/src/renderer/features/bots/BotDirectMessageCard.tsx, apps/desktop/src/renderer/features/bots/BotDirectMessageView.tsx, apps/desktop/src/renderer/features/bots/BotFollowMark.tsx, apps/desktop/src/renderer/features/bots/BotGenerationLabel.tsx, apps/desktop/src/renderer/features/bots/BotGroupAvatars.tsx, apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx, apps/desktop/src/renderer/features/bots/BotGroupComposer.tsx, apps/desktop/src/renderer/features/bots/BotGroupCreateDialog.tsx, apps/desktop/src/renderer/features/bots/BotGroupPendingInteraction.tsx, apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx, apps/desktop/src/renderer/features/bots/BotGroupQuote.tsx, apps/desktop/src/renderer/features/bots/BotGroupRuntimeFailureNotice.tsx, apps/desktop/src/renderer/features/bots/BotGroupSettingsDrawer.tsx, apps/desktop/src/renderer/features/bots/BotGroupSidebarRow.tsx, apps/desktop/src/renderer/features/bots/BotHistorySessionView.tsx, apps/desktop/src/renderer/features/bots/BotImportForm.tsx, apps/desktop/src/renderer/features/bots/BotInvitationWelcome.tsx, apps/desktop/src/renderer/features/bots/BotLearningFooter.tsx, apps/desktop/src/renderer/features/bots/BotLifecycleSettings.tsx, apps/desktop/src/renderer/features/bots/BotMemorySettings.tsx, apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx, apps/desktop/src/renderer/features/bots/BotPortraitPicker.tsx, apps/desktop/src/renderer/features/bots/BotRosterView.tsx, apps/desktop/src/renderer/features/bots/BotRoutines.tsx, apps/desktop/src/renderer/features/bots/BotSessionContentHeader.tsx, apps/desktop/src/renderer/features/bots/BotSessionTaskLink.tsx, apps/desktop/src/renderer/features/bots/BotSessionTaskResultCard.tsx, apps/desktop/src/renderer/features/bots/BotSessionView.tsx, apps/desktop/src/renderer/features/bots/BotSettingsBlock.tsx, apps/desktop/src/renderer/features/bots/BotSettingsDrawer.tsx, apps/desktop/src/renderer/features/bots/BotTaskCardHeader.tsx, apps/desktop/src/renderer/features/bots/BotTaskModelEditor.tsx, apps/desktop/src/renderer/features/bots/BotTodoList.tsx, apps/desktop/src/renderer/features/bots/BotWorkbench.tsx, apps/desktop/src/renderer/features/bots/BotWorkingStatus.tsx, apps/desktop/src/renderer/features/bots/BotsFeatureLayout.tsx, apps/desktop/src/renderer/features/bots/BotsGlobalSettingsSection.tsx, apps/desktop/src/renderer/features/bots/BotsHomeView.tsx, apps/desktop/src/renderer/features/bots/BotsListView.tsx, apps/desktop/src/renderer/features/bots/BotsSidebar.tsx, apps/desktop/src/renderer/features/bots/ChatBotAccessField.tsx, apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx, apps/desktop/src/renderer/features/bots/ChatInviteDialog.tsx, apps/desktop/src/renderer/features/bots/ChatInviteHost.tsx, apps/desktop/src/renderer/features/bots/ChatServerControls.tsx, apps/desktop/src/renderer/features/bots/ChatThreadPanel.tsx, apps/desktop/src/renderer/features/bots/CindyDevicePicker.tsx, apps/desktop/src/renderer/features/bots/CindyDeviceRow.tsx, apps/desktop/src/renderer/features/bots/RemoteBotSessionView.tsx, apps/desktop/src/renderer/features/bots/RemoteBotSettings.tsx, apps/desktop/src/renderer/features/bots/WorkbenchSessionList.tsx, apps/desktop/src/renderer/features/bots/botAvatarIdentity.ts, apps/desktop/src/renderer/features/bots/botCapabilityDefaults.ts, apps/desktop/src/renderer/features/bots/botChatPresentation.ts, apps/desktop/src/renderer/features/bots/botConversationPresentation.ts, apps/desktop/src/renderer/features/bots/botConversationTimeline.ts, apps/desktop/src/renderer/features/bots/botDelegationLive.ts, apps/desktop/src/renderer/features/bots/botFollowScopes.ts, apps/desktop/src/renderer/features/bots/botGeneratedArtifacts.ts, apps/desktop/src/renderer/features/bots/botGroupAttachments.ts, apps/desktop/src/renderer/features/bots/botGroupLane.ts, apps/desktop/src/renderer/features/bots/botGroupMentions.ts, apps/desktop/src/renderer/features/bots/botGroupPresentation.ts, apps/desktop/src/renderer/features/bots/botGroupStore.ts, apps/desktop/src/renderer/features/bots/botListDisplay.ts, apps/desktop/src/renderer/features/bots/botNavigation.ts, apps/desktop/src/renderer/features/bots/botPronounContext.tsx, apps/desktop/src/renderer/features/bots/botReadState.ts, apps/desktop/src/renderer/features/bots/botRosterDisplay.ts, apps/desktop/src/renderer/features/bots/botSessionOwners.ts, apps/desktop/src/renderer/features/bots/botSettingsAutosave.ts, apps/desktop/src/renderer/features/bots/botStore.ts, apps/desktop/src/renderer/features/bots/botTodo.css, apps/desktop/src/renderer/features/bots/botWelcomeContext.ts, apps/desktop/src/renderer/features/bots/botWorkbenchProjection.ts, apps/desktop/src/renderer/features/bots/chatError.ts, apps/desktop/src/renderer/features/bots/cindyDeviceRoster.ts, apps/desktop/src/renderer/features/bots/remoteBotRoster.ts, apps/desktop/src/renderer/features/bots/remoteBotSettingsData.ts, apps/desktop/src/renderer/features/bots/useBotGeneratedFileDeliveries.ts, apps/desktop/src/renderer/features/bots/useBotIslandVisibleSession.ts, apps/desktop/src/renderer/features/bots/useBotSettingsAutosave.ts, apps/desktop/src/renderer/features/bots/useBotUnreadSync.ts, apps/desktop/src/renderer/features/bots/useRemoteBots.ts, apps/desktop/src/renderer/features/bots/useWorkbenchSessionPages.ts, apps/desktop/src/renderer/features/bots/useWorkingStatusCopy.ts, apps/desktop/src/renderer/features/cc-agent/CCAgentFeatureLayout.tsx, apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx | 277 | 38 | 477 |++| `desktop.bots` | desktop | 伙伴(列表 / 对话 / 设置 / 历史 / 伙伴私聊 / 群聊) | hash `/bots`、`/bots/list`、`/bots/:botId`、`/bots/roster` 及伙伴当前/历史任务、伙伴私聊、伙伴群聊路由(BotsFeatureLayout) | BotBasicProfileFields, BotCollaborationCard, BotDirectMessageView, BotGroupChatView, BotGroupCreateDialog, BotGroupSettingsDrawer, BotHistorySessionView, BotLifecycleSettings, BotModelChainEditor, BotRosterView, BotSessionView, BotSettingsDrawer, BotsHomeView, BotsListView, RemoteBotSessionView | apps/desktop/src/renderer/components/chat/AgentActionRow.tsx, apps/desktop/src/renderer/components/chat/AgentActionsBlock.tsx, apps/desktop/src/renderer/components/chat/AgentOnOtherDeviceContext.tsx, apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx, apps/desktop/src/renderer/components/chat/AgentTaskLiveDetails.tsx, apps/desktop/src/renderer/components/chat/AnnotationStrokesSvg.tsx, apps/desktop/src/renderer/components/chat/AskUserQuestionBubble.tsx, apps/desktop/src/renderer/components/chat/AssistantMessage.tsx, apps/desktop/src/renderer/components/chat/AutomationOriginBadge.tsx, apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx, apps/desktop/src/renderer/components/chat/ChatDisplaySnapshotContext.tsx, apps/desktop/src/renderer/components/chat/ChatImageView.tsx, apps/desktop/src/renderer/components/chat/ChatLoadingImage.tsx, apps/desktop/src/renderer/components/chat/ChatSessionFileContext.tsx, apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx, apps/desktop/src/renderer/components/chat/ChatVideoView.tsx, apps/desktop/src/renderer/components/chat/CindyMakeDoctorCard.tsx, apps/desktop/src/renderer/components/chat/CopyAsImageBlock.tsx, apps/desktop/src/renderer/components/chat/CredentialSwitchWaitBanner.tsx, apps/desktop/src/renderer/components/chat/DiffView.tsx, apps/desktop/src/renderer/components/chat/ErrorBanner.tsx, apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsx, apps/desktop/src/renderer/components/chat/GeneratedFilesCard.tsx, apps/desktop/src/renderer/components/chat/GhostCardHostPrompts.tsx, apps/desktop/src/renderer/components/chat/GhostSummonCard.tsx, apps/desktop/src/renderer/components/chat/GhostToolCard.tsx, apps/desktop/src/renderer/components/chat/HookTaskCard.tsx, apps/desktop/src/renderer/components/chat/ImageGalleryContext.tsx, apps/desktop/src/renderer/components/chat/ImageHoverPreview.tsx, apps/desktop/src/renderer/components/chat/ImageLightbox.tsx, apps/desktop/src/renderer/components/chat/ImageMissingPlaceholder.tsx, apps/desktop/src/renderer/components/chat/InlineReferenceChip.tsx, apps/desktop/src/renderer/components/chat/InterruptedTurnBanner.tsx, apps/desktop/src/renderer/components/chat/JumpToBottomChip.tsx, apps/desktop/src/renderer/components/chat/MarkdownDiffBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownMermaidBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx, apps/desktop/src/renderer/components/chat/MermaidLightbox.tsx, apps/desktop/src/renderer/components/chat/MessageActionBar.tsx, apps/desktop/src/renderer/components/chat/MessageNavRail.tsx, apps/desktop/src/renderer/components/chat/MessageSourceLabels.tsx, apps/desktop/src/renderer/components/chat/MessageStream.tsx, apps/desktop/src/renderer/components/chat/MessageViewport.tsx, apps/desktop/src/renderer/components/chat/ModelLightbox.tsx, apps/desktop/src/renderer/components/chat/NewMessageIndicator.tsx, apps/desktop/src/renderer/components/chat/PlanReviewBubble.tsx, apps/desktop/src/renderer/components/chat/PrevMessageJumpChip.tsx, apps/desktop/src/renderer/components/chat/ProjectLinkChip.tsx, apps/desktop/src/renderer/components/chat/QuoteChip.tsx, apps/desktop/src/renderer/components/chat/RewindPreviewDialog.tsx, apps/desktop/src/renderer/components/chat/SelectionQuoteButton.tsx, apps/desktop/src/renderer/components/chat/SentAgentReferenceChip.tsx, apps/desktop/src/renderer/components/chat/SentInlineAtomBody.tsx, apps/desktop/src/renderer/components/chat/SessionHandoffCard.tsx, apps/desktop/src/renderer/components/chat/SessionLinkChip.tsx, apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx, apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx, apps/desktop/src/renderer/components/chat/SlackIcon.tsx, apps/desktop/src/renderer/components/chat/StreamFadeSpan.tsx, apps/desktop/src/renderer/components/chat/StreamingMarkdownChunk.tsx, apps/desktop/src/renderer/components/chat/SystemCard.tsx, apps/desktop/src/renderer/components/chat/TextLightbox.tsx, apps/desktop/src/renderer/components/chat/ThinkingCard.tsx, apps/desktop/src/renderer/components/chat/ThinkingText.tsx, apps/desktop/src/renderer/components/chat/TodoListCard.tsx, apps/desktop/src/renderer/components/chat/ToolCallCard.tsx, apps/desktop/src/renderer/components/chat/ToolPayloadLightbox.tsx, apps/desktop/src/renderer/components/chat/TopRightChipStack.tsx, apps/desktop/src/renderer/components/chat/TurnChangesCard.tsx, apps/desktop/src/renderer/components/chat/UnreadFailedScheduleBanner.tsx, apps/desktop/src/renderer/components/chat/UpgradeBanner.tsx, apps/desktop/src/renderer/components/chat/UserAttachmentChip.tsx, apps/desktop/src/renderer/components/chat/UserMessage.tsx, apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx, apps/desktop/src/renderer/components/chat/UserMessageUrlLink.tsx, apps/desktop/src/renderer/components/chat/VideoLightbox.tsx, apps/desktop/src/renderer/components/chat/WorkGroupBlock.tsx, apps/desktop/src/renderer/components/chat/WorktreeRestoreBanner.tsx, apps/desktop/src/renderer/components/chat/XIcon.tsx, apps/desktop/src/renderer/components/chat/activityRowChrome.ts, apps/desktop/src/renderer/components/chat/animateFocusScroll.ts, apps/desktop/src/renderer/components/chat/autoFollowIntent.ts, apps/desktop/src/renderer/components/chat/chatChrome.ts, apps/desktop/src/renderer/components/chat/errorReasonI18n.ts, apps/desktop/src/renderer/components/chat/generatedFilesProjection.ts, apps/desktop/src/renderer/components/chat/imageDisplaySize.ts, apps/desktop/src/renderer/components/chat/lightboxAnnotations.ts, apps/desktop/src/renderer/components/chat/lightboxGestures.ts, apps/desktop/src/renderer/components/chat/markdownImageTargets.ts, apps/desktop/src/renderer/components/chat/markdownMedia.ts, apps/desktop/src/renderer/components/chat/messageNavRailModel.ts, apps/desktop/src/renderer/components/chat/messageNavRailWheel.ts, apps/desktop/src/renderer/components/chat/messageNavigationProjection.ts, apps/desktop/src/renderer/components/chat/messageProjectionCache.ts, apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts, apps/desktop/src/renderer/components/chat/messageViewportCompensation.ts, apps/desktop/src/renderer/components/chat/messageViewportGeometry.ts, apps/desktop/src/renderer/components/chat/messageWorkGroups.ts, apps/desktop/src/renderer/components/chat/observeProgrammaticScroll.ts, apps/desktop/src/renderer/components/chat/rehypeFencedCodeMarker.ts, apps/desktop/src/renderer/components/chat/rehypeHighlightShared.ts, apps/desktop/src/renderer/components/chat/rehypeMathBlockMarker.ts, apps/desktop/src/renderer/components/chat/rehypeStreamWordFade.ts, apps/desktop/src/renderer/components/chat/remarkHtmlImages.ts, apps/desktop/src/renderer/components/chat/remarkLocalPathLinks.ts, apps/desktop/src/renderer/components/chat/remarkPreserveRawLocalDestinations.ts, apps/desktop/src/renderer/components/chat/remarkSessionLinks.ts, apps/desktop/src/renderer/components/chat/remarkStrictInlineMath.ts, apps/desktop/src/renderer/components/chat/remarkTruncateCjkUrls.ts, apps/desktop/src/renderer/components/chat/repairStreamingMarkdown.ts, apps/desktop/src/renderer/components/chat/scrollAnchoringDetect.ts, apps/desktop/src/renderer/components/chat/shareSelectionStore.ts, apps/desktop/src/renderer/components/chat/streamingMarkdownBlocks.tsx, apps/desktop/src/renderer/components/chat/streamingMarkdownChunks.ts, apps/desktop/src/renderer/components/chat/streamingMessageProjection.ts, apps/desktop/src/renderer/components/chat/toolLoopI18n.ts, apps/desktop/src/renderer/components/chat/unreadCount.ts, apps/desktop/src/renderer/components/chat/useAutomaticHistoryLoadBudget.ts, apps/desktop/src/renderer/components/chat/useCopyAsImage.tsx, apps/desktop/src/renderer/components/chat/useDeleteMessage.ts, apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx, apps/desktop/src/renderer/components/chat/useForkAtMessage.ts, apps/desktop/src/renderer/components/chat/useImageClipboard.ts, apps/desktop/src/renderer/components/chat/useImageLoadFailure.ts, apps/desktop/src/renderer/components/chat/useMessageViewport.ts, apps/desktop/src/renderer/components/chat/useNavigationKeyListener.ts, apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx, apps/desktop/src/renderer/components/chat/usePrevUserMessageInView.ts, apps/desktop/src/renderer/components/chat/useTurnChangeSets.ts, apps/desktop/src/renderer/components/chat/userMessageCollapse.ts, apps/desktop/src/renderer/components/chat/userMessageDisplayText.ts, apps/desktop/src/renderer/components/chat/userMessageLinkify.ts, apps/desktop/src/renderer/components/chat/viewportFillDetect.ts, apps/desktop/src/renderer/components/new-chat/AddRemoteProjectDialog.tsx, apps/desktop/src/renderer/components/new-chat/AgentSelect.tsx, apps/desktop/src/renderer/components/new-chat/AskUserQuestionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/AtMentionPanel.tsx, apps/desktop/src/renderer/components/new-chat/AttachmentTypeThumb.tsx, apps/desktop/src/renderer/components/new-chat/ChatInput.tsx, apps/desktop/src/renderer/components/new-chat/CjkPunctDecoration.ts, apps/desktop/src/renderer/components/new-chat/CjkPunctuationUtils.ts, apps/desktop/src/renderer/components/new-chat/ComposerAttachments.tsx, apps/desktop/src/renderer/components/new-chat/ComposerListIndentDecoration.ts, apps/desktop/src/renderer/components/new-chat/ComposerListNodes.ts, apps/desktop/src/renderer/components/new-chat/ComposerQuoteNode.tsx, apps/desktop/src/renderer/components/new-chat/DeviceSwitcherPill.tsx, apps/desktop/src/renderer/components/new-chat/EffortSlider.tsx, apps/desktop/src/renderer/components/new-chat/EmptyDocSelectionGuard.ts, apps/desktop/src/renderer/components/new-chat/ExtraDirsButton.tsx, apps/desktop/src/renderer/components/new-chat/FastModeToggle.tsx, apps/desktop/src/renderer/components/new-chat/FolderPickerPopover.tsx, apps/desktop/src/renderer/components/new-chat/FullAccessConfirmContent.tsx, apps/desktop/src/renderer/components/new-chat/GhostCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx, apps/desktop/src/renderer/components/new-chat/GoalIndicator.tsx, apps/desktop/src/renderer/components/new-chat/HomeUsageDashboard.tsx, apps/desktop/src/renderer/components/new-chat/ListComposerTextarea.tsx, apps/desktop/src/renderer/components/new-chat/LocalModelCatalogNotice.tsx, apps/desktop/src/renderer/components/new-chat/MentionChipNode.tsx, apps/desktop/src/renderer/components/new-chat/MentionDragCaretDecoration.ts, apps/desktop/src/renderer/components/new-chat/ModelCompatibilityNotice.tsx, apps/desktop/src/renderer/components/new-chat/ModelConfigFlyout.tsx, apps/desktop/src/renderer/components/new-chat/ModelHarnessPicker.tsx, apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx, apps/desktop/src/renderer/components/new-chat/ModelSourceDetails.tsx, apps/desktop/src/renderer/components/new-chat/NewGoalDialog.tsx, apps/desktop/src/renderer/components/new-chat/PastedTextChipNode.tsx, apps/desktop/src/renderer/components/new-chat/PendingQueuePanel.tsx, apps/desktop/src/renderer/components/new-chat/PermissionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PermissionSelector.tsx, apps/desktop/src/renderer/components/new-chat/PinnedPlanPanel.tsx, apps/desktop/src/renderer/components/new-chat/PlanActionCard.tsx, apps/desktop/src/renderer/components/new-chat/PlanModeIndicator.tsx, apps/desktop/src/renderer/components/new-chat/PlanViewerCard.tsx, apps/desktop/src/renderer/components/new-chat/PluginConnectionForm.tsx, apps/desktop/src/renderer/components/new-chat/PluginOauthDeviceCode.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupRemoteDesktopButton.tsx, apps/desktop/src/renderer/components/new-chat/PluginWriteAccessRecovery.tsx, apps/desktop/src/renderer/components/new-chat/QuickStartPillMark.ts, apps/desktop/src/renderer/components/new-chat/RemoteOauthSetupCard.tsx, apps/desktop/src/renderer/components/new-chat/SendButton.tsx, apps/desktop/src/renderer/components/new-chat/SlashCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsx, apps/desktop/src/renderer/components/new-chat/TakeoverMask.tsx, apps/desktop/src/renderer/components/new-chat/ThinkingToggle.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedFlyoutHost.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRail.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx, apps/desktop/src/renderer/components/new-chat/UsageDailyBars.tsx, apps/desktop/src/renderer/components/new-chat/UsageHeatmap.tsx, apps/desktop/src/renderer/components/new-chat/VendorSegmentedSwitcher.tsx, apps/desktop/src/renderer/components/new-chat/VoiceInputDraftDecoration.ts, apps/desktop/src/renderer/components/new-chat/WindowsSelectionReplacement.ts, apps/desktop/src/renderer/components/new-chat/WorktreeChipsRow.tsx, apps/desktop/src/renderer/components/new-chat/WorktreeCreatingOverlay.tsx, apps/desktop/src/renderer/components/new-chat/agentOptions.ts, apps/desktop/src/renderer/components/new-chat/agentSwitchConfirmation.ts, apps/desktop/src/renderer/components/new-chat/branchPick.ts, apps/desktop/src/renderer/components/new-chat/composerBlankPointerFocus.ts, apps/desktop/src/renderer/components/new-chat/composerContentSerialization.ts, apps/desktop/src/renderer/components/new-chat/composerDocState.ts, apps/desktop/src/renderer/components/new-chat/composerFrameScheduler.ts, apps/desktop/src/renderer/components/new-chat/composerHistoryProjection.ts, apps/desktop/src/renderer/components/new-chat/composerModelSelection.ts, apps/desktop/src/renderer/components/new-chat/composerPromptRecommendation.ts, apps/desktop/src/renderer/components/new-chat/composerRenderGate.ts, apps/desktop/src/renderer/components/new-chat/composerSendOwnership.ts, apps/desktop/src/renderer/components/new-chat/composerSendSnapshot.ts, apps/desktop/src/renderer/components/new-chat/effortChangeQueue.ts, apps/desktop/src/renderer/components/new-chat/extraDirsActions.ts, apps/desktop/src/renderer/components/new-chat/ghostComposerPlacement.ts, apps/desktop/src/renderer/components/new-chat/localAttachmentPicker.ts, apps/desktop/src/renderer/components/new-chat/mentionChipInsertion.ts, apps/desktop/src/renderer/components/new-chat/modelWindowErrorToast.ts, apps/desktop/src/renderer/components/new-chat/pastePipeline.ts, apps/desktop/src/renderer/components/new-chat/pathPaste.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueLocks.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowActivity.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowPresentation.ts, apps/desktop/src/renderer/components/new-chat/planModeComposerCommand.ts, apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx, apps/desktop/src/renderer/components/new-chat/remoteBrowseAdapters.ts, apps/desktop/src/renderer/components/new-chat/remoteExistingProjects.ts, apps/desktop/src/renderer/components/new-chat/restoreComposerDocument.ts, apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.ts, apps/desktop/src/renderer/components/new-chat/sourceSwitch.ts, apps/desktop/src/renderer/components/new-chat/unifiedModelSelection.ts, apps/desktop/src/renderer/components/new-chat/usagePalette.ts, apps/desktop/src/renderer/components/new-chat/useComposerSendFocusRestore.ts, apps/desktop/src/renderer/components/new-chat/useModelDiscoveryPending.ts, apps/desktop/src/renderer/components/new-chat/useProviderWeeklyQuota.ts, apps/desktop/src/renderer/components/new-chat/useUnifiedRowActions.ts, apps/desktop/src/renderer/features/bots/BotAuthorizationCard.tsx, apps/desktop/src/renderer/features/bots/BotAvatar.tsx, apps/desktop/src/renderer/features/bots/BotBasicProfileFields.tsx, apps/desktop/src/renderer/features/bots/BotCapabilitySettings.tsx, apps/desktop/src/renderer/features/bots/BotCollaborationCard.tsx, apps/desktop/src/renderer/features/bots/BotConnectionStatus.tsx, apps/desktop/src/renderer/features/bots/BotCreateMenu.tsx, apps/desktop/src/renderer/features/bots/BotDeleteDialog.tsx, apps/desktop/src/renderer/features/bots/BotDirectMessageCard.tsx, apps/desktop/src/renderer/features/bots/BotDirectMessageView.tsx, apps/desktop/src/renderer/features/bots/BotFollowMark.tsx, apps/desktop/src/renderer/features/bots/BotGenerationLabel.tsx, apps/desktop/src/renderer/features/bots/BotGroupAvatars.tsx, apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx, apps/desktop/src/renderer/features/bots/BotGroupComposer.tsx, apps/desktop/src/renderer/features/bots/BotGroupCreateDialog.tsx, apps/desktop/src/renderer/features/bots/BotGroupPendingInteraction.tsx, apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx, apps/desktop/src/renderer/features/bots/BotGroupQuote.tsx, apps/desktop/src/renderer/features/bots/BotGroupRuntimeFailureNotice.tsx, apps/desktop/src/renderer/features/bots/BotGroupSettingsDrawer.tsx, apps/desktop/src/renderer/features/bots/BotGroupSidebarRow.tsx, apps/desktop/src/renderer/features/bots/BotHistorySessionView.tsx, apps/desktop/src/renderer/features/bots/BotImportForm.tsx, apps/desktop/src/renderer/features/bots/BotInvitationWelcome.tsx, apps/desktop/src/renderer/features/bots/BotLearningFooter.tsx, apps/desktop/src/renderer/features/bots/BotLifecycleSettings.tsx, apps/desktop/src/renderer/features/bots/BotMemorySettings.tsx, apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx, apps/desktop/src/renderer/features/bots/BotPortraitPicker.tsx, apps/desktop/src/renderer/features/bots/BotRosterView.tsx, apps/desktop/src/renderer/features/bots/BotRoutines.tsx, apps/desktop/src/renderer/features/bots/BotSessionContentHeader.tsx, apps/desktop/src/renderer/features/bots/BotSessionTaskLink.tsx, apps/desktop/src/renderer/features/bots/BotSessionTaskResultCard.tsx, apps/desktop/src/renderer/features/bots/BotSessionView.tsx, apps/desktop/src/renderer/features/bots/BotSettingsBlock.tsx, apps/desktop/src/renderer/features/bots/BotSettingsDrawer.tsx, apps/desktop/src/renderer/features/bots/BotTaskCardHeader.tsx, apps/desktop/src/renderer/features/bots/BotTaskModelEditor.tsx, apps/desktop/src/renderer/features/bots/BotTodoList.tsx, apps/desktop/src/renderer/features/bots/BotWorkbench.tsx, apps/desktop/src/renderer/features/bots/BotWorkingStatus.tsx, apps/desktop/src/renderer/features/bots/BotsFeatureLayout.tsx, apps/desktop/src/renderer/features/bots/BotsGlobalSettingsSection.tsx, apps/desktop/src/renderer/features/bots/BotsHomeView.tsx, apps/desktop/src/renderer/features/bots/BotsListView.tsx, apps/desktop/src/renderer/features/bots/BotsSidebar.tsx, apps/desktop/src/renderer/features/bots/ChatBotAccessField.tsx, apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx, apps/desktop/src/renderer/features/bots/ChatInviteDialog.tsx, apps/desktop/src/renderer/features/bots/ChatInviteHost.tsx, apps/desktop/src/renderer/features/bots/ChatServerControls.tsx, apps/desktop/src/renderer/features/bots/ChatThreadPanel.tsx, apps/desktop/src/renderer/features/bots/CindyDevicePicker.tsx, apps/desktop/src/renderer/features/bots/CindyDeviceRow.tsx, apps/desktop/src/renderer/features/bots/RemoteBotSessionView.tsx, apps/desktop/src/renderer/features/bots/RemoteBotSettings.tsx, apps/desktop/src/renderer/features/bots/WorkbenchSessionList.tsx, apps/desktop/src/renderer/features/bots/botAvatarIdentity.ts, apps/desktop/src/renderer/features/bots/botCapabilityDefaults.ts, apps/desktop/src/renderer/features/bots/botChatPresentation.ts, apps/desktop/src/renderer/features/bots/botConversationPresentation.ts, apps/desktop/src/renderer/features/bots/botConversationTimeline.ts, apps/desktop/src/renderer/features/bots/botDelegationLive.ts, apps/desktop/src/renderer/features/bots/botFollowScopes.ts, apps/desktop/src/renderer/features/bots/botGeneratedArtifacts.ts, apps/desktop/src/renderer/features/bots/botGroupAttachments.ts, apps/desktop/src/renderer/features/bots/botGroupLane.ts, apps/desktop/src/renderer/features/bots/botGroupMentions.ts, apps/desktop/src/renderer/features/bots/botGroupOutbox.ts, apps/desktop/src/renderer/features/bots/botGroupPresentation.ts, apps/desktop/src/renderer/features/bots/botGroupStore.ts, apps/desktop/src/renderer/features/bots/botListDisplay.ts, apps/desktop/src/renderer/features/bots/botNavigation.ts, apps/desktop/src/renderer/features/bots/botPronounContext.tsx, apps/desktop/src/renderer/features/bots/botReadState.ts, apps/desktop/src/renderer/features/bots/botRosterDisplay.ts, apps/desktop/src/renderer/features/bots/botSessionOwners.ts, apps/desktop/src/renderer/features/bots/botSettingsAutosave.ts, apps/desktop/src/renderer/features/bots/botStore.ts, apps/desktop/src/renderer/features/bots/botTodo.css, apps/desktop/src/renderer/features/bots/botWelcomeContext.ts, apps/desktop/src/renderer/features/bots/botWorkbenchProjection.ts, apps/desktop/src/renderer/features/bots/chatError.ts, apps/desktop/src/renderer/features/bots/cindyDeviceRoster.ts, apps/desktop/src/renderer/features/bots/remoteBotRoster.ts, apps/desktop/src/renderer/features/bots/remoteBotSettingsData.ts, apps/desktop/src/renderer/features/bots/useBotGeneratedFileDeliveries.ts, apps/desktop/src/renderer/features/bots/useBotIslandVisibleSession.ts, apps/desktop/src/renderer/features/bots/useBotSettingsAutosave.ts, apps/desktop/src/renderer/features/bots/useBotUnreadSync.ts, apps/desktop/src/renderer/features/bots/useRemoteBots.ts, apps/desktop/src/renderer/features/bots/useWorkbenchSessionPages.ts, apps/desktop/src/renderer/features/bots/useWorkingStatusCopy.ts, apps/desktop/src/renderer/features/cc-agent/CCAgentFeatureLayout.tsx, apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx | 277 | 38 | 477 || `desktop.chat.files` | desktop | 工作目录文件浏览 | hash `/cc-agent/files/:sessionId`(WorkdirBrowseRoute) | FileBodyView, FileTreeView, WorkdirBrowseRoute | apps/desktop/src/renderer/features/cc-agent/workdir-browse/DocSearchBar.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/DrawioPreview.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/FileBodyView.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/FileFilterInput.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/FileTabsBar.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/FileTreeView.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/FilterResultList.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/ImagePreview.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/OpenInSystemActions.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/PdfPreview.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/SessionTabsBar.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/UnrenderablePlaceholder.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseRoute.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseSidebar.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useChatRailCollapsed.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useChatRailResize.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useConfirmSwitchAwayIfDirty.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useDelayedFlag.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useFileContent.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useFileTree.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useOpenTabs.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useProjectFileList.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useRevealFileInTree.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/activeFileBodyHandle.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/docModeSwitchProjects.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/drawioExt.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/expandedStore.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/fileContentCache.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/fileIcon.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/fileMeta.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/fileScrollStore.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/fileSelectionParams.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/filterFiles.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/imageExt.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/markdownAutosave.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/openTabsStore.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/pdfExt.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/selectedFileStore.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/search/SearchInput.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/search/SearchPanel.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/search/SearchResults.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/search/hooks/useProjectSearch.ts | 17 | 7 | 45 || `desktop.chat.new-draft` | desktop | 新建任务草稿页 | hash `/cc-agent/new`(NewMakerDraftRoute) | NewMakerDraftRoute | apps/desktop/src/renderer/features/cc-agent/NewMakerDraftRoute.tsx | 15 | 0 | 3 || `desktop.chat.orca-workflow` | desktop | Orca 协同工作台 | hash `/cc-agent/orca/:sessionId`(OrcaWorkflowRoute) | CCAgentSessionView, OrcaSplitView, OrcaWorkerPanel, OrcaWorkflowRoute | apps/desktop/src/renderer/components/chat/AgentActionRow.tsx, apps/desktop/src/renderer/components/chat/AgentActionsBlock.tsx, apps/desktop/src/renderer/components/chat/AgentOnOtherDeviceContext.tsx, apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx, apps/desktop/src/renderer/components/chat/AgentTaskLiveDetails.tsx, apps/desktop/src/renderer/components/chat/AnnotationStrokesSvg.tsx, apps/desktop/src/renderer/components/chat/AskUserQuestionBubble.tsx, apps/desktop/src/renderer/components/chat/AssistantMessage.tsx, apps/desktop/src/renderer/components/chat/AutomationOriginBadge.tsx, apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx, apps/desktop/src/renderer/components/chat/ChatDisplaySnapshotContext.tsx, apps/desktop/src/renderer/components/chat/ChatImageView.tsx, apps/desktop/src/renderer/components/chat/ChatLoadingImage.tsx, apps/desktop/src/renderer/components/chat/ChatSessionFileContext.tsx, apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx, apps/desktop/src/renderer/components/chat/ChatVideoView.tsx, apps/desktop/src/renderer/components/chat/CindyMakeDoctorCard.tsx, apps/desktop/src/renderer/components/chat/CopyAsImageBlock.tsx, apps/desktop/src/renderer/components/chat/CredentialSwitchWaitBanner.tsx, apps/desktop/src/renderer/components/chat/DiffView.tsx, apps/desktop/src/renderer/components/chat/ErrorBanner.tsx, apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsx, apps/desktop/src/renderer/components/chat/GeneratedFilesCard.tsx, apps/desktop/src/renderer/components/chat/GhostCardHostPrompts.tsx, apps/desktop/src/renderer/components/chat/GhostSummonCard.tsx, apps/desktop/src/renderer/components/chat/GhostToolCard.tsx, apps/desktop/src/renderer/components/chat/HookTaskCard.tsx, apps/desktop/src/renderer/components/chat/ImageGalleryContext.tsx, apps/desktop/src/renderer/components/chat/ImageHoverPreview.tsx, apps/desktop/src/renderer/components/chat/ImageLightbox.tsx, apps/desktop/src/renderer/components/chat/ImageMissingPlaceholder.tsx, apps/desktop/src/renderer/components/chat/InlineReferenceChip.tsx, apps/desktop/src/renderer/components/chat/InterruptedTurnBanner.tsx, apps/desktop/src/renderer/components/chat/JumpToBottomChip.tsx, apps/desktop/src/renderer/components/chat/MarkdownDiffBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownMermaidBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx, apps/desktop/src/renderer/components/chat/MermaidLightbox.tsx, apps/desktop/src/renderer/components/chat/MessageActionBar.tsx, apps/desktop/src/renderer/components/chat/MessageNavRail.tsx, apps/desktop/src/renderer/components/chat/MessageSourceLabels.tsx, apps/desktop/src/renderer/components/chat/MessageStream.tsx, apps/desktop/src/renderer/components/chat/MessageViewport.tsx, apps/desktop/src/renderer/components/chat/ModelLightbox.tsx, apps/desktop/src/renderer/components/chat/NewMessageIndicator.tsx, apps/desktop/src/renderer/components/chat/PlanReviewBubble.tsx, apps/desktop/src/renderer/components/chat/PrevMessageJumpChip.tsx, apps/desktop/src/renderer/components/chat/ProjectLinkChip.tsx, apps/desktop/src/renderer/components/chat/QuoteChip.tsx, apps/desktop/src/renderer/components/chat/RewindPreviewDialog.tsx, apps/desktop/src/renderer/components/chat/SelectionQuoteButton.tsx, apps/desktop/src/renderer/components/chat/SentAgentReferenceChip.tsx, apps/desktop/src/renderer/components/chat/SentInlineAtomBody.tsx, apps/desktop/src/renderer/components/chat/SessionHandoffCard.tsx, apps/desktop/src/renderer/components/chat/SessionLinkChip.tsx, apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx, apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx, apps/desktop/src/renderer/components/chat/SlackIcon.tsx, apps/desktop/src/renderer/components/chat/StreamFadeSpan.tsx, apps/desktop/src/renderer/components/chat/StreamingMarkdownChunk.tsx, apps/desktop/src/renderer/components/chat/SystemCard.tsx, apps/desktop/src/renderer/components/chat/TextLightbox.tsx, apps/desktop/src/renderer/components/chat/ThinkingCard.tsx, apps/desktop/src/renderer/components/chat/ThinkingText.tsx, apps/desktop/src/renderer/components/chat/TodoListCard.tsx, apps/desktop/src/renderer/components/chat/ToolCallCard.tsx, apps/desktop/src/renderer/components/chat/ToolPayloadLightbox.tsx, apps/desktop/src/renderer/components/chat/TopRightChipStack.tsx, apps/desktop/src/renderer/components/chat/TurnChangesCard.tsx, apps/desktop/src/renderer/components/chat/UnreadFailedScheduleBanner.tsx, apps/desktop/src/renderer/components/chat/UpgradeBanner.tsx, apps/desktop/src/renderer/components/chat/UserAttachmentChip.tsx, apps/desktop/src/renderer/components/chat/UserMessage.tsx, apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx, apps/desktop/src/renderer/components/chat/UserMessageUrlLink.tsx, apps/desktop/src/renderer/components/chat/VideoLightbox.tsx, apps/desktop/src/renderer/components/chat/WorkGroupBlock.tsx, apps/desktop/src/renderer/components/chat/WorktreeRestoreBanner.tsx, apps/desktop/src/renderer/components/chat/XIcon.tsx, apps/desktop/src/renderer/components/chat/activityRowChrome.ts, apps/desktop/src/renderer/components/chat/animateFocusScroll.ts, apps/desktop/src/renderer/components/chat/autoFollowIntent.ts, apps/desktop/src/renderer/components/chat/chatChrome.ts, apps/desktop/src/renderer/components/chat/errorReasonI18n.ts, apps/desktop/src/renderer/components/chat/generatedFilesProjection.ts, apps/desktop/src/renderer/components/chat/imageDisplaySize.ts, apps/desktop/src/renderer/components/chat/lightboxAnnotations.ts, apps/desktop/src/renderer/components/chat/lightboxGestures.ts, apps/desktop/src/renderer/components/chat/markdownImageTargets.ts, apps/desktop/src/renderer/components/chat/markdownMedia.ts, apps/desktop/src/renderer/components/chat/messageNavRailModel.ts, apps/desktop/src/renderer/components/chat/messageNavRailWheel.ts, apps/desktop/src/renderer/components/chat/messageNavigationProjection.ts, apps/desktop/src/renderer/components/chat/messageProjectionCache.ts, apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts, apps/desktop/src/renderer/components/chat/messageViewportCompensation.ts, apps/desktop/src/renderer/components/chat/messageViewportGeometry.ts, apps/desktop/src/renderer/components/chat/messageWorkGroups.ts, apps/desktop/src/renderer/components/chat/observeProgrammaticScroll.ts, apps/desktop/src/renderer/components/chat/rehypeFencedCodeMarker.ts, apps/desktop/src/renderer/components/chat/rehypeHighlightShared.ts, apps/desktop/src/renderer/components/chat/rehypeMathBlockMarker.ts, apps/desktop/src/renderer/components/chat/rehypeStreamWordFade.ts, apps/desktop/src/renderer/components/chat/remarkHtmlImages.ts, apps/desktop/src/renderer/components/chat/remarkLocalPathLinks.ts, apps/desktop/src/renderer/components/chat/remarkPreserveRawLocalDestinations.ts, apps/desktop/src/renderer/components/chat/remarkSessionLinks.ts, apps/desktop/src/renderer/components/chat/remarkStrictInlineMath.ts, apps/desktop/src/renderer/components/chat/remarkTruncateCjkUrls.ts, apps/desktop/src/renderer/components/chat/repairStreamingMarkdown.ts, apps/desktop/src/renderer/components/chat/scrollAnchoringDetect.ts, apps/desktop/src/renderer/components/chat/shareSelectionStore.ts, apps/desktop/src/renderer/components/chat/streamingMarkdownBlocks.tsx, apps/desktop/src/renderer/components/chat/streamingMarkdownChunks.ts, apps/desktop/src/renderer/components/chat/streamingMessageProjection.ts, apps/desktop/src/renderer/components/chat/toolLoopI18n.ts, apps/desktop/src/renderer/components/chat/unreadCount.ts, apps/desktop/src/renderer/components/chat/useAutomaticHistoryLoadBudget.ts, apps/desktop/src/renderer/components/chat/useCopyAsImage.tsx, apps/desktop/src/renderer/components/chat/useDeleteMessage.ts, apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx, apps/desktop/src/renderer/components/chat/useForkAtMessage.ts, apps/desktop/src/renderer/components/chat/useImageClipboard.ts, apps/desktop/src/renderer/components/chat/useImageLoadFailure.ts, apps/desktop/src/renderer/components/chat/useMessageViewport.ts, apps/desktop/src/renderer/components/chat/useNavigationKeyListener.ts, apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx, apps/desktop/src/renderer/components/chat/usePrevUserMessageInView.ts, apps/desktop/src/renderer/components/chat/useTurnChangeSets.ts, apps/desktop/src/renderer/components/chat/userMessageCollapse.ts, apps/desktop/src/renderer/components/chat/userMessageDisplayText.ts, apps/desktop/src/renderer/components/chat/userMessageLinkify.ts, apps/desktop/src/renderer/components/chat/viewportFillDetect.ts, apps/desktop/src/renderer/components/new-chat/AddRemoteProjectDialog.tsx, apps/desktop/src/renderer/components/new-chat/AgentSelect.tsx, apps/desktop/src/renderer/components/new-chat/AskUserQuestionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/AtMentionPanel.tsx, apps/desktop/src/renderer/components/new-chat/AttachmentTypeThumb.tsx, apps/desktop/src/renderer/components/new-chat/ChatInput.tsx, apps/desktop/src/renderer/components/new-chat/CjkPunctDecoration.ts, apps/desktop/src/renderer/components/new-chat/CjkPunctuationUtils.ts, apps/desktop/src/renderer/components/new-chat/ComposerAttachments.tsx, apps/desktop/src/renderer/components/new-chat/ComposerListIndentDecoration.ts, apps/desktop/src/renderer/components/new-chat/ComposerListNodes.ts, apps/desktop/src/renderer/components/new-chat/ComposerQuoteNode.tsx, apps/desktop/src/renderer/components/new-chat/DeviceSwitcherPill.tsx, apps/desktop/src/renderer/components/new-chat/EffortSlider.tsx, apps/desktop/src/renderer/components/new-chat/EmptyDocSelectionGuard.ts, apps/desktop/src/renderer/components/new-chat/ExtraDirsButton.tsx, apps/desktop/src/renderer/components/new-chat/FastModeToggle.tsx, apps/desktop/src/renderer/components/new-chat/FolderPickerPopover.tsx, apps/desktop/src/renderer/components/new-chat/FullAccessConfirmContent.tsx, apps/desktop/src/renderer/components/new-chat/GhostCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx, apps/desktop/src/renderer/components/new-chat/GoalIndicator.tsx, apps/desktop/src/renderer/components/new-chat/HomeUsageDashboard.tsx, apps/desktop/src/renderer/components/new-chat/ListComposerTextarea.tsx, apps/desktop/src/renderer/components/new-chat/LocalModelCatalogNotice.tsx, apps/desktop/src/renderer/components/new-chat/MentionChipNode.tsx, apps/desktop/src/renderer/components/new-chat/MentionDragCaretDecoration.ts, apps/desktop/src/renderer/components/new-chat/ModelCompatibilityNotice.tsx, apps/desktop/src/renderer/components/new-chat/ModelConfigFlyout.tsx, apps/desktop/src/renderer/components/new-chat/ModelHarnessPicker.tsx, apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx, apps/desktop/src/renderer/components/new-chat/ModelSourceDetails.tsx, apps/desktop/src/renderer/components/new-chat/NewGoalDialog.tsx, apps/desktop/src/renderer/components/new-chat/PastedTextChipNode.tsx, apps/desktop/src/renderer/components/new-chat/PendingQueuePanel.tsx, apps/desktop/src/renderer/components/new-chat/PermissionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PermissionSelector.tsx, apps/desktop/src/renderer/components/new-chat/PinnedPlanPanel.tsx, apps/desktop/src/renderer/components/new-chat/PlanActionCard.tsx, apps/desktop/src/renderer/components/new-chat/PlanModeIndicator.tsx, apps/desktop/src/renderer/components/new-chat/PlanViewerCard.tsx, apps/desktop/src/renderer/components/new-chat/PluginConnectionForm.tsx, apps/desktop/src/renderer/components/new-chat/PluginOauthDeviceCode.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupRemoteDesktopButton.tsx, apps/desktop/src/renderer/components/new-chat/PluginWriteAccessRecovery.tsx, apps/desktop/src/renderer/components/new-chat/QuickStartPillMark.ts, apps/desktop/src/renderer/components/new-chat/RemoteOauthSetupCard.tsx, apps/desktop/src/renderer/components/new-chat/SendButton.tsx, apps/desktop/src/renderer/components/new-chat/SlashCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsx, apps/desktop/src/renderer/components/new-chat/TakeoverMask.tsx, apps/desktop/src/renderer/components/new-chat/ThinkingToggle.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedFlyoutHost.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRail.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx, apps/desktop/src/renderer/components/new-chat/UsageDailyBars.tsx, apps/desktop/src/renderer/components/new-chat/UsageHeatmap.tsx, apps/desktop/src/renderer/components/new-chat/VendorSegmentedSwitcher.tsx, apps/desktop/src/renderer/components/new-chat/VoiceInputDraftDecoration.ts, apps/desktop/src/renderer/components/new-chat/WindowsSelectionReplacement.ts, apps/desktop/src/renderer/components/new-chat/WorktreeChipsRow.tsx, apps/desktop/src/renderer/components/new-chat/WorktreeCreatingOverlay.tsx, apps/desktop/src/renderer/components/new-chat/agentOptions.ts, apps/desktop/src/renderer/components/new-chat/agentSwitchConfirmation.ts, apps/desktop/src/renderer/components/new-chat/branchPick.ts, apps/desktop/src/renderer/components/new-chat/composerBlankPointerFocus.ts, apps/desktop/src/renderer/components/new-chat/composerContentSerialization.ts, apps/desktop/src/renderer/components/new-chat/composerDocState.ts, apps/desktop/src/renderer/components/new-chat/composerFrameScheduler.ts, apps/desktop/src/renderer/components/new-chat/composerHistoryProjection.ts, apps/desktop/src/renderer/components/new-chat/composerModelSelection.ts, apps/desktop/src/renderer/components/new-chat/composerPromptRecommendation.ts, apps/desktop/src/renderer/components/new-chat/composerRenderGate.ts, apps/desktop/src/renderer/components/new-chat/composerSendOwnership.ts, apps/desktop/src/renderer/components/new-chat/composerSendSnapshot.ts, apps/desktop/src/renderer/components/new-chat/effortChangeQueue.ts, apps/desktop/src/renderer/components/new-chat/extraDirsActions.ts, apps/desktop/src/renderer/components/new-chat/ghostComposerPlacement.ts, apps/desktop/src/renderer/components/new-chat/localAttachmentPicker.ts, apps/desktop/src/renderer/components/new-chat/mentionChipInsertion.ts, apps/desktop/src/renderer/components/new-chat/modelWindowErrorToast.ts, apps/desktop/src/renderer/components/new-chat/pastePipeline.ts, apps/desktop/src/renderer/components/new-chat/pathPaste.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueLocks.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowActivity.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowPresentation.ts, apps/desktop/src/renderer/components/new-chat/planModeComposerCommand.ts, apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx, apps/desktop/src/renderer/components/new-chat/remoteBrowseAdapters.ts, apps/desktop/src/renderer/components/new-chat/remoteExistingProjects.ts, apps/desktop/src/renderer/components/new-chat/restoreComposerDocument.ts, apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.ts, apps/desktop/src/renderer/components/new-chat/sourceSwitch.ts, apps/desktop/src/renderer/components/new-chat/unifiedModelSelection.ts, apps/desktop/src/renderer/components/new-chat/usagePalette.ts, apps/desktop/src/renderer/components/new-chat/useComposerSendFocusRestore.ts, apps/desktop/src/renderer/components/new-chat/useModelDiscoveryPending.ts, apps/desktop/src/renderer/components/new-chat/useProviderWeeklyQuota.ts, apps/desktop/src/renderer/components/new-chat/useUnifiedRowActions.ts, apps/desktop/src/renderer/features/cc-agent/CCAgentFeatureLayout.tsx, apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx, apps/desktop/src/renderer/features/cc-agent/OrcaSplitView.tsx, apps/desktop/src/renderer/features/cc-agent/OrcaWorkerPanel.tsx, apps/desktop/src/renderer/features/cc-agent/OrcaWorkflowRoute.tsx | 252 | 38 | 337 |diff --cc docs/product-rules/bot-group-chat.mdindex 7722b8dbdf,fea8a8d0a2..69b41ed5d0--- a/docs/product-rules/bot-group-chat.md+++ b/docs/product-rules/bot-group-chat.md@@@ -351,8 -352,6 +352,8 @@@ Chris 已明确扩展到多人各带伙同一草稿的点名目标 ID、顺序或所有人标记变化,即使显示名字与正文没变,也必须使用新的 `clientId`。只有正文、点名目标、分工标记和附件均不变时,失败重试才复用原发送尝试。- Desktop 主群输入框发送即乐观显示:点发送后消息立即接在时间线末尾,输入框与托盘马上空出,可以接着发下一条;同一个群的提交按发出顺序逐条交给 main,慢于 0.6 秒才在气泡下显示「发送中…」。回执的 `messageId` 是替换依据:时间线读到该消息即换成真实消息,回执之后开始的重读没读到也视为已进历史;推送重读先于回执到达时,只对正在提交的那一条按「基线之后、未被回执认领、正文与附件数一致的自己的消息」做显示去重,最终仍以 `messageId` 为准。附件按输入生成临时列表;带手绘标注的图片入队即烧录,完成后气泡改用烧录后的本地预览,提交与重试复用同一份烧录结果,放回输入框的仍是带笔迹的原件。真实消息到达而服务器副本尚未可用(无 url / path,或旧版尚未列出)时,在同一 `messageId` 内配对:数量一致按发送顺序,旧版逐个列出时按顺序同名(烧录后的名字)配对,继续显示本地预览直到副本可用,不退成缺失、不重复、同名文件不互换。离开输入框、尚未确认的图片(含标注原图与烧录副本)登记进存储清理的保护清单直到条目释放,已确认消息的本地预览不登记(发送时 main 已在群的 `bot-group-attachment` 引用下固定);本地预览按已加载的全部时间线(含更早的页)结算,不设条数上限;尚未进入消息的暂存文件按归属回收:还没开始提交的条目(排队中、已失败)归发件箱,群被删除(包括不在当前页、从列表消失且读取确认 `NOT_FOUND` 的群;读取不确定时在 5 秒、30 秒、2 分钟后各重试一次,群回到列表或读到仍存在即停止)时立即回收;已开始提交的条目归它的那次请求——烧录期间被丢弃的不再发出并回收,已交给 main 的等 main 答复,成功(已进入消息)不回收,失败或调用异常才回收(main 在答复前读完本地文件,失败时不留引用暂存路径的本地记录)。切换账号时发件箱同样发出回收,但 main 只删当前账号暂存目录里的副本,renderer 看到切换时 main 已在新账号(或边界)下,所以前一账号的暂存副本留在它自己的目录里,不在发件箱范围内。发送失败绝不自动重发:输入框为空(无文字、附件、分工标签)时把正文、点名、标签与附件原样放回并提示原因,再发沿用原 `clientId`;输入框已有新内容时消息留在时间线上显示「没发出去」,可「重试」(同一 `clientId`)或在输入框清空后「编辑」放回;失败时输入框不在(切到别的群、分享模式),回到该群时同样放回空输入框并提示原因。发件箱原样保存并发出完整发送输入(附件入队即开始烧录标注,提交时序列化),首发与重试不挑字段;除 `clientId` 外的全部字段与附件共同决定能否复用原 `clientId`,新增发送字段无需改动发件箱。发件箱只在 renderer 内存中保留,切群后仍按群隔离,切换到另一个账号时清空(同账号的 generation 修复、认证边界短暂的 null 不清空)、删群丢弃,不持久化。Thread 回复与手机端仍是等待回执后显示。实现见 `renderer/features/bots/botGroupOutbox.ts`,回归见 `botGroupOutbox.test.ts` 与 `BotGroupChatView.test.tsx`。++Desktop 主群输入框发送即乐观显示:点发送后消息立即接在时间线末尾,输入框与托盘马上空出,可以接着发下一条;同一个群的提交按发出顺序逐条交给 main,慢于 0.6 秒才在气泡下显示「发送中…」。回执的 `messageId` 是替换依据:时间线读到该消息即换成真实消息,回执之后开始的重读没读到也视为已进历史;推送重读先于回执到达时,只对正在提交的那一条按「基线之后、未被回执认领、正文与附件数一致的自己的消息」做显示去重,最终仍以 `messageId` 为准。附件按输入生成临时列表;带手绘标注的图片入队即烧录,完成后气泡改用烧录后的本地预览,提交与重试复用同一份烧录结果,放回输入框的仍是带笔迹的原件。真实消息到达而服务器副本尚未可用(无 url / path,或旧版尚未列出)时,在同一 `messageId` 内配对:数量一致按发送顺序,旧版逐个列出时按顺序同名(烧录后的名字)配对,继续显示本地预览直到副本可用,不退成缺失、不重复、同名文件不互换。离开输入框、尚未确认的图片(含标注原图与烧录副本)登记进存储清理的保护清单直到条目释放,已确认消息的本地预览不登记(发送时 main 已在群的 `bot-group-attachment` 引用下固定);本地预览按已加载的全部时间线(含更早的页)结算,不设条数上限;尚未进入消息的暂存文件按归属回收:还没开始提交的条目(排队中、已失败)归发件箱,群被删除(包括不在当前页、从列表消失且读取确认 `NOT_FOUND` 的群;读取不确定时在 5 秒、30 秒、2 分钟后各重试一次,群回到列表或读到仍存在即停止)时立即回收;已开始提交的条目归它的那次请求——烧录期间被丢弃的不再发出并回收,已交给 main 的等 main 答复,成功(已进入消息)不回收,失败或调用异常才回收(main 在答复前读完本地文件,失败时不留引用暂存路径的本地记录)。切换账号时发件箱同样发出回收,但 main 只删当前账号暂存目录里的副本,renderer 看到切换时 main 已在新账号(或边界)下,所以前一账号的暂存副本留在它自己的目录里,不在发件箱范围内。发送失败绝不自动重发:输入框为空(无文字、附件、分工标签)时把正文、点名、标签与附件原样放回并提示原因,再发沿用原 `clientId`;输入框已有新内容时消息留在时间线上显示「没发出去」,可「重试」(同一 `clientId`)或在输入框清空后「编辑」放回;失败时输入框不在(切到别的群、分享模式),回到该群时同样放回空输入框并提示原因。「引用回复」随消息进入发件箱:待发气泡上方显示同一个引用块,引用是发送输入的一部分(换引用即换 `clientId`);失败放回时引用只随它自己的正文放回(期间已另选引用的以新选为准),原消息不可用(`QUOTE_UNAVAILABLE`)时只放回正文。发件箱原样保存并发出完整发送输入(附件入队即开始烧录标注,提交时序列化),首发与重试不挑字段;除 `clientId` 外的全部字段与附件共同决定能否复用原 `clientId`,新增发送字段无需改动发件箱。发件箱只在 renderer 内存中保留,切群后仍按群隔离,切换到另一个账号时清空(同账号的 generation 修复、认证边界短暂的 null 不清空)、删群丢弃,不持久化。Thread 回复与手机端仍是等待回执后显示。实现见 `renderer/features/bots/botGroupOutbox.ts`,回归见 `botGroupOutbox.test.ts` 与 `BotGroupChatView.test.tsx`。+完成全部显式目标校验后,最终点名列表继续沿用排除当前用户自己的既有规则;主群、Thread 与手机直连均一致,不因显式列表或所有人标记改变。手机直连入口同样在发送前读取已加入成员、校验全部显式目标,再展开所有人。点名失效沿用本地化提示和草稿恢复,不把群页标为离线;重选当前成员后可以立即继续发送。回归见 `chatServerMobileEntry.test.tsx` 与 `BotGroupChatScreen.test.tsx`。