-
Notifications
You must be signed in to change notification settings - Fork 133
[WOOMOB-1396] - Booking's customer section actions #14692
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
[WOOMOB-1396] - Booking's customer section actions #14692
Conversation
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
Implements customer contact actions (call, SMS, WhatsApp, Telegram, email) for Booking details by extracting reusable phone contact option logic and reusing it in Order details. Key changes include a new utility for determining available phone contact options and new Compose UI components (dropdown menu) integrating those actions directly in the Booking customer details section.
- Added PhoneContactOptionsUtils to centralize available contact option resolution (including conditional WhatsApp/Telegram).
- Refactored existing order customer phone action logic to reuse the new utility and extracted SMS intent creation into ActivityUtils.
- Implemented booking-side UI (dropdown menu + inline actions) replacing callback-based design.
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 |
---|---|
PhoneContactOptionsUtils.kt | New utility to build list of available phone contact actions. |
ActivityUtils.kt | Added sendSms helper to centralize SMS intent handling. |
OrderDetailCustomerInfoView.kt | Refactored to use new contact options utility instead of hardcoded package checks. |
OrderCustomerHelper.kt | Reused new ActivityUtils.sendSms instead of duplicating intent logic. |
BookingDetailsScreen.kt | Adjusted call site after composable API change (callbacks removed). |
ContactDropdownMenu.kt | New composable presenting dynamic contact options. |
BookingCustomerDetails.kt | Integrated dropdown menu; inlined email/phone action handling (removed external callbacks). |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/ContactDropdownMenu.kt
Outdated
Show resolved
Hide resolved
fun BookingCustomerDetails( | ||
model: BookingCustomerDetailsModel, | ||
onEmailClick: () -> Unit, | ||
onPhoneClick: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
var phoneMenuExpanded by remember { mutableStateOf(false) } |
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.
[nitpick] Removing the onEmailClick and onPhoneClick callbacks hardcodes side effects (email intent, phone actions) inside the composable, reducing testability and flexibility (e.g., adding analytics, logging, or alternative behaviors). Consider reintroducing callbacks (with sensible defaults) so the UI remains a pure presenter while delegating side effects to higher layers.
Copilot uses AI. Check for mistakes.
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.
flexibility (e.g., adding analytics,
I was about to mention that too. Adding analytics would indeed be easier if we handled actions in the view models. But it’s not a major concern, we can revisit it when we implement analytics.
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.
True. I think there are pros and cons, like always. This way, the component is very easy to drop and use, without needing to implement the actions every time.
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 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 #14692 +/- ##
============================================
- Coverage 38.38% 38.36% -0.03%
+ Complexity 9825 9824 -1
============================================
Files 2094 2096 +2
Lines 116793 116854 +61
Branches 15625 15632 +7
============================================
- Hits 44834 44833 -1
- Misses 67800 67861 +61
- Partials 4159 4160 +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.
Nice job, Adam! It works as expected. 👍🏻 🚀
When an app like Telegram is installed/unistalled with Woo in the background, the list will be rechecked after entering foreground and thus preventing a crash.
WOOMOB-1396
Description
This PR implements the actions in the Booking details screen for both the phone and email rows in the customer details section.
There we a couple of things that I did:
Steps to reproduce
Customer
section...
iconTesting information
You can verify the Order details screen for regression. Testing Whatsapp, Telegram is a plus. Light and dark theme.
The tests that have been performed
The above
Images/gif
booking_contact_actions.mp4
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.