Skip to content

Conversation

AdamGrzybkowski
Copy link
Contributor

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

  1. Log in
  2. Go to Settings -> Developer Options
  3. Tap "Show booking details"
  4. Verify the UI matches the designs

Testing information

Test with different font/display scaling and dark/light mode.

The tests that have been performed

The above

Images/gif

Light Dark
Screenshot 2025-09-23 at 09 48 50 Screenshot 2025-09-23 at 09 49 06
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 23, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit0695ecc
Direct Downloadwoocommerce-wear-prototype-build-pr14649-0695ecc.apk

) {
WCTag(
text = state.text(),
backgroundColor = colorResource(R.color.tagView_bg),
Copy link
Contributor Author

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.

Copy link
Contributor

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.

Comment on lines +38 to +40
FlowRow(
modifier = Modifier.padding(top = 2.dp),
) {
Copy link
Contributor Author

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?

Copy link
Contributor

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.

Comment on lines +27 to +29
enum class BookingPaymentStatus {
UNPAID, PENDING_CONFIRMATION, CONFIRMED, PAID, CANCELLED, COMPLETE
}
Copy link
Contributor Author

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),
Copy link
Contributor Author

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.

Copy link
Contributor

@Copilot Copilot AI left a 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.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 23, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit0695ecc
Direct Downloadwoocommerce-prototype-build-pr14649-0695ecc.apk

@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 10.79137% with 124 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.49%. Comparing base (f2e35a9) to head (0695ecc).
⚠️ Report is 10 commits behind head on trunk.

Files with missing lines Patch % Lines
...erce/android/ui/bookings/compose/BookingSummary.kt 9.09% 60 Missing ⚠️
...ce/android/ui/bookings/compose/PaymentStatusTag.kt 2.94% 33 Missing ⚠️
...android/ui/bookings/compose/AttendanceStatusTag.kt 3.12% 31 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@irfano irfano self-assigned this Sep 23, 2025
Copy link
Contributor

@irfano irfano left a 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),
Copy link
Contributor

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.

Comment on lines +38 to +40
FlowRow(
modifier = Modifier.padding(top = 2.dp),
) {
Copy link
Contributor

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.

Comment on lines +33 to +37
Text(
text = model.date,
color = MaterialTheme.colorScheme.onSurface,
style = MaterialTheme.typography.bodyLarge.copy(fontWeight = FontWeight.Medium),
)
Copy link
Contributor Author

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.

Copy link
Contributor

@irfano irfano left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants