CodePilot
CodePilot copied to clipboard
feat(search): 适配 v0.56 全局搜索面板 UI/UX
Summary
这个 PR 基于当前 v0.56 的设计语言,重新打磨全局搜索面板 UI/UX。重点不是扩展搜索后端能力,而是让现有搜索入口更像 CodePilot 当前的 command palette:更简洁、更稳定、更少视觉噪音。
主要改动
- 重做
GlobalSearchDialog前端结构:移除上一版偏重的卡片墙、分栏结果和重复说明,改为单输入 + scope pills + 单列结果 stack。 - 为
会话 / 消息 / 文件三类搜索范围补充轻量 icon,icon 只出现在范围选择器,不再在结果列表里重复堆叠。 - 固定搜索弹层的
top与高度,结果区内部滚动,避免空态、输入态、加载态、结果态切换时上下抖动。 - 结果区继续保留原有能力:会话、消息、文件三类分组展示,关键词高亮,点击后跳转到对应 session/message/file。
- 更新搜索 E2E,补充弹层几何稳定性断言,防止后续再次引入位置抖动。
验证
本地已执行:
npm run typechecknpx eslint src/components/layout/GlobalSearchDialog.tsx src/__tests__/e2e/global-search-modes.spec.tsNO_PROXY=127.0.0.1,localhost PLAYWRIGHT_BASE_URL=http://127.0.0.1:3237 npx playwright test src/__tests__/e2e/global-search-modes.spec.ts --reporter=linegit diff --check
浏览器验收:
- 使用本地预览
http://127.0.0.1:3237/chat验证搜索面板空态、输入态、结果态。 - 弹层几何采样稳定:空态 / 输入后 / 结果态均为
top=276 height=560。 - PR 截图采用空查询裁剪弹层,不包含任何搜索结果,也不包含
wps/笔记相关内容。
Notes
- 这个 PR 只调整搜索面板前端呈现与 E2E 断言,不改
/api/search后端语义。 - targeted ESLint 仍有一个既有
max-lineswarning:GlobalSearchDialog.tsx超过 500 行;本 PR 未进一步拆文件,避免扩大评审范围。
@KevinYoung-Kw is attempting to deploy a commit to the op7418's projects Team on Vercel.
A member of the Team first needs to authorize it.
Superseded by https://github.com/op7418/CodePilot/pull/672