feat(desktop): add configurable file tree hiding
Closed
RA
1mo ago+2141+2141+0123456789012345678901234567890123456789-28-28-01234567890123456789
Summary
- add a Settings > Appearance list of gitignore-flavored patterns hidden from the v2 workspace file tree
- default to
.git,node_modules, and.DS_Store - apply filtering to initial directory loads, refreshes, live creates, and renames
- reload the current tree immediately when patterns change
Closes the current request tracked in #5595 and revives the still-applicable behavior from #3153.
Validation
bun test src/shared/file-tree-patterns.test.ts src/renderer/routes/_authenticated/settings/utils/settings-search/- 22 passed, 0 failed
bunx turbo typecheck --filter=@superset/desktop --filter=@superset/local-db- Biome check on all changed source files
- manually verified on macOS Desktop v1.20.2 against a repository containing dot-directories, caches, nested generated folders, and live file-system changes
Manual behavior verified
- defaults hide
.git,node_modules, and.DS_Store - adding/removing patterns updates the open Files sidebar
- anchored
/output, directory-onlybuild/, basename,*,?, and**patterns behave as documented - Reset to defaults restores the shipped list
- terminal and file operations remain unaffected
Summary by cubic
Adds configurable hidden-file patterns to Desktop file trees, applied to both the v2 workspace tree and the legacy Files explorer. Patterns are persisted, loaded before first render, and used to filter loads, refreshes, live events, and search results.
-
New Features
- New Settings > Appearance “Hidden files” textarea with Save/Reset; searchable; editing/save/reset are disabled while saving or until patterns load; load failures show a Retry; oversized patterns are rejected with an error.
- Defaults to
.git,node_modules, and.DS_Store; every loaded directory reloads immediately when patterns change; initial load waits for persisted patterns. - Filtering covers v2 Files tab and the legacy Files explorer: refresh and live create/rename are filtered (events under hidden ancestors are ignored; renames into hidden drop the entry); search results are filtered; legacy caches invalidate on changes.
- Glob support:
*,?,**, leading/to anchor to root, trailing/for directories, and basename matches without/. - TRPC:
getFileTreeHiddenPatternsandsetFileTreeHiddenPatternswith input limits; saves are blocked if the pattern list hasn’t loaded. - Matcher with unit tests; matches ancestors per path segment derived from the relative path; normalizes Windows separators.
-
Migration
- Adds
settings.file_tree_hidden_patternscolumn in@superset/local-db; applies via existing migrations, no manual steps.
- Adds
Summary by CodeRabbit
-
New Features
- Added configurable hidden-file patterns for the workspace file tree.
- Added a “Hidden Files” section in Appearance settings with editing, saving, reset, search highlighting, and guidance.
- Supports glob-style patterns for hiding files and folders, including wildcards, directory matching, comments, and rooted paths.
- Hidden entries are also excluded from file search results.
-
Bug Fixes
- Hidden files and directories remain filtered during refreshes, creation, and renames.
-
Tests
- Added coverage for pattern matching, path formats, wildcards, comments, and invalid patterns.