Skip to content

Implement infinite scrolling for document search#3855

Merged
tillprochaska merged 4 commits intodevelopfrom
fix/3320-doc-search-infinite-scrolling
Oct 16, 2024
Merged

Implement infinite scrolling for document search#3855
tillprochaska merged 4 commits intodevelopfrom
fix/3320-doc-search-infinite-scrolling

Conversation

@tillprochaska
Copy link
Contributor

When searching a large document in a dataset which has a significant number of results, only the first set of results are shown.

I’ve fixed this by implementing infinite scrolling in the same way we already implement this for other views (such as the main search view). Now, when a user has scrolled to the end of the search results list and if there are more results, the next page of results is automatically loaded.

In addition, I’ve used the opportunity to do some cleanup and remove dead code from the component responsible for displaying document search results.

This is just a small refactoring to make it easier to adjust this method.
… because that is what it actually does -- it doesn’t load a page from the document, it loads a list of pages that contain the search terms.
I’m not sure what exactly the intention here was originally, but it didn’t have any effect in its current version. `page` and `res.index` would always be undefined and as a result, the `active` class was applied to every single link. The `active` class doesn’t apply any styles.

Probably this is just leftover from a previous iteration of the UI, so I’ve removed this.
@tillprochaska tillprochaska requested review from catileptic and stchris and removed request for Rosencrantz October 15, 2024 17:27
Copy link
Contributor

@stchris stchris left a comment

Choose a reason for hiding this comment

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

Works smoothly 👍

@tillprochaska tillprochaska merged commit 4adad5f into develop Oct 16, 2024
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.

2 participants