Skip to content

Fix: exclude hidden directories when drag-dropping folders into virtualTabs panel#45

Merged
winterdrive merged 5 commits into
mainfrom
copilot/fix-drag-and-drop-hidden-files
May 14, 2026
Merged

Fix: exclude hidden directories when drag-dropping folders into virtualTabs panel#45
winterdrive merged 5 commits into
mainfrom
copilot/fix-drag-and-drop-hidden-files

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

When dragging a folder from VS Code's native tree view into the virtualTabs panel, hidden directories (.git, .github, etc.) were recursively included — inconsistent with how VS Code's explorer displays file trees.

Changes

  • src/dragAndDrop.ts — Added a guard in getFilesInDirectoryRecursive to skip directories whose names start with '.'. Hidden files (e.g. .gitignore, .editorconfig) are still included, matching VS Code's native explorer behaviour which only excludes hidden folders like .git by default:

    // Skip hidden directories (names starting with '.') such as .git, .github
    // Hidden files (e.g. .gitignore, .editorconfig) are still included.
    if (name.startsWith('.')) {
        continue;
    }
  • src/test/unit/dragAndDropHiddenFiles.test.ts — Unit tests covering: hidden directories are excluded, hidden files (.gitignore, .editorconfig) are retained, nested children of hidden dirs are excluded, normal files are unaffected, and edge cases (empty dir, dir containing only hidden entries).

Copilot AI changed the title [WIP] Fix drag and drop behavior for hidden folders in virtualtabs panel Fix: exclude hidden files/folders when drag-dropping directories into virtualTabs panel May 12, 2026
Copilot AI requested a review from winterdrive May 12, 2026 19:31
@winterdrive
Copy link
Copy Markdown
Owner

@copilot 應該是只忽略 “.” 開頭的folder,而非連檔案也要忽略,這樣會導致.gitignore或其他可用檔案直接被忽略。我的理解是否正確,請正反兩面評價。

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 12, 2026

@copilot 應該是只忽略 “.” 開頭的folder,而非連檔案也要忽略,這樣會導致.gitignore或其他可用檔案直接被忽略。我的理解是否正確,請正反兩面評價。

你的理解是正確的。以下是兩面評估:

只忽略隱藏資料夾(建議採用)

  • VS Code 原生 explorer 預設只排除 .git 資料夾(透過 files.exclude),不會隱藏 .gitignore.editorconfig.eslintrc 等常見 dotfile
  • 使用者拖曳專案時,可能需要將這些設定檔加入面板,不應被靜默排除

同時忽略隱藏檔案與資料夾

  • 規則更簡單一致
  • 缺點:會意外排除使用者可能需要的檔案

已在 5f95c41 將過濾條件改為僅跳過以 . 開頭的資料夾.git.github 等),隱藏檔案.gitignore.editorconfig 等)仍會正常納入。

Copilot AI changed the title Fix: exclude hidden files/folders when drag-dropping directories into virtualTabs panel Fix: exclude hidden directories when drag-dropping folders into virtualTabs panel May 12, 2026
@winterdrive winterdrive marked this pull request as ready for review May 14, 2026 02:50
…s for scope management logic

- Implemented E2E tests for Scope Filter UI behavior covering various scenarios including built-in and repo scopes.
- Added unit tests for addGroup scope decision logic to ensure correct behavior based on active scopes.
- Created tests for built-in group initialization conditions to verify proper handling of existing user groups.
- Developed migration tests for transitioning from single to multiple active scopes.
- Added tests for computing scope descriptions based on active scopes.
- Implemented tests for root tree structure after applying scope filters to validate node types and order.
- Updated existing tests to reflect changes in the visibility of the Add Group button in multi-root workspaces.
@winterdrive winterdrive merged commit 3cf457c into main May 14, 2026
5 checks passed
@winterdrive winterdrive deleted the copilot/fix-drag-and-drop-hidden-files branch May 14, 2026 18:26
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.

拖曳資料夾進 virtualtabs panel 時會包含 .git 等隱藏檔案夾,與原生 tree view 行為不一致

2 participants