From 8f1aefe13ec1f208698e07b46dfbbe496fd5c32b Mon Sep 17 00:00:00 2001 From: Blizzard Date: Mon, 13 Jul 2026 16:57:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor(desktop):=20=E5=8E=BB=E9=BB=91?= =?UTF-8?q?=E8=AF=9D=20+=20=E6=94=B6=E5=9F=BA=E5=BB=BA=E7=81=AF(=E5=95=86?= =?UTF-8?q?=E4=B8=9A=E5=8C=96=E8=AF=AD=E8=A8=80=E9=93=BA=E5=BC=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 把首屏定的"去黑话+精致克制"语言铺到其余页面: - 顶栏 5 盏基建灯(Gateway/DB/NATS/Milvus/Neo4j)→ 一枚「系统正常」状态点 (客户不看数据库名;异常时 tooltip 提示项数,顺带缓解窄屏拥挤) - 知识库:入库阶段标签去实现名(写入向量库/Milvus/Bleve/Neo4j → 建立语义索引/ 全文索引/构建知识关系);检索台「混合召回+rerank」→「在库中搜索」,命中分数 0.83→83%,"RAG 未配置"→"该库可能为空";图谱去「Neo4j·力导向」 - 运行:流式中→生成中;"token 在此流式呈现"→"回复逐字呈现";忠实→可信度/引用 - 编排节点「检索(RAG)」→「知识检索」,描述去"混合检索" Co-Authored-By: Claude Opus 4.8 --- .../frontend/src/shell/TopBar.tsx | 26 +++++++++-------- .../frontend/src/studio/nodeCatalog.ts | 4 +-- .../frontend/src/views/KbView.tsx | 28 +++++++++---------- .../frontend/src/views/RunsView.tsx | 6 ++-- 4 files changed, 34 insertions(+), 30 deletions(-) diff --git a/sundynix-desktop/frontend/src/shell/TopBar.tsx b/sundynix-desktop/frontend/src/shell/TopBar.tsx index 26d369a..e35ba16 100644 --- a/sundynix-desktop/frontend/src/shell/TopBar.tsx +++ b/sundynix-desktop/frontend/src/shell/TopBar.tsx @@ -10,12 +10,20 @@ import { cn } from "../ui"; const DRAG = { "--wails-draggable": "drag" } as CSSProperties; const NODRAG = { "--wails-draggable": "no-drag" } as CSSProperties; -function Light({ on, label }: { on: boolean; label: string }) { - const dot = on ? "bg-success shadow-[0_0_8px_rgba(52,211,153,0.7)]" : "bg-danger"; +// 系统状态:把 5 项基建健康收成一个整体状态点(客户不看数据库名,异常时 tooltip 提示项数)。 +function SystemStatus({ h }: { h: ReturnType }) { + const down = [h.gateway, h.db, h.nats, h.milvus, h.neo4j].filter((v) => !v).length; + const ok = down === 0; return ( - - - {label} + + + {ok ? "系统正常" : "部分异常"} ); } @@ -140,12 +148,8 @@ export function TopBar({ user, tenant, tenants = [], onSwitchTenant, space, spac 搜索与命令 ⌘K -
- - - - - +
+
diff --git a/sundynix-desktop/frontend/src/studio/nodeCatalog.ts b/sundynix-desktop/frontend/src/studio/nodeCatalog.ts index a84cc88..cc2302d 100644 --- a/sundynix-desktop/frontend/src/studio/nodeCatalog.ts +++ b/sundynix-desktop/frontend/src/studio/nodeCatalog.ts @@ -45,10 +45,10 @@ export const NODE_KINDS: Record = { }, retriever: { kind: "retriever", - label: "检索 (RAG)", + label: "知识检索", accent: "border-l-sky-500", badge: "bg-sky-100 text-sky-700", - desc: "绑定知识库做混合检索", + desc: "从知识库检索相关内容", fields: [ { key: "kb", label: "知识库", type: "select", options: ["(未建库)", "合同库", "判例库"], required: true }, { key: "topK", label: "TopK", type: "number" }, diff --git a/sundynix-desktop/frontend/src/views/KbView.tsx b/sundynix-desktop/frontend/src/views/KbView.tsx index 7949940..ccc331f 100644 --- a/sundynix-desktop/frontend/src/views/KbView.tsx +++ b/sundynix-desktop/frontend/src/views/KbView.tsx @@ -77,15 +77,16 @@ interface FileJob { } type KbTab = "ingest" | "vault" | "search" | "graph"; +// key 对齐后端事件阶段(勿改);label 用「结果语言」,不暴露 Milvus/Bleve/Neo4j 等实现名。 const STAGE: Record = { 解析: { icon: Upload, label: "解析文件" }, 解析完成: { icon: FileText, label: "解析完成" }, - 切块: { icon: Scissors, label: "切块" }, - 向量化: { icon: Sparkles, label: "向量化" }, - 写Milvus: { icon: Database, label: "写入向量库" }, - 写Bleve: { icon: Search, label: "写入全文索引" }, - 抽实体: { icon: Network, label: "抽取知识" }, - 写Neo4j: { icon: Share2, label: "写入图谱" }, + 切块: { icon: Scissors, label: "拆分段落" }, + 向量化: { icon: Sparkles, label: "理解内容" }, + 写Milvus: { icon: Database, label: "建立语义索引" }, + 写Bleve: { icon: Search, label: "建立全文索引" }, + 抽实体: { icon: Network, label: "提取知识点" }, + 写Neo4j: { icon: Share2, label: "构建知识关系" }, 完成: { icon: CheckCircle2, label: "完成" }, 失败: { icon: XCircle, label: "失败" }, }; @@ -395,23 +396,22 @@ export function KbView({ identity, spaceId = "", spaceReadOnly = false }: { iden {tab === "search" && (
-

检索调试台 · 「{kb}」(混合召回 + rerank)

+

在「{kb}」中搜索

- setQ(e.target.value)} onKeyDown={(e) => e.key === "Enter" && onSearch()} placeholder="输入查询,语义召回相关片段…" /> + setQ(e.target.value)} onKeyDown={(e) => e.key === "Enter" && onSearch()} placeholder="输入问题或关键词,查找相关内容…" /> setTopK(Number(e.target.value))} title="TopK" />
    - {hits === null &&
  • 输入查询后展示命中片段与分数。
  • } - {hits !== null && hits.length === 0 &&
  • 无命中(该库为空或 RAG 未配置)。
  • } + {hits === null &&
  • 输入问题后,这里会列出最相关的内容片段。
  • } + {hits !== null && hits.length === 0 &&
  • 没有找到相关内容(该库可能为空)。
  • } {hits?.map((h, i) => (
  • - 混合检索 #{i + 1} - {h.score.toFixed(3)} + {(h.score * 100).toFixed(0)}%
    {h.text}
  • @@ -423,7 +423,7 @@ export function KbView({ identity, spaceId = "", spaceReadOnly = false }: { iden {tab === "graph" && (
    -

    知识图谱 · 「{kb}」(Neo4j · 力导向)

    +

    「{kb}」知识关系图谱

    @@ -613,7 +613,7 @@ function VaultPanel({ identity, kb, spaceReadOnly = false }: { identity: Identit )} - 笔记支持 [[双链]];保存后重建索引与图谱 + 支持 [[双链]] 关联;保存后自动更新搜索
    {mode === "graph" ? ( diff --git a/sundynix-desktop/frontend/src/views/RunsView.tsx b/sundynix-desktop/frontend/src/views/RunsView.tsx index dcb0f5d..c735d96 100644 --- a/sundynix-desktop/frontend/src/views/RunsView.tsx +++ b/sundynix-desktop/frontend/src/views/RunsView.tsx @@ -79,7 +79,7 @@ export function RunsView({ run }: { run: RunState }) { const statusCls = cur.phase === "streaming" ? "text-accent-400" : cur.phase === "done" ? "text-success" : cur.phase === "error" ? "text-danger" : "text-slate-500"; const statusText = - cur.phase === "streaming" ? "流式中…" : cur.phase === "done" ? "完成 ✓" : cur.phase === "error" ? `✗ ${cur.error ?? "出错"}` : cur.phase === "submitting" ? "提交中…" : "就绪"; + cur.phase === "streaming" ? "生成中…" : cur.phase === "done" ? "完成 ✓" : cur.phase === "error" ? `✗ ${cur.error ?? "出错"}` : cur.phase === "submitting" ? "提交中…" : "就绪"; return (
    @@ -145,7 +145,7 @@ export function RunsView({ run }: { run: RunState }) { {cur.output ? ( ) : ( - + )}
    @@ -208,7 +208,7 @@ function EvalView({ ev }: { ev: EvalResult | null }) { {ev.level} · {ev.overall.toFixed(2)} {ev.corrected && 已纠偏} 规则 {ev.rule.toFixed(2)} · 质量 {ev.llm.toFixed(2)} - {ev.sources > 0 && 忠实 {ev.faithful.toFixed(2)} · {ev.sources} 来源} + {ev.sources > 0 && 可信度 {ev.faithful.toFixed(2)} · {ev.sources} 处引用}
    {ev.reason &&

    {ev.reason}

    } {ev.flags?.length > 0 &&

    {ev.flags.join(";")}

    }