Skip to content

Conversation

@LangInteger
Copy link
Contributor

@LangInteger LangInteger commented Dec 30, 2025

User description

Closes #14757

I have made one change:
- 1. Only show the "Restart search" button when the fetch failed

    1. Let the “Restart search” button to bypass the cache

Steps to test

    1. start -> New empty library
    1. add example entry
    1. only the only newly added entry
    1. check DOI exists in the General panel
    1. switch to Citations panel
    • both the "cite" and "cited by" have a restart search button
    • click the button, the search will start with bypassing local cache

Please refer to the video below:

test2.mov

Mandatory checks


PR Type

Bug fix


Description

  • Only show restart search button when citation fetch fails

  • Trigger searches for both cite and cited sides when switching fetchers

  • Hide refresh button on successful search completion


Diagram Walkthrough

flowchart LR
  A["Fetcher Changed"] --> B["Search Both Sides"]
  B --> C["Cite Search"]
  B --> D["Cited By Search"]
  C --> E{Success?}
  D --> E
  E -->|Yes| F["Hide Refresh Button"]
  E -->|No| G["Show Refresh Button"]
  F --> H["Show Import Button"]
  G --> H
Loading

File Walkthrough

Relevant files
Bug fix
CitationRelationsTab.java
Fix dual-side search and refresh button visibility             

jabgui/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/CitationRelationsTab.java

  • Added second searchForRelations call to trigger searches for both cite
    and cited sides when fetcher changes
  • Modified onSearchForRelationsSucceed to hide refresh button on
    successful search completion
  • Removed refresh button from being shown after successful search
    results
+3/-2     
Documentation
CHANGELOG.md
Document citation-relation panel fixes                                     

CHANGELOG.md

+2/-1     

@github-actions github-actions bot added good second issue Issues that involve a tour of two or three interweaved components in JabRef status: changes-required Pull requests that are not yet complete labels Dec 30, 2025
@LangInteger LangInteger marked this pull request as ready for review December 30, 2025 11:16
@qodo-free-for-open-source-projects
Copy link
Contributor

qodo-free-for-open-source-projects bot commented Dec 30, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #13109
🔴 Add pseudonymization functionality to the CLI
Make org.jabref.logic.pseudonymization.Pseudonymization available on the command line
interface
Implement similar CLI experience as the consistency check
Follow the implementation pattern of org.jabref.cli.CheckConsistency class
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects
Copy link
Contributor

qodo-free-for-open-source-projects bot commented Dec 30, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Cancel both background search tasks

Cancel the citedByTask in addition to the citingTask when the citation fetcher
changes. This prevents potential race conditions and unnecessary background
processing.

jabgui/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/CitationRelationsTab.java [467-473]

 // Cancel any running searches so they don't continue with the old fetcher
 if (citingTask != null && !citingTask.isCancelled()) {
     citingTask.cancel();
+}
+if (citedByTask != null && !citedByTask.isCancelled()) {
+    citedByTask.cancel();
 }
 entryEditorPreferences.setCitationFetcherType(newValue);
 searchForRelations(citingComponents, citedByComponents);
 searchForRelations(citedByComponents, citingComponents);

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that when the fetcher is changed, the citedByTask is not cancelled, unlike the citingTask. This could lead to unnecessary resource usage and potential race conditions, as both tasks are re-triggered by the PR's changes.

Medium
  • Update

@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Dec 30, 2025
@calixtus
Copy link
Member

I think this PR does not closes the issue. The issue description states:

If citations were successfully (!) fetched, there is no possibility to "Restart" the search. The button just refreshes the display.

This PR disables the restart button after the citations have been fetched.

@LangInteger
Copy link
Contributor Author

I think this PR does not closes the issue. The issue description states:

If citations were successfully (!) fetched, there is no possibility to "Restart" the search. The button just refreshes the display.

This PR disables the restart button after the citations have been fetched.

@calixtus

The issue states that after citations are successfully fetched, there is no real possibility to “Restart” the search, and the button becomes misleading.

Since a restart is not supported in that state, this PR hides/disables the button once the fetch succeeds and only shows it when an error occurs during the fetch process.

I’m happy to consider alternative approaches if you have a different suggestion in mind.

@calixtus
Copy link
Member

I see. What if the user selects the other provider to search for citations?

@LangInteger
Copy link
Contributor Author

I see. What if the user selects the other provider to search for citations?

Screen.Recording.2025-12-31.at.01.37.26.mov

The left citation side will be refreshed, and the restart button may appear again if that refresh fails.
Check the above video for this scenario.

@calixtus
Copy link
Member

@koppor is this the behavior you desire? I think it's ok, since the result of a search for citations probably won't change that quickly

@calixtus
Copy link
Member

Btw the title of the issue was " 'Restart search" should restart search"

@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2026

Your pull request conflicts with the target branch.

Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.

@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Jan 1, 2026
}
entryEditorPreferences.setCitationFetcherType(newValue);
searchForRelations(citingComponents, citedByComponents);
searchForRelations(citingComponents, citedByComponents, true);
Copy link
Contributor Author

@LangInteger LangInteger Jan 2, 2026

Choose a reason for hiding this comment

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

switch the fetcher will not trigger refresh from the remote

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the last parameter has been updated to false

@LangInteger LangInteger changed the title Only show restart search button in citation-relation panel when the fetch failed Only show restart search button in citation-relation panel when the fetch failed and make it to bypass the cache Jan 2, 2026
@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Jan 4, 2026
@subhramit
Copy link
Member

subhramit commented Jan 7, 2026

Hey @LangInteger !
is this PR ready for review?

@LangInteger
Copy link
Contributor Author

@subhramit Hi, yes this PR is ready for review. As mentioned in the introduction, it does two things:

    1. Only show the "Restart search" button when the fetch failed
    1. Let the “Restart search” button to bypass the cache

However, I do want to confirm with @koppor , do you want both changes, or the second one is enough?

@koppor
Copy link
Member

koppor commented Jan 20, 2026

2. Let the “Restart search” button to bypass the cache

Only this, because the user might want to see if there are new cites.

@LangInteger LangInteger changed the title Only show restart search button in citation-relation panel when the fetch failed and make it to bypass the cache Restart search button in citation-relation panel should bypass the cache Jan 20, 2026
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Jan 20, 2026
@LangInteger
Copy link
Contributor Author

  1. Let the “Restart search” button to bypass the cache

Only this, because the user might want to see if there are new cites.

@koppor Ok. I have removed changes for 1.
The change is not unit-test friendly. So I did not add any test cases. Is that ok?

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Jan 22, 2026
@koppor
Copy link
Member

koppor commented Jan 23, 2026

The change is not unit-test friendly. So I did not add any test cases. Is that ok?

Yes, this is OK. -- UI tests are hard. If you are curious, you could try out http://www.sikulix.com/ or https://pyguibot.wordpress.com/. But both are not maintained currently, but promising 😅

Please merge upstream/main and resolve the merge conflicts. @LangInteger

CHANGELOG.md Outdated
- We fixed an issue where JabRef would not start on Linux ARM due to missing binaries for postgres-embedded [#14783](https://github.com/JabRef/jabref/issues/14783)
- We fixed an issue where JaRef would not correctly remember the opened side panels in the preferences [#14818](https://github.com/JabRef/jabref/issues/14818)
- Updates of the pre-selected fetchers are now followed at the Web fetchers. [#14768](https://github.com/JabRef/jabref/pull/14768)
- Restart search button in citation-relation panel should bypass the cache [#14757](https://github.com/JabRef/jabref/issues/14757)
Copy link
Member

@koppor koppor Jan 23, 2026

Choose a reason for hiding this comment

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

Maybe more user targed:

Suggested change
- Restart search button in citation-relation panel should bypass the cache [#14757](https://github.com/JabRef/jabref/issues/14757)
- Restart search button in citation-relation panel now refreshes using external services. [#14757](https://github.com/JabRef/jabref/issues/14757)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

udpated

@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Jan 26, 2026
@LangInteger
Copy link
Contributor Author

@koppor

After merging upstream/main, I have to add the file jablib/src/main/resources/ltwa/ltwa_20210702.csv on my local machine to run the jabgui. This is done by executing:

xx@Mac-mini jabref % git submodule update --init --remote
Submodule 'abbrv.jabref.org' (https://github.com/JabRef/abbrv.jabref.org.git) registered for path 'jablib/src/main/abbrv.jabref.org'
Submodule 'csl-locales' (https://github.com/citation-style-language/locales.git) registered for path 'jablib/src/main/resources/csl-locales'
Submodule 'csl-styles' (https://github.com/citation-style-language/styles.git) registered for path 'jablib/src/main/resources/csl-styles'
Submodule 'jablib/src/main/resources/ltwa' (https://github.com/JabRef/ltwa.git) registered for path 'jablib/src/main/resources/ltwa'
Cloning into '/Users/liulang/gitrepo/github/jabref/jablib/src/main/abbrv.jabref.org'...
Cloning into '/Users/liulang/gitrepo/github/jabref/jablib/src/main/resources/csl-locales'...
Cloning into '/Users/liulang/gitrepo/github/jabref/jablib/src/main/resources/csl-styles'...
Cloning into '/Users/liulang/gitrepo/github/jabref/jablib/src/main/resources/ltwa'...
Submodule path 'jablib/src/main/abbrv.jabref.org': checked out '91f15ce2f885b735149fd65bdfcc869b1ea22fa1'
Submodule path 'jablib/src/main/resources/csl-locales': checked out 'cc53ee1fb4bc425898329b112b34aff250f43321'
Submodule path 'jablib/src/main/resources/csl-styles': checked out '8c60c99fb51e64ac0c510451555f20878e7aa531'
Submodule path 'jablib/src/main/resources/ltwa': checked out '880536620bc5c42f48647fb66c87fec181e107d3'

The file is added to the repo's submodule in #14892. If the exist of ltwa_20210702.csv becomes a prerequisite for the jabgui gradle run task, does that mean the git submodule command should be included in the developer guilde - setup a local workspace?

@koppor
Copy link
Member

koppor commented Jan 26, 2026

* I will try UI test [http://www.sikulix.com](http://www.sikulix.com/) or [pyguibot.wordpress.com](https://pyguibot.wordpress.com/) when I have time

Nice!

After merging upstream/main, I have to add the file jablib/src/main/resources/ltwa/ltwa_20210702.csv on my local machine to run the jabgui.

Yes

Simply

git submodule init --update

does the job. We posted it into the community chat (gitter.im)

does that mean the git submodule command should be included

Thank you for checking - but no

grafik

The issue only arises for contributors already having a clone. For newcomers --recurse-submodules is enough.

@koppor koppor added this pull request to the merge queue Jan 26, 2026
@github-actions github-actions bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Jan 26, 2026
Merged via the queue into JabRef:main with commit 0e62148 Jan 26, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: citation-relations component: entry-editor good second issue Issues that involve a tour of two or three interweaved components in JabRef Review effort 2/5 status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Restart search" should restart search

4 participants