Skip to content
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

Gradually fetch namespaces by handling pagination on RTK query #2618

Closed
lorenzo-cavazzi opened this issue Jun 22, 2023 · 1 comment
Closed
Labels

Comments

@lorenzo-cavazzi
Copy link
Member

Motivation

There are many cases where we need to handle pagination. RTK doesn't offer an out-of-the-box solution but gives suggestions.

Proposal

We should find a common solution when we face pagination. That should simplify assessing whether we expect more items after we get the first page.
Based on the situation, the React comment can decide the best strategy: either show already the first items and allow early interactions (possibly indicating when more items are loading) or wait for the whole content.

We can start with namespaces as a follow-up to #2606
In that case, we need to fetch >100. We could actually fetch 20 by 20 and let the user pick one already, showing a spinning wheel when more namespaces are coming.

Context

This approach is useful when the total number of items we expect is within a reasonable boundary.
When we have thousands of items, relying on backend search is a better strategy -- an example is the entity search.

@leafty
Copy link
Member

leafty commented Jun 23, 2023

As a note here, the suggestion component we are using supports async fetching of suggestions, so we can use it to show potential namespace picks based on what the user starts typing.

@lorenzo-cavazzi lorenzo-cavazzi changed the title Handle pagination on RTK query with a reusable solution - Namespaces Gradually fetch namespaces ba handling pagination on RTK query Nov 3, 2023
@lorenzo-cavazzi lorenzo-cavazzi changed the title Gradually fetch namespaces ba handling pagination on RTK query Gradually fetch namespaces by handling pagination on RTK query Jan 8, 2024
@lorenzo-cavazzi lorenzo-cavazzi closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants