Skip to content

feat(core): #1662 第二轮 快捷键与终端(WS-08/16/17) - #1768

Merged
1lck merged 5 commits into
previewfrom
feat/issue-1662-r2-keymap-terminal
Nov 5, 2026
Merged

1lck merged 5 commits into
previewfrom
feat/issue-1662-r2-keymap-terminal

Conversation

@1lck

@1lck 1lck commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

关联 #1662(第二轮 快捷键与终端)。

WS-08 快捷键冲突检测(完成)

  • 新增 Core keymap.analyzeConflicts:按 默认 -> 预设 -> 用户 逐层覆盖后的最终生效绑定判定冲突;修饰键顺序、大小写、别名(cmd/command/mod、option、esc 等)不同但等价的绑定视为同一个;when 空白归一;无法解析的绑定进 invalid 且不参与冲突。
  • macOS:KeyboardShortcutFeatureModel 的冲突判断改由 Core 完成(原生按键到绑定文本的转换留在平台)。
  • Windows:行内冲突提示、编辑保存、导入都按最终生效绑定检测(含默认和预设),有冲突拒绝保存并提示冲突命令;导入先整体校验再改预设/写 store。以前只看用户 store 的原始字符串。

WS-16 终端文件链接(完成)

  • 新增 Core terminal.parseLinkTarget:path:line:column、file URI 解码、~、相对路径映射;不看扩展名、不访问文件系统。
  • 删除 Windows 扩展名白名单:改为对含路径形状的候选逐个检查文件是否存在(命中区域、存在性检查、打开动作仍在平台)。远程/WSL 通过列出父目录(文件树同一适配器)判断存在,不带行号的 src/foo.ts 仍可点开,三种根行为一致,无扩展名例外。同一(工作目录,行文本)结果 TTL 2s、LRU 128,进行中请求共享。
  • macOS 删除 TerminalLinkResolver;App.swift:12 不再被误当 URL scheme。

WS-17 Double Shift(有意保留平台实现,不下沉)

  • 理由:状态机在每个原生按键事件上同步运行;Windows 的 Tauri invoke 是异步的,按键路径不能每键调用 Core。
  • 例外边界:只有这一个状态机保留双端实现;两端用同一份 shared/fixtures/keymap/modifier-gesture-v1.json(16 个序列)逐步对照测试,已在功能矩阵、契约文档和两端代码注释中说明,改动须同时改 fixture 与两端。
  • fixture 覆盖:两次独立点击触发、触发后消耗、打字大写/中间按键取消、超阈值、阈值边界(等于不触发/略小触发)、时钟倒退、其他修饰键(按下/持有中/释放时/无 Shift 时)、重复事件、无按下的释放、reset。

验证

  • cargo test lithe-core(keymap/terminal_link,23 通过);verify-rust-core-comments、platform-feature-matrix、shared-contracts、windows-boundaries、verify-core、i18n 检查通过。
  • Windows:typecheck 通过;相关 bun 测试逐文件通过;真实 Core dylib 跑 binding-conflicts.native.integration 9 通过。keyboard-settings-routing 测试替身补了 keymap.analyzeConflicts(installKeymapContextPlans 增加可选应答参数)。
  • macOS:test-macos.sh 过滤 83 个测试通过(含新增 fixture 测试)。
  • 既有失败:matcher.test.ts 的 IME 用例在 origin/preview 上同样失败,非本次引入。
  • 未执行:Windows 真机验收(主会话在 lithe-dev 上做);未跑 cargo check --bin lithe-windows。

与 open PR 重叠

🤖 Generated with Claude Code

@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Nov 5, 2026
@1lck

1lck commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

