Skip to content

Conversation

toupper
Copy link
Contributor

@toupper toupper commented Oct 3, 2025

Part of WOOMOB-1149

Description

With this PR we handle the error and empty cases when loading POS Orders. The CTA for the empty state is still to be defined.

Steps to reproduce

Empty State

With a store without POS orders

  1. Go to POS
  2. Go to Orders
  3. See the empty state.
  4. Tap on the back arrow. You should navigate to the POS homescreen.

Error State

  1. Go to POS
  2. Turn offline
  3. Go to Orders
  4. See the error state.
  5. Go Online
  6. Tap on Retry
  7. Orders should be loaded properly
  8. Check also that tapping on the back arrow sends you to the POS Homescreen when the error state is shown.

Images/gif

Screen_Recording_20251003_155502_Woo.Dev.mp4
  • 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.

@toupper toupper added this to the 23.5 milestone Oct 3, 2025
@toupper toupper requested a review from kidinov October 3, 2025 14:48
@toupper toupper added the type: task An internally driven task. label Oct 3, 2025
text = it.text,
onClick = it.click,
modifier = Modifier
.fillMaxWidth(.5f)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kidinov In this case (and in the empty state), the button has a narrower width in the design. Let me know if you have a better idea for how to adapt it.

Copy link
Contributor

Choose a reason for hiding this comment

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

That changes the state on all 11 places where this component is used. If this is what Wagner's idea was, then it's fine. Overall, I think it looks ok

Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to extract that constant so that changing the width will only require one change. This is because both buttons must have the same width

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 3, 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
Commit2aec62a
Direct Downloadwoocommerce-wear-prototype-build-pr14695-2aec62a.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 3, 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
Commit2aec62a
Direct Downloadwoocommerce-prototype-build-pr14695-2aec62a.apk

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.38%. Comparing base (88b2c70) to head (70e150e).
⚠️ Report is 41 commits behind head on trunk.

Files with missing lines Patch % Lines
...ce/android/ui/woopos/home/items/WooPosItemsList.kt 0.00% 1 Missing ⚠️
.../android/ui/woopos/orders/WooPosOrdersViewModel.kt 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##              trunk   #14695   +/-   ##
=========================================
  Coverage     38.37%   38.38%           
- Complexity     9835     9836    +1     
=========================================
  Files          2093     2093           
  Lines        116753   116757    +4     
  Branches      15630    15630           
=========================================
+ Hits          44809    44812    +3     
- Misses        67781    67782    +1     
  Partials       4163     4163           

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

@@ -0,0 +1,25 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
Copy link
Contributor

Choose a reason for hiding this comment

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

This icon is not adapted for the dark mode. Notice in Figma that design system colors are used and you need to use them here as well

Image

val onBackClicked = { onNavigationEvent(WooPosNavigationEvent.GoBack) }
BackHandler { onNavigationEvent(WooPosNavigationEvent.GoBack) }

if (state is WooPosOrdersState.Error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally, sealed class -> when statement without else -> compilation time check that all cases are handled.

And I think there’s some issue with structure. Your top-level state goes down to what is "Content" state, while you still treat as top-level WooPosOrdersState state

The toolbar should be visible all the time, not rerendered on the state change. Also there are some naming issues. I tried to address those in the patch, please let me know wdyt?

Refactor_WooPosOrdersScreen_to_improve_state_handling_and_simplify_composables.patch

}

fun onOrdersEmptyActionClicked() {
// Action to be defined
Copy link
Contributor

Choose a reason for hiding this comment

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

Just sharing my perspective - I think the only CTA needed on an empty state is "create a new something" one, and here it doesn’t apply. I think only what we need is to have pull to refresh enabled on this state, and that's it. There is nothing to "learn more" here.

Copy link
Contributor

@kidinov kidinov left a comment

Choose a reason for hiding this comment

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

Thanks for your work here! I left a few comments; please take a look and let me know what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants