Fix "No matches" flash in wp-rs Pages search#23032
Merged
Merged
Conversation
When typing in the Pages list search bar, the empty-state message flashed for the duration of the network fetch before results appeared. loadItemsForTab() set isLoading=false even when the freshly created search collection had no cached rows yet, satisfying the empty-state condition until the refresh completed. Keep isLoading true while the first page is still being fetched and we have no rows; updateListInfoForTab() already flips it off once the fetch genuinely completes, so the shimmer shows instead and the empty message only appears for real empty results. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Generated by 🚫 Danger |
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
Mirrors the isLoading = isLoading && fetchingFirstPage pattern used in updateListInfoForTab(). Logically identical, no behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
|
Contributor
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #23032 +/- ##
==========================================
- Coverage 37.44% 37.44% -0.01%
==========================================
Files 2326 2326
Lines 125535 125539 +4
Branches 17231 17232 +1
==========================================
Hits 47008 47008
- Misses 74707 74711 +4
Partials 3820 3820 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
When typing in the search bar of the new wp-rs Pages list, the "No pages matching your search" empty-state message flashed for the duration of the network fetch before the real results appeared. This PR resolves that problem.
The fix conditionally holds the
isLoadingflag while a freshly created search collection has no cached rows yet, so the shimmer shows during the fetch instead of the empty state;updateListInfoForTab()clears the flag once the fetch genuinely completes, at which point an empty result is real.Testing
To verify manually: