console: 重排版为侧边导航 + 三栏工作台 + 任务详情内页签

旧排版(顶栏页签 + 数据卡片置顶 + 长页堆叠 + 详情卡片堆在对话下)全部去掉,功能不变:
- 左侧栏:导航按任务/管理分组,底部紧凑概览卡片始终可见;整页不再单页长滚动,各 pane 各自滚动
- 任务工作台:左任务列表轨(搜索/筛选/分页),中派发(可收起)+ 单列对话,右任务详情检查器
- 详情检查器:概览/协作/评审与审批/线程四个内页签,一次只显示一组
- 其余功能各成独立页面:项目与成员、环境与 Workers、技能与自动化、系统与 Key
- 视图同步到 location.hash(#view-tasks 等)

构建:npm run build(tsc + vite singlefile)通过,产物 332130 字节;本地全量 cloud 1275 项全过(skipped 4)。
This commit is contained in:
host committed 2026-10-30 03:22:02 +08:00
1 parent f0aba700e0
commit 44b080971e
4 files changed
+187 -148

No files matched your search

@@ -1,3 +1,4 @@
import { useState } from "react";
import { useConsole } from "../context";
import { Card } from "../components/ui";
import { shortId, fmt } from "../api/client";
@@ -7,19 +8,25 @@ import DetailActions from "./detail/DetailActions";
import ReviewPanel from "./detail/ReviewPanel";
import { CoordPanel, AgentsPanel, ApprovalPanel, PeerPanel, ThreadPanel } from "./detail/DetailLists";
// Right detail column for the task view, card-style layout.
// Everything structured lives here — never inside a chat bubble.
// Layout only: data, actions and sub-sections are unchanged,
// just grouped into cards instead of one <br>-separated block:
// 概览(状态 + 耗时/token/成本三张指标卡)
// 基本信息(键值网格)
// prompt(单独一张卡,长 prompt 不再挤在信息行末尾)
// 操作与结果
// 协调子任务 / 子代理链路 / 评审队列 / 运行时审批队列 /
// 给其他任务发消息 / 线程(各一张卡)
// Task inspector (redesign 2026-10-30): the old detail stack —
// 概览 + 基本信息 + prompt + 操作 + 协调 + 子代理 + 评审 +
// 审批 + 任务间消息 + 线程, all stacked under the conversation —
// is gone. The same panels now live in four inspector tabs so
// only one group is visible at a time:
// 概览:状态/耗时/token/成本 + 基本信息 + prompt + 操作与结果
// 协作:协调子任务 / 子代理链路 / 给其他任务发消息
// 评审与审批:评审队列 / 运行时审批队列
// 线程:线程管理
// Data, actions and sub-sections are unchanged; only grouping
// and visibility changed.
type DetailTab = "overview" | "collab" | "review" | "threads";
const DETAIL_TABS: Array<[DetailTab, string]> = [
["overview", "概览"], ["collab", "协作"], ["review", "评审与审批"], ["threads", "线程"],
];
export default function TaskDetailPanel() {
const ctx = useConsole();
const t = ctx.currentTask;
const [tab, setTab] = useState<DetailTab>("overview");
if (!t) return <Card id="nav-detail" title="任务详情"><div className="muted">点任务行查看详情</div></Card>;
const [dur, durTitle] = durationOf(t);
const [tok, tokTitle] = tokenOf(t);
@@ -30,6 +37,12 @@ export default function TaskDetailPanel() {
: t.verify_command ? "goal 模式(旧语义,验收命令)" : null;
return (
<div className="detail-stack" id="nav-detail">
<nav className="detail-tabs" aria-label="任务详情页签">
{DETAIL_TABS.map(([id, label]) => (
<button key={id} type="button" className={tab === id ? "active" : ""} onClick={() => setTab(id)}>{label}</button>
))}
</nav>
{tab === "overview" ? (<>
<Card title="任务详情">
<div style={{ display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }}>
<span className="issue-first" title={"任务首字:" + fc} aria-hidden="true">{fc}</span>
@@ -84,12 +97,16 @@ export default function TaskDetailPanel() {
<pre>{ctx.detailBody || "(暂无 result/error 输出)"}</pre>
{ctx.costBox ? <pre>{ctx.costBox}</pre> : null}
</Card>
</>) : tab === "collab" ? (<>
<Card title="协调子任务"><CoordPanel /></Card>
<Card title="子代理链路"><AgentsPanel /></Card>
<Card title="给其他任务发消息"><PeerPanel /></Card>
</>) : tab === "review" ? (<>
<Card title="评审队列"><ReviewPanel /></Card>
<Card title="运行时审批队列"><ApprovalPanel /></Card>
<Card title="给其他任务发消息"><PeerPanel /></Card>
</>) : (<>
<Card title="线程"><ThreadPanel /></Card>
</>)}
</div>
);
}