Skip to content

[Routine - VT] fix(AutoGrouper): move bookmarks to sub-groups on extension/date auto-grouping#81

Draft
winterdrive wants to merge 1 commit into
mainfrom
routine/vt-fix-autogroup-bookmarks-260708
Draft

[Routine - VT] fix(AutoGrouper): move bookmarks to sub-groups on extension/date auto-grouping#81
winterdrive wants to merge 1 commit into
mainfrom
routine/vt-fix-autogroup-bookmarks-260708

Conversation

@winterdrive

Copy link
Copy Markdown
Owner

1. Pre-flight Check

Open PRs / active branches checked before starting:

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() and AutoGrouper.groupByDate() (the MCP-layer auto-grouping methods) move a source group's files into newly created sub-groups but never touched sourceGroup.bookmarks. After sourceGroup.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 empty bookmarks object, mirroring the existing move-with-file pattern already used in dragAndDrop.ts's handleFileDrop (lines ~273-287). Added src/test/unit/autoGrouperBookmarks.test.ts covering: bookmarks migrate correctly on groupByExtension, on groupByDate, 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.bookmarks keyed by file URI — this only relocates existing entries to the correct group).

3. Safety Verification

Commands run locally, all passed:

  • npx tsc -p ./ — no errors
  • npm run test (tsc -p ./ && jest --runInBand) — 26 suites / 178 tests passed

4. 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.

…-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.
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