Commit 75f9510
Pages list: hierarchy (phase 3) (#22966)
* Pages list: Phase 2 search & author filter
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>
* Pages list: satisfy detekt ReturnCount in resolveAuthorNames
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>
* Pages list: align search debounce with post list
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>
* Pages list: use separate author filter pref from post list
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Pages list: simplify Phase 2 additions
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>
* Pages list: add new-page FAB
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>
* Pages list: route FAB through Modal Layout Picker
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>
* Pages list: drop site payload from CreateNewPage event
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>
* Pages list: animate FAB and add tooltip
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Pages list: drop _site backing field and sort imports
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Pages list: toast on trashed page tap
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>
* Pages list: simplify isAuthorFilterSupported and speed up author merge
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Pages list: extract proceedOpenPage to drop a return statement
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Pages list: drop redundant search seed and author-guard null check
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Pages list: Phase 3 hierarchy and virtual homepage/posts-page rows
Switches PageTabUiState.pages to a sealed PageRsListItem (Real with
indentLevel, Virtual for the site's homepage / posts page). Hierarchy
flattening is a pure helper used only on PUBLISHED outside of search
and Me-filter; virtuals are prepended and their real rows hidden.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Pages list: switch to TITLE ASC to match legacy ordering
PUBLISHED, DRAFTS, and TRASHED now use WpApiParamPostsOrderBy.TITLE
+ ASC so the new list mirrors the legacy alphabetical pre-sort
preserved by PR #22896. SCHEDULED stays on DATE ASC until the
legacy date-divider grouping (Today / Tomorrow / Next week) lands.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Pages list: merge site guard to satisfy ReturnCount
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Pages list: reword TODO comment to satisfy detekt ForbiddenComment
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Pages list: apply simplifications from branch review
- Reuse isSearch local instead of re-reading the search query
- Skip no-op copy when no author name to preserve
- Drop redundant empty-list guard in flattenToTree
- Collapse KeyboardOptions.Default.copy to direct constructor
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Pages list: cancel in-flight collection jobs on teardown
Collection-scoped work (init, refresh, load-more, observer callbacks)
now runs in a child scope that clearCollections() cancels and
replaces, so a job resuming after a search/filter teardown can't
touch a closed collection or write stale error state into the
rebuilt tabs. Generic catch blocks rethrow CancellationException so
cancellation isn't reported as a load failure.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Pages list: close orphaned collection when creation is cancelled mid-flight
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Pages list: handle parent cycles in tree builder and guard listInfo call
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Pages list: apply branch simplifications
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Pages list: note per-page actions menu gap in row composable
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 70f4da8 commit 75f9510
8 files changed
Lines changed: 648 additions & 229 deletions
File tree
- WordPress/src
- main/java/org/wordpress/android/ui/pagesrs
- screens
- test/java/org/wordpress/android/ui/pagesrs
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | | - | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
23 | | - | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
25 | 34 | | |
26 | 35 | | |
27 | 36 | | |
28 | 37 | | |
| 38 | + | |
29 | 39 | | |
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
33 | 43 | | |
34 | 44 | | |
35 | | - | |
| 45 | + | |
| 46 | + | |
36 | 47 | | |
37 | 48 | | |
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
24 | 46 | | |
25 | 47 | | |
26 | 48 | | |
| |||
31 | 53 | | |
32 | 54 | | |
33 | 55 | | |
| 56 | + | |
34 | 57 | | |
35 | 58 | | |
36 | 59 | | |
| |||
77 | 100 | | |
78 | 101 | | |
79 | 102 | | |
| 103 | + | |
80 | 104 | | |
81 | 105 | | |
82 | 106 | | |
| |||
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
0 commit comments