feat: add conversation search and usage dashboard

This commit is contained in:
shiyue
2026-08-03 18:20:33 +08:00
parent cc600bdf31
commit 58d5f816c2
30 changed files with 6316 additions and 22 deletions

View File

@@ -0,0 +1 @@
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}

View File

@@ -0,0 +1 @@
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}

View File

@@ -0,0 +1,34 @@
# 高级会话检索
## 背景
会话数量增长后,现有侧栏检索只能使用标题、项目、路径和 ID 等元数据,无法通过曾经讨论过的消息正文找回会话。
## 目标
保留现有检索不变,在其旁边新增高级检索按钮,打开独立检索工作台,支持搜索历史用户消息和助手回复、查看上下文摘要并跳转到原消息。
## 功能范围
- 新增高级检索入口和独立覆盖面板。
- 搜索标题、项目、路径、ID、用户消息和助手回复。
- 支持相关优先/最新优先、整词/包含。
- 展示结果数、耗时、命中来源、摘要和更新时间。
- 点击结果打开会话并定位命中消息。
- 服务端维护可重建的派生索引,保存、重命名、删除后增量同步。
## 非目标
- 不改变现有检索框、过滤函数和普通会话列表协议。
- 不引入拼音、模糊纠错、向量语义检索或外部搜索服务。
- 不索引 system、工具参数、工具结果和附件内容。
- 不修改现有会话 JSON schema。
## 验收标准
- 现有检索行为和回归保持不变。
- 只出现在历史用户/助手消息里的中英文片段可找到正确会话。
- 搜索模式视觉结构与参考图一致:连续结果流、青蓝标题、暖黄命中、弱化时间、无卡片堆叠。
- 新消息持久化后 2 秒内可检索,重命名和删除同步生效。
- 缓存缺失/损坏可重建,查询 p95 低于 50ms,响应最多 50 条。
- 桌面、参考视口和移动端真实浏览器验收通过。

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

View File

@@ -0,0 +1,10 @@
{
"name": "advanced-search-reference",
"role": "完整视觉参考",
"original_path": "sessions/_attachments/237582ef-4157-4175-84fa-38629613df7f.png",
"archived_path": "references/source-assets/advanced-search-reference.png",
"sha256": "39e5b93d26deca64ea88a46b09bed7f7c47d2af733e8f2f857a9d35fc7895692",
"size": [733, 673],
"format": "PNG RGBA",
"usage": "仅用于构图与视觉验收,不进入运行时"
}

View File

@@ -0,0 +1,23 @@
# 高级检索视觉规格
## 设计方向
沿用当前主题背景和语义 token,不创建新主题。高级检索是覆盖主工作区的独立操作面,参考图只提供构图、层级和结果阅读方式。
## 关键尺寸
- 桌面面板:覆盖 `.chat-main`,最小宽度 0,顶栏 58–64px。
- 内容最大宽度:960px;参考视口下左右 46–48px,窄屏下 18px。
- 控件高度:24–30px;结果标题与正文间距 12–16px;结果垂直内边距 18–22px。
- 摘要最多两段,每段最多约 220 字符;时间位于结果底部右侧。
## 状态覆盖
- 未输入、输入不足两个字符、查询中、索引构建中、无结果、错误、有结果。
- 长标题、长路径、长摘要、中文/英文、代码片段、特殊 HTML 字符。
- 参考视口 733×673、常规桌面 1440×900、移动端 390×844。
## 安全
- 标题和摘要只用文本节点渲染,高亮拆分 text/mark 节点。
- 尊重 `prefers-reduced-motion`,移动端不使用大幅位移。

View File

@@ -0,0 +1,33 @@
{
"id": "advanced-conversation-search",
"name": "advanced-conversation-search",
"title": "高级会话检索",
"description": "",
"status": "completed",
"dev_type": null,
"scope": null,
"package": null,
"priority": "P2",
"creator": "shiyue",
"assignee": "shiyue",
"createdAt": "2026-08-03",
"completedAt": "2026-08-03",
"branch": null,
"base_branch": "main",
"worktree_path": null,
"commit": null,
"pr_url": null,
"subtasks": [],
"children": [],
"parent": null,
"relatedFiles": [
"lib/session-search-index.js",
"server.js",
"public/index.html",
"public/app.js",
"public/style.css",
"scripts/regression.js"
],
"notes": "高级会话检索已完成专项、全量回归和 1672/1440/390 三视口真实 Chromium 验收。",
"meta": {}
}