docs(frontend): 同步前端 UI 设计规范 + AI 使用日志
- docs/design.md 追加「前端 UI 设计规范」章节(设计系统、文件结构、兼容约束、本轮交付 vs 计划) - _AI_USAGE_LOG.md 追加 5 条本轮记录(架构设计 / Agent 实现 / 反馈迭代 三个范式步骤) 参考:docs/superpowers/specs/2026-08-30-frontend-beautify-design.md
This commit is contained in:
@@ -1933,3 +1933,47 @@ Document(注入后 Word 文档)
|
||||
- **异步链路**:`run_impact` 为 `async def`,RAG 路径 `await ImpactAgent(engine=..., rag=..., use_rag=True).run_impact(...)`;`app.start_impact` 端点改为 `async def` 并 `await service.run_impact(sid, use_rag=use_rag)`;`chat/agent.py` 调用处以 `asyncio.run(...)` 包裹以兼容同步消息处理。
|
||||
- **线程安全(D2)**:`RagStore` 构造使用 `sqlite3.connect(db_path, check_same_thread=False)` 并加 `threading.Lock`,读写均加锁串行化,适配 Web 服务端 worker 线程复用连接。
|
||||
- **向后兼容**:`use_rag=False` 时 prompt 不含 RAG 小节标题(`_RAG_CONTEXT_TITLE`),影响报告为确定性 `impact-report.json`,不调用 LLM。
|
||||
|
||||
## 前端 UI 设计规范(2026-08-30)
|
||||
|
||||
### 设计系统
|
||||
|
||||
- **风格**:深色指挥中心 + 文档工作台混合
|
||||
- **强调色**:`#5EEAD4`(青绿,唯一)
|
||||
- **背景色阶**:`--bg-base: #0B0F17` / `--bg-surface: #141A24` / `--bg-elevated: #1B2330` / `--bg-input: #0F141C`
|
||||
- **文本色阶**:`--text-primary: #E5EAF0` / `--text-secondary: #8B95A7` / `--text-muted: #5C6677`
|
||||
- **边框色阶**:`--border-subtle: rgba(255,255,255,.08)` / `--border-strong: rgba(255,255,255,.14)`
|
||||
- **状态色**:`--success: #34D399` / `--warning: #FBBF24` / `--danger: #F87171` / `--info: #60A5FA`
|
||||
- **字体策略**:系统字体栈(不引入 Google Fonts / JetBrains Mono)
|
||||
- UI:`-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif`
|
||||
- 等宽:`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`
|
||||
- **间距阶梯**:4 / 8 / 12 / 16 / 20 / 24
|
||||
- **圆角阶梯**:6 (sm) / 10 (md) / 14 (lg) / 9999 (胶囊)
|
||||
- **动效**:`cubic-bezier(.2, 0, 0, 1)` × `0.18s`
|
||||
|
||||
### 文件结构
|
||||
|
||||
- `src/genesis/server/static/chat.html`:仅 DOM 结构(约 125 行)
|
||||
- `src/genesis/server/static/chat.css`:所有视觉样式(约 470 行 v1 深色版)
|
||||
- `src/genesis/server/static/chat.js`:业务逻辑 + 8 项交互(计划下轮实施;本轮 chat.html 仍含内联 JS)
|
||||
- `chat_state.js` / `chat_ws.js`:协议层,不动
|
||||
|
||||
### 兼容约束
|
||||
|
||||
- 所有 DOM id 保留(业务逻辑依赖)
|
||||
- 所有 localStorage / sessionStorage 键保留
|
||||
- 所有 API 端点不变
|
||||
- 移动端改造(< 768px 抽屉化)不在本轮
|
||||
- 快捷键仅 Esc + Cmd/Ctrl+K(计划)
|
||||
- 消息气泡"重新生成"按钮不在本轮
|
||||
|
||||
### 本轮交付 vs 计划
|
||||
|
||||
- **本轮已做**:chat.html 拆分 chat.css(机械拆分,行为零变更);chat.css 视觉重塑为深色主题(spec §一+§二 全部落地)
|
||||
- **下轮再做**:chat.js 拆分;8 项交互改造(分组 / 拖拽 / 气泡操作 / 多行输入 / 顶栏徽章 / 快捷键 / 骨架屏 / 空状态快捷指令 / 错误分级)
|
||||
- **不做**:移动端、消息重新生成、主题切换
|
||||
|
||||
### 设计规范来源
|
||||
|
||||
- 完整 spec:`docs/superpowers/specs/2026-08-30-frontend-beautify-design.md`
|
||||
- 实施计划:`docs/superpowers/plans/2026-08-30-frontend-beautify.md`
|
||||
|
||||
Reference in New Issue
Block a user