界面与交互全面翻修(前两波):运行态有了 HUD 和时间轴,终态会收尾,全站令牌、组件、文案统一

来自 2026-09 的 UI/UX 审查(142 条)。本提交是前两波,第三波(记录页接入时间轴、跨页互链、check-ui 更新、全站扫尾)另行提交。

地基
- 设计令牌:全局规则和 .btn/.field/.chip 放进 CSS 层,Tailwind 工具类重新生效,选中态、开启态不再被吞掉;字号阶梯;
  辅助文字在所有底色上 >= 4.5:1;状态色专用,节点类型色与之拉开色相;「跟随系统」真的跟随,首帧不闪深色;新字标与 favicon
- 基础组件:confirmDialog / promptDialog 取代原生对话框;toast 出错不自动消失、可复制、读屏可播报;离线横幅与断线恢复;
  九种剪影的状态徽标;唯一一份状态文案(lib/status)、格式化(lib/format)、术语(lib/terms)、报错人话(lib/errors)
- 运行态内核:事件折成航迹(run/trace.ts),可投影到任意时刻;取消 / 失败 / 服务重启后统一收尾,不再永远转圈;
  run.status 随事件回写;token 事件不再堆进 events
- 后端:协作成员逐个完成即发事件,调度者决策有事件;时长分执行 / 墙钟 / 等人;API 时间带时区;
  中断的运行也发 stream.end;运行列表可筛选翻页;删除运行 / 工作流有保护;运行默认值接通;可测未保存的配置;
  报错说清发生了什么、为什么、怎么办

功能
- 画布:状态四重编码、固定高度遥测槽、按缩放三档、运行胶囊与 HUD、航迹时间轴与回放、执行轨迹边、
  等待闸门、跟随执行、正式运行只读、一次性时刻(开场点亮、回扫、阻断级联、出具印章)
- 编辑:撤销重做、版本历史、问题面板可定位、三栏可收起、模板与表达式字段区分、变量血缘、快捷键、带搜索的选择器
- 回答流 / 问数据:贴底才跟随滚动、工件下钻、出具横幅列出缺口、答案可复制导出、按会话的忙闲、
  答案不再在 2000 字处截断、重启后这一轮会收尾
- 记录页:待审批 / 运行中 / 失败页签、筛选翻页、实时接流、排错路径指到节点、封存凭证常驻
- 管理页:新的「数据」页、写操作失败都有反馈、弹窗里先测连接、统一持久的连接状态
- 外壳:导航改版、⌘K 命令面板、? 快捷键帮助、404、页面标题与 favicon 状态点、后台提醒

验证(沙箱):tsc 干净,pytest 579 passed,14 个检查脚本中 13 个全绿;check-ui 剩 1 项旧断言(按旧日期格式找运行行),第三波更新。
This commit is contained in:
ThearchyHelios
2026-09-26 23:11:31 +08:00
parent 95ff6470d1
commit e10c4f23fc
132 changed files with 43558 additions and 5399 deletions
+3 -1
View File
@@ -175,5 +175,7 @@ async def web_search(ctx: ToolContext, **kwargs: Any) -> dict[str, Any]:
results = await _duckduckgo(args.query, args.max_results)
engine = "duckduckgo"
except Exception as e: # noqa: BLE001 - 搜索失败不该让整个 run 挂掉
return {"error": f"搜索失败:{type(e).__name__}: {e}", "results": []}
from app.api.errors import explain
return {"error": f"搜索失败:{explain(e)[0]}", "results": []}
return {"engine": engine, "query": args.query, "results": results}
+5 -1
View File
@@ -132,7 +132,11 @@ def _make_query_tool(source: DataSource, ctx: ToolContext) -> StructuredTool:
# 给一句笼统的"失败了"只会让它瞎猜
return f"SQL 被拒绝:{e}"
except Exception as e: # noqa: BLE001
return f"查询失败:{type(e).__name__}: {e}"
from app.api.errors import explain, first_line
# 驱动的原话留着("no such table: x" 正是模型改写 SQL 要的线索),
# 类名和 SQLAlchemy 的包装前缀去掉:这一行也会原样出现在运行面板上
return f"查询失败:{first_line(e) or explain(e)[0]}"
payload = result.to_payload()
payload["source"] = source.name
+19 -2
View File
@@ -53,7 +53,7 @@ class McpManager:
except Exception as e: # noqa: BLE001 - 一个 server 挂了不影响其他的
logger.warning("MCP server %s 连接失败: %s", row.name, e)
out[row.name] = []
await self._mark(row.id, "error", f"{type(e).__name__}: {e}", [])
await self._mark(row.id, "error", _reason(e), [])
return out
async def _mark(
@@ -127,7 +127,24 @@ class McpManager:
],
}
except Exception as e: # noqa: BLE001
return {"ok": False, "error": f"{type(e).__name__}: {e}"}
from app.api.errors import raw
return {"ok": False, "error": _reason(e), "detail": raw(e)}
def _reason(e: BaseException) -> str:
"""连不上 MCP 服务的原因,写成工具页上看得懂的话。
最常见的两种:命令不存在(没装 npx / uvx)和超时(进程起来了但不讲 MCP)。
"""
from app.api.errors import explain
if isinstance(e, FileNotFoundError):
return f"启动不了:找不到命令 {e.filename or ''}。确认它已安装、并且在后端的 PATH 里"
if isinstance(e, asyncio.TimeoutError):
return "连上了但 30 秒内没有应答:确认这个命令启动的是 MCP 服务,参数有没有写错"
reason, hint = explain(e)
return f"{reason}。{hint}" if hint else reason
mcp_manager = McpManager()