Skip to content

Rich diff for Metadata Group Tree External changes #13325

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

Merged
merged 4 commits into from
Jun 22, 2025

Conversation

MiguelCBar
Copy link
Contributor

@MiguelCBar MiguelCBar commented Jun 13, 2025

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.

pr_video_demonstration.mp4

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 diogo.almada@tecnico.ulisboa.pt

Steps to test

The instructions to test are displayed in the video.

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • [/] Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (if change is visible to the user)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • 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.

Added a dedicated view for visualizing external changes in the
Metadata Group Tree within a .bib file.

Previously, there was no way to see which groups were added, removed,
or changed.

Now, the Group Tree appears in the External Changes Resolver dialog
with visual highlights indicating what changes were made.

Co-authored-by: Diogo Almada <diogo.almada@tecnico.ulisboa.pt>
@jabref-machine
Copy link
Collaborator

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.

@Siedlerchr
Copy link
Member

Cool! Love the UI design. Will b take a look at the code later

@Siedlerchr
Copy link
Member

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.

grafik

@calixtus calixtus changed the title Feat #11221: Rich diff for Metadata Group Tree External changes Rich diff for Metadata Group Tree External changes Jun 14, 2025
* upstream/main: (47 commits)
  Adapt some fetcher tests (JabRef#13370)
  change template issue number (JabRef#13367)
  Refine error message in URLUtil::create (JabRef#13337)
  fix deletion again (JabRef#13369)
  Only prevent failure in publishing from stopping the workflow (JabRef#13368)
  Refactor "enableFileAnnotationsTab" to "smartFileAnnotationsTab" and rewrote shouldShow in FileAnnotationTab as requested in JabRef#13279 (JabRef#13338)
  fix workflow (JabRef#13366)
  Fixamd64linux (JabRef#13365)
  Only delete for arm64 (JabRef#13364)
  New Crowdin updates (JabRef#13363)
  Bump org.junit.jupiter:junit-jupiter-api in /versions (JabRef#13362)
  Bump org.apache.logging.log4j:log4j-to-slf4j in /versions (JabRef#13359)
  Bump com.github.javaparser:javaparser-symbol-solver-core in /versions (JabRef#13361)
  Bump org.junit.platform:junit-platform-launcher in /versions (JabRef#13360)
  Bump com.fasterxml.jackson.datatype:jackson-datatype-jsr310 in /versions (JabRef#13358)
  Gradle build updates (JabRef#13319)
  Add "Disable GitHub actions" (JabRef#13356)
  Make jabref host executable on mac and on linux and fix import command line argument (JabRef#13355)
  Delete .github/workflows/merge-upstream.yml (JabRef#13357)
  chore(deps): update dependency org.apache.logging.log4j:log4j-to-slf4j to v2.25.0 (JabRef#13353)
  ...
Comment on lines +67 to +68
// Show both original and new values
diffContainer.getChildren().add(new Label(diff.originalObject().toString()));
Copy link

Choose a reason for hiding this comment

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

Comment is trivial and simply restates what the code does. The code is self-explanatory and doesn't need this comment.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jun 18, 2025
@Siedlerchr Siedlerchr enabled auto-merge June 22, 2025 09:00
Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

for now its good

@Siedlerchr Siedlerchr added this pull request to the merge queue Jun 22, 2025
Merged via the queue into JabRef:main with commit f6dc0ca Jun 22, 2025
50 of 51 checks passed
Siedlerchr added a commit that referenced this pull request Jun 22, 2025
* upstream/main:
  Fix patterns
  Fix pr-comment.yml
  Try to fix ghprcomment.yml
  Rich diff for Metadata Group Tree External changes (#13325)
  New translations jabref_en.properties (Portuguese, Brazilian) (#13391)
  Speed up build by making assumptions (#13388)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rich diff for group changes (diffs)
3 participants