Skip to content

Conversation

@paudelritij
Copy link
Contributor

@paudelritij paudelritij commented Jul 7, 2025

Closes #5507

This PR introduce pagination for web-search results.

Steps to test

  1. To fetch entries from an online catalog, choose View → Web search, and the search interface will appear in the side panel.
  2. Select the catalogs you want to search (e.g., arXiv) in the dropdown menu.
  3. Then enter the words of your query, and press Enter, or the Search button.
  4. The results will be displayed in the import inspection dialog.
Screenshot 2025-08-25 at 3 07 47 PM image image

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)
  • I checked the user documentation: Is the information available and up to date? If not, I created an issue at JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in JabRef/user-documentation@main/en.

@jabref-machine
Copy link
Collaborator

Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. 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 / Checkstyle (pull_request)" and click on it.

In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.

Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues, commit, and push.

- Clone and create web* (WebImportEntriesDialog and WebImportEntriesDialogViewModel for web implementation)
- Cache prev pages in case of page based fetcher
- Enhance the background fetching mechanism for page-based search entries
- Fix 'Import Entries' button functionality
- Fix display of total and selected items counters
- Fix selection buttons behavior (unselectAll, selectAllNewEntries, selectAllEntries)
- generalized fetching of entries for all page-search-based fetcher
- improved pageNumberLabel UI
- update JabRef_en.properties
@paudelritij paudelritij marked this pull request as ready for review July 24, 2025 15:15
@paudelritij paudelritij requested a review from koppor July 24, 2025 15:16
koppor
koppor previously requested changes Jul 28, 2025
Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

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

Much code is copied - should not happen. Can you unify? Maybe show and hide buttons? Treat fetching of non-pages as special case?

@paudelritij paudelritij requested a review from koppor August 4, 2025 00:15
@InAnYan
Copy link
Member

InAnYan commented Aug 10, 2025

Thank you for working on this feature! I'm one of persons who wants it

@calixtus calixtus requested a review from InAnYan August 22, 2025 08:45
Copy link
Member

@subhramit subhramit left a comment

Choose a reason for hiding this comment

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

Hey, sorry for keeping you waiting for so long.
The maintainers were a bit busy.
I have left some more comments - once you address them, IMO should be good to merge.

Copy link
Member

@InAnYan InAnYan left a comment

Choose a reason for hiding this comment

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

Great! It works!

Though, there is small UI problem, it shows new entry quicker than updating the "Fetching..." label. As soon as new entries are fetched, the label should be updated to "%0 of %1".

Overall, everything's good!

- Added status label to display loading messages and entry status.
- Implemented bindings to enable/disable pagination buttons based on loading state and current page.
- Updated next/previous page button actions to handle fetching more entries when on the last page.
- Introduced initialLoadComplete property to manage the loading state more effectively.
@paudelritij
Copy link
Contributor Author

Though, there is small UI problem, it shows new entry quicker than updating the "Fetching..." label. As soon as new entries are fetched, the label should be updated to "%0 of %1".

There is no UI issue, I made fetching of entries when user is on last page, since 1st page is last page initially so dialog was showing 'Fetching...' and when user lands on last page it was made to auto fetch entries and show 'Fetching...' instead of 3 of 3 which is last page.

I have enhanced the UI which will now provide comprehensive feedback to user when they are on last page and want to navigate further. PR description ss has been updated.

InAnYan
InAnYan previously approved these changes Aug 25, 2025
Copy link
Member

@InAnYan InAnYan left a comment

Choose a reason for hiding this comment

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

Thanks for your dedication! I think after you'll address others comments, then we can merge this PR

- Refactor ImportEntriesViewModel and ImportEntriesDialog to use Optional for fetcher and query.
@trag-bot
Copy link

trag-bot bot commented Aug 31, 2025

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

@subhramit subhramit added this pull request to the merge queue Aug 31, 2025
@koppor koppor mentioned this pull request Aug 31, 2025
1 task
Merged via the queue into JabRef:main with commit c06435a Aug 31, 2025
3 checks passed
@github-actions github-actions bot mentioned this pull request Aug 31, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: Paging support for fetchers

7 participants