Repository navigation
feat(desktop): 构建选项新增忽略路径,默认跳过所有以 . 开头的文件夹 - #1902
Merged
Merged
Conversation
PINNED_CORE_REVISION 升到 Lithe-core-rust#35 的合并提交 d19e9ef(其下是 #34)。 build.detect 按忽略路径剪掉文件夹:规则一行一条,写法同 .gitignore,相对项目根目录, 只匹配文件夹;默认是 ".*",.claude/worktrees 这类以 . 开头的文件夹不再被当成构建根。 - core:BuildDetectOptions.ignoredPaths、resolveStoredOptions 返回的 ignoredPaths (patterns + source local/team/default),新增 EditBuildIgnoredPaths 绑定 build.editIgnoredPaths。 - 构建选项对话框顶部新增“检测”分区:忽略路径多行输入、ⓘ 说明、当前来源说明 (本机 / 团队文件 .lithe/build/options.json / 默认),本机列表可“恢复默认”。 修改只写本机文档,保存后重新检测;Core 拒绝的规则按行号报错,对话框保持打开。 - Build 窗口标题栏新增齿轮,打开只含忽略路径的构建选项;构建系统行的齿轮和 右键菜单仍打开该构建系统的选项,并在上方显示忽略路径。中文里该按钮改叫“选项”, 与标题栏的“构建选项”区分。 - 新增 i18n 词条与功能矩阵说明;测试覆盖保存/恢复默认/行号报错和 Core 绑定。
对话框打开和“恢复默认”时读取 .lithe/build/options.json 与本机构建选项文档, 改为和 Core 调用一起在后台执行,窗口线程只发布结果。
21 of 28 tasks
xiaoyumuxi
marked this pull request as ready for review
November 14, 2026 06:34
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 14, 2026
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
PR 类型 / Type
改动说明 / What changes
背景 / Why
#1898 让构建检测跳过被 Git 忽略的目录,但没写进
.gitignore的点目录仍会被当成构建根目录,例如工具状态、缓存、.claude/worktrees下的代理工作树副本,Build 窗口因此会把同一个模块列好几遍。用户希望在构建选项里加一个忽略路径的配置,默认忽略所有以.开头的目录。Core 部分(规则语义、分层存储、校验和错误码)已在 Lithe-core-rust#35 合入。这个 PR 把桌面端固定到 #35,并在 Build 选项对话框里提供编辑入口。
改动 / Changes
scripts/desktop/build-desktop-core.sh的PINNED_CORE_REVISION从 feat(windows): multi-session terminal (#31) #34 的1d4556b(feat(desktop): 侧栏按钮可以隐藏,隐藏的工具窗口列在“…”按钮里 #1901 固定)升到 Lithe-core-rust#35 的合并提交d19e9ef,中间没有别的 Core 改动。build.detect新增可选字段ignoredPaths:省略或null时用默认值[".*"],传[]表示不额外忽略。build.resolveStoredOptions返回ignoredPaths { patterns, source },source是local、team或default。build.editIgnoredPaths:传数组替换本机列表,传null删除本机列表。plugin.build.invalidIgnoredPath,field是ignoredPaths[i];规则单独都能解析、合在一起编译失败时,field是ignoredPaths。internal/core/build_options.go、build.go):BuildDetectOptions.IgnoredPaths随检测请求发送,nil编码为省略,空切片编码为[]。BuildStoredOptions.IgnoredPaths和BuildIgnoredPaths{Patterns, Source},加上三个来源常量。(*Client).EditBuildIgnoredPaths:Inherit: true时发送patterns: null,否则发送数组,没有规则时发送[]。Kernel接口相应新增这个方法(workbench/app.go)。workbench/build_options.gobuildDetectOptions):检测前已经通过resolveStoredOptions合并本机和团队文档,这次把其中的storage.ignoredPaths.patterns一并传给build.detect,桌面端不自己解析规则。workbench/build_options.go):.gitignore、相对项目根目录、只匹配文件夹、后面的规则优先、以!开头的规则能让被 Git 忽略的文件夹重新参与检测、默认值、依赖缓存和构建输出始终跳过、最多 256 条。build.editIgnoredPaths读出团队列表或默认值,填进输入框,但不写入;用户点保存后才删除本机列表。ignoredPaths[i]换算成输入框里的行号(空行也算行数),报“第 N 行不是可用的忽略规则……”,对话框保持打开,什么都不写。规则合在一起编译失败时,报“这些忽略规则不能一起使用”。workbench/build_tree_view.go):workbench/ide_api_build.go):saveBuildOptionChanges多了忽略路径参数,IDE API 的选项写入传nil,行为不变。app.action.performed,动作名分别是build.options.save和build.ignoredPaths.restoreDefault。标题栏的齿轮沿用build.options.open。desktop.build.detection、ignoredPaths、ignoredPathsHelp、ignoredPathsLocal、ignoredPathsTeam、ignoredPathsDefault、invalidIgnoredPath、invalidIgnoredPaths,中英两份都有。desktop.build.optionsTitle的说明,它现在也是标题栏按钮的名称。desktop.build.options的中文改成“选项”。shared.generated.go。build-system-plugins的证据加上core/build_options.go、workbench/build_options.go和workbench/build_ignored_paths_test.go,说明补上这一行为。两端的状态不变,仍是partial/pending。core/build_options_test.go:TestBuildIgnoredPathsResolveFromTheLayersAndEditTheLocalList覆盖三层取值(默认、团队、本机)、本机替换、空列表保留为“不忽略”、删除本机列表后回到团队列表、注释行被拒并定位到ignoredPaths[1]。TestBuildDetectSkipsTheIgnoredPaths覆盖默认跳过点目录、[]不忽略、/tools只忽略这一个目录。workbench/build_ignored_paths_test.go,夹具在根目录、.claude/copy和tools下各放一个构建系统标记:TestBuildOptionsIgnoredPathsAreSavedOnThisMachineAndRestored:默认跳过.claude/copy;标题栏齿轮打开时没有构建系统选项、显示默认来源、没有“恢复默认”;输入.*、!.claude、空行、/tools后保存,重新检测得到根目录和.claude/copy,并存进本机文档;重开后显示本机来源;“恢复默认”在保存前不写入,保存后检测结果和来源都回到默认。TestBuildOptionsNameTheLineOfARefusedIgnoredPath:使用团队列表时,构建系统行的“选项”打开该构建系统的选项和团队来源说明;第 3 行写# note时报第 3 行的错误,对话框保持打开,本机什么也没存。不在本 PR 范围内 / Out of scope
.lithe/build/options.json里的ignoredPaths需要手动编辑,对话框只显示它正在生效。build.detect)。按 Core [Bug] 多模块spring boot的项目中.worktree导致的崩溃问题 #35 的设计,自动运行项发现、指纹扫描和 Node 清单发现不受影响。.gitignore的写法一致。类型专属:feat
多平台对齐
platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/build-system-plugins.json:补上证据路径和说明;两端验证状态保持pending,没有做实机验收./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD.artifacts/下生成的矩阵视图统一日志系统 / Structured logging
app.action.performed(a.performed),没有新增事件、print或手写事件 IDgenerate-log-events.mjs --check/verify-log-usage.mjs:仓库里已没有scripts/logging/,本 PR 也没有新增事件声明界面文案 / i18n
shared/i18n/补齐中英词条,运行node scripts/i18n/generate-i18n.mjs并提交生成结果node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或扩大豁免名单逻辑归属 / Logic placement
.*由 Core 给出,桌面端没有写死性能与内存 / Performance and memory
resolveStoredOptions,“恢复默认”调用一次editIgnoredPaths,两者都在后台执行,结果按会话号丢弃过期答复设置 / Settings
.*,不是空框或“自动”),下方写明来源插件契约 / Plugin contract
ignoredPaths是团队和本机构建选项文档的字段,build.editIgnoredPaths是宿主调用 Core 的命令,不是插件可调用的宿主方法。Core [Bug] 多模块spring boot的项目中.worktree导致的崩溃问题 #35 已在协议更新记录中登记(API 编号 —)PINNED_CORE_REVISION已升到包含该改动的 Core commitd19e9ef,桌面端测试经scripts/desktop/desktop-go.sh链接的就是这份 Core发行包与资源 / Bundle and resources
build-local-options.json(原有文件),团队列表在项目里。已运行./scripts/desktop/verify/verify-runtime-bundle-immutability.sh,通过无用代码与重构 / Dead code and refactoring
saveBuildOptionChanges改为同时处理构建系统选项和忽略路径,IDE API 与对话框共用同一条写入路径验证 / Verification
scripts/desktop/desktop-go.sh test ./... -count=1(LITHE_CORE_RUST_DIR指向 Cored19e9ef,变基到含 #1901 的 preview 后)scripts/desktop/desktop-go.sh test ./internal/workbench ./internal/core -count=1(加上保存日志、读取挪到后台之后)scripts/desktop/desktop-go.sh test ./internal/workbench -race -run TestBuildnode scripts/i18n/generate-i18n.mjs --checknode scripts/i18n/verify-app-language-localization.mjs./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD./scripts/desktop/verify/verify-runtime-bundle-immutability.shcargo test --workspace、clippy -D warnings、fmt --check、verify-docs.mjs未能执行的检查和原因:
pending。提交前确认 / Final checks
preview创建(已变基到包含 feat(desktop): 侧栏按钮可以隐藏,隐藏的工具窗口列在“…”按钮里 #1901 的 preview,固定版本冲突保留 [Bug] 多模块spring boot的项目中.worktree导致的崩溃问题 #35,变基后重跑了全部桌面端测试、i18n、矩阵和发行包检查);目标分支preview