Files
sundynix-agentix/sundynix-desktop/frontend/src/shell/LeftNav.tsx
T
Blizzard ba8c6b3c43 feat(report): 报告生成端到端 — 规划→分章并行检索撰写→渲染真实 Word
- shared: 新增 intent=report 任务约定 + ReportPath(跨进程共享落盘目录,零配置对齐)
- dispatcher: handleReport 专用编排(DeepSeek 规划大纲 → 各章并行 RAG 检索+撰写
  → 汇聚 → report_render),Pool.Chat 非流式聚合;进度与正文经 Token 流实时回流
- mcp-go: 用标准库 archive/zip + OOXML 拼出真实可打开的 .docx(零额外依赖),
  report_render 工具落盘到共享目录;附 docx 有效性测试
- gateway: POST /reports 触发;GET /reports/:id/download 下发 Word
- desktop: 新增「报告」页(主题→实时编排进度→下载 Word),左导航置为就绪

实测:DeepSeek 生成 5 章报告 → 渲染 5KB docx → file 识别为 Microsoft Word 2007+
→ textutil 提取标题/各章正文完整。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 14:02:21 +08:00

60 lines
2.3 KiB
TypeScript

export type ViewKey =
| "home"
| "studio"
| "kb"
| "report"
| "runs"
| "memory"
| "market"
| "admin";
interface Item {
key: ViewKey;
label: string;
icon: string;
group?: string;
ready?: boolean;
}
const ITEMS: Item[] = [
{ key: "home", label: "工作台", icon: "▤", ready: true },
{ key: "studio", label: "编排", icon: "◆", group: "BUILD", ready: true },
{ key: "kb", label: "知识库", icon: "▣", group: "BUILD", ready: true },
{ key: "report", label: "报告", icon: "▦", group: "BUILD", ready: true },
{ key: "runs", label: "运行", icon: "▸", group: "RUN" },
{ key: "memory", label: "记忆", icon: "◇", group: "MANAGE", ready: true },
{ key: "market", label: "市场", icon: "⌧", group: "MANAGE" },
{ key: "admin", label: "管理", icon: "⚙", group: "MANAGE" },
];
// 左导航:深色,激活态紫色高亮 + 左侧光条。
export function LeftNav({ active, onSelect }: { active: ViewKey; onSelect: (v: ViewKey) => void }) {
let lastGroup: string | undefined;
return (
<nav className="flex w-[72px] shrink-0 flex-col gap-0.5 border-r border-line bg-ink-900 py-2">
{ITEMS.map((it) => {
const header = it.group && it.group !== lastGroup ? it.group : null;
lastGroup = it.group ?? lastGroup;
const isActive = active === it.key;
return (
<div key={it.key}>
{header && <div className="mt-3 px-2 text-[9px] font-semibold tracking-widest text-slate-600">{header}</div>}
<button
onClick={() => onSelect(it.key)}
className={`relative flex w-full flex-col items-center gap-1 py-2.5 text-[11px] transition ${
isActive ? "text-violet-300" : "text-slate-500 hover:bg-ink-800 hover:text-slate-300"
}`}
title={it.ready === false ? `${it.label}(规划中)` : it.label}
>
{isActive && <span className="absolute left-0 top-1/2 h-6 w-0.5 -translate-y-1/2 rounded-r bg-gradient-to-b from-violet-400 to-cyan-400" />}
<span className={`text-lg leading-none ${isActive ? "drop-shadow-[0_0_6px_rgba(139,92,246,0.6)]" : ""}`}>{it.icon}</span>
{it.label}
{it.ready === false && <span className="text-[8px] text-slate-600"></span>}
</button>
</div>
);
})}
</nav>
);
}