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-06-13] [$2000] Fix auto-suggestion animation on Android #18974

Closed
puneetlath opened this issue May 15, 2023 · 59 comments
Closed
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@puneetlath
Copy link
Contributor

puneetlath commented May 15, 2023

The fix to the deploy blocker here broke animations for the auto-suggestion component on Android.

@Pujan92 reported this issue and suggested this fix.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01dca0ae0bdca5d804
  • Upwork Job ID: 1658195904748879872
  • Last Price Increase: 2023-05-25
@puneetlath puneetlath 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 May 15, 2023
@puneetlath puneetlath self-assigned this May 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

Current assignee @puneetlath is eligible for the Bug assigner, not assigning anyone new.

@melvin-bot melvin-bot bot changed the title Fix auto-suggestion animation on Android [$1000] Fix auto-suggestion animation on Android May 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 15, 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

@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

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

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

melvin-bot bot commented May 15, 2023

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

@s77rt
Copy link
Contributor

s77rt commented May 15, 2023

@puneetlath Did you link the correct comment? I don't see any proposal 😅

@Pujan92
Copy link
Contributor

Pujan92 commented May 15, 2023

@s77rt It was my fault as I deleted it bcoz it wasn't solving the app crash issue. #18842 (comment)

@s77rt
Copy link
Contributor

s77rt commented May 15, 2023

@Pujan92 That's a fine of $5000 😁.

@melvin-bot melvin-bot bot added the Overdue label May 18, 2023
@s77rt
Copy link
Contributor

s77rt commented May 18, 2023

Not overdue. Waiting for proposals

@melvin-bot melvin-bot bot removed the Overdue label May 18, 2023
@allroundexperts
Copy link
Contributor

Update: Still exploring the react-native-reanimated library. Now hoping to have a proposal over the weekend.

@allroundexperts
Copy link
Contributor

Proposal

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

Add auto suggestion menu animation

What is the root cause of that problem?

Trying to switch to react-native-reanimated as agreed here.

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

First of all, we need to remove the existing animation here. Next, in the BaseAutoCompleteSuggestions component, we have to change the wrapping View to Animated.View. The style props to the former View should be replaced with:

            style={[styles.autoCompleteSuggestionsContainer, animatedStyles]}

animatedStyles is defined as:

const animatedItemsHeight = useSharedValue(0);

    const animatedStyles = useAnimatedStyle(() => {
        const optionalPadding = props.shouldIncludeReportRecipientLocalTimeHeight ? CONST.RECIPIENT_LOCAL_TIME_HEIGHT : 0;
        const padding = CONST.AUTO_COMPLETE_SUGGESTER.SUGGESTER_PADDING - optionalPadding;

        // The suggester is positioned absolutely within the component that includes the input and RecipientLocalTime view (for non-expanded mode only). To position it correctly,
        // we need to shift it by the suggester's height plus its padding and, if applicable, the height of the RecipientLocalTime view.
        return {
            overflow: 'hidden',
            top: -(animatedItemsHeight.value + padding),
        };
    });

The animation created above can be triggered by adding the following line below the rowHeight variable definition:

    animatedItemsHeight.value = withTiming(rowHeight, {duration: 200});

Result

Screen.Recording.2023-05-22.at.2.59.52.AM.mov
Screen.Recording.2023-05-22.at.3.00.16.AM.mov
Screen.Recording.2023-05-22.at.3.00.38.AM.mov

What alternative solutions did you explore? (Optional)

None

@melvin-bot melvin-bot bot added the Overdue label May 21, 2023
@s77rt
Copy link
Contributor

s77rt commented May 21, 2023

@allroundexperts Thanks for the proposal. Can you please explain the problem that we are trying to solve 😅? The animation on Android seems to me same as Web. Am I missing something?

@melvin-bot melvin-bot bot removed the Overdue label May 21, 2023
@allroundexperts
Copy link
Contributor

@allroundexperts Thanks for the proposal. Can you please explain the problem that we are trying to solve 😅? The animation on Android seems to me same as Web. Am I missing something?

@s77rt We're trying to add an animation to the autocomplete menu. We previously had a animation but it caused app to crash on android ref. It was a deploy blocker so I quickly fixed the crash by changing the place where the animation was being called. It turned out that the new place that I put the animation actually resulted in the animation not being triggered at all. As such, we decided to ditch the previous method of animating the autocomplete menu and decided to use the react-native-reanimated library for creating this animation. This proposal is doing just that.

@s77rt
Copy link
Contributor

s77rt commented May 22, 2023

@allroundexperts Thanks! That makes sense but the animations looks wrong. The whole view is moving when the suggestion list changes from displaying one item to displaying multiples. Check the video below and observe how the view get reset and starts the bottom.

Kooha-2023-05-22-11-34-04.mp4

@allroundexperts
Copy link
Contributor

@allroundexperts Thanks! That makes sense but the animations looks wrong. The whole view is moving when the suggestion list changes from displaying one item to displaying multiples. Check the video below and observe how the view get reset and starts the bottom.

Kooha-2023-05-22-11-34-04.mp4

What's the expected behaviour here @s77rt? I'm animating the height of the menu.

@allroundexperts
Copy link
Contributor

@shawnborton Can you also share your feedback please?

@s77rt
Copy link
Contributor

s77rt commented May 22, 2023

@allroundexperts I'm not totally sure how should this be animated but probably not as it's now. It feels broken.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 6, 2023
@melvin-bot melvin-bot bot changed the title [$2000] Fix auto-suggestion animation on Android [HOLD for payment 2023-06-13] [$2000] Fix auto-suggestion animation on Android Jun 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.24-5 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-06-13. 🎊

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 @Pujan92
  • Contributor that fixed the issue @aswin-s
  • Contributor+ that helped on the issue and/or PR @s77rt

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 Jun 6, 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:

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

@s77rt
Copy link
Contributor

s77rt commented Jun 6, 2023

@puneetlath puneetlath removed their assignment Jun 8, 2023
@puneetlath puneetlath added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jun 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 8, 2023

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 8, 2023
@melvin-bot

This comment was marked as duplicate.

@puneetlath
Copy link
Contributor Author

Upwork contracts sent. Checklist looks good to me.

@michaelhaxhiu re-assigning to you for payment while I'm OOO next week.

@puneetlath puneetlath self-assigned this Jun 8, 2023
@melvin-bot melvin-bot bot added the Overdue label Jun 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

@puneetlath, @aswin-s, @michaelhaxhiu, @s77rt Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@michaelhaxhiu
Copy link
Contributor

tomorrow is payday

@michaelhaxhiu
Copy link
Contributor

No speed bonus here

@michaelhaxhiu
Copy link
Contributor

all parties paid.

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Jun 22, 2023
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 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

7 participants