Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rich diff for group changes (diffs) #11221

Open
2 tasks
koppor opened this issue Apr 18, 2024 · 0 comments
Open
2 tasks

Rich diff for group changes (diffs) #11221

koppor opened this issue Apr 18, 2024 · 0 comments

Comments

@koppor
Copy link
Member

koppor commented Apr 18, 2024

When a library is modified externally, the group diff is very small.

To reproduce:

  1. Create a new library with a few groups and assign some entries to them
  2. Outside of JabRef, open the bib file in a text editor, scroll down to the end of JabRef and modify the group structure, e.g., change the group name or add new group by copy and paste
  3. Wait for the dialog "This library has been modified by another program"
  4. Click on Review Changes
  5. See the metadata like in the screenshot

image

The line "Modified groups tree" is generated from the object org.jabref.logic.bibtex.comparator.GroupDiff. This class should be refined to show a "real" diff (which is then somehow passed via org.jabref.gui.collab.DatabaseChange#setChangeName inside GroupDiff).

The second block with Optional is originating by simply outputting the list of differences and each old and new object with toString(). Since the group diff is handled explicitly (by org.jabref.logic.bibtex.comparator.MetaDataDiff#getGroupDifferences) and implicilty by the list org.jabref.logic.bibtex.comparator.MetaDataDiff#getDifferences it currently appears twice. (org.jabref.gui.collab.DatabaseChangeList#compareAndGetChanges)

The groupDiff should be removed from MetaDataDiff and handled in org.jabref.gui.collab.DatabaseChangesResolverDialog.

  • The dialog should split up the changes in the meta data to separate lines to resolve
  • The button "Merge" should be clickable and a UI appear

Ideas:

  1. Simple text highlight of the diff. See org.jabref.gui.mergeentries.DiffHighlighting for ideas
  2. Create a real diff for groups (enhanced GroupDiff) and a UI to handle that
  3. Convert group structure to JSON, offer RichTextEditor for JSON. Convert JSON back to group structure. Use web technologies to handle the JSON and the diff. Embed the html page inside a WebView used. (Use some JavaScript library to handle JSON diffs.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Free to take
Development

No branches or pull requests

2 participants