-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CMM-802 create taxonomies data view #22258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…-menu-depending-on-the-server-configuration
Generated by 🚫 Danger |
Project manifest changes for WordPressThe following changes in the --- ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/base_manifest.txt 2025-10-07 14:06:37.292791917 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/head_manifest.txt 2025-10-07 14:06:39.462807090 +0000
@@ -321,6 +321,10 @@
android:label="@string/application_password_info_title"
android:theme="@style/WordPress.NoActionBar" />
<activity
+ android:name="org.wordpress.android.ui.taxonomies.TermsDataViewActivity"
+ android:label="@string/taxonomies_title"
+ android:theme="@style/WordPress.NoActionBar" />
+ <activity
android:name="org.wordpress.android.ui.prefs.notifications.NotificationsSettingsActivity"
android:configChanges="orientation|screenSize"
android:exported="false" Go to https://buildkite.com/automattic/wordpress-android/builds/23530/canvas?sid=0199befa-9717-4d30-891b-61c04506e906, click on the |
Project manifest changes for WordPressThe following changes in the --- ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/base_manifest.txt 2025-10-07 14:06:58.291738296 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/head_manifest.txt 2025-10-07 14:07:00.901753039 +0000
@@ -455,6 +455,10 @@
android:label="@string/application_password_info_title"
android:theme="@style/WordPress.NoActionBar" />
<activity
+ android:name="org.wordpress.android.ui.taxonomies.TermsDataViewActivity"
+ android:label="@string/taxonomies_title"
+ android:theme="@style/WordPress.NoActionBar" />
+ <activity
android:name="org.wordpress.android.ui.prefs.notifications.NotificationsSettingsActivity"
android:configChanges="orientation|screenSize"
android:exported="false" Go to https://buildkite.com/automattic/wordpress-android/builds/23530/canvas?sid=0199befa-9718-42f5-aeb5-56bea74b8df5, click on the |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22258-d2e9f03 | |
Commit | d2e9f03 | |
Direct Download | wordpress-prototype-build-pr22258-d2e9f03.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22258-d2e9f03 | |
Commit | d2e9f03 | |
Direct Download | jetpack-prototype-build-pr22258-d2e9f03.apk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR creates a generic taxonomies data view to replace hardcoded category and tag views. It introduces a new TermsDataViewActivity with a ViewModel that can handle any taxonomy type (categories, tags, or custom taxonomies) with support for hierarchical structures, searching, and sorting.
- Adds generic terms view with support for hierarchical and non-hierarchical taxonomies
- Refactors site settings to use the new generic terms view instead of hardcoded category/tag activities
- Implements proper sorting, searching, and detail view functionality for terms
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
TermsViewModel.kt | Core logic for handling terms data, sorting, hierarchy, and API calls |
TermsDataViewActivity.kt | Activity with Compose UI for displaying terms list and detail views |
TermsViewModelTest.kt | Unit tests covering sorting logic and offline state handling |
ActivityLauncher.java | Added method to launch the new terms view |
SiteSettingsFragment.java | Updated to use generic terms view instead of hardcoded category/tag activities |
AndroidManifest.xml | Registered the new TermsDataViewActivity |
strings.xml | Added string resources for terms UI |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
WordPress/src/main/java/org/wordpress/android/ui/taxonomies/TermsViewModel.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/taxonomies/TermsDataViewActivity.kt
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22258 +/- ##
==========================================
- Coverage 39.93% 39.91% -0.02%
==========================================
Files 2166 2168 +2
Lines 102536 102650 +114
Branches 14774 14793 +19
==========================================
+ Hits 40945 40970 +25
- Misses 58123 58212 +89
Partials 3468 3468 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…-menu-depending-on-the-server-configuration
…mies-in-the-menu-depending-on-the-server-configuration' into feature/CMM-802-Create-TaxonomiesDataView
…te-TaxonomiesDataView # Conflicts: # WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Test plan succeeded for me. Left a few suggestions to consider, but nothing blocking.
) | ||
|
||
term.parent?.let { parentId -> | ||
val parentName = allTerms.firstOrNull { it.id == parentId }?.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking for my own education to better understand Jetpack Compose: are there downsides (performance?) to passing the entire list of items for filtering the parent name? Should we instead provide the parent or its name to TermDetailCard
? I.e., perform the filtering higher in the Compose tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is one downside: running the filtering in the UI thread. But no matter at what level it is filtered, I don't see it making any difference. We are executing it in every CardDetails composition.
I don't like this approach tbh, because the Composable items are asking directly to the ViewModel (and even performing some logic). I would prefer the ViewModel executing all the logic and giving just the state to the View. But the current DataView
flow does not work that way, so a refactor is needed to do that.
But from this discussion, I think I'll give it a try. So, thank you :)
|
Description
This PR creates a generic taxonomies data view to replace hardcoded category and tag views. It introduces a new TermsDataViewActivity with a ViewModel that can handle any taxonomy type (categories, tags, or custom taxonomies) with support for hierarchical structures, searching, and sorting.
Important notes:
worpdress-rs
API. The FluxC layer will be included in next iterations to take advantage of local storage.Before:

After:

Testing instructions