Skip to content

Fix removal of reloaded group files when config stores relative paths#47

Merged
winterdrive merged 6 commits into
mainfrom
copilot/fix-remove-file-from-group
May 17, 2026
Merged

Fix removal of reloaded group files when config stores relative paths#47
winterdrive merged 6 commits into
mainfrom
copilot/fix-remove-file-from-group

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

After reloading, files shown in group views could not be removed because persisted virtualTab.json entries may be relative paths, while removal logic compared only full URI strings. This caused “Remove Selected Files from Group” to no-op on reloaded data.

  • Path-aware file removal in provider

    • Added FileEntryMatcher to match a selected file against stored entries by:
      • exact URI match
      • normalized fsPath match
      • scope-root resolution for relative stored paths
    • Updated TempFoldersProvider.removeFilesFromGroup to remove by matcher instead of raw string equality.
    • Aligned bookmark cleanup with the same matcher so bookmark keys tied to removed files are deleted consistently.
  • Command path consolidation for remove actions

    • Updated virtualTabs.removeFileFromGroup and virtualTabs.removeSelectedFilesFromGroup to route removals through provider logic and process selections per groupIdx.
    • Eliminates duplicate filtering logic that assumed URI-only storage format.
  • Regression coverage

    • Added unit tests for file-entry matching across relative path, URI, and non-match cases.
    • Added UI E2E regression test for:
      • persisted relative path in virtualTab.json
      • reload
      • invoking “Remove Selected Files from Group”
      • confirming file is removed from both tree and config.
// Provider removal now uses normalized matching rather than URI string equality
group.files = group.files.filter(storedEntry =>
  !targets.some(target =>
    matchesStoredFileEntry(storedEntry, target.uri, target.fsPath, scopeRoot)
  )
);

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/vscode-virtual-tabs/vscode-virtual-tabs/node_modules/.bin/extest setup-and-run out/test/ui/**/*.test.js -e .vscode-test/extensions -r test-resources/multi-root/virtual-tabs.code-workspace -c 1.96.0 (dns block)
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/vscode-virtual-tabs/vscode-virtual-tabs/node_modules/.bin/extest setup-and-run out/test/ui/removeSelectedFilesFromGroup.ui.test.js -e .vscode-test/extensions -r test-resources/multi-root/virtual-tabs.code-workspace -c 1.96.0 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue May 16, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix failure to remove selected file from group Fix removal of reloaded group files when config stores relative paths May 16, 2026
Copilot AI requested a review from winterdrive May 16, 2026 05:14
Copy link
Copy Markdown
Owner

@winterdrive winterdrive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

  1. unit test 與e2e test的coverage是否已達100%?目前可如何檢測?
  2. 本次修改對使用者會有什麼風險?

@winterdrive winterdrive marked this pull request as ready for review May 16, 2026 13:41
@winterdrive
Copy link
Copy Markdown
Owner

Ready to publish

@winterdrive winterdrive merged commit fe0d231 into main May 17, 2026
5 checks passed
@winterdrive winterdrive deleted the copilot/fix-remove-file-from-group branch May 17, 2026 08:19
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.

從群組移除選取的檔案失敗

2 participants