[Routine - VT] fix(AutoGrouper): move bookmarks to sub-groups on extension/date auto-grouping#81
Draft
winterdrive wants to merge 1 commit into
Draft
Conversation
…-grouping groupByExtension() and groupByDate() moved a source group's files into new sub-groups but never touched sourceGroup.bookmarks, orphaning any bookmarks tied to those files on the now-empty source group where the UI can no longer surface them. Mirrors the existing move-bookmarks-with-file pattern already used in dragAndDrop.ts's handleFileDrop.
This was referenced Jul 8, 2026
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Pre-flight Check
Open PRs / active branches checked before starting:
routine/vt-fix-jumptobookmark-clamp-260707— touchessrc/commands.tsonly.routine/vt-fix-filemanager-relpath-260706— touchessrc/core/FileManager.tsand its test file.routine/vt-fix-bookmark-stale-groupidx-260703— touchessrc/provider.tsonly.routine/vt-fix-treeview-listener-disposal-260702— touchessrc/extension.tsonly.release/0.7.6-260701— release PR, touchespackage.json/package-lock.json/CHANGELOG.mdonly.origin/routine/vt-fix-*branches are stale (already squash-merged intomain, confirmed viagit log) and have no open PR.This PR only touches
src/core/AutoGrouper.ts(plus a new test file), which none of the above modify — no overlap.2. Changes
AutoGrouper.groupByExtension()andAutoGrouper.groupByDate()(the MCP-layer auto-grouping methods) move a source group'sfilesinto newly created sub-groups but never touchedsourceGroup.bookmarks. AftersourceGroup.files = [], any bookmarks keyed by the moved file URIs stayed attached to the now-empty source group — unreachable from the UI (which reads bookmarks from the file's actual containing group) and left to accumulate silently in the JSON store across repeated auto-grouping calls.Added a
moveBookmarks()private static helper that relocates each moved file's bookmark entries from the source group to its new sub-group and cleans up the emptybookmarksobject, mirroring the existing move-with-file pattern already used indragAndDrop.ts'shandleFileDrop(lines ~273-287). Addedsrc/test/unit/autoGrouperBookmarks.test.tscovering: bookmarks migrate correctly ongroupByExtension, ongroupByDate, and that groups without bookmarks are left untouched.Confirmed this PR does not modify commands, contributed configuration keys, dependencies, or the tab-group serialization/storage format (bookmarks already lived on
TempGroup.bookmarkskeyed by file URI — this only relocates existing entries to the correct group).3. Safety Verification
Commands run locally, all passed:
npx tsc -p ./— no errorsnpm run test(tsc -p ./ && jest --runInBand) — 26 suites / 178 tests passed4. CI / Release Gate Note
This is a daily routine Draft PR. Package version bump and CHANGELOG updates are intentionally deferred to the weekend release/integration PR. If CI fails only due to the repository's version-bump/release-readiness gate, that is expected behavior for a routine PR, not a code validation failure.