本地集成验证(#1662 第二轮)

本 PR 与 #1765、#1768、#1767、#1766、#1769 一起,在本地集成分支 feat/issue-1662-r2-integration(基于 preview c1c7015)上验证。结果如下:

Rust

  • cargo test -p lithe-core:2130 个测试通过。
  • cargo test -p lithe-agent-host -- --test-threads=2:270 个测试通过。
  • cargo fmt --check -p lithe-core 通过。
  • cargo check --bin lithe-windows 在 macOS 上只有 2 个已知的 std::os::windows 错误,没有新增。

校验脚本
以下脚本全部通过:rust-core-comments、verify-core、shared-contracts、service-boundaries、windows-boundaries、platform-feature-matrix、两个 i18n 检查、runtime-bundle-immutability。

macOS

  • swift build --build-tests 通过。
  • test-macos.sh 跑了相关的 701 个测试,没有本次引入的失败:
    • cancellingSaveAllDuringRemoteDrainDoesNotWrite 在 preview 上同样失败,是既有问题。
    • 另外 3 个失败是高负载下的时序抖动,单独重跑能通过。

Windows 前端(在 Mac 上用 bun 跑)

  • bun run typecheck 通过。
  • 逐文件跑了 259 个测试文件,只有 3 个失败(git-status-display-order、matcher 的 IME 用例、agent-hooks-settings),在 preview 上同样失败,都是既有问题。

未执行
Windows 真机上的编译和测试没跑,因为 lithe-dev 服务器暂时连不上。

验证通过后用 --admin squash 合并,没有触发云端 macOS/Windows CI。

1lck and others added 5 commits November 5, 2026 05:56
…arseLinkTarget

快捷键冲突按默认、预设、用户逐层覆盖后的最终绑定检测,修饰键顺序和别名不同的等价绑定视为同一个;终端链接统一解析 path:line:column、file URI、~ 和相对路径,不按扩展名猜测。附共享 fixture、契约和跨 JSON 边界测试。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macOS 的冲突判断改由 Core 完成;Windows 按最终生效绑定(含默认和预设)检测,行内提示、编辑保存和导入都会拒绝冲突。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows 改为对候选路径检查文件是否存在;macOS 不再把 App.swift:12 误当成 URL scheme。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
按键路径必须同步,不能每个按键走一次 Core IPC,因此不下沉;两端用同一份 modifier-gesture fixture 逐步验证,并在功能矩阵说明。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
不带行号的远程/WSL 文件路径不再回退;悬停同一行时按(工作目录,行文本)做有界 TTL 缓存并共享进行中的请求。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1lck
1lck force-pushed the feat/issue-1662-r2-keymap-terminal branch from d7ff674 to ee96218 Compare November 5, 2026 13:57
@1lck
1lck marked this pull request as ready for review November 5, 2026 13:57
@1lck
1lck merged commit 235ab68 into preview Nov 5, 2026
1lck added a commit that referenced this pull request Nov 6, 2026
* feat(core): #1662 GIT-18/19 Core 提交图投影 git.graphProjection

新增 Core 命令 git.graphProjection:把 macOS 的 IntelliJ 提交图算法(permanent layout、head 排序、
定色、过滤后的虚线拓扑、隐藏祖先、missing parents、print element、推荐宽度)搬进 git::graph,
返回整数 lane、稳定的 color ID、路由和标签。删除没有调用方的旧 project_graph。
共享 fixture graph-projection-v1.json、IntelliJ 对拍 fixture 迁到 shared/fixtures/git/graph-idea,
Rust 测试覆盖 fixture、真实历史对拍和 5000 提交规模。

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat(windows): #1662 GIT-18/19 Windows 提交图改走 Core git.graphProjection

提交图布局、定色、过滤后的虚线拓扑和 missing parents 改为整窗口一次调用 git.graphProjection,
删除 TS 的 DFS/permanent layout/head 排序/按名称哈希定色和 git-graph-filter-projection。
当前分支祖先高亮改用 Core 返回的 currentBranchHashes。颜色 ID 到具体颜色的映射留在 git-graph-colors。
测试替身新增 git-graph-projection-stub(回放共享 fixture),布局/行/主题/表格测试改为断言 fixture 的具体结果。

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat(macos): #1662 GIT-18/19 macOS 提交图改走 Core git.graphProjection

提交图布局、定色、过滤后的虚线拓扑和 missing parents 改为整窗口一次调用 git.graphProjection,
删除 Swift 的 GitGraphProjection / GitGraphHeadOrdering / GitGraphMissingParents;
当前分支祖先高亮改用 Core 返回的 currentBranchHashes。
测试通过 GitGraphCoreTestSupport 调用真实链接的 Core;删除 LitheGitGraphVerifier 与 CoreVerifier 里的图布局检查,
性能 verifier 链接 Rust Core;同步功能矩阵、Agent Note 与语言特定词基线。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(core): #1662 第三轮 测试历史覆盖合并(RUN-10)

- 新增 build.mergeTestOutcomes:宿主给出历史/本次结果 ID 与覆盖范围(精确 ID + ID 前缀),Core 只比较字符串,输出稳定顺序的合并条目;空范围不覆盖任何结果,空前缀拒绝。
- 新增共享 fixture test-outcome-merge-v1.json。
- macOS LanguageTestService 删除自有合并算法,coverage 转长度前缀 ID 前缀后调用 Core。
- Windows maven.store 删除自有合并算法,Java 嵌套类(Outer$Inner)在 Maven 适配层转成前缀后调用 Core;测试替身补齐新命令。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(macos): #1662 RUN-10 coverage 缺 suite 的 case 直接拒绝

契约与 Core 解码已禁止只有 case、没有 suite 的 coverage,生产方不会产出。macOS 解码层同样拒绝这种组合,覆盖前缀不再把它降级成 project 前缀,避免删多历史结果;补解码拒绝测试。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(scripts): #1662 模块边界检查不再要求终端模块保留链接解析器

WS-16(#1768)已把终端文件链接解析下沉到 Core(terminal.parseLinkTarget),
macOS 删除了 TerminalLinkResolver,但 verify-module-boundaries.sh 仍要求
LitheTerminalModule 里有这个类型,导致脚本在 preview 上失败。去掉这一项,
保留旧文件不得回到可执行 target 的检查。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant