Repository navigation
fix(providers): prevent search panel from covering card actions - #8151
Conversation
GPT-6 Astra 自动代码审查审查提交: 由 Codex 定时任务使用 GPT-6 Astra 子 agent 审查,并经主 agent 复核。 [P2] 移入滚动布局后,重复搜索快捷键需要重新显示输入框位置:src/components/providers/ProviderList.tsx:463 当供应商列表长于视口时,打开搜索(可以保留空搜索词),向下滚动直到搜索面板离开视口,再点击列表非编辑区域并按 Ctrl/Cmd+F。此次改动让面板随列表滚出视口,但现有快捷键只 preventDefault 并 setIsSearchOpen(true),聚焦 effect 仅依赖 isSearchOpen;值已经是 true 时不会再次 focus,也没有滚动恢复逻辑。因此快捷键被吞掉而搜索框仍在视口外,用户只能手动滚回顶部或先关闭再重开搜索才能修改查询。原先 body portal 的 fixed 面板不会随列表滚走,因此这是移除固定定位后新出现的可达性回归,而不只是原有重复快捷键不聚焦的问题。 证据:
建议:保留正常流布局,但在搜索已打开时收到 Ctrl/Cmd+F 也显式聚焦并将输入框滚入视口;保持对其他编辑区域的快捷键保护。补充长列表中面板保持开启、滚出视口后再次按快捷键的回归用例,不要只覆盖关闭后重开。 验证与范围完整覆盖两文件差异、搜索状态、快捷键与实际滚动容器,确认一项 P2。主 agent 核对正常流布局、重复 setState(true)、仅依赖开关变化的聚焦 effect,以及两个 ProviderList 容器。
未验证或受限范围:
本评论仅针对以上提交的代码审查结果,不构成合并批准。 |
|
已在 e42caff 修复这条审查意见。搜索保持开启时,重复 Ctrl/Cmd+F 会重新 focus/select,并通过 scrollIntoView({ block: "nearest" }) 将输入框滚回可见区域;原有输入框、textarea、select、contenteditable 快捷键保护保持不变。 新增 4 组回归覆盖 Ctrl/Cmd × 受控/内部开关状态,以及连续两次重新聚焦;这些用例在修复前均因焦点未恢复失败,修复后通过。另补 4 组编辑区域保护用例。 验证:ProviderList 24/24;相关 4 个测试文件 77/77;前端全量 202 个文件、2443 个测试通过;TypeScript、改动文件 Prettier、git diff --check、renderer build 均通过。新增滚动断言基于 jsdom,验证的是显式滚动请求及焦点/选区,未对这个新提交声称真实浏览器或 Windows WebView2 GUI 验收。上游 CI 当前仍需维护者批准运行。 AI-assisted;补丁已独立复核。 |
|
已合并,感谢 @xue-ding-e! 把搜索面板放回列表的正常布局,首张卡片的编辑和更多按钮就不会再被挡住,这是对症的改法。Astra 指出「面板随列表滚出视口后快捷键会被吞掉」,你当天就补上了「已打开时重新聚焦并滚回可见区域」,还加了受控/非受控 × Ctrl/Cmd 的回归用例,以及不抢其他输入框快捷键的保护用例。我在合并树上跑了 typecheck 和前端全量测试,都通过;Chromium 前后对照的截图也很有说服力。 预告一下后续:我们准备把搜索框挪到列表上方第一行的最右端。有模式切换的应用放在「直连 / 路由 / 聚合」那一行,累加式应用放在「已添加 · N」那一行。这样打开搜索时卡片不会下移,也不会挡住任何按钮。你加的重新聚焦逻辑和测试会保留下来。 再次感谢,今天连着三个修复质量都很高! |
The search panel used to float over the list (covering the first card's actions, #8100), and #8151 moved it into the list flow, which pushed every card down by the panel's height when search opened. Put a compact search field at the right end of the row that already sits above the cards instead, so opening search neither covers nor moves anything. - Claude Code, Codex, Gemini CLI and Grok Build: the mode row gets a slot next to the status text; ProviderList portals the field into it, keeping the search term, filtering and shortcuts in the list. - Apps without a mode row: the first section title ("Added · N") and the field share the list's first row, which always reserves the field height. With no matches only the field remains, and the input stays the same node so typing keeps focus. Lists without a section title (Claude Desktop) show the row only while searching. - The scope and Esc hints move into the input's tooltip.
Summary / 概述
Fixes #8100.
搜索面板原来通过 body portal 固定在右上方,会遮住第一张供应商卡片的编辑、更多操作。改为在列表正常布局中预留面板高度,保留右对齐、最大宽度和开关动画。
新增回归测试覆盖 Ctrl/Cmd+F、筛选、编辑、Escape、清空及重复开关。没有修改搜索匹配逻辑、用户文案或 Rust 代码。
Screenshots / 截图与浏览器验收
真实 Chromium 前后对照运行及截图 artifact
验收工作流与 harness 仅保存在 fork 的独立 QA 分支;本 PR 只包含组件修复和单测两个文件。QA 使用的产品代码与本 PR SHA
133dbbd5c14f14c1d3199baf9d5886215581d49f一致。Checklist / 检查清单
pnpm typecheckpassespnpm format:checkpassespnpm build:rendererpassesAI-assisted; patch reviewed and regression reproduced before and after the fix.