-
Notifications
You must be signed in to change notification settings - Fork 131
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
[Woo POS][Design system] Implement design review comments #13615
[Woo POS][Design system] Implement design review comments #13615
Conversation
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
@coderabbitai review |
@@ -154,27 +154,36 @@ private fun TotalsLoaded( | |||
horizontalAlignment = Alignment.CenterHorizontally, | |||
verticalArrangement = Arrangement.Center, | |||
) { | |||
if (!state.isFreeOrder) { |
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.
In my opinion, this is not a valid way to build a view model. With this approach, you can have a view model that includes, for instance, reader status "ready for payment" and "isFreeOrder == true," which is an invalid state. I believe we should not model it this way therefore I changed it. wdyt?
Having said that, I don't understand why we even allow an order with price zero collected with cash but not with card? In both cases, it's impossible, correct?
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.
Having said that, I don't understand why we even allow an order with price zero collected with cash but not with card? In both cases, it's impossible, correct?
Stripe wont' allow us to create a payment intent with price 0. I think a proper solution would be to replace the Cash Payment
button with something like Complete Order
-> change payment success screen, to something like Order Completed
screen. However, I'm not sure it's worth the effort considering this flow is not for usual sales, but for rare use-cases in which someone is giving away free stuff but they still want to keep a record of them.
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.
Stripe wont' allow us to create a payment intent with price 0. I think a proper solution would be to replace the Cash Payment button with something like Complete Order -> change payment success screen, to something like Order Completed screen. However, I'm not sure it's worth the effort considering this flow is not for usual sales, but for rare use-cases in which someone is giving away free stuff but they still want to keep a record of them.
I see. Make sense! Thanks
To be honest, I would leave it to the user, as I believe we handle the error when the payment intent was not created. So my understanding is that there will be an error in the top half and a "cash payment" button at the bottom. We added extra complexity just to avoid showing an error, while, in my opinion, the error is perfectly acceptable in this case and maybe even clearer for the user than just missing the card reader section. However, I think that since we already have this code, we can keep it.
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.
So my understanding is that there will be an error in the top half and a "cash payment" button at the bottom.
That's not the case. There are much bigger problem when we enable card payments for free products. You can find the discussion here - p1736742009959369-slack-C070SJRA8DP.
is WooPosTotalsViewState.ReaderStatus.Disconnected -> { | ||
ReaderDisconnected(modifier = Modifier, status = readerStatus, onUIEvent = onUIEvent) | ||
} | ||
Column( |
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.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #13615 +/- ##
============================================
- Coverage 38.06% 38.05% -0.01%
+ Complexity 9058 9057 -1
============================================
Files 2058 2058
Lines 112694 112696 +2
Branches 14286 14285 -1
============================================
- Hits 42898 42891 -7
- Misses 65895 65904 +9
Partials 3901 3901 ☔ View full report in Codecov by Sentry. |
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.
Thanks @kidinov!
The changes all look good to me. The one minor thing I'm not sure about is whether the vertical position of the email/cash value shouldn't be centralized, but we can iterate on that later.
@AnirudhBhat Could you please scan through the changes to the payment states? They look good to me, but better be sure.
P.S. I think it would have been clearer to keep the payment state changes in a separate PR - mostly because, if there is a bug the misleading PR title might throw us off when searching for the PR that introduced the bug. I wouldn't worry about it too much, but I'd personally try to avoid this in the future.
@malinajirka thanks for the review!
Yep, I agree. I started to modify that because there is a comment from Wagner regarding this state, and I could not resist not adjusting the view model
That's relatively easy to do, but it will cause "jumping" of them when the keyboard shows/hides. I'll try and see if it looks ok then |
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.
I've scanned the payment state code changes. LGTM
Awesome, thanks @AnirudhBhat! I've tested the following:
@kidinov I think this PR is good to be merged. I haven't checked two out of the three checkboxes in the |
Closes: #13614
Description
The PR brings multiple changes to address PR review comments
qJpoXnTMMBPsgHBedaBWGv-fi-5_7448
Testing information
The tests that have been performed
Images/gif
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: