feat: 资源管理器支持按模式排除文件/目录(issue #18) - #21
Open
wuxiangru915 wants to merge 4 commits into
Open
Conversation
- 新增 exclude-patterns 纯函数(单 * 通配、大小写不敏感、零依赖,预编译 matcher) - SidebarPrefs 新增 explorerExclude 字符串数组(缺省 [] = 不过滤,行为不变) - 声明式设置新增 texts 文本行(多行输入、失焦提交、去空/去重),explorer tab 声明排除模式 - ExplorerView 订阅 prefs,按模式过滤渲染,设置页修改即时生效 - 双语文案 + 单测(匹配逻辑 12、prefs 解析、设置行、组件渲染、schema 默认值)
PR omdsh-dev#21 的 settings.texts(多行文本行,如 explorerExclude 排除模式) 与 main 侧 v0.11/v0.12 的声明式设置演进(toggles 支持 switch/text/number、pluginToggles、render 自定义面板)合并: - SideCardSection: 保留新版开关/文本/数字行 + 自定义面板,texts 多行 textarea 作为追加行接入 FeatureSettingsRows/SettingsBody,齿轮条件 计入 texts - service.ts / prefs.ts: texts 与 pluginToggles/render 并存; stringArrayOf 与 pluginSettingsMapOf 并存 - 测试/文档/锁文件同步合并(unrun 显式依赖保留) 验证:pnpm typecheck ✓ pnpm build ✓ NODE_ENV=test pnpm test 509 全过 (41 文件,含 explorer-exclude 与 side-card-section 新规格)
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 #18:资源管理器像常见 IDE 一样按模式隐藏不需要的文件/目录(Unity 用户过滤
.meta、隐藏node_modules、build等系统生成内容)。设计要点
src/exclude-patterns.ts:条目名称匹配(目录/文件一视同仁),单个*通配、大小写不敏感、空白模式忽略;compileExcludePatterns预编译正则(渲染路径每行复用,不重复编译)。fs.tree路由与listDirectory不动,其他消费者(git/editor)不受影响;explorerExclude缺省[]= 行为不变。settings.toggles(布尔)之外新增settings.texts文本行——多行输入、失焦提交、自动 trim/去空/去重;explorer tab 在设置页齿轮弹窗中维护排除模式,修改后 ExplorerView 订阅 prefs 即时生效。SidebarPrefs(prefs-shared)+PrefsSchema(config)+parsePrefs防御解析 + 设置持久化。改动清单
src/exclude-patterns.ts(新):匹配逻辑src/prefs-shared.ts/src/config.ts/src/client/prefs.ts:explorerExclude字段src/client/service.ts:SidebarSettingText+settings.textssrc/client/SideCardSection.tsx/.module.css:文本行 UI(TextSettingRow)src/client/builtins/tabs.tsx/ExplorerView.tsx:声明 + 过滤渲染src/client/locales.ts:zh/en 文案docs/plans/2026-08-14-explorer-exclude-design.md、README(zh/en)、AGENTS.md验证
pnpm typecheck✓pnpm build✓NODE_ENV=test pnpm test:423/424 通过(唯一失败为预先存在的 node-pty 预编译环境问题,与本改动无关)chore: 显式声明unrun依赖——tsdown 的 optional peer,全新pnpm install后pnpm build会因缺它失败(本机 Node 22 + pnpm 11 实测),显式声明后构建稳定。已知限制(README 已记录)
**、?、{}等)后续可加