refactor: include hidden dotfiles folders in file picker search (#6315)

Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
This commit is contained in:
Abhijay Jain 2026-01-13 01:26:30 +05:30 committed by GitHub
parent 5bc0b8c51b
commit 9376796cf0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 5 deletions

View file

@ -32,7 +32,8 @@ To close the search box without selecting a file, press `Esc` or click in the ch
- **Fuzzy matching**: Intelligently matches partial text and prioritizes matches at word boundaries
- **Highlighted results**: Shows matched characters highlighted in the search results
- **Performance optimized**: Scans up to 5 directory levels deep with intelligent filtering
- **Auto-filtering**: Automatically excludes common directories like `.git`, `node_modules`, `__pycache__`, `.vscode`, `.idea`, `target`, `dist`, and `build`
- **Auto-filtering**: Automatically excludes common directories like `.git`, `node_modules`, `__pycache__`, `target`, `dist`, and `build`
- **Hidden folder support**: Includes important configuration directories like `.github`, `.vscode`, `.idea`, `.config`, and other CI/CD folders (`.circleci`, `.gitlab`, `.azure`, `.jenkins`)
- **Cross-platform**: Searches from user directories (`/Users` on macOS, `C:\Users` on Windows, `/home` on Linux)
- **Visual indicators**: Distinguishes between files and directories with clear icons

View file

@ -160,8 +160,6 @@ const MentionPopover = forwardRef<
'.hg',
'node_modules',
'__pycache__',
'.vscode',
'.idea',
'target',
'dist',
'build',
@ -174,6 +172,17 @@ const MentionPopover = forwardRef<
'.Trash',
];
const allowedHiddenDirs = [
'.github',
'.vscode',
'.idea',
'.config',
'.gitlab',
'.circleci',
'.azure',
'.jenkins',
];
// Don't skip as many directories at deeper levels to find more items
const skipDirsAtDepth =
depth > 2 ? ['.git', '.svn', '.hg', 'node_modules', '__pycache__'] : skipDirs;
@ -194,8 +203,13 @@ const MentionPopover = forwardRef<
const fullPath = `${dirPath}/${item}`;
const itemRelativePath = relativePath ? `${relativePath}/${item}` : item;
// Skip hidden items and common ignore patterns
if (item.startsWith('.') || skipDirsAtDepth.includes(item)) {
// Skip items in the skip list
if (skipDirsAtDepth.includes(item)) {
continue;
}
// Skip hidden items except for allowed hidden directories
if (item.startsWith('.') && !allowedHiddenDirs.includes(item)) {
continue;
}