-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Block Directory: Fix "no result" ui flash #22783
Conversation
Size Change: +1 B Total Size: 1.12 MB
ℹ️ View Unchanged
|
The counter approach feels unintuitive to me, what about restructuring
Then |
That's where my head went first as well. I tracked back under the following unordered assumptions:
Thoughts? |
We're already storing the requests for each response per filterValue (right now it's If we trigger 3 requests when typing, maybe for |
You're right, it didn't register that we were already caching them and how that ties into the selector/resolver.
That's true. I'm not 💯 convinced that we need to keep the result set in memory. I think it could get a bit messy when we start passing more context to the block directory to provide better search results in the future (theres no plan, just an idea)... But I don't mind tracking the progress on the specific request for now. I'll update. |
@ryelle Mind taking another pass through this one? Thanks :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working great in browser, just some comments about the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this test different from the others?
Weird, totally unnecessary. Thanks. 😕
885b1a3
to
afc0377
Compare
@ryelle Anything left here that you think should be addressed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, once the conflict is resolved this can be merged 👍
dbe82d0
to
aede0f9
Compare
aede0f9
to
df0d8ec
Compare
Description
When searching for block directory blocks, we flash "No blocks found in your library" and then
switch it out with a result from the block directory.
Ideally, the user should never see "No blocks found in your library" while there is still a request pending.
How has this been tested?
Typing slowly (to avoid debouncing), one letter at a time,
Watch the gif below ⬇️ .
Screenshots
Types of changes
The problem arises because we are queuing API requests while the user is typing. We try to reduce the number of request by debouncing but it's still common to queue up multiple requests.
Before:
isRequestingDownloadableBlocks
totrue
.isRequestingDownloadableBlocks
tofalse
.If the user has 2 requests pending at once,
isRequestingDownloadableBlocks
is set tofalse
once the first request resolves even though the latest request is still in transit.After
pendingSearchRequests
instead of a boolean value to track requests.> 0
requests pending.Checklist: