-
Notifications
You must be signed in to change notification settings - Fork 134
[WOOMOB-1342] Booking details header/list item component #14649
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
base: trunk
Are you sure you want to change the base?
Conversation
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
) { | ||
WCTag( | ||
text = state.text(), | ||
backgroundColor = colorResource(R.color.tagView_bg), |
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.
This color doesn't match the designs, but it's the one used for the same components in the app. I would assume the consistency is more important here, but let me know if I should change it.
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, good call! I would do the same.
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/AttendanceStatusTag.kt
Show resolved
Hide resolved
FlowRow( | ||
modifier = Modifier.padding(top = 2.dp), | ||
) { |
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.
FlowRow
because it's hard to predict the length of those two fields: booking name and the staff name. Each one could be quite long, so it's highly likely to exceed one line.
Alternatively, we could use the auto-size feature to decrease font size to fit in one line, not sure what the preference is. Any thoughts?
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’m not a fan of auto-size, as it causes inconsistent UI. I think FlowRow is a good solution.
enum class BookingPaymentStatus { | ||
UNPAID, PENDING_CONFIRMATION, CONFIRMED, PAID, CANCELLED, COMPLETE | ||
} |
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.
These are taken from this post pe5sF9-4Bq-p2. I believe, this is not a final list of possible states.
) { | ||
WCTag( | ||
text = state.text(), | ||
backgroundColor = colorResource(R.color.tagView_bg), |
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.
This should change depending on the state, but not all the states are defined yet.
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 introduces a reusable booking details header/list item component for the WooCommerce Android app. It implements the UI components needed to display booking information including date, service name, staff, and status indicators.
- Creates new Compose components for booking summary display with attendance and payment status tags
- Adds string resources for booking payment and attendance statuses
- Updates booking details screen to use the new summary component
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
strings.xml | Adds localized strings for booking payment and attendance status values |
BookingDetailsViewState.kt | Adds booking summary data model with hardcoded placeholder data |
BookingDetailsViewModel.kt | Minor formatting fix to trailing comma |
BookingDetailsScreen.kt | Integrates new BookingSummary component into the details screen UI |
PaymentStatusTag.kt | New component for displaying booking payment status with enum and styling |
BookingSummary.kt | Main reusable component that displays booking date, service info, and status tags |
AttendanceStatusTag.kt | New component for displaying booking attendance status with enum and styling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...merce/src/main/kotlin/com/woocommerce/android/ui/bookings/details/BookingDetailsViewState.kt
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingSummary.kt
Show resolved
Hide resolved
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #14649 +/- ##
============================================
- Coverage 38.52% 38.49% -0.04%
- Complexity 9781 9783 +2
============================================
Files 2068 2071 +3
Lines 115548 115686 +138
Branches 15393 15434 +41
============================================
+ Hits 44516 44531 +15
- Misses 66896 67020 +124
+ Partials 4136 4135 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Good job! It looks great across various accessibility settings. I’ve added a few comments and would like to hear your thoughts on them before approving.
) { | ||
WCTag( | ||
text = state.text(), | ||
backgroundColor = colorResource(R.color.tagView_bg), |
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, good call! I would do the same.
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/AttendanceStatusTag.kt
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingSummary.kt
Show resolved
Hide resolved
FlowRow( | ||
modifier = Modifier.padding(top = 2.dp), | ||
) { |
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’m not a fan of auto-size, as it causes inconsistent UI. I think FlowRow is a good solution.
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/PaymentStatusTag.kt
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingSummary.kt
Outdated
Show resolved
Hide resolved
Text( | ||
text = model.date, | ||
color = MaterialTheme.colorScheme.onSurface, | ||
style = MaterialTheme.typography.bodyLarge.copy(fontWeight = FontWeight.Medium), | ||
) |
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.
FYI: I've left a comment in Figma to ask about the styles. The ones in the design don't match the typography defined in the app, so it's a bit tricky to make it exactly the same without overriding individual values.
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! 👍🏻 I’m approving, but not merging since you mentioned you’re still waiting on design feedback.
WOOMOB-1342
Description
This PR creates the top/header Composable component for the Booking details screen. It's also the same component that can be reused on the Booking list screen.
I will leave some extra comments below.
Steps to reproduce
Testing information
Test with different font/display scaling and dark/light mode.
The tests that have been performed
The above
Images/gif
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.