Rich diff for Metadata Group Tree External changes
Fixes #11221.
We have introduced a dedicated view for visualizing external changes in the Metadata Group Tree, made directly in .bib files.
Previously, users had no visibility or info about which groups were added, removed, or modified when external changes occurred. This made it very difficult to understand the changes.
With this update, the Group Tree is now displayed directly in the External Changes Resolver dialog. Visual highlights, using org.jabref.gui.mergeentries.DiffHighlighting, indicate differences between the old and new versions. This makes it possible to understand what has changed so that they can decide to accept or reject the changes.
Furthermore, to support large or deeply nested group trees, the old and new one are now scrollable independently. This ensures users can explore the full structure on both sides without losing context.
https://github.com/user-attachments/assets/1cd285b4-128e-41a1-9b0f-3a1192f97c93
Regarding the merging aspect, we spent some time discussing possible approaches, but it turned out to be more complex than we initially expected. Because of that, we decided to focus on delivering a clear and useful visual diff.
While this doesn’t fully address all the points raised in the issue, we believe it represents solid progress. Previously, users had no meaningful insight into what had changed, so this already brings significant value to the external changes workflow.
Tests were not created since this is a visual diff for the user.
Co-authored-by: Diogo Almada [email protected]
Steps to test
The instructions to test are displayed in the video.
Mandatory checks
- [x] I own the copyright of the code submitted and I license it under the MIT license
- [x] Change in
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user) - [/] Tests created for changes (if applicable)
- [x] Manually tested changed features in running JabRef (always required)
- [x] Screenshots added in PR description (if change is visible to the user)
- [x] Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
- [x] Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.
JUnit tests of jablib are failing. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Tests / Unit tests (pull_request)" and click on it.
You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.
Cool! Love the UI design. Will b take a look at the code later
I tried it, it even works with hundreds of groups nested deeply but I think it would be great to have buttons like: Got to next change, etc and it would scroll there (not sure how feasible this is, can be also done as a separate issue)
The other thing: The group diff is showing under the metadata change not under the group tree diff.