Skip to content

Conversation

kidinov
Copy link
Contributor

@kidinov kidinov commented Aug 19, 2025

WOOMOB-1032

Description

Added barcode scanner setup functionality to the empty cart state in Woo POS. When the cart is empty and the POS settings feature flag is enabled, users can now access barcode scanner settings directly from the cart screen through a dedicated button. The implementation includes automatic navigation to Hardware → Barcode scanners settings with smooth animations and refactored empty state components for better code reusability.

There are also some change in the UI of the empty cart when the flag disabled too, so please evaluate them

Steps to reproduce

  1. Open Woo POS app
  2. Ensure WooPosPosSettingsEnabled feature flag is enabled
  3. Navigate to the cart screen
  4. Ensure cart is empty
  5. Observe the empty cart state now shows both product adding options and barcode scanning setup
  6. Click "Set up scanner" button
  7. Verify navigation goes to Settings → Hardware → Barcode scanners

Testing information

  • Tested on empty cart state with feature flag enabled/disabled
  • Verified navigation flow from cart to barcode scanner settings
  • Confirmed smooth animations during multi-level navigation
  • Tested UI layout and spacing consistency
  • Verified accessibility support for screen readers

The tests that have been performed

  • Manual testing of the empty cart UI layout
  • Navigation flow testing from cart to settings
  • Feature flag toggle testing
  • Code refactoring verification for EmptyStateSection component
  • Import cleanup and formatting validation

Images/gif

08-20--09-41.mp4
image
  • 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 Aug 19, 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
Commitd8b93d9
Direct Downloadwoocommerce-wear-prototype-build-pr14487-d8b93d9.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 19, 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
Commitd8b93d9
Direct Downloadwoocommerce-prototype-build-pr14487-d8b93d9.apk

@kidinov kidinov requested a review from samiuelson August 20, 2025 07:48
@kidinov kidinov added this to the 23.1 milestone Aug 20, 2025
@kidinov kidinov marked this pull request as ready for review August 20, 2025 07:50
@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2025

Codecov Report

❌ Patch coverage is 41.66667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.92%. Comparing base (16bc6c2) to head (d8b93d9).
⚠️ Report is 226 commits behind head on trunk.

Files with missing lines Patch % Lines
...android/ui/woopos/home/cart/WooPosCartViewModel.kt 40.00% 3 Missing ⚠️
...e/android/ui/woopos/home/cart/WooPosCartUIEvent.kt 0.00% 1 Missing ⚠️
...d/ui/woopos/home/toolbar/WooPosToolbarViewModel.kt 0.00% 1 Missing ⚠️
...ndroid/ui/woopos/root/navigation/WooPosRootHost.kt 0.00% 1 Missing ⚠️
...gs/details/hardware/WooPosSettingsHardwareState.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##              trunk   #14487   +/-   ##
=========================================
  Coverage     37.92%   37.92%           
- Complexity     9329     9330    +1     
=========================================
  Files          2015     2015           
  Lines        113218   113223    +5     
  Branches      14984    14985    +1     
=========================================
+ Hits          42942    42944    +2     
- Misses        66360    66363    +3     
  Partials       3916     3916           

☔ 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.

@wpmobilebot wpmobilebot modified the milestones: 23.1, 23.2 Aug 22, 2025
@wpmobilebot
Copy link
Collaborator

Version 23.1 has now entered code-freeze, so the milestone of this PR has been updated to 23.2.

@samiuelson samiuelson self-assigned this Aug 22, 2025
@samiuelson samiuelson requested a review from Copilot August 22, 2025 11:44
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 implements barcode scanner setup functionality in the empty cart state of Woo POS. When the POS settings feature flag is enabled, users can now access barcode scanner settings directly from an empty cart through a dedicated button, improving the user experience by providing immediate access to scanner configuration.

  • Added barcode scanner setup button to empty cart state when feature flag is enabled
  • Refactored navigation events to support hierarchical settings navigation with smooth animations
  • Updated empty cart UI with enhanced design including OR divider and dual-option layout

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
WooPosCartScreen.kt Redesigned empty cart UI with barcode scanner setup option and refactored components
WooPosCartViewModel.kt Added feature flag integration and barcode setup click handling
WooPosSettingsNavigation.kt Added new route for direct navigation to barcode scanner settings
WooPosSettingsScreen.kt Implemented automatic navigation with delays for smooth multi-level transitions
WooPosHomeChildToParentCommunication.kt Refactored navigation events to support hierarchical settings structure
strings.xml Added new UI strings for barcode scanner setup functionality
ic_woo_pos_empty_cart.xml Removed custom cart icon in favor of Material Design icons

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@samiuelson samiuelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, LGTM! I'd prefer to get rid of delays in Compose layout because, to me, the effect is weird.

val navigationPath = buildNavigationPath(initial.second)

for (destination in navigationPath) {
delay(300)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Hm. I'm not convinced of these delays. I really like the UI effect more without delays.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, me nether. I won't change it now as we may want to change and open the setup flow directly. I won't merge the PR yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed that


@Composable
fun WooPosSettingsScreen(
onNavigationEvent: (WooPosNavigationEvent) -> Unit,
initial: Pair<WooPosSettingsCategory, WooPosSettingsDetailDestination>? = null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
initial: Pair<WooPosSettingsCategory, WooPosSettingsDetailDestination>? = null,
destination: Pair<WooPosSettingsCategory, WooPosSettingsDetailDestination>? = null,

initial is not intuitive, how about destination, initialState, etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Won't change it yet as maybe I need to remove it complete if we go with opening the setup flow dialog from the empty state cart

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this too

@kidinov kidinov enabled auto-merge August 25, 2025 12:30
@kidinov kidinov merged commit f2d2202 into trunk Aug 25, 2025
17 checks passed
@kidinov kidinov deleted the woomob-1032-woo-possettings-move-barcode-scanners-button-to-the-empty branch August 25, 2025 13:02
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