CodePilot icon indicating copy to clipboard operation
CodePilot copied to clipboard

feat(search): 适配 v0.56 全局搜索面板 UI/UX

Open KevinYoung-Kw opened this issue 5 months ago • 1 comments

Summary

CodePilot v0.56 global search panel refresh

这个 PR 基于当前 v0.56 的设计语言,重新打磨全局搜索面板 UI/UX。重点不是扩展搜索后端能力,而是让现有搜索入口更像 CodePilot 当前的 command palette:更简洁、更稳定、更少视觉噪音。

主要改动

  • 重做 GlobalSearchDialog 前端结构:移除上一版偏重的卡片墙、分栏结果和重复说明,改为单输入 + scope pills + 单列结果 stack。
  • 为 会话 / 消息 / 文件 三类搜索范围补充轻量 icon,icon 只出现在范围选择器,不再在结果列表里重复堆叠。
  • 固定搜索弹层的 top 与高度,结果区内部滚动,避免空态、输入态、加载态、结果态切换时上下抖动。
  • 结果区继续保留原有能力:会话、消息、文件三类分组展示,关键词高亮,点击后跳转到对应 session/message/file。
  • 更新搜索 E2E,补充弹层几何稳定性断言,防止后续再次引入位置抖动。

验证

本地已执行:

  • npm run typecheck
  • npx eslint src/components/layout/GlobalSearchDialog.tsx src/__tests__/e2e/global-search-modes.spec.ts
  • NO_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=line
  • git diff --check

浏览器验收:

  • 使用本地预览 http://127.0.0.1:3237/chat 验证搜索面板空态、输入态、结果态。
  • 弹层几何采样稳定:空态 / 输入后 / 结果态均为 top=276 height=560。
  • PR 截图采用空查询裁剪弹层,不包含任何搜索结果,也不包含 wps / 笔记 相关内容。

Notes

  • 这个 PR 只调整搜索面板前端呈现与 E2E 断言,不改 /api/search 后端语义。
  • targeted ESLint 仍有一个既有 max-lines warning:GlobalSearchDialog.tsx 超过 500 行;本 PR 未进一步拆文件,避免扩大评审范围。

KevinYoung-Kw avatar Jun 14 '26 09:06 KevinYoung-Kw

@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.

vercel[bot] avatar Jun 14 '26 09:06 vercel[bot]

已用最新 main(v0.67.1)重开:#672。

这条旧分支不再跟。#672 迁的是这套搜索面板样式(pills、固定高度、分组结果、cmdk),并补了 Playwright。

KevinYoung-Kw avatar Aug 20 '26 01:08 KevinYoung-Kw

Superseded by https://github.com/op7418/CodePilot/pull/672

KevinYoung-Kw avatar Aug 20 '26 01:08 KevinYoung-Kw