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 2023-10-09] [$1000] The transition animation doesn't work for the request money page #22388

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

Comments

@kavimuru
Copy link

kavimuru commented Jul 6, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


HOLD on #26415

Action Performed:

  1. Click on the fab button and select request money
  2. Enter an amount
  3. Click on the currency or on next
  4. Watch what happens

Expected Result:

The new page opens with an horizontal animation

Actual Result:

The new page opens without animation

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.37-2
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
Notes/Photos/Videos: Any additional supporting documentation

2023-07-05.19-26-27.mp4
Recording.1207.mp4

Expensify/Expensify Issue URL:
Issue reported by: @ShogunFire
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688606747153309

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01571ed2ce05eced7f
  • Upwork Job ID: 1679102953265299456
  • Last Price Increase: 2023-08-02
  • Automatic offers:
    • tienifr | Contributor | 26776245
    • ShogunFire | Reporter | 26776250
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 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

@ShogunFire
Copy link
Contributor

ShogunFire commented Jul 7, 2023

Proposal

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

When we click on the currency or next in requestmoney page there is no horizontal sliding animation

What is the root cause of that problem?

The root cause of that problem is that in:

  • IOUCurrencySelection
  • MoneyRequestParticipantsSelector
  • MoneyRequestParticipantsSplitSelector

we use an OptionsSelector for example here

<OptionsSelector
sections={sections}
onSelectRow={confirmCurrencySelection}
value={searchValue}
onChangeText={setSearchValue}
textInputLabel={translate('common.search')}
headerMessage={headerMessage}
safeAreaPaddingBottomStyle={safeAreaPaddingBottomStyle}
initiallyFocusedOptionKey={initiallyFocusedOptionKey}
shouldHaveOptionSeparator
/>

By default OptionSelectors focus the input here:

And that can cause the transition animation to be stopped.

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

We can use the same method that was used here https://github.com/Expensify/App/pull/22621/files to focus the input, for our case we are not in the same file that the input when we declare the screenwrapper so we will have to use forward ref in BaseOptionSelector.

The problem with that solution is that the input is not focused when we reload the page because onEntryTransitionEnd is never called.

In ScreenWrapper before we declare the listener for the end of the transition we can check the active route index in the stack, if it is 0 it means that we accessed this page without transition and we can call onEntryTransitionEnd directly without passing by the listener

What alternative solutions did you explore? (Optional)

We can set up a boolean isTransitionHappening to true by listening to the event transitionStart, I think we should do that in Navigation. And test if that boolean is true before setting up the listener for the end of the transition

@chiragxarora
Copy link
Contributor

hmmm weird, I think we never had shouldDelayFocus on these, was going through the recent commits on the file and seems like something got wrong after navigation refactor maybe?

@ShogunFire
Copy link
Contributor

@chiragxarora I am not sure but maybe that has to do with that PR where we added withNavigationFocus: https://github.com/Expensify/App/pull/19824/files

@melvin-bot melvin-bot bot added the Overdue label Jul 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 10, 2023

@JmillsExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@JmillsExpensify
Copy link

Hmm, yeah I'm not sure how/why these pages stopped being animated with the page coming in from the right. Regardless, I agree we should consistently animate, so I'm opening this one up to the community.

@melvin-bot melvin-bot bot removed the Overdue label Jul 12, 2023
@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label Jul 12, 2023
@melvin-bot melvin-bot bot changed the title The transition animation doesn't work for the request money page [$1000] The transition animation doesn't work for the request money page Jul 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01571ed2ce05eced7f

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

melvin-bot bot commented Jul 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

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

@b4s36t4
Copy link
Contributor

b4s36t4 commented Jul 12, 2023

Proposal

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

The transition animation doesn't work for the request money page

What is the root cause of that problem?

Root Cause of the issue is that we have an input inside the modal which is having autoFocus prop default to true which is causing and breaking the animation. Ideally we should only focus the input or render anything at all inside the modal only after transition done.

Existing issues like #22036 does possess same problem like this.

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

The simple solution we can use is adding shouldDelayFocus but according to the other issues I followed up shouldDelayFOcus can't be used because of setTimeOut used inside the logic. Even more to this if the list of user-contacts is high (if it's high traffic account) this issue comes again.

To resolve this we should manually handle focus of input.

Changes

Here we should add autoFocus={false} to disable auto-focus.

From here

{({safeAreaPaddingBottomStyle}) => (

We can take the state didScreenTransitionEnd and pass it to the

here.

Like the following

autoFocus={didScreenTransitionEnd}

Using this inside these two components

We create ref maybe like

const optionRef = useRef(null)

and assign this ref here

using the below code

ref={(element) => optionRef.current = element}

And when we see the props.autoFocus as true within componentDidUpdate or useEffect we do autoFocus using

optionRef.current.textInput.focus()

Also if we have a high traffic account which does have multiple user contacts in that case also the transition could get effected to fix this we should add a check here as well

const isOptionsDataReady = ReportUtils.isReportDataReady() && OptionsListUtils.isPersonalDetailsReady(this.props.personalDetails);
To check weather transition ended or not then only we do show options until then loader will be shown.

What alternative solutions did you explore? (Optional)

I have seen this issue happens in other places as well, we could consider conditional rendering here

<SafeAreaConsumer>

Adding a conditional rendering based on the state didScreenTransitionEnd could fix this issue at all maybe.

Result

kk.mp4

@chiragxarora
Copy link
Contributor

chiragxarora commented Jul 12, 2023

@b4s36t4 did this work for you?
I tried exactly same thing but I was unable to animate... I see you haven't added the results video

@b4s36t4
Copy link
Contributor

b4s36t4 commented Jul 12, 2023

It was working for me.

@chiragxarora
Copy link
Contributor

great!
maybe I missed something

@b4s36t4
Copy link
Contributor

b4s36t4 commented Jul 12, 2023

@chiragxarora Updated the proposal with the video.

@ShogunFire
Copy link
Contributor

Hello @b4s36t4 can you also check my proposal here: #22388 (comment)

We use onDelayFocus everywhere so I don't understand @chiragxarora comment about it.

@b4s36t4
Copy link
Contributor

b4s36t4 commented Jul 12, 2023

I think he's saying we never did added shouldDelayFocus prop anywhere in the component to make it slide. Yes I see your proposal works, but it's work around #22271 please see this issue :( it did rejected for me because of shouldDelayFocus.

@tienifr
Copy link
Contributor

tienifr commented Jul 12, 2023

This has the same RCA as #22271, also my proposal can solve this as well with some more configurations.

@allroundexperts Do you think we should combine all the autofocus-block-transition issues and fix them all at once as you've pointed out in #22271 (comment)?

cc @chiragxarora

@allroundexperts
Copy link
Contributor

This has the same RCA as #22271, also my proposal can solve this as well with some more configurations.

@allroundexperts Do you think we should combine all the autofocus-block-transition issues and fix them all at once as you've pointed out in #22271 (comment)?

cc @chiragxarora

I think we should combine them, yes.

@tienifr
Copy link
Contributor

tienifr commented Jul 13, 2023

Update: So far I have found three affected pages:

  • RequestMoneyConfirmPage
  • SplitBillDetailsPage: select participants
  • Pronouns: change pronouns page

Will dig deeper tomorrow.

@ShogunFire
Copy link
Contributor

ShogunFire commented Jul 13, 2023

By the way if I understand correctly someone is trying to fix this problem in every page at the same time here: #19530 (comment)

@melvin-bot melvin-bot bot added the Overdue label Sep 28, 2023
@roryabraham
Copy link
Contributor

@JmillsExpensify this issue appears to be eligible for the #urgency bonus. The PR was created, tested, and C+ approved within 3 working days of assignment. It was only delayed by me, so I think it's fair that @tienifr and @eVoloshchak get the urgency bonus. Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Sep 29, 2023
@mountiny

This comment was marked as off-topic.

@melvin-bot melvin-bot bot added the Overdue label Oct 1, 2023
@tienifr
Copy link
Contributor

tienifr commented Oct 1, 2023

@mountiny Did you comment on the wrong issue? The regression issues were 28417 and 26945. Not this one.

@melvin-bot melvin-bot bot removed the Overdue label Oct 1, 2023
@mountiny
Copy link
Contributor

mountiny commented Oct 1, 2023

oops, yes, but speaking of devil this deploy blocker seems highly related to this PR/issue #28523 can you have a look @tienifr @eVoloshchak

@melvin-bot
Copy link

melvin-bot bot commented Oct 1, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@mountiny
Copy link
Contributor

mountiny commented Oct 2, 2023

Coming back from this issue #28523 the PR linked is already in staging, but the request money page transitions are not working. also noticed different bug which I will report in expensify bugs

Screen.Recording.2023-10-02.at.16.06.08.mp4

@tienifr
Copy link
Contributor

tienifr commented Oct 2, 2023

@mountiny Hmm I'm not sure about your expectations for transition animation here? I see that it's working fine. Can you elaborate more?

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Oct 2, 2023
@melvin-bot melvin-bot bot changed the title [$1000] The transition animation doesn't work for the request money page [HOLD for payment 2023-10-09] [$1000] The transition animation doesn't work for the request money page Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 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-09. 🎊

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.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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:

  • [@eVoloshchak] The PR that introduced the bug has been identified. Link to the PR:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] Determine if we should create a regression test for this bug.
  • [@eVoloshchak] 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.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@mountiny
Copy link
Contributor

mountiny commented Oct 2, 2023

@tienifr for example on the 14th second you can see the page blinks completely, in others you can see the transition is not smooth

I understand if that is related to more generic issues such as too heavy rerenders, but wanted to raise that

@JmillsExpensify
Copy link

I believe based on the above the correct payment summary is:

@mountiny Did you potentially want to ask for a follow-up PR, or are you good with this summary?

@mountiny
Copy link
Contributor

mountiny commented Oct 9, 2023

We are good here

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Oct 9, 2023
@JmillsExpensify
Copy link

Issue reporter and contributor have been paid. @eVoloshchak Please complete the BZ checklist and add a request via NewDot so we can get this issue closed. Thanks!

@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Refactor/23149 money request page #23979
  • 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: https://github.com/Expensify/App/pull/23979/files#r1354565648
  • 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: this has already been discussed and there is now a universal way to autofocus a TextInput, which resolves the problem we were having
  • Determine if we should create a regression test for this bug.
    Is it easy to test for this bug? Yes
    Is the bug related to an important user flow? Yes
    Is it an impactful bug? No

    The bug has near zero impact and doesn't prevent user from using the app, I don't think a regression test is needed in this case

@JmillsExpensify
Copy link

$1,500 payment approved for @eVoloshchak based on BZ summary.

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. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

10 participants