diff --git a/src/components/AgentTracker.tsx b/src/components/AgentTracker.tsx index 868da36..55e2b3c 100644 --- a/src/components/AgentTracker.tsx +++ b/src/components/AgentTracker.tsx @@ -25,56 +25,50 @@ export function AgentTracker() { const focusMsgs = focus === runId ? messagesAll.filter(m => m.runId === runId) : subMessages[focus] ?? [] return ( + // 阶段③ 收敛:只保留 OverlayHost 一层壳(此前在其内又嵌 .modal 双层窗框)。 store.setUI({ trackerRunId: null })}> -
-
- 🤖 Sub-agent 追踪 - - -
-
- {!root &&
加载中…
} - {root && ( -
-
-
- - {root.kind === 'subagent' ? root.agentName || '子代理' : '主任务'} - {root.status}{root.phase ? ` · ${root.phase}` : ''} - - +
+ {!root &&
加载中…
} + {root && ( + <> +
+
+ + {root.kind === 'subagent' ? root.agentName || '子代理' : '主任务'} + {root.status}{root.phase ? ` · ${root.phase}` : ''} + + +
+ {children.length > 0 && ( +
+ {children.map(c => ( +
setSelected(c.id)}> + + 🤖 {c.agentName || c.id} + {c.status} +
+ ))}
- {children.length > 0 && ( -
- {children.map(c => ( -
setSelected(c.id)}> - - 🤖 {c.agentName || c.id} - {c.status} -
- ))} -
- )} -
-
中间过程({focus === runId ? '主任务' : '子代理'})
-
- {focusMsgs.length === 0 &&
(无中间过程消息)
} - {focusMsgs.map(m => ( -
- {m.parts.map((p, i) => ( -
- {p.type === 'text' && p.text} - {p.type === 'thinking' && {p.text}} - {p.type === 'tool_call' && 🛠 {p.toolCall?.name}} -
- ))} -
- ))} -
+ )}
- )} -
+
中间过程({focus === runId ? '主任务' : '子代理'})
+
+ {focusMsgs.length === 0 &&
(无中间过程消息)
} + {focusMsgs.map(m => ( +
+ {m.parts.map((p, i) => ( +
+ {p.type === 'text' && p.text} + {p.type === 'thinking' && {p.text}} + {p.type === 'tool_call' && 🛠 {p.toolCall?.name}} +
+ ))} +
+ ))} +
+ + )}
) diff --git a/src/components/Conversation.tsx b/src/components/Conversation.tsx index ce14cfa..2bc5afb 100644 --- a/src/components/Conversation.tsx +++ b/src/components/Conversation.tsx @@ -40,13 +40,14 @@ function PartView({ part, live }: { part: Part; live?: boolean | null }) { const art = a ? findArtifact(a.artifactId) : undefined const name = a?.name ?? '工件' const icon = artifactIcon(name, a?.kind ?? art?.kind) + // 阶段③ 收敛:标题点击 = 右栏预览(唯一落位);动作只剩 全屏预览 + 下载。 return ( - - + e.stopPropagation()}> diff --git a/src/components/Workbench.tsx b/src/components/Workbench.tsx index 59ee487..86c829c 100644 --- a/src/components/Workbench.tsx +++ b/src/components/Workbench.tsx @@ -7,11 +7,12 @@ import { Icon } from '@ui' import { api } from '../api' // 工件解析/打开注入:渲染器纯展示,doc-ref 词汇经此桥接本仓状态(D29)。 +// 打开语义走 requestPreview 唯一入口(阶段③ 收敛:默认右栏轻预览)。 export const docBridge: DocBridge = { resolveDoc: id => store.getState().artifacts.find(a => a.id === id), onOpenDoc: id => { const art = store.getState().artifacts.find(a => a.id === id) - if (art) store.viewArtifact(art) + if (art) store.requestPreview(art) }, } @@ -43,7 +44,7 @@ export function Workbench() {
{railArtifact.name} - +
@@ -56,7 +57,7 @@ export function Workbench() { downloadUrl: api.artifactDownloadUrl(railArtifact.id), }} /> - ) :
在消息工件卡片或工件面板点「右栏预览」——文件会在这里边聊边看(md/图片/pdf/Office/代码均可)
} + ) :
点消息里的工件卡片或右侧工件面板——文件会在这里边聊边看(md/图片/pdf/Office/代码均可)
}
) : (
diff --git a/src/components/Workspaces.tsx b/src/components/Workspaces.tsx index 6c9d322..b74bdfe 100644 --- a/src/components/Workspaces.tsx +++ b/src/components/Workspaces.tsx @@ -93,15 +93,15 @@ export function ArtifactsPanel() { : visible.length === 0 ?
没有匹配「{q}」的文件
: visible.map(a => ( -
- store.viewArtifact(a)}> - store.viewArtifact(a)} title={a.name}> +
store.requestPreview(a)} title={`预览 ${a.name}(右栏,边聊边看)`}> + + {a.name} {a.kind} · {humanSize(a.size) || '—'} · {shortTime(a.updatedAt)} - - + e.stopPropagation()}> diff --git a/src/store.ts b/src/store.ts index c62bcb6..238c1cd 100644 --- a/src/store.ts +++ b/src/store.ts @@ -521,6 +521,15 @@ export const store = { if (!a) { setUI({ railPreviewId: null, rightTab: 'inbox' }); return } setUI({ railPreviewId: a.id, rightTab: 'preview', rightCollapsed: false }) }, + /** + * 工件预览唯一入口(重设计方案 阶段③ 收敛,Command 语义):一切预览请求只经这里, + * 落位由本方法派生——默认右栏轻预览(不打断对话),hint 'full' 落位全屏深读 + * (DocViewer,全项目唯一"大窗"形态)。下载语义同理由各落位只保留一个按钮。 + */ + requestPreview(a: Artifact, hint?: 'full') { + if (hint === 'full') { setUI({ viewingArtifact: a }); return } + setUI({ railPreviewId: a.id, rightTab: 'preview', rightCollapsed: false }) + }, openSettings(open: boolean) { setUI({ settingsOpen: open }) }, openProjectSettings(id: string | null) { setUI({ projectSettingsId: id }) }, toast(msg: string) {