Add pagination to GitHub issue finder #249
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Intended to close #242
Added pagination and fixed the whole thing. Here's a quick overview of changes made:
Improved looks by CSS
When no items - show it instead of infinite loading
Show loading when data is actually not loaded
Fix bug when pressing clear on FILTERS would prevent changing tabs
All filters work as AND instead of god knows how
Add pages component with pages that can be clicked to change the page
Optimized css for different sizes
Add option to option to choose number of results per page
More details
Basically, the thing was very bugged, when no issues were satisfying the chosen options, infinite loading was shown. Now it shows an informative message.
Now all the options work as AND - meaning if you have something in search, checkbox "is assigned", and filters for labels, it will show only issues that satisfy all the criteria.
The filter by labels was completely broken, working very weird, and pressing the trash button (clearing filters) was preventing the tabs from being able to change. Now all of it works.
Further possible improvements:
So, now the info for pull requests is only fetched for issues of this repository. I think it should not be changed because the number of issues here is not so big, and because there's a limit of 60 requests per hour, it should be enough. On the other hand, fetching pull requests info for all generic github issues would not be possible because it would very quickly surpass the api limit.
Right now it fetches only 100 issues from github, saves them, and all filters only apply to the 100 issues. But it turns out, the github api's search limit is much more generous - 10 queries per minute. So it probably should be feasible to make a request to github api for each combination of labels, but that would need to be implemented well, so for examle if I in quick succession choose 3 labels, it would not send 3 requests in a second. Even though rate is very generous, it could still surpass 10 queries per minute quite quickly. Maybe adding an "apply" button or something.
Video:
Here's a screencast of how it looks now:
brave_vHBkMoGkyI.mp4