Repository navigation
fix(search): 局部键位面缺条目时徽标回落代码默认 - #1968
Merged
Merged
Conversation
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.
变更概述
搜索浮窗结果行右侧的直选徽标(⌘1–9 / ↵)在真实安装环境不显示。根因:已安装用户磁盘上的默认
keybindings.json是 #1785 之前的旧快照(Rustmaterialize磁盘优先、不回填新条目),面已加载却缺local-search-row-pick;getLocalSpec在「面非空但缺该 id」时返回 null 且不回落代码默认,⌘N徽标因此为空(选中行↵仍在)。既有 e2e 因 mock 默认返回空面、走回落路径而全绿,掩盖了真实面路径。关联 Issue
Closes #1842
变更内容
src/lib/keybindings/localHotkeys.ts:getLocalSpec在面非空但缺该 id 时按 id 回落FALLBACK_SHORTCUTS(仍为单一来源,未硬编码);面有该 id 时仍用面项(尊重重映射);显式items路径语义不变。src/__tests__/lib/localHotkeys.test.ts:新增「面非空缺 id 回落」「面含 id 重映射不被覆盖」两例。e2e/search-float-badge-surface.spec.ts:注入缺 id 旧面 → 断言↵/⌘2–4;注入重映射⌥1–9→ 断言↵/⌥2–4。影响范围
仅影响局部键位读面(属性面板文档菜单 / 标签建议菜单 / 搜索浮窗三处共用);仅在「面缺该 id」时新增回落,不改面已含该 id 的行为。
验证方式
.artifacts/1842/state-coverage.json(4 态:旧面徽标、选中迁移、空查询隐藏、重映射 ⌥)。[↵,"","",""]→ 修复后[↵,⌘2,⌘3,⌘4]。质量门禁引用
[↵,"","",""],见证据与单测失败输出。[↵,"","",""]→[↵,⌘2,⌘3,⌘4];验证基于 35f0f94(分支基点)。风险评估
风险等级: low
来源: ai-generated
回滚方案
git revert 即可回滚