Repository navigation
fix(search): 补齐注解搜索与保留查询切换的回归 - #2326
Merged
Merged
Conversation
…150-search-text-hint
1lck
marked this pull request as ready for review
November 23, 2026 17:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
bcdb1094a04e167fff0b93ae6edef00cb4c8ebba。PR 类型 / Type
改动说明 / What changes
背景 / Why
#2150 报告 v0.8.5 默认“全部”搜索
@xxl没有结果,切到“文本”则有八行命中。核对当前main后确认:#2213 已把content加入“全部”的默认来源(desktop/internal/workbench/search_everywhere.go的everywhereKinds包含file、type、symbol、content),原报告中“全部不搜索正文”的前提已经消失。现有
TestProjectSearchReadsUnsavedTextAndAllSearchesContents验证的是编辑器中未保存的普通单词,没有覆盖原报告中的未打开磁盘文件、@前缀、大小写不敏感,以及来源过滤后的页签切换。本 PR 补齐这条真实用户流程,沿用已经合入的搜索行为。改动 / Changes
desktop/internal/workbench/search_everywhere_test.go:新增TestEverywhereAllFindsAnnotationTextAndTextTabRetainsQuery。在临时项目中写入包含八行@XxlJob注解的合成Demo.java,通过顶栏按钮和键盘输入小写@xxl,使用真实 Core 搜索。content结果、准确路径与行号(i*2+2),且没有打开该文件或依赖语言插件。scope == 5),确认原查询保留、八条正文结果重新出现。shared/platform-feature-matrix/features/search-global.json:补充#2150回归验证动作,保留 macOS/Windows 的原生验收pending状态。origin/main(883fce9c6)以对齐最新仓库状态与固定 Core 修订(076ce04e314ecdde790b36ee3f374becb11951a0)。不在本 PR 范围内 / Out of scope
本 PR 没有改动生产搜索代码、默认范围、界面文案或布局。原建议中的“全部只搜索文件名、类和符号”已不符合当前实现,因此没有加入该提示。macOS/Windows 原生窗口交互验收不在本次无头本地验证内。
类型专属:fix
复现与根因
everywhereKinds只有file、type、symbol,输入@xxl在“全部”下无命中;feat(search): 支持分页分组、未保存内容和搜索大小设置 #2213(bcdb1094a04e167fff0b93ae6edef00cb4c8ebba)加入content后“全部”直接命中八行注解正文,并在筛选隐藏“文本”后切到“文本”页签保留原查询返回结果。everywhereKinds缺少content;已由 feat(search): 支持分页分组、未保存内容和搜索大小设置 #2213 修复。原创建分支时使用 Go overlay 仅还原该行三来源清单,新用例在 150 ms 内按预期失败(0 条结果),去掉 overlay 后通过。检查项
desktop/internal/workbench/search_everywhere_test.go(TestEverywhereAllFindsAnnotationTextAndTextTabRetainsQuery),旧三来源语义下输出annotation search: failed=false, matches=[]; want eight content rowseverywhereKinds、resultKinds、options、updateEverywhere、来源筛选和页签点击路径;“文本”页签不继承“全部”的来源隐藏开关)范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/search-global.json:补充#2150回归验证动作;macOS/Windows 的verificationStatus如实保留pending./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD(222 项能力通过).artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空Demo.java与内联testKernel(嵌入真实core.Client),无真实插件 ID、无插件包依赖、无“缺少插件时跳过”shared/i18n/,构建步骤未写入宿主文档UI 验证 / UI evidence
N/A:本 PR 无生产 UI、布局、文案或交互状态变更(仅新增测试与功能矩阵验证说明);同时已运行
TestVisualSearch*确认现有视觉搜索场景通过。统一日志系统 / Structured logging
N/A:没有新增或修改生产日志、失败路径或用户操作事件。
界面文案 / i18n
N/A:没有新增用户可见文案;i18n 语言与生成物检查通过。
逻辑归属 / Logic placement
N/A:没有新增或修改生产业务逻辑。
性能与内存 / Performance and memory
N/A:没有生产搜索、索引、后台任务、缓存或运行时依赖变更;测试使用单一小型合成文件,无真实时间
sleep,等待使用h.await事件唤醒与 8 秒本地期限,退出清理完整。设置 / Settings
N/A:没有设置项或持久化行为变化。
插件契约 / Plugin contract
N/A:没有插件契约、宿主方法、能力版本或 SDK 变化。
发行包与资源 / Bundle and resources
N/A:没有运行时资源或发行包变化;
verify-runtime-bundle-immutability.sh通过。无用代码与重构 / Dead code and refactoring
验证 / Verification
环境:macOS arm64,Go 1.27.4,固定 Core
076ce04e314ecdde790b36ee3f374becb11951a0(合并origin/main883fce9c6后)。gofmt -l desktop/&git diff --check origin/main...HEAD./scripts/desktop/desktop-go.sh vet ./...&vet -tags dev ./..../.agents/skills/write-stable-tests/scripts/test-stability-macos.sh --package ./internal/workbench -- --filter '^(TestEverywhere|TestSearchPanels|TestProjectSearchReadsUnsavedTextAndAllSearchesContents)'TestEverywhereAllFindsAnnotationTextAndTextTabRetainsQuery100ms,最慢TestEverywhereFindsPagesAndOpensSelectedFile740ms;报告.artifacts/test-stability/index.html)./scripts/desktop/desktop-go.sh test -race -count=5 ./internal/workbench -run '^(TestEverywhere|TestSearchPanels|TestProjectSearchReadsUnsavedTextAndAllSearchesContents)'ok ... 20.816s)./scripts/desktop/desktop-go.sh test -tags 'dev vivahead' -count=5 ./internal/workbench -run '^(TestEverywhere|TestSearchPanels|TestProjectSearchReadsUnsavedTextAndAllSearchesContents)'ok ... 11.970s)LITHE_VISUAL_OUTPUT_DIR=... ./scripts/desktop/desktop-go.sh test -tags 'dev vivahead lithevisual' -count=1 ./internal/workbench -run '^TestVisualSearch'ok ... 7.231s,临时截图目录已清理)./scripts/desktop/desktop-go.sh test -count=1 ./internal/core -run 'TestEverywhere|TestWorkspaceSearch'ok ... 1.343s)./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh --base origin/main-race+ 人工审查确认)./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD&verify-platform-feature-matrix.sh./scripts/agent-notes/verify-agent-notes.shnode scripts/i18n/verify-app-language-localization.mjs&node scripts/i18n/generate-i18n.mjs --check./scripts/desktop/verify/verify-runtime-bundle-immutability.shrg&node scripts/desktop/validate-pins.mjsrg0 命中;pins 有效可达)未能执行的检查和原因: macOS/Windows 原生窗口交互验收未在桌面应用界面运行(保持矩阵
verificationStatus: pending);未重跑无关模块全量 Go 测试(仅验证搜索与 Core 搜索受影响包)。提交前确认 / Final checks
origin/main(883fce9c6),目标分支为main.build/、target/、dist/、.artifacts/、PNG 或extension-host/