Commit e3e0289
authored
Add debug-only Post Types module for
* Add experimental Post Types feature flag
Added debug-only experimental flag to enable/disable the Post Types screen.
This flag will control visibility of the new post types functionality that
allows users to view and navigate different post types from a unified screen.
Changes:
- Added EXPERIMENTAL_POST_TYPES feature to ExperimentalFeatures enum
- Configured flag to only appear in debug builds via BuildConfig check
- Added UI strings for feature name and description
* Add Post Types screen UI skeleton
Implements the initial UI for the experimental Post Types feature:
- `PostTypesActivity` with Compose-based UI
- `PostTypesViewModel` with hardcoded post types (Posts, Pages)
- `PostTypesScreen` composable with list display
- Navigation wiring from My Site menu (when feature flag enabled)
The screen is accessible from My Site menu when the experimental
Post Types feature flag is enabled in debug builds.
Changes:
- Add `PostTypesActivity`, `PostTypesViewModel`, and `PostTypesScreen`
- Register activity in AndroidManifest
- Add `OpenPostTypes` navigation action and `POST_TYPES` list item action
- Wire up navigation in `MySiteFragment`, `MenuActivity`, and handlers
- Add `post_types_screen_title` string resource
* Code cleanup for Post Types feature
- Add proper import for `PostTypesActivity` in `ActivityLauncher.java`
- Add `@Suppress("unused")` annotation for `site` property in
`PostTypesViewModel` (will be used when API integration is added)
* Add flat post list screen skeleton
Introduces `CptFlatPostListActivity` - a Compose-based screen that
displays a flat list of posts for a given post type. This is a skeleton
implementation with mock data to establish the navigation flow.
The `Cpt` prefix is used for all new types in this feature to avoid
naming conflicts with existing types and to indicate WIP status.
Changes:
- Add `CptFlatPostListActivity` with Compose UI
- Add `CptFlatPostListViewModel` with mock post data
- Add `CptFlatPostListScreen` composable with title, excerpt, and status
- Add `CptPostListItem` and `CptFlatPostListUiState` data classes
- Add `PostTypesNavigationAction` sealed class for type-safe navigation
- Wire up navigation from `PostTypesActivity` using SharedFlow
- Register new activity in AndroidManifest
* Rename Post Types classes to use Cpt prefix
Renames all new types in the posttypes package to use the `Cpt` prefix
for consistency and to avoid naming conflicts with existing types.
Renames:
- `PostTypesActivity` → `CptPostTypesActivity`
- `PostTypesViewModel` → `CptPostTypesViewModel`
- `PostTypesScreen` → `CptPostTypesScreen`
- `PostTypesUiState` → `CptPostTypesUiState`
- `PostTypeItem` → `CptPostTypeItem`
- `PostTypesNavigationAction` → `CptNavigationAction`
* Extract Post Types feature to isolated module
Moves the Custom Post Types (CPT) feature to `libs/posttypes` module
to enforce clean boundaries and prevent accidental FluxC usage during
wordpress-rs integration.
The module is intentionally isolated with minimal dependencies. A
`bridge` package contains temporary coupling code (`SiteReference`,
`CptTheme`, `BridgeConstants`) that explicitly documents what needs
attention when integrating wordpress-rs or merging back.
Changes:
- Create `libs/posttypes` module with Compose, Hilt, and Parcelize
- Add `bridge` package with documented temporary bridging types
- Move CPT activities, ViewModels, and Compose screens to new module
- Update `ActivityLauncher` to convert `SiteModel` to `SiteReference`
- Add comprehensive README with migration instructions
* Fix Post Types module UI issues and add composition pattern
Fixes navigation not working and removes green action bar header that
appeared due to inheriting the app's default theme.
Changes:
- Add `extraBufferCapacity = 1` to SharedFlow for reliable navigation
- Add `CptActivity` interface with `applyBaseSetup()` extension for
composition over inheritance pattern
- Add `Cpt.NoActionBar` theme to prevent action bar from showing
- Update activities to use new composition pattern
- Document bridge components and migration notes in README
* Fix detekt issues in Post Types module
Resolve 8 detekt violations:
- Rename ActivitySetup.kt to CptActivity.kt to match top-level declaration
- Remove TODO markers from suppression comments
- Refactor mock data generation to use loop instead of hardcoded list
- Add @Suppress annotations for intentional violations (mock data, stub handler)
* Add hierarchical post list skeleton for Pages
Add separate UI for hierarchical post types (like Pages) that displays
posts with visual indentation based on parent-child relationships.
Changes:
- Add `hierarchical` flag to `CptPostTypeItem` model
- Create `CptHierarchicalPostListActivity` and ViewModel with mock hierarchy
- Create `CptHierarchicalPostListScreen` with indent-based display
- Route Pages to hierarchical screen, Posts to flat screen
* Fix Sonar security warnings in Post Types manifest
Set explicit secure defaults for `allowBackup` and `usesCleartextTraffic`
to satisfy static analysis. Main app values override during manifest merge.
* Fix SiteItemsBuilderTest missing experimentalFeatures parameter
Add mock for ExperimentalFeatures and pass it to SiteItemsBuilder
constructor to fix compilation error after adding the dependency.wordpress-rs integration (#22405)1 parent 9c55474 commit e3e0289
File tree
32 files changed
+1207
-3
lines changed- WordPress
- src
- main
- java/org/wordpress/android/ui
- mysite
- cards
- items/listitem
- prefs/experimentalfeatures
- res/values
- test/java/org/wordpress/android/ui/mysite/items
- libs/posttypes
- src/main
- java/org/wordpress/android/posttypes
- bridge
- compose
- res/values
32 files changed
+1207
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
705 | 707 | | |
706 | 708 | | |
707 | 709 | | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
708 | 720 | | |
709 | 721 | | |
710 | 722 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
| 619 | + | |
| 620 | + | |
619 | 621 | | |
620 | 622 | | |
621 | 623 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | | - | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
68 | 86 | | |
69 | 87 | | |
70 | 88 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
0 commit comments