-
Notifications
You must be signed in to change notification settings - Fork 135
[Woo POS][Local Catalog] Disable "cellular data" toggle if device doesn't have data modem #14971
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][Local Catalog] Disable "cellular data" toggle if device doesn't have data modem #14971
Conversation
Generated by 🚫 Danger |
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 adds functionality to disable the "cellular data" toggle in the WooCommerce POS Local Catalog settings when the device doesn't have cellular capability (data modem).
Key Changes:
- Introduced
WooPosCellularCapabilityDetectorutility class to detect device telephony capabilities - Updated ViewModel to check cellular capability on initialization and disable the preference when unavailable
- Modified UI to visually disable and reduce opacity of the cellular data section when capability is absent
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| WooPosCellularCapabilityDetector.kt | New utility class that checks for FEATURE_TELEPHONY system feature to determine cellular capability |
| WooPosSettingsLocalCatalogViewModel.kt | Added cellular capability checking in init block and forces preference to false when capability is unavailable |
| WooPosSettingsLocalCatalogState.kt | Added hasCellularCapability boolean field to track device capability state |
| WooPosSettingsLocalCatalogScreen.kt | Updated UI to disable toggle and apply reduced opacity when device lacks cellular capability; added preview parameter provider for testing both states |
| WooPosSettingsLocalCatalogViewModelTest.kt | Added comprehensive tests for cellular capability detection and preference handling behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...e/src/main/kotlin/com/woocommerce/android/ui/woopos/util/WooPosCellularCapabilityDetector.kt
Show resolved
Hide resolved
...e/android/ui/woopos/settings/details/localcatalog/WooPosSettingsLocalCatalogViewModelTest.kt
Outdated
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.
|
…-local-catalog-settings-in
|
📲 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 #14971 +/- ##
=========================================
Coverage 38.44% 38.45%
- Complexity 10218 10221 +3
=========================================
Files 2152 2154 +2
Lines 122036 122052 +16
Branches 16789 16790 +1
=========================================
+ Hits 46918 46929 +11
- Misses 70359 70364 +5
Partials 4759 4759 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
WOOMOB-1697
Description
This PR adds functionality to disable the "cellular data" toggle in the WooCommerce POS Local Catalog settings when the device doesn't have cellular capability (data modem).
Key Changes:
WooPosCellularCapabilityDetectorutility class to detect device telephony capabilitiesTest Steps
Test POS > Settings > Catalog screen on different devices:
Images/gif
Enabled
Disabled
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.