Skip to content

[Routine - VT] fix: preserve sourceScopeId when duplicating a group#67

Draft
winterdrive wants to merge 5 commits into
mainfrom
routine/vt-fix-duplicate-scope-260625
Draft

[Routine - VT] fix: preserve sourceScopeId when duplicating a group#67
winterdrive wants to merge 5 commits into
mainfrom
routine/vt-fix-duplicate-scope-260625

Conversation

@winterdrive

Copy link
Copy Markdown
Owner

Pre-flight Check

Active branches/PRs checked before this PR:

No other open PRs were found.

Changes

File: src/commands.tsvirtualTabs.duplicateGroup command handler (~line 543)

Before: the duplicated group object omitted sourceScopeId, so saveGroupsImmediate() in provider.ts fell back to the first available ConfigScope (backward-compat path, line 352–360) regardless of which scope the original group belonged to. In a multi-scope workspace this silently saved the duplicate to the wrong scope.

After: sourceScopeId: group.sourceScopeId is copied to the new group, routing the save to the correct scope.

 provider.groups.push({
     id: Date.now().toString() + Math.random().toString(36).substring(2, 9),
     name: newName,
-    files: group.files ? [...group.files] : []
+    files: group.files ? [...group.files] : [],
+    sourceScopeId: group.sourceScopeId
 });

Safety Verification

npm test
> tsc -p ./ && jest --runInBand

Test Suites: 23 passed, 23 total
Tests:       160 passed, 160 total
Snapshots:   0 total
Time:        10.708 s
Ran all test suites.

TypeScript compilation (tsc -p ./) succeeded with zero errors as part of the test run. No lint/format scripts exist in this project.

🤖 Generated with Claude Code

winterdrive and others added 5 commits June 21, 2026 21:10
In multi-scope workspaces the duplicated group was missing sourceScopeId,
causing saveGroupsImmediate() to fall back to the first scope regardless of
which scope the original group belonged to.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant