Skip to content

Pages list: search and author filter (phase 2) and FAB#22950

Open
nbradbury wants to merge 17 commits into
trunkfrom
pages-rs-list-phase-2
Open

Pages list: search and author filter (phase 2) and FAB#22950
nbradbury wants to merge 17 commits into
trunkfrom
pages-rs-list-phase-2

Conversation

@nbradbury

@nbradbury nbradbury commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

This PR implements Phase 2 of the wordpress-rs pages list (phases 0–1 landed in #22936) by adding a debounced search and per-author filter, mirroring the behavior of the wordpress-rs post list.

A FAB to create a new page was also added to this PR. This feature was notably absent from Claude's initial plan.

Testing instructions

Prereqs: enable the wordpress-rs pages list experimental feature in Settings → Experimental Features (debug build only), then open My Site → Pages.

Search:

  1. Tap the search icon in the top app bar.
  • Verify the tab row hides and the keyboard / text field opens.
  1. Type two characters.
  • Verify no network call fires and the list area stays blank.
  1. Continue to three or more characters and wait ~250 ms.
  • Verify results load, mixing pages from all statuses, with each row showing a status label (Published / Draft / etc.).
  1. Tap the close (✕) icon to clear the query, or the back arrow to exit search entirely.
  • Verify the active tab reloads immediately without debounce delay.

Author filter (WP.com multi-author sites):

  1. On a WP.com site where the signed-in user can edit others' pages, reopen the pages list.
  • Verify a person/avatar icon appears in the top app bar.
  1. Tap it and switch between Everyone and Me.
  • Verify the list reloads filtered by the chosen author.
  • Verify the selection persists across app restarts
  1. On a self-hosted Jetpack site (or any single-author site).
  • Verify the author filter icon is hidden.

FAB

  • Verify that the FAB on the new pages list works as expected

Adds debounced search and a per-author filter to the wordpress-rs
pages list, mirroring the post-list playbook from PostRsListViewModel.

Search: typing past 3 characters (200 ms debounce) tears down all
tab collections and rebuilds the active tab against PostListFilter
with status = ALL_STATUSES and a non-null search term. Results
render a status label per row so users can tell which bucket each
hit came from. Closing search clears the query and immediately
re-initializes the active tab without waiting for the debounce.

Author filter: gated on isUsingWpComRestApi + hasCapabilityEditOthersPages
+ isSingleUserSite == false (consistent with the legacy PagesViewModel
and PostRsListViewModel). Selection persists via the shared
appPrefsWrapper.postListAuthorSelection pref. Display names are
resolved through the existing entity-agnostic
PostRsRestClient.fetchUserDisplayNames and skipped when filtering
by Me.

Analytics: tracks PAGES_LIST_SEARCH_ACCESSED, PAGES_LIST_ITEM_SELECTED,
and the pre-existing PAGES_LIST_AUTHOR_FILTER_CHANGED.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dangermattic

dangermattic commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator
2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Jun 8, 2026

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
Versionpr22950-41d8547
Build Number1493
Application IDorg.wordpress.android.prealpha
Commit41d8547
Installation URL4mmfs5l89mpo8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Fold the _site null guard into the combined early-return so the function
stays under detekt's two-return limit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wpmobilebot

wpmobilebot commented Jun 8, 2026

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
Versionpr22950-41d8547
Build Number1493
Application IDcom.jetpack.android.prealpha
Commit41d8547
Installation URL75vkrron96t20
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Bump SEARCH_DEBOUNCE_MS from 200 to 250 to match PostRsListViewModel,
so users who use both lists see the same input latency.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wpmobilebot

wpmobilebot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

nbradbury and others added 3 commits June 8, 2026 13:46
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop unused PageRsUiModel.status field, replace buildString header
with listOfNotNull/joinToString, and inline single-use findPage helper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a FloatingActionButton to the wordpress-rs pages list that opens
the editor for a new page via ActivityLauncher.addNewPageForResult,
matching the legacy PagesFragment behavior. The FAB is hidden during
search but visible on all four tabs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nbradbury nbradbury changed the title Pages list: search and author filter (phase 2) Pages list: search and author filter (phase 2) and FAB Jun 8, 2026
nbradbury and others added 8 commits June 8, 2026 14:56
Wire the wordpress-rs pages list FAB through ModalLayoutPickerViewModel
when the block editor is the default for new posts and the Jetpack
feature-removal phase allows template selection, matching the legacy
PagesFragment flow. Falls back to launching a blank page directly when
the picker can't be shown. Also tracks PAGES_ADD_PAGE on FAB tap for
analytics parity.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The activity already reads viewModel.site directly when handling the
MLP result; making the event itself a data object unifies that access
path and removes the redundant parameter-threading.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previously tapping a page on the TRASHED tab was a silent no-op, and
during search a trashed result surfaced on a non-trashed tab would fall
through and try to open the editor. Track an isTrashed flag on the UI
model and emit a toast in both cases; the real move-to-draft flow is
deferred to phase 3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nbradbury nbradbury marked this pull request as ready for review June 9, 2026 14:42
@nbradbury nbradbury requested a review from adalpari June 9, 2026 14:42
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 19.79866% with 239 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.19%. Comparing base (161e21e) to head (41d8547).

Files with missing lines Patch % Lines
...ss/android/ui/pagesrs/screens/PagesRsListScreen.kt 0.00% 140 Missing ⚠️
...rdpress/android/ui/pagesrs/PagesRsListViewModel.kt 49.57% 47 Missing and 12 partials ⚠️
.../wordpress/android/ui/pagesrs/PageRsListUiState.kt 0.00% 13 Missing ⚠️
...press/android/ui/pagesrs/screens/PageRsListItem.kt 0.00% 13 Missing ⚠️
.../android/ui/pagesrs/screens/PageRsTabListScreen.kt 0.00% 8 Missing ⚠️
.../java/org/wordpress/android/ui/prefs/AppPrefs.java 0.00% 4 Missing ⚠️
.../org/wordpress/android/ui/prefs/AppPrefsWrapper.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #22950      +/-   ##
==========================================
- Coverage   37.22%   37.19%   -0.04%     
==========================================
  Files        2329     2329              
  Lines      125323   125584     +261     
  Branches    17044    17090      +46     
==========================================
+ Hits        46657    46716      +59     
- Misses      74893    75084     +191     
- Partials     3773     3784      +11     

☔ 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.

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.

3 participants