refactor: include hidden dotfiles folders in file picker search (#6315)
Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
This commit is contained in:
@@ -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
|
- **Fuzzy matching**: Intelligently matches partial text and prioritizes matches at word boundaries
|
||||||
- **Highlighted results**: Shows matched characters highlighted in the search results
|
- **Highlighted results**: Shows matched characters highlighted in the search results
|
||||||
- **Performance optimized**: Scans up to 5 directory levels deep with intelligent filtering
|
- **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)
|
- **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
|
- **Visual indicators**: Distinguishes between files and directories with clear icons
|
||||||
|
|
||||||
|
|||||||
@@ -160,8 +160,6 @@ const MentionPopover = forwardRef<
|
|||||||
'.hg',
|
'.hg',
|
||||||
'node_modules',
|
'node_modules',
|
||||||
'__pycache__',
|
'__pycache__',
|
||||||
'.vscode',
|
|
||||||
'.idea',
|
|
||||||
'target',
|
'target',
|
||||||
'dist',
|
'dist',
|
||||||
'build',
|
'build',
|
||||||
@@ -174,6 +172,17 @@ const MentionPopover = forwardRef<
|
|||||||
'.Trash',
|
'.Trash',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const allowedHiddenDirs = [
|
||||||
|
'.github',
|
||||||
|
'.vscode',
|
||||||
|
'.idea',
|
||||||
|
'.config',
|
||||||
|
'.gitlab',
|
||||||
|
'.circleci',
|
||||||
|
'.azure',
|
||||||
|
'.jenkins',
|
||||||
|
];
|
||||||
|
|
||||||
// Don't skip as many directories at deeper levels to find more items
|
// Don't skip as many directories at deeper levels to find more items
|
||||||
const skipDirsAtDepth =
|
const skipDirsAtDepth =
|
||||||
depth > 2 ? ['.git', '.svn', '.hg', 'node_modules', '__pycache__'] : skipDirs;
|
depth > 2 ? ['.git', '.svn', '.hg', 'node_modules', '__pycache__'] : skipDirs;
|
||||||
@@ -194,8 +203,13 @@ const MentionPopover = forwardRef<
|
|||||||
const fullPath = `${dirPath}/${item}`;
|
const fullPath = `${dirPath}/${item}`;
|
||||||
const itemRelativePath = relativePath ? `${relativePath}/${item}` : item;
|
const itemRelativePath = relativePath ? `${relativePath}/${item}` : item;
|
||||||
|
|
||||||
// Skip hidden items and common ignore patterns
|
// Skip items in the skip list
|
||||||
if (item.startsWith('.') || skipDirsAtDepth.includes(item)) {
|
if (skipDirsAtDepth.includes(item)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip hidden items except for allowed hidden directories
|
||||||
|
if (item.startsWith('.') && !allowedHiddenDirs.includes(item)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user