Skip to content

feat(search): add configurable global search exclusions in settings - #1064

Open
Rizmi wants to merge 4 commits into
lgse:mainfrom
Rizmi:feat/1062-search-exclusions
Open

Rizmi wants to merge 4 commits into
lgse:mainfrom
Rizmi:feat/1062-search-exclusions

Conversation

@Rizmi

@Rizmi Rizmi commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Description

Allow users to configure custom search exclusions in Settings under "SEARCH & FILTERING". Exclusions support both folder names (e.g. .venv, matching any folder with that name across the directory tree) and specific directory paths (e.g. ~/Downloads or /var/log, matching only that directory and its subtrees).

• Adds search_exclusions preference to Preferences and ThemeManager (Vec<String>, serialized only when non-empty).
• Implements SearchExclusions helper to classify entries into folder names vs directory paths (resolving ~ to user home).
• Updates search tree indexing (index_trees_with_exclusions, recursive walker scheduler, and single-directory walker) to skip excluded folder names anywhere in the hierarchy and specific directory paths.
• Provides a dedicated "Global search exclusions" modal dialog matching the layout, tokens, and style 1:1 with the "Copy to" dialog (modal_layout, entry with inline error validation, "Browse…" button via gtk::FileDialog, type badges for folder name vs directory, and delete action for each row).
• Wires the "Manage" row under "SEARCH & FILTERING" in General settings and indexes the action in settings search (Target { id: "search-exclusions", title: "Global search exclusions", ... }).
• Adds unit and integration tests covering configuration persistence, exclusion classification, directory pruning in search results, and dialog validation.

Note

In-folder filtering (search in current pane) and destination selection dialogs intentionally operate within their explicit browsing context and bypass global search exclusions (documented in search.rs).

Visual evidence

screenrecording-2026-09-16_11-07-05.mp4

How to test

  1. Open Settings (Ctrl+,) and navigate to General -> SEARCH & FILTERING.
  2. Click Manage on the Global search exclusions row: verify the modal dialog opens cleanly over the blurred settings overlay.
  3. Test adding a folder name:
    • Type .venv or node_modules and press Enter (or click "Add").
    • Verify it appears in the list with a "Folder name" badge.
  4. Test adding a directory path:
    • Type ~/Documents/Private or use the "Browse…" button to select a directory.
    • Verify it appears in the list with a "Directory" badge.
  5. Test validation:
    • Attempting to add an empty name, root/home (/ or ~), ambiguous relative paths without leading / or ~/, or duplicate entries shows an inline error message and highlights the field with form-field-error.
  6. Test search exclusion behavior:
    • In global search (Ctrl+K), search for a file known to be inside an excluded folder or directory.
    • Verify matching items inside excluded paths are not returned in results.
  7. Test removal:
    • Click the "Remove" button next to an entry in the exclusions modal.
    • Verify the entry is removed immediately, persisted, and subsequent searches include that path again.

Related issue

Closes #1062

@Rizmi
Rizmi marked this pull request as draft September 16, 2026 04:45
@Rizmi Rizmi changed the title feat(search): add configurable search exclusions in settings feat(search): add configurable global search exclusions in settings Sep 16, 2026
Allow users to configure custom search exclusions in Settings under
"SEARCH & FILTERING". Exclusions support both folder names (e.g. `.venv`,
matching any folder with that name across the directory tree) and
specific directory paths (e.g. `~/Downloads` or `/var/log`, matching
only that directory and its subtrees).

- Add `search_exclusions` preference to ThemeManager and Preferences.
- Introduce `SearchExclusions` to parse and evaluate folder name vs directory rules.
- Update `index_trees_with_exclusions`, recursive scheduler, and directory indexing to prune excluded directories from search results.
- Implement "Search exclusions" modal dialog matching the "Copy to" layout and styling 1:1, allowing users to list, add (via text entry or native directory picker), and remove exclusions.
- Wire into settings navigation and search.
- Add unit and integration tests for exclusions and dialog behavior.

Closes lgse#1062
@Rizmi
Rizmi force-pushed the feat/1062-search-exclusions branch from 736c66a to 663bd45 Compare September 16, 2026 04:53
@Rizmi
Rizmi marked this pull request as ready for review September 16, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(search): add configurable global search exclusions in settings

1 participant