Repository navigation
feat(desktop): 工具和生态的隐藏目录改由插件声明,Core 固定到 main ac8825b (#1856) - #2060
Merged
Merged
Conversation
- 宿主读取插件语言时,把已启用的构建系统插件和 VCS 插件的清单交给 Core 的 workspace.configureVisibility;名单变化后每个打开的标签页重读已展开目录。 - 文件图标的排除目录样式只认这份名单,不再写死 target、build、node_modules 等名字。 - 本地历史 ⓘ 说明改为如实描述:默认规则就是隐藏目录,删掉对应的行也不会开始记录。 - 收掉 #69 留下的死代码:BuildRuntimeRequirement.HostManaged 和按运行时名字回退到 PATH 的分支。 - 仓库选择 fixture 测试跳过 #71 新增的 chosen 用例(桌面端还不发送,#2013)。 - PINNED_CORE_REVISION 升到 Lithe-core-rust #72 分支 a88fe73(已含 main 上的 #69、#71)。 - 新增 Agent Note,归档 Python 环境跳过的旧 Note,更新构建契约和仓库发现 Note、功能矩阵, 补本地历史说明的中英文截图。
…-directories # Conflicts: # shared/platform-feature-matrix/features/file-explorer.json
xiaoyumuxi
marked this pull request as ready for review
November 16, 2026 14:39
26 of 29 tasks
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
Core 和桌面端原来各写死一份要隐藏的目录名:Core 有 4 份(可见性规则、本地历史、VCS 根目录探测、运行扫描),桌面端的文件图标又有一份(
target、build、out、bin、dist、node_modules、.idea)。这些名字都是 Cargo、Gradle、npm、Python 等具体工具的约定,违反“Core 和宿主不对语言或工具做特判,由插件注入”的规则(#1856)。Lithe-core-rust #72(已合入 main,ac8825b)把这些名单删了:Core 自己只隐藏
.git、.worktree、.worktrees、.DS_Store和.lithe,其余目录由插件在buildSystems[].layout.hiddenDirectoryNames里声明,VCS 提供者的目录标记(如.svn)同样隐藏;宿主通过新命令workspace.configureVisibility把已启用插件的清单交给 Core。本 PR 是桌面端接入。改动 / Changes
隐藏目录接入(
desktop/internal/workbench/hidden_directories.go,新文件)configureVisibility:取已启用的构建系统插件(复用pluginservice.BuildPlugins)和 VCS 插件(复用已读到的VcsPlugins)的清单,同一插件只发一次,调用 Core 的workspace.configureVisibility。清单读不出的插件不隐藏任何目录(它的构建系统本来也探测不到);被 Core 拒绝的清单计入错误。applyHiddenDirectories:失败用已有事件app.background.operation_failed(operation=workspace_visibility)记一次;Core 返回新名单时更新文件图标,并让每个打开的标签页重读已展开的目录(resyncTreeListings,保留展开和选中状态,正在进行的旧读取作废)。名单没变什么都不做,所以一次插件变化后其余标签页的重读不会重复刷新。plugins.go:reloadPluginLanguages在读取插件语言的同一个后台任务里调用configureVisibility,时机和插件语言相同:工作台启动,以及安装、启用、禁用、卸载插件之后。updates.go:抽出openTabs(),供上面遍历所有打开的标签页。desktop/internal/core/workspace_visibility.go(新文件):ConfigureVisibility的 Go 绑定和VisibilityConfiguration(hiddenDirectoryNames、rejected)。文件图标(
desktop/internal/fileicons/fileicons.go)target、build、out、bin、dist、node_modules、.idea),排除目录样式只认SetHiddenDirectoryNames设进来的名单(忽略 ASCII 大小写);名单没变时返回 false,供上面判断是否需要重读目录。本地历史设置的 ⓘ 说明(
shared/i18n/,settingswindow/local_history_view.go注释)!开头的行显示;删除这行!行即可重新开启该规则。**/.git/),以及已启用插件声明的目录(例如构建输出目录)。隐藏目录里的文件始终不记入本地历史,删掉对应的行也一样。删掉的行在应用后显示为以“!”开头的行;删除这一行即可恢复该规则。messages.json的词条描述同步更新,已重新生成desktop/internal/i18n/shared.generated.go。m46-history-default-rules-help(settingswindow/visual_capture_test.go):滚到本地历史,点击通配符列表那一行的 ⓘ,固定显示说明;弹层有淡入动画,截图前把帧时钟推进 1 秒。#69 留下的死代码(Core 已删除对应字段)
desktop/internal/core/build.go:删除BuildRuntimeRequirement.HostManaged。desktop/internal/workbench/build.go:case "runtime"只按runtimes[candidate.Runtime]解析,删除按运行时名字回退到 PATH 的分支。Core 固定版本
scripts/desktop/build-desktop-core.sh:PINNED_CORE_REVISION升到 Lithe-core-rust mainac8825b(fix: keep large run logs responsive #72 squash 合入)。相对上一个固定版本5a8d786新增:fix: stop redundant Git refresh loops #69(删除KNOWN_RUNTIME_TOOLS)、ci: parallelize macOS validation and releases #71(多仓库 Git Log 混排,桌面端还不发送chosen等新字段,[Feature] IDEA 风格的多仓库分支入口与 Git Log 聚合 #2013)、lithe 0.2.2 #74(git.workspacePushPreview,桌面端还不调用;对已有代码只把 3 个函数改为pub(crate))、fix: keep large run logs responsive #72。测试
core/workspace_visibility_test.go(新):TestWorkspaceVisibilityHidesTheFoldersPluginsDeclare,真实 Core 隐藏插件声明的目录(任意层级、忽略大小写),被拒的清单不生效,清空后重新显示。workbench/hidden_directories_test.go(新,合成插件dev.lithe.test.*):TestPluginDeclaredFoldersLeaveTheProjectTree:启用后项目树隐藏声明的目录,禁用后重新显示。TestHiddenFoldersListTheTreeAgainOnlyWhenTheyChange:名单变化才重读目录。TestHiddenFoldersLeaveTheTreeOfEveryOpenTab:每个打开的标签页都生效。workbench/local_history_settings_test.go:默认规则改为断言包含插件声明的目录,不再依赖 Core 内置的工具目录。core/workspace_tree_test.go:删除TestWorkspaceDirectoryAndSearchHidePythonEnvironments(Core 不再内置.venv、venv、__pycache__,隐藏插件声明的目录由上面的可见性测试覆盖)。core/workspace_search_test.go、workbench/filetree_test.go:被过滤的文件事件路径从node_modules/…改为 Core 仍内置的.worktrees/…。fileicons/fileicons_test.go:排除目录图标只认当前名单。core/repository_discovery_test.go:ci: parallelize macOS validation and releases #71 给仓库选择 fixture 新增了chosen用例,桌面端还不发送chosen([Feature] IDEA 风格的多仓库分支入口与 Git Log 聚合 #2013),这些用例跳过并计数,确保其余用例仍被检查。Agent Note、功能矩阵和截图
.agents/notes/implemented/architecture/2026-11-16-plugin-declared-hidden-directories.md:结论、正确做法和反例、4 个备选方案(Core 保留“中立”默认名单、每次请求带名单、读.gitignore、像 IntelliJ 登记库根)及取舍。2026-10-29的“工作区扫描默认跳过 Python 环境和字节码”(被新 Note 取代,仍有价值的理由已并入);构建契约 Note、仓库发现 Note 同步更新。file-explorer、git-repository-discovery、history-snapshots补充本次行为和验证命令。docs/assets/hidden-directories/:本地历史 ⓘ 说明的深色中文、浅色英文截图和复验命令。与 main 合并
file-explorer.json的verification冲突按“保留 fix(workspace): 修复项目树目录读取误用计算超时 #2045 新增的一句 + 本 PR 的改动”解决。不在本 PR 范围内 / Out of scope
["target"]、Gradle 插件声明[".gradle", "build"]、Maven 插件声明["target"]。旧宿主会拒绝带新字段的清单,所以要等包含本 PR 的桌面端发布后,在各插件仓库提 PR 并发版。在此之前,target、build、node_modules、.venv等目录会出现在项目树里,也会被搜索和本地历史记录(用户已确认接受,见 Note“后果”)。chosen:[Feature] IDEA 风格的多仓库分支入口与 Git Log 聚合 #2013。manifest.json:[Feature] pluginservice 每种贡献类型各自选择版本并重读 manifest.json:一次插件重读每个插件 5 次 Core 往返、5 次读盘,改为共享一份已安装插件快照 #2058(既有债务)。类型专属:feat
多平台对齐
改动都在 macOS 和 Windows 共用的 Viva 桌面端 Go 代码和 Rust Core 里,没有平台分支。Windows 只在 CI 上跑测试,本机虚拟机未验收(见“验证”)。
范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/<id>.json:两端的实现状态和验证状态、证据路径、owner、验证动作都如实填写;没有运行验证的保持pending(file-explorer、git-repository-discovery、history-snapshots;原生窗口验收写明待做)./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh;改了平台实现路径的,还运行了./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD.artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空dev.lithe.test.*;repository_discovery_test.go跳过的是 Core fixture 里桌面端还不发送的chosen用例,与插件无关)shared/i18n/;插件的构建步骤、资源路径和补丁没有写进docs/ci-builds.md、Agent Note 或 SkillUI 验证 / UI evidence
scripts/desktop/desktop-go.sh test -tags vivahead,lithevisual ./internal/settingswindow -run 'TestVisualSettings/m46-history-default-rules-help' -count=1 -timeout 300s,提交 e937f0f,场景m46-history-default-rules-help,深色中文(不设LITHE_VISUAL_LANGUAGE)和浅色英文(LITHE_VISUAL_LANGUAGE=en),1800×1400 像素统一日志系统 / Structured logging
rust/logging/events/<root>.json声明,再用生成的事件类型和 span 记录;没有NSLog、os_log/Logger、直接写 stderr、print或手写事件 ID(新失败路径用已声明的app.background.operation_failed,经已有的backgroundFailed记录,operation=workspace_visibility,没有新增事件)path、错误用error类型,动态通道段来自已校验的 IDscripts/logging/)已移除:本 PR 未涉及界面文案 / i18n
shared/i18n/补齐中英词条,运行node scripts/i18n/generate-i18n.mjs并提交生成结果,没有手改生成文件;Viva 代码通过desktop/internal/i18n/的接口读取shared/i18n/node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或扩大豁免名单逻辑归属 / Logic placement
性能与内存 / Performance and memory
resyncTreeListings。插件重读会多读一次已启用插件的清单(BuildPlugins),重复读取已在 [Feature] pluginservice 每种贡献类型各自选择版本并重读 manifest.json:一次插件重读每个插件 5 次 Core 往返、5 次读盘,改为共享一份已安装插件快照 #2058 建单设置 / Settings
插件契约 / Plugin contract
buildSystems0、vcsProviders0 内的补充)scripts/desktop/build-desktop-core.sh的PINNED_CORE_REVISION已升到包含该契约的 Core commit(main ac8825b),桌面端测试经scripts/desktop/desktop-go.sh读到的就是这份契约sdk-e2e.mjs:只加了清单的可选字段,没有改插件后端协议workspace.configureVisibility是宿主调用 Core 的命令,不是插件可调用的宿主方法,没有新增宿主方法或通知发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh(没有新增资源路径)无用代码与重构 / Dead code and refactoring
HostManaged和按运行时名字回退 PATH 的分支)refactor标签的 Issue,没有在本 PR 顺手处理:[Feature] pluginservice 每种贡献类型各自选择版本并重读 manifest.json:一次插件重读每个插件 5 次 Core 往返、5 次读盘,改为共享一份已安装插件快照 #2058验证 / Verification
scripts/desktop/desktop-go.sh test ./... -count=1(Core 固定 ac8825b,合并 main e84c2a6 之后)scripts/desktop/desktop-go.sh test ./internal/workbench ./internal/core ./internal/fileicons -count=1(合并 main 之后)scripts/desktop/desktop-go.sh test -tags vivahead,lithevisual ./internal/settingswindow -run 'TestVisualSettings/m46-history-default-rules-help' -count=1 -timeout 300s(中文、LITHE_VISUAL_LANGUAGE=en各一次)gofmt -l,go vet -tags vivahead,lithevisual ./internal/settingswindow./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEADnode scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --checknode scripts/agent-notes/verify-agent-notes.mjs./scripts/desktop/verify/verify-runtime-bundle-immutability.sh.agents/skills/write-stable-tests/scripts/verify-test-stability.sh --base origin/main(合并 main 之后)develop-lithe第三节插件归属自查命令未能执行的检查和原因:
layout.hiddenDirectoryNames的构建插件后项目树隐藏对应目录、禁用后重新显示,目前只有无头测试覆盖;已发布的插件都还没有声明这个字段,要等插件更新后才能实机验收。提交前确认 / Final checks
main创建;目标分支:feat、fix、docs 为main,release 以发布流程要求为准(提交前已合并最新 main e84c2a6).build/、target/、dist/、.artifacts/等产物,没有凭据、个人路径和未脱敏的日志或截图