Skip to content

Conversation

@samiuelson
Copy link
Contributor

@samiuelson samiuelson commented Nov 14, 2025

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:

  • Introduced WooPosCellularCapabilityDetector utility 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

Test Steps

Test POS > Settings > Catalog screen on different devices:

  1. Having cellular data capability
  2. Not having cellular data capability (Wi-Fi only)

Images/gif

Enabled
Screenshot_20251114_145740
Disabled
Screenshot_20251114_142715
  • 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.

@dangermattic
Copy link
Collaborator

dangermattic commented Nov 14, 2025

1 Warning
⚠️ Class CellularCapabilityPreviewParameterProvider is missing tests, but unit-tests-exemption label was set to ignore this.

Generated by 🚫 Danger

@samiuelson samiuelson added this to the 23.8 milestone Nov 14, 2025
@samiuelson samiuelson added type: task An internally driven task. feature: point of sale POS project labels Nov 14, 2025
Copilot finished reviewing on behalf of samiuelson November 14, 2025 14:00
Copy link
Contributor

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 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 WooPosCellularCapabilityDetector utility 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.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 14, 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 NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit1375f4a
Direct Downloadwoocommerce-wear-prototype-build-pr14971-1375f4a.apk

@samiuelson samiuelson requested a review from kidinov November 14, 2025 14:07
@samiuelson samiuelson marked this pull request as ready for review November 14, 2025 14:07
@wpmobilebot
Copy link
Collaborator

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

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit1375f4a
Direct Downloadwoocommerce-prototype-build-pr14971-1375f4a.apk

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 62.50000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.45%. Comparing base (6748237) to head (1375f4a).

Files with missing lines Patch % Lines
...ui/woopos/util/WooPosCellularCapabilityDetector.kt 0.00% 4 Missing ⚠️
...s/localcatalog/WooPosSettingsLocalCatalogScreen.kt 0.00% 2 Missing ⚠️
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.
📢 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.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants