Repository navigation
feat(core): #1662 车道 E 工作区下沉(WS-05/13/18) - #1758
Merged
Merged
Conversation
This was referenced Nov 5, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
同时在命令注册表、dispatcher 和 rust-core-api 契约里登记本 PR 新增的全部命令 (workspace.orderEntries、workspace.recentProjects.reduce、diff.compareTexts)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1lck
force-pushed
the
feat/issue-1662-e-workspace
branch
from
November 5, 2026 09:51
7857162 to
0f1d5cc
Compare
Owner
Author
本地验证(代替 GitHub macOS / Windows CI)本 PR 与 #1760、#1755、#1753、#1759、#1756、#1758、#1757 一起,在本地集成分支 macOS(本机,macOS 26.6 arm64)
Windows(lithe-dev,Windows Server)
合并前每个 PR 已 rebase 到最新 preview,并重新执行编译、i18n、 |
1lck
marked this pull request as ready for review
November 5, 2026 09:52
This was referenced Nov 5, 2026
1lck
added a commit
that referenced
this pull request
Nov 6, 2026
* 新增 lithe-core-rules 同步规则桥和 wasm 构建接入 (#1662) - 新增纯 Rust crate rust/lithe-core-rules:只依赖 serde,不碰 I/O 和时钟,能编译到 wasm32;lithe-core 依赖它,并通过现有 JSON 分发暴露 keymap.modifierGestureStep,envelope 与错误码和其他 Core 命令一致 - wasm ABI 不用 wasm-bindgen:导出 alloc/dealloc/execute/result_len,输入输出为 Core envelope JSON;release 约 141 KB - Windows 新增 src/core/core-rules.ts:启动时异步 instantiate(WebView2 不允许同步编译大模块),之后 executeCoreRuleSync 同步调用;加载失败显示本地化错误,不回退 TS 算法 - 新增 scripts/windows/prepare/prepare-core-rules-wasm.mjs,接入 dev/build、ci-windows 前端 job 和两个 Windows 发布工作流;产物不提交 - 注释检查、rustfmt、日志检查和 Rust 单测纳入新 crate - 工作树资源清单登记不可复用的 core-rules-wasm,补测试和 docs/ci-builds.md - 新增 coreRules.* 中英词条 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * WS-17 双击 Shift 手势改走 Core,删除两端算法 (#1662) - macOS DoubleShiftGestureRecognizer 和 Windows double-shift-recognizer.ts 只保留薄适配层,状态机和阈值由 keymap.modifierGestureStep 提供;macOS 经 FFI 同步调用,Windows 经 wasm 同步调用 - 共享 fixture modifier-gesture-v1.json 由 Rust 测试、macOS 测试(真实 FFI)和 Windows bun 测试(真实 wasm)逐步驱动 - 删除功能矩阵、契约文档和代码注释里的 WS-17 例外说明,契约补充 keymap.modifierGestureStep - 新增 Agent Note 2026-11-05-core-rules-wasm-sync-bridge.md,并在 develop-lithe Skill 加一行指引 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * fix(windows): 同步 src-tauri Cargo.lock 中 lithe-core 的 similar 依赖 lithe-core 新增 similar(diff.compareTexts,#1758)时只更新了 rust/Cargo.lock, windows/tauri/src-tauri/Cargo.lock 缺少 similar 与 bstr 条目,导致 `cargo build --locked` 在 preview 上报 cannot update the lock file。 补上这两个条目,版本与 rust/Cargo.lock 一致,不升级其他依赖。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * LSP-16 编辑器分组成员状态改走 Core,删除两端旧规则 (#1662) - 新增 Core 命令 editor.workbenchState.reduce(rust/lithe-core-rules,同时经 lithe-core JSON 分发):规范“组成员状态”取两端并集(有序去重成员、选中项、MRU、固定、预览),动作含 normalize、open、close、activate、move、reorder、固定、预览、mergeGroup,返回新状态和 removedGroupIds - 两端在选中项离开分组时的既有行为不同,用 selectionFallback(adjacent / first)保留:Windows 选相邻标签,macOS 回到第一个标签 - Windows:pane-tree.ts 的 normalizeGroup、成员打开/关闭/移动/固定/预览等算法删除,经 workbench-state.ts 适配层在 zustand set() 里同步调用 wasm,每个动作一次 Core 调用;布局树只按 removedGroupIds 修剪;会话恢复不再自己去重 - macOS:EditorTabOrderFeatureModel 的 reconcileGroups、drop、insert、move 的归属与选中规则改为经 RustEditorWorkbenchState 调用 Core,EditorGroupLayout 只保留树结构和比例;MRU、固定、预览传空值 - 共享 fixture shared/fixtures/editor/workbench-state-v1.json(56 例)由 Rust、macOS(真实 FFI)和 Windows(真实 wasm)测试驱动;补 pane-tree、pane.store(含 Core 调用次数、拖动比例不调用 Core)、会话测试,三个 buffer 测试加载真实 wasm - 契约、功能矩阵 workbench-panes 和同步桥 Note 已更新 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * WS-04 隐藏路径规则统一进 lithe-core-rules (#1662) - 新增 workspace.classifyVisibility(按一批路径一次判断)和 workspace.visibilityDefaults,默认列表、glob 匹配、目录/文件区别只在 rust/lithe-core-rules/src/visibility.rs 一份;lithe-core 的 files.rs 复用同一份,删除第二份 - macOS:LitheCoreContracts 只定义 FileVisibilityEngine 协议,App 内 RustFileVisibilityEngine 经 FFI 实现;删除 Swift 默认列表和匹配算法;插件目录列表按目录批量分类 - Windows:文件树按目录批量调用 wasm 并按“目录 + 规则版本”缓存;删除 ignore 判断和 default-settings.ts 的默认列表(新装默认为空,已保存值不变) - 共享 fixture visibility-v1.json 同时驱动 Rust、macOS(真实 FFI)和 Windows(真实 wasm)测试 - 更新功能矩阵、契约文档和同步桥 Note Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * fix(core-rules): #1662 宿主语言检查覆盖新 crate,修正类型和测试隔离 - 宿主语言检查的扫描范围和 workflow 触发路径加入 rust/lithe-core-rules/src。 - 基线按代码搬迁记录:files.rs 的 toolTables 19 和 1 个 words 随隐藏目录表移到 lithe-core-rules 的 visibility.rs;FileVisibilityRules.swift 的 1 个 words 已删除,总数减 1。 - file-tree-visibility:workspaceRootFor 允许返回 undefined;默认值测试补上类型参数。 - core-rules 增加 resetCoreRulesForTests()。pane.store 的 Core 调用计数测试先重置再加载, 避免同一 Bun 进程里更早的测试文件已经加载了不计数的实例。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
引用 #1662(车道 E:工作区、文件、搜索、快捷键),Draft。
本 PR 完成的条目
workspace.orderEntries(project/file_name_order.rs),共享 fixtureshared/fixtures/workspace/entry-order-v1.json。macOS 删除listDirectories兜底扫描和 Swift 比较器,插入文件时由 Core 排序;Windows 文件树/面包屑/可见行排序改走 Core(v0.1.12不再排在v0.1.4前,不再受 locale 影响)。diff.compareTexts(rust/lithe-core/src/diff/),fixtureshared/fixtures/diff/compare-texts-v1.json;git/mod.rs里私有的行配对改为复用该模块;macOS 删除 collection difference+bigram DP,Windows 删除 patience+LIS,换行规范化统一。workspace.recentProjects.reduce(project/recent_projects.rs,容量与固定策略作为参数),fixturerecent-projects-v1.json;两端保留集合一致,workspace-open-switch功能矩阵已更新。新 API
workspace.orderEntries、workspace.recentProjects.reduce、diff.compareTexts(已登记rust-core-api.md)。rust/Cargo.lock因 diff 模块依赖变化。本 PR 不包含(留给后续)
rankNames才能删干净,macOS 旧打分同理,不硬塞半成品。terminal模块)已丢弃。与 #1658 重叠的文件(后合并者需 rebase)
RustWorkspaceOperations.swift、RemoteWorkspaceRouting.swift、FileNodePathLookup.swift、WorkspaceFeatureContracts.swift、WorkspaceFeatureModel.swift、ProjectTreeLoaderTests.swift、git/mod.rs、protocol/command.rs、runtime/dispatcher.rs、rust-core-api.md。与 #1716 无重叠。验证
cargo test -p lithe-core --lib:1865 passed。tsc --noEmit干净;bun test相关目录 290 pass / 18 skip(依赖原生 Core)/ 0 fail。verify-rust-core-comments、verify-shared-contracts、verify-core、verify-service-boundaries、verify-windows-boundaries、verify-platform-feature-matrix、i18n 两项均通过。test-macos.sh --filter(LitheCoreLogicTests、RecentProjectsStore、ProjectTree、LocalHistory、SearchEverywhere):310 个中 7 个失败,均为窗口焦点/并发时序类(LazyProjectTreeInventory 单独重跑 26/26 通过;SearchEverywhere 的 popup 焦点与尺寸测试未被本 PR 触及,未单独复核)。test-macos.sh;Windowscargo check --bin lithe-windows在 macOS 宿主因os::windows无法编译(与本改动无关);verify-rust-core.sh。🤖 Generated with Claude Code