Skip to content

Fix "No matches" flash in wp-rs Pages search#23032

Merged
nbradbury merged 2 commits into
trunkfrom
rs-pages-search-fix
Jun 24, 2026
Merged

Fix "No matches" flash in wp-rs Pages search#23032
nbradbury merged 2 commits into
trunkfrom
rs-pages-search-fix

Conversation

@nbradbury

@nbradbury nbradbury commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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 isLoading flag 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:

  1. Open the new Pages list and tap search.
  2. Type a multi-character query.
  3. Confirm a shimmer (not "No pages matching your search") shows during the fetch, and the empty message only appears when there genuinely are no matches.

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>
@dangermattic

dangermattic commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot

Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This 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>
@wpmobilebot

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr23032-39cf1b9
Build Number1497
Application IDorg.wordpress.android.prealpha
Commit39cf1b9
Installation URL6n2kuis0jtlr0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr23032-39cf1b9
Build Number1497
Application IDcom.jetpack.android.prealpha
Commit39cf1b9
Installation URL6a26avjo2t600
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.44%. Comparing base (38dc191) to head (39cf1b9).

Files with missing lines Patch % Lines
...rdpress/android/ui/pagesrs/PagesRsListViewModel.kt 0.00% 5 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nbradbury nbradbury marked this pull request as ready for review June 24, 2026 11:08
@nbradbury nbradbury requested a review from adalpari June 24, 2026 11:08

@adalpari adalpari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good fix! :shipit:

@nbradbury nbradbury merged commit b861a1c into trunk Jun 24, 2026
25 checks passed
@nbradbury nbradbury deleted the rs-pages-search-fix branch June 24, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants