-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Subscriber detail navigation, take two #21969
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
Generated by 🚫 Danger |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr21969-062ee8d | |
Commit | 062ee8d | |
Direct Download | wordpress-prototype-build-pr21969-062ee8d.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr21969-062ee8d | |
Commit | 062ee8d | |
Direct Download | jetpack-prototype-build-pr21969-062ee8d.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 implements navigation between the subscriber list and a detailed subscriber view using Jetpack Compose Navigation. Key changes include:
- Adding new string resources for subscriber details.
- Updating SubscribersViewModel to expose a helper method and refactoring the API request handling.
- Implementing Compose-based UI screens for subscriber details, including navigation and pull-to-refresh for the data view.
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 |
---|---|
strings.xml | Added new subscriber-related string resources. |
SubscribersViewModel.kt | Refactored API request handling and added an extension method. |
SubscribersActivity.kt | Implemented Compose navigation for list-detail screens with back navigation. |
SubscriberDetailScreen.kt | Created a new detail screen UI using Compose. |
RemoteImage.kt | Introduced a Compose component to load remote images with fallback. |
DataViewScreen.kt | Updated pull-to-refresh implementation and removed the back click handler. |
DataViewItemCard.kt | Updated usage of RemoteImage with adjustments for UI styling. |
Comments suppressed due to low confidence (1)
WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscriberDetailScreen.kt:215
- Consider formatting the subscription date to a user-friendly, locale-aware format rather than using toString().
value = subscriber.dateSubscribed.toString()
WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscribersActivity.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/dataview/DataViewScreen.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscribersViewModel.kt
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #21969 +/- ##
=======================================
Coverage 39.10% 39.10%
=======================================
Files 2150 2150
Lines 101026 101026
Branches 15521 15521
=======================================
Hits 39504 39504
Misses 58034 58034
Partials 3488 3488 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ubscribersActivity.kt Co-authored-by: Copilot <[email protected]>
…ViewScreen.kt Co-authored-by: Copilot <[email protected]>
…ubscribersViewModel.kt Co-authored-by: Copilot <[email protected]>
@@ -61,6 +57,11 @@ fun DataViewItemCard( | |||
RemoteImage( | |||
imageUrl = image.imageUrl, | |||
fallbackImageRes = image.fallbackImageRes, | |||
modifier = modifier |
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.
I think the modifier
from the DataViewItemCard
arguments should only be passed to the first composable item. So, in this case, we may need to create new one
modifier = modifier | |
modifier = Modifier |
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.
Thanks for catching that! It was a typo on my part. Resolved in c91a8bf.
WordPress/src/main/java/org/wordpress/android/ui/dataview/DataViewScreen.kt
Outdated
Show resolved
Hide resolved
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.
Overall looks good to me. I left some comments about the Modifier object since I would like just to be consistent about its usage across the UI elements
|
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.
Pretty clean code and UX flow :)
LGTM!!
This PR uses Jetpack Compose Navigation to navigate between the subscriber list and subscriber detail.
My original hope was to make navigation part of the generic
DataViewScreen
so it could be re-used rather than re-implemented in future data view screens, but that turned out to be wishful thinking. It's better for each data view screen to handle its own navigation.I've only used Jetpack navigation once before so the concept is fairly new to me. I'm open to any suggestions to improve it!
Note: The detail screen is not the final design. The goal of this PR isn't the detail screen but instead the navigation between the list and detail.
To test
subs.mp4