feat(⌘K): 全文搜索改为一键开关,不用再手输「内容:」前缀 - #51
Open
jhoncao wants to merge 1 commit into
Open
Conversation
- 搜索框旁新增「▤ 搜内容」胶囊开关,点击或 ⇧Tab 即切换全文搜索 - 开启后直接输入关键词就搜文件内容(含 PDF、截图 OCR),placeholder 与空态提示随模式切换 - 「内容:」「content:」前缀完全兼容,老习惯不受影响 - 快捷键提示行补充 ⇧Tab 说明,中英文案同步进 i18n 词典
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.
动机
⌘K 里想搜文件内容,现在必须先敲一串「内容:」或「content:」前缀才能触发全文搜索。这个约定藏在 placeholder 文案里,第一次用很难发现;就算知道了,每次搜之前先打 3~8 个字符的前缀也挺费手。
改动
实测
本地
node server.js+ headless Chromium 逐条验证:/api/content,命中结果带行号与关键词高亮 ✅content:前缀 → 仍走全文搜索,与既有行为一致 ✅/api/search文件名模糊匹配,不受影响 ✅改动集中在
cmdk对象与静态标记,共 3 个文件 +29/-8,无后端改动。