Skip to content

refactor(Scanner): Move mapping creation from mergeable to diffItem#2253

Open
marcelklehr wants to merge 7 commits intodevelopfrom
fix/2230/crank-up-children-similarity
Open

refactor(Scanner): Move mapping creation from mergeable to diffItem#2253
marcelklehr wants to merge 7 commits intodevelopfrom
fix/2230/crank-up-children-similarity

Conversation

@marcelklehr
Copy link
Copy Markdown
Member

@marcelklehr marcelklehr commented May 8, 2026

fixes #2230

  • Add regresion test for unidirectional sync
  • Fix linkwarden
  • Fix dropbox-encrypted

…similarity

fixes #2230

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr marcelklehr force-pushed the fix/2230/crank-up-children-similarity branch from aa5995f to 1458fd5 Compare May 9, 2026 09:09
With this change, mappings will only be created if both childrenSimilarity and mergeable give a go. Before, mergeable would sometimes create mappings prematurely.

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr marcelklehr force-pushed the fix/2230/crank-up-children-similarity branch from 1458fd5 to 6c0df45 Compare May 9, 2026 09:10
@marcelklehr marcelklehr changed the title fix(Unidirectional|Merge): Use lower similarity threshold for matching folders by similarity refactor(Scanner): Move mapping creation from mergeable to diffItem May 9, 2026
@marcelklehr marcelklehr requested a review from Copilot May 9, 2026 09:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Refactors the sync scanning flow so mapping creation happens inside Scanner.diffItem rather than being accumulated in strategy-specific mergeable callbacks, addressing issue #2230.

Changes:

  • Extend Scanner to accept Mappings and optionally create mappings during scanning.
  • Remove strategy-level “collect then add mappings” logic in Default, Merge, and Unidirectional strategies.
  • Add a regression test covering item moves where similarly named folders exist in different branches.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/ui/views/native/Home.vue Template formatting change (unrelated to scanner refactor).
src/test/test.js Adds regression test for move behavior with duplicate folder names.
src/lib/strategies/Unidirectional.ts Routes mapping creation through Scanner (passes mappings, toggles flags).
src/lib/strategies/Merge.ts Removes newMappings collection and relies on Scanner mapping creation.
src/lib/strategies/Default.ts Removes newMappings flow; updates Scanner instantiation flags.
src/lib/Scanner.ts Adds mappings + createMappings option; creates mappings in diffItem; adds debug logging.
src/lib/Mappings.ts Prevents duplicate mappings by removing an existing mapping before adding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/Scanner.ts Outdated
Comment thread src/lib/Scanner.ts
Comment thread src/lib/Scanner.ts
Comment thread src/lib/Mappings.ts
Comment thread src/lib/Mappings.ts
Comment thread src/ui/views/native/Home.vue
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr marcelklehr force-pushed the fix/2230/crank-up-children-similarity branch from 4527c27 to f0ba511 Compare May 10, 2026 12:41
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.

Folders with the same name got replaced by sync

2 participants