-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2023-10-23] [$500] [distance] Don't disable the Next
button. Show error message
#27045
Comments
Current assignee @JmillsExpensify is eligible for the Bug assigner, not assigning anyone new. |
Next
button for distance, don't disable the button and instead show an errorNext
button for distance, don't disable the button and instead show an error
Job added to Upwork: https://www.upwork.com/jobs/~01a0151b41111ef451 |
Bug0 Triage Checklist (Main S/O)
|
Current assignee @JmillsExpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Bottom Dock the next button and keep it enabled all the time, in case of invalid data show message What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
Result on desktop webScreen.Recording.2023-09-21.at.1.13.01.PM.movResult on IOSScreen.Recording.2023-09-21.at.1.16.52.PM.movError HandlingScreen.Recording.2023-09-21.at.3.59.40.PM.movPS - I have added padding top in IOS (realised it later) What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Button shows as disabled which violates the form rules and also needs to snap to the bottom of the scroll view. What is the root cause of that problem?The root cause is that a quick fix was issued to fix certain screen sizes rather than having a more robust solution, which causes the layout to break on small screens. Since this was a quick fix as well, the button never adhered to the form rules What changes do you think we should make in order to solve the problem?Rather than like above proposal, which changes the layout of that container and restricts the map size, instead I think that button should be anchored to the bottom of the scrollview container in an alternate fashion that doesn't also change the layout as mentioned instead. As for the button being disabled, we simply need to make a couple of adjustments on what happens based on its state and show an error message when clicked at an improper time (via a tooltip or simple indicator component, whichever is more consistent throughout the app). We could also create an error/validation component to make this more extensible and reusable throughout the app in the future for button inputs What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
App/src/components/DistanceRequest.js Lines 166 to 174 in 5c13816
The inner ScrollView takes the whole screen height and it has flex:1 . All its children will align from top to bottom.
App/src/components/DistanceRequest.js Lines 263 to 269 in 5c13816
The button has a isDisabled property that will disable the button when the size of validatedWaypoints is < 2
What changes do you think we should make in order to solve the problem?
position the button at the bottom of the screens with sufficient vertical space. If the screen is extremely short. Using Proposed Solution: Implement a 'margin-top: auto' style property to the button, which in our codebase can be achieved by applying the 'styles.mtAuto' class to the button element. This solution ensures that the button is positioned at the bottom on taller screens and remains hidden within the scroll view on extremely short screens.
Proposed Solution: It's a good user experience to always show the button as exp-issue-27045.movWhat alternative solutions did you explore? (Optional) |
@BhuvaneshPatil for this question.
We show the only error when the |
@BhuvaneshPatil I have a question about your proposal. Why do we need to add a new state for this? |
About that @hayata-suenaga , The state will be used like following - When have to show the error only if user has clicked the button, to achieve this we will need a state. |
Can we just check if the error exists or not? |
as @JmillsExpensify mentioned, we only want to show error when user clicks on button, we have information about errors, we need to show that in UI only when user clicks the button. Here is code snippet - <View>
{_.size(validatedWaypoints) < 2 && userTriedSubmitting && (
<DotIndicatorMessage
style={[styles.mh5, styles.mv3]}
messages={{8217392: 'Minimum two routes required'}}
type="error"
/>
)}
<Button
success
style={[styles.w100, styles.mb4, styles.ph4, styles.flexShrink0]}
onPress={() => {
setUserTriedSubmitting(true);
if (_.size(validatedWaypoints) < 2) return;
IOU.navigateToNextPage(iou, iouType, reportID, report);
}}
text={translate('common.next')}
/>
</View> in summary, we know what to show we need state for when to show. |
@JmillsExpensify, @allroundexperts Whoops! This issue is 2 days overdue. Let's get this updated quick! |
ah I see thank you for the explanation. @allroundexperts could you review proposals? |
Triggered auto assignment to @shawnborton ( |
Still waiting for @allroundexperts to review proposals though I also added design for a second set of eyes. |
For the first problem, I think we have a built in component that achieves the bottom docking. I would rather go with a proposal that makes use of it instead of re-inventing the wheel. |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.84-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-10-23. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Next
button. Show error messageNext
button. Show error message
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.84-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-10-23. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Next
button. Show error messageNext
button. Show error message
@allroundexperts mind kicking us off with the BZ checklist? |
Yep. On it today! |
Can you expound on this outside of this PR? |
@JmillsExpensify I think that @BhuvaneshPatil is correct. The PR got raised on Oct 10 and got merged on Oct 13 (Even then it was about 2 hours late because our lint checks were running slow that day). |
Checklist
|
That's a regression ^ btw |
@BhuvaneshPatil Can you please check? |
As the code is already deployed to production, I reverted my PR on latest main and tested. Screen.Recording.2023-10-19.at.7.25.10.AM.movSo I think this is not a regression but an undetected bug. Rest is upto you to decide. |
@neil-marcellini Any thoughts on that last comment? I believe our policy is that whether it's a regression or an undetected issue, both are subject to a decrease in pay. I'd love a confirmation though, thanks! |
I see. Thank you @BhuvaneshPatil for testing and providing evidence. It definitely wasn't a regression from your PR. It would have been a good case to test, since I did say this in the issue description solution.
That being said, I didn't consider that we could have 2 valid waypoints and the start or finish waypoint could be empty, so I didn't see it coming either. @JmillsExpensify I don't think we should reduce anyone's pay for this. |
Thanks! Payout summary as follows:
|
@allroundexperts in the future, please paste the regression steps in this issue. That makes it just a little bit easier to tackle next steps. |
Ah, you're just linking to the OP above. Disregard my last comment, all good! |
$750 payment approved for @allroundexperts based on summary. |
Regression test created and Contributor contract paid. Closing this issue. |
Edited by @neil-marcellini :
Context
Currently to get valid waypoints we do the following:
Problem
If there are < 2 valid waypoints we disable the next button.
Solution
Instead of doing that we should show an error message. If the original waypoints have an empty start or finish the error message should say something like “Please enter at least two waypoints”. Otherwise the error message should say that there are duplicate waypoints.
Tests / expected behavior
Empty
One empty stop
Same start and finish
Duplicate start
Duplicate start, duplicate stop
cc @shawnborton @hayata-suenaga
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: