From 7089f768fdfb2acc10ffda77eeade42f25507670 Mon Sep 17 00:00:00 2001 From: weichen Date: Thu, 1 Oct 2026 03:32:55 +0000 Subject: [PATCH] Make the final reply always visible and fix artifacts-panel dead clicks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: field report two — the final answer collapsed into the process area (the CF0 long-reply fold swallowed 2000+ char replies and the model inlines narration, so users saw "everything folded") and the artifacts workspace panel preview clicks did nothing (the full-screen overlay stayed up, hiding the rail the preview opened in). Evidence: - Conversation.tsx: removed the CF0 LongReplyCollapse entirely — the final output contract is "the reply to the user is always fully visible; only process parts fold"; deliverable cards stay pinned after the reply - Workspaces.tsx ArtifactsPanel: row click and fullscreen action now close the workspace overlay before requesting the rail/fullscreen preview, so the preview is actually on screen - vitest 40/40, tsc clean; no design-guard regressions (no new colors, keyframes, or inline font sizes) Impact: replies are readable in place; ⌘1 panel clicks visibly open previews; no other surfaces changed. Refs: task feature/agent-native-deliverables-r1 (backend: artifact backfill root fix + agent-native deliverables) --- src/components/Conversation.tsx | 34 +++++---------------------------- src/components/Workspaces.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/src/components/Conversation.tsx b/src/components/Conversation.tsx index de132d7..77e5075 100644 --- a/src/components/Conversation.tsx +++ b/src/components/Conversation.tsx @@ -165,29 +165,6 @@ function ProcessCollapse({ parts, idKey }: { parts: Part[]; idKey: string }) { ) } -// 长回复折叠阈值(CF0):终态后超长正文收成摘要行,点击展开全文;live 期间全文可见。 -const LONG_REPLY_CHARS = 800 - -function LongReplyCollapse({ text, idKey }: { text: string; idKey: string }) { - // 摘句取压缩空白后的前 100 字;字数按 Markdown 源码长度计。 - const excerpt = text.replace(/\s+/g, ' ').trim().slice(0, 100) - return ( -
- - ▸ - 📄 长回复 - {text.length} 字(按 Markdown 源码计) - {excerpt && {excerpt}…} - }> -
-
-
- -
- ) -} - // 已工作计时(ZCode「已工作 X 分 X 秒」摘要行;1s 步进,仅 live 期间挂载)。 function useElapsed(startedAt: number): string { const [, tick] = useState(0) @@ -239,14 +216,13 @@ function AssistantMessage({ msg, live }: { msg: Message; live?: LiveState | null ? (showProcess ?
: ) - : (() => { - // CF0:非 live 的超长文本部件折叠为摘要行;live 与短文本不受影响。 - if (!live && b.part.type === 'text' && (b.part.text?.length ?? 0) > LONG_REPLY_CHARS) - return - return
+ : ( + // 最终输出契约:终轮正文是对用户的回复,一律完整可见(CF0 长回复折叠 + // 已废除——过程进折叠区,回复不再折叠);交付卡片钉在正文之后。 +
- })())} + ))} {live && } {!live && ctxObs && }
diff --git a/src/components/Workspaces.tsx b/src/components/Workspaces.tsx index b74bdfe..6798c25 100644 --- a/src/components/Workspaces.tsx +++ b/src/components/Workspaces.tsx @@ -93,15 +93,17 @@ export function ArtifactsPanel() { : visible.length === 0 ?
没有匹配「{q}」的文件
: visible.map(a => ( + // 预览落位在右栏——弹层必须先收起,否则预览换到被盖住的右栏, + // 用户看到的是「点了没反应」(工件面板是全屏 OverlayHost)。
store.requestPreview(a)} title={`预览 ${a.name}(右栏,边聊边看)`}> + onClick={() => { store.closeWorkspace(); store.requestPreview(a) }} title={`预览 ${a.name}(右栏,边聊边看)`}> {a.name} {a.kind} · {humanSize(a.size) || '—'} · {shortTime(a.updatedAt)} - + e.stopPropagation()}>