Skip to content

Show DOI lookup link in citation relations tab #13285

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

YaxPrajapti
Copy link

@YaxPrajapti YaxPrajapti commented Jun 9, 2025

Closes #13234

This PR enhances the "Citation relations" feature by making the "Look up a DOI and try again." text a clickable hyperlink. On clicking, the text changes to "Looking up DOI...". Based on the lookup result:

If a DOI is found, it is used for citation relations.

If no DOI is found, a notification "No DOI found" is shown and the link resets to its original state.

Steps to test

Add a paper in jabRef entry editor.
Go to citation relations. You will see hyperlink. Click on that hyperlink.
Screenshot 2025-06-09 at 5 52 24 PM

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.

@subhramit
Copy link
Member

Please fix the failing tests and follow the correct format for the PR description and title (check other prs for reference)

@subhramit
Copy link
Member

You can check the details of why a test is failing by clicking on it:
image

And then go to the Files Changed tab to correlate it with your changes
image

CHANGELOG.md Outdated
@@ -1575,6 +1576,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We added the ability to use negation in export filter layouts. [#5138](https://github.com/JabRef/jabref/pull/5138)
- Focus on Name Area instead of 'OK' button whenever user presses 'Add subgroup'. [#6307](https://github.com/JabRef/jabref/issues/6307)
- We changed the behavior of merging that the entry which has "smaller" bibkey will be selected. [#7395](https://github.com/JabRef/jabref/issues/7395)
- we added a new
Copy link
Member

Choose a reason for hiding this comment

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

artifact?

@calixtus calixtus changed the title Fix for issue 13234 Show DOI lookup link in citation relations tab Jun 9, 2025
@koppor koppor mentioned this pull request Jun 10, 2025
5 tasks
Copy link

trag-bot bot commented Jun 11, 2025

@trag-bot didn't find any issues in the code! ✅✨

.onSuccess(doiIdentifier -> {
if (doiIdentifier.isPresent()) {
entry.setField(StandardField.DOI, doiIdentifier.get().asString());
searchForRelations(entry, listView, abortButton, refreshButton, searchType, importButton, progress, shouldRefresh);
Copy link
Member

Choose a reason for hiding this comment

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

you are introducing a recursive cascade here with endless creation of UI elements.
This needs to be done differently.

Extract the background task. put the result in a property. update the view if the property is modified.

Copy link
Member

@calixtus calixtus left a comment

Choose a reason for hiding this comment

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

@@ -434,13 +444,29 @@ protected void bindToEntry(BibEntry entry) {
*/
private void searchForRelations(BibEntry entry, CheckListView<CitationRelationItem> listView, Button abortButton,
Button refreshButton, CitationFetcher.SearchType searchType, Button importButton,
ProgressIndicator progress) {
ProgressIndicator progress, boolean shouldRefresh) {
Copy link
Member

Choose a reason for hiding this comment

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

avoid magic booleans. if someone calls searchForRelations(...,...,true), nobody knows what true means. this may be done for simple methods, but for a recursive method self-documenting code is most important.

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.

Automatic lookup of DOI at citation relations
3 participants