-
Notifications
You must be signed in to change notification settings - Fork 133
[Woo POS] Move analytics tracking to VM #14815
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?
[Woo POS] Move analytics tracking to VM #14815
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
This PR refactors analytics tracking for the back navigation action in the WooPos cash payment flow by moving the tracking logic from the navigation handler to the ViewModel layer. This improves separation of concerns by keeping UI/navigation logic separate from business logic and analytics tracking.
- Removed analytics tracking from the navigation event handler
- Added analytics tracking to the ViewModel via a new
onBackClicked()method - Simplified the root screen by removing analytics tracker dependency from navigation components
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| WooPosNavigationEventHandler.kt | Removed analytics tracking logic and tracker dependency from GoBack navigation event handling |
| WooPosRootScreen.kt | Removed analytics tracker parameter from root screen composition functions |
| WooPosActivity.kt | Removed analytics tracker parameter when initializing WooPosRootScreen |
| WooPosCashPaymentViewModel.kt | Added new onBackClicked() method to handle analytics tracking for back navigation |
| WooPosCashPaymentScreen.kt | Updated back click handlers to call ViewModel's onBackClicked() method before triggering navigation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.../src/main/kotlin/com/woocommerce/android/ui/woopos/cashpayment/WooPosCashPaymentViewModel.kt
Show resolved
Hide resolved
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
…ing-in-cash-payment-screen
|
📲 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 #14815 +/- ##
============================================
- Coverage 38.23% 38.23% -0.01%
- Complexity 10085 10086 +1
============================================
Files 2129 2129
Lines 120421 120425 +4
Branches 16489 16490 +1
============================================
+ Hits 46047 46048 +1
- Misses 69718 69722 +4
+ Partials 4656 4655 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
WOOMOB-1567
Description
This PR refactors analytics tracking for the back navigation action in the WooPos cash payment flow by moving the tracking logic from the navigation handler to the ViewModel layer.
Test Steps
It's important to test if the analytics event is tracked correctly in the Cash screen, during back click – both on the top toolbar and the system back:
🔵 Tracked: woocommerceandroid_pos_back_to_checkout_from_cashImages/gif
N/A
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.