Skip to content
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 2024-01-26] [$500] Wallet - Fix the errors button is non-functional in Additional details #32520

Closed
6 tasks done
lanitochka17 opened this issue Dec 5, 2023 · 63 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Design Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Dec 5, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.8-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to URL
  2. Log in wirh any account
  3. Go to Settings -> Wallet-> Enable wallet
  4. Go through the process of connecting to Idology questions
  5. Click Save@Submit
    without choosing any variant
  6. Click on Fix the errors

Expected Result:

The first unselected radio button is activated

Actual Result:

Fix the errors button is non-functional

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6302298_1701805167094.bandicam_2023-12-05_12-51-12-008.mp4
Recording.6004.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ddd8bb8dc018a4a6
  • Upwork Job ID: 1732125580300574720
  • Last Price Increase: 2024-01-02
  • Automatic offers:
    • fedirjh | Reviewer | 28095131
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 5, 2023
@melvin-bot melvin-bot bot changed the title Wallet - Fix the errors button is non-functional in Additional details [$500] Wallet - Fix the errors button is non-functional in Additional details Dec 5, 2023
Copy link

melvin-bot bot commented Dec 5, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01ddd8bb8dc018a4a6

Copy link

melvin-bot bot commented Dec 5, 2023

Triggered auto assignment to @NicMendonca (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 5, 2023
Copy link

melvin-bot bot commented Dec 5, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Dec 5, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (External)

@happy-devs
Copy link

happy-devs commented Dec 5, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Clicking the "Fix the errors" button does not focus the first radio option as expected in the Idology question form

What is the root cause of that problem?

There onFixTheErrorsLinkPressed function within the FormWrapper is dedicated to focusing an item in the form fields key which in this case defaults to the SingleChoiceQuestion label above the radios (in @lanitochka17 's video example, "In which country have you lived?") Since the text component is passed the ref attribute rather than the RadioButtons, it's child options cannot be activated as described in the expected behaviour.

return (
<>
<Text
ref={ref}
style={[styles.textStrong, styles.mb5]}
>
{prompt}
</Text>
<RadioButtons
items={possibleAnswers}
key={currentQuestionIndex}
onPress={onInputChange}
/>

onFixTheErrorsLinkPressed={() => {
const errorFields = !_.isEmpty(errors) ? errors : formState.errorFields;
const focusKey = _.find(_.keys(inputRefs.current), (key) => _.keys(errorFields).includes(key));
const focusInput = inputRefs.current[focusKey].current;
// Dismiss the keyboard for non-text fields by checking if the component has the isFocused method, as only TextInput has this method.
if (typeof focusInput.isFocused !== 'function') {
Keyboard.dismiss();
}
// We subtract 10 to scroll slightly above the input
if (focusInput.measureLayout && typeof focusInput.measureLayout === 'function') {
// We measure relative to the content root, not the scroll view, as that gives
// consistent results across mobile and web
focusInput.measureLayout(formContentRef.current, (x, y) =>
formRef.current.scrollTo({
y: y - 10,
animated: false,
}),
);
}
// Focus the input after scrolling, as on the Web it gives a slightly better visual result
if (focusInput.focus && typeof focusInput.focus === 'function') {
focusInput.focus();
}
}}

What changes do you think we should make in order to solve the problem?

There are a few options. onFixTheErrorsLinkPressed could be refactored to include a check if the form input key is a radio button and focus its sibling element if so (or even moved to its own file given the size / extensibility). Another way to could be preserve the ref object for each item with useImperativeHandle, or applying styles or other indicators to show focus.

What alternative solutions did you explore? (Optional)

A longer-term proposal can be to assign the following components to the Typescript migration project (https://github.com/orgs/Expensify/projects/46):

@happy-devs
Copy link

@lanitochka17 This might need some more clarification from the internal team. Do they want the first option to just be focused in order to draw the user's attention, or actually checked? "activated" is a little unclear

Copy link

melvin-bot bot commented Dec 6, 2023

Triggered auto assignment to @dubielzyk-expensify (Design), see these Stack Overflow questions for more details.

@mountiny
Copy link
Contributor

mountiny commented Dec 6, 2023

@dubielzyk-expensify hello! Would you be able to weigh in and help us with the expected behaviour? I am not sure what our form guidelines say about this but feels odd to me that we should activate/select some option for the user in this case when it comes to validation.

Would we just move the focus on some of the radio buttons so pressing enter would select it?

Should we do nothing in the case? Its pretty clear what needs to be done to fix the error?

Eitherway we should add whatever we decide to the FORMS.md guidelines

@happy-devs
Copy link

This article has some interesting ideas

https://dev.to/andrewmcoupe/dont-fear-custom-radio-buttons-465a

@fedirjh
Copy link
Contributor

fedirjh commented Dec 6, 2023

@mountiny I think this is a regression from the recent Form refactor #32196 , Here is the difference between the old and new behavior :

Old New
Screenshot 2023-12-06 at 6 21 06 PM Screenshot 2023-12-06 at 6 21 30 PM

@kowczarz
Copy link
Contributor

kowczarz commented Dec 7, 2023

Hey @fedirjh! that was intentional UI change, here you can see the discusson #31401 (comment)

@mountiny good point, we didn't consider what should be the behaviour of the fix button. As soon as we will figure it out I can prepare a PR with update in the FORMS.md guidelines and an optional behaviour change of the button.

@melvin-bot melvin-bot bot added the Overdue label Dec 11, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Dec 11, 2023

Still awaiting design decision on #32520 (comment) , cc @dubielzyk-expensify

@melvin-bot melvin-bot bot removed the Overdue label Dec 11, 2023
Copy link

melvin-bot bot commented Dec 12, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@dubielzyk-expensify
Copy link
Contributor

Sorry for the late reply. In this instance, I think we shouldn't select anything so if they click next immediately, it's fine to throw an error. We'd want them to make an explicit choice, hence why a default selection is no bueno :)

@melvin-bot melvin-bot bot removed the Overdue label Dec 14, 2023
Copy link

melvin-bot bot commented Dec 18, 2023

@NicMendonca, @fedirjh, @dubielzyk-expensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Jan 11, 2024

Thanks @kowczarz that looks good.

Let's proceed with this proposal

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Jan 11, 2024

Triggered auto assignment to @blimpich, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@blimpich blimpich added the External Added to denote the issue can be worked on by a contributor label Jan 11, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 11, 2024
@blimpich blimpich removed Internal Requires API changes or must be handled by Expensify staff Help Wanted Apply this label when an issue is open to proposals by contributors labels Jan 11, 2024
Copy link

melvin-bot bot commented Jan 11, 2024

Current assignee @fedirjh is eligible for the External assigner, not assigning anyone new.

@blimpich blimpich assigned kowczarz and unassigned kowczarz Jan 11, 2024
Copy link

melvin-bot bot commented Jan 11, 2024

📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@blimpich blimpich assigned kowczarz and unassigned kowczarz Jan 11, 2024
@blimpich
Copy link
Contributor

Oh Melvin. Was trying to get it to assign @kowczarz as the contributor, but doesn't seem to want to do it. Not sure if that is important since @kowczarz is part of an expert agency. Either way, @kowczarz feel free to raise the PR and we can figure out how to wrangle Melvin if need be.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Jan 12, 2024
@melvin-bot melvin-bot bot changed the title [$500] Wallet - Fix the errors button is non-functional in Additional details [HOLD for payment 2024-01-26] [$500] Wallet - Fix the errors button is non-functional in Additional details Jan 19, 2024
Copy link

melvin-bot bot commented Jan 19, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 19, 2024
Copy link

melvin-bot bot commented Jan 19, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.27-1 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 2024-01-26. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jan 19, 2024

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:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@fedirjh] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@NicMendonca] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@fedirjh
Copy link
Contributor

fedirjh commented Jan 24, 2024

BugZero Checklist:

1. Open Expensify App
2. Login with expensifail account
3. Go to Settings > Wallet > Enable Wallet
4. Go through plaid verification flow
5. Follow the flow until Idology questions
6. Don't fill anything and press Save & continue
7. Verify that an Error appears without fix the errors alert

@NicMendonca
Copy link
Contributor

@fedirjh you've been paid - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Design Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests