Desktop: Resolves #16134: Add data loader and word-level diff for Conflict resolution UI - #16135
Open
varunkumar-22 wants to merge 7 commits into
Open
Desktop: Resolves #16134: Add data loader and word-level diff for Conflict resolution UI#16135varunkumar-22 wants to merge 7 commits into
varunkumar-22 wants to merge 7 commits into
Conversation
Owner
|
@varunkumar-22 please fix the conflict |
varunkumar-22
force-pushed
the
feat/conflict-data-loader
branch
from
August 8, 2026 10:17
ff09173 to
7e52721
Compare
Contributor
Author
|
Conflict is resolved now. Recent commits ensures that: diffNotes is up-to-date with PR: #16023 , and also it was agreed to use original note instead of remote columns & that update is made in |
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.
Fixes #16134
PR Summary
Two things are covered in this PR:
Conflict Data loader
This PR adds the shared data layer that the future conflict resolution UI will use. There is no UI in this, it's just the data layer required for further implementation of UI.
loadConflictData(noteId)reads the three versions of a conflict note, runs them through the merge engine, and returns:In some cases there wil be nothing to merge. Then the loader returns a status of Unavailable, which tells the caller to fall back to the read-only conflict view. That covers:
As mentioned in #16134 :
Sections are worked out fresh on every call instead of being read from storage. Sync never saves them — it only keeps the merged text — and it doesn't compute them at all when there's no base version. Recomputing means every conflict note works the same way, old or new.
Word-level diff
library used : jsdiff
Although there is diff-match-patch already in repo, which can be used for word-level diff is no longer a active and maintained repo. So I chose jsdiff library for this as it is very much active and well maintained and also used by many other products
Also, while reviewing my changes with AI, AI found this bug: jsdiff's built-in word splitter only knows Latin letters. So, for Cyrillic, Greek, Arabic and Hebrew , it fell back to comparing single characters and highlighted partial words
Additional implementation details
Everything is behind the existing hidden featureFlag.conflictResolution. When it's off the loader returns Unavailable.
This branch includes the merge engine unchanged from #16023 so it builds and its tests run on their own. It is not part of this PR and will be removed once #16023 merges.
Testing:
Tests are added
AI Assistance Disclosure:
AI was used to review the implemented code and also to add some of the tests [ Only after mentor approval ]. All the code was reviewed by me before submitting.