App icon indicating copy to clipboard operation
App copied to clipboard

fix: bottom tab transitions duration

Open kirillzyusko opened this issue 1 year ago • 10 comments

Explanation of Change

Reduced animation transition to 150ms to make it faster.

Fixed Issues

$ https://github.com/Expensify/App/issues/53347 PROPOSAL: N/A

Tests

  • go through the tabs on Android/iOS and be sure animation doesn't take too long to switch the scene

Offline tests

N/A

QA Steps

  • go through the tabs on Android/iOS and be sure animation doesn't take too long to switch the scene

PR Author Checklist

  • [x] I linked the correct issue in the ### Fixed Issues section above
  • [x] I wrote clear testing steps that cover the changes made in this PR
    • [x] I added steps for local testing in the Tests section
    • [x] I added steps for the expected offline behavior in the Offline steps section
    • [x] I added steps for Staging and/or Production testing in the QA steps section
    • [x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • [x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • [x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • [x] I included screenshots or videos for tests on all platforms
  • [x] I ran the tests on all platforms & verified they passed on:
    • [x] Android: Native
    • [x] Android: mWeb Chrome
    • [x] iOS: Native
    • [x] iOS: mWeb Safari
    • [x] MacOS: Chrome / Safari
    • [x] MacOS: Desktop
  • [x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • [x] I followed proper code patterns (see Reviewing the code)
    • [x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • [x] I verified that comments were added to code that is not self explanatory
    • [x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • [x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • [x] If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • [x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • [x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • [x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • [x] I verified the JSDocs style guidelines (in STYLE.md) were followed
  • [x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • [x] I followed the guidelines as stated in the Review Guidelines
  • [x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • [x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • [x] I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • [x] I verified that if a function's arguments changed that all usages have also been updated correctly
  • [x] If any new file was added I verified that:
    • [x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • [x] If a new CSS style is added I verified that:
    • [x] A similar style doesn't already exist
    • [x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • [x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • [x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • [x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • [x] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • [x] If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • [x] I verified that all the inputs inside a form are aligned with each other.
    • [x] I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • [x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • [x] I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • [x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native

https://github.com/user-attachments/assets/e25f8a69-ec9a-49eb-9e52-a8015159cd6b

Android: mWeb Chrome

https://github.com/user-attachments/assets/f76c038b-ee83-4aa1-99a7-3e4e6c71625a

iOS: Native

https://github.com/user-attachments/assets/38c54292-141c-412a-9ab1-5c60de146cde

iOS: mWeb Safari

https://github.com/user-attachments/assets/413768b8-04ba-40d5-b659-2ea94fcd4fee

MacOS: Chrome / Safari

https://github.com/user-attachments/assets/ff054fe6-7e4e-4be5-9216-cf133846716c

MacOS: Desktop

https://github.com/user-attachments/assets/e765f6fc-e1ba-4262-9e59-cc19681c220a

kirillzyusko avatar Dec 09 '24 13:12 kirillzyusko

@dannymcclain @DylanDylann One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

melvin-bot[bot] avatar Dec 09 '24 13:12 melvin-bot[bot]

@mountiny may I ask you to trigger a build and ask design team to make tests to be sure that the duration is okay now? 😊

kirillzyusko avatar Dec 09 '24 13:12 kirillzyusko

🚧 @dannymcclain has triggered a test build. You can view the workflow run here.

github-actions[bot] avatar Dec 09 '24 14:12 github-actions[bot]

:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube:

Android :robot: iOS :apple:
https://ad-hoc-expensify-cash.s3.amazonaws.com/android/53754/index.html https://ad-hoc-expensify-cash.s3.amazonaws.com/ios/53754/index.html
Android iOS
Desktop :computer: Web :spider_web:
https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/53754/NewExpensify.dmg https://53754.pr-testing.expensify.com
Desktop Web

:eyes: View the workflow run that generated this build :eyes:

github-actions[bot] avatar Dec 09 '24 14:12 github-actions[bot]

@DylanDylann @kirillzyusko Could you please add recordings here? I cannot run the ad-hoc build unfortunately.

mountiny avatar Dec 09 '24 15:12 mountiny

Sure, I will do it soon

DylanDylann avatar Dec 09 '24 15:12 DylanDylann

Could you please add recordings here?

Ooops, I somehow uploaded wrong recordings 😔 I uploaded correct recordings now!

kirillzyusko avatar Dec 09 '24 15:12 kirillzyusko

@kirillzyusko the test failed

DylanDylann avatar Dec 10 '24 09:12 DylanDylann

@DylanDylann tests fixed!

kirillzyusko avatar Dec 10 '24 12:12 kirillzyusko

@DylanDylann, what is your eta for this one?

mountiny avatar Dec 10 '24 12:12 mountiny

@dannymcclain Could you make a build again and test on that build to ensure the duration is fine now?

DylanDylann avatar Dec 11 '24 05:12 DylanDylann

From my testing, I don't see a significant difference in the behavior compared to the main branch when clicking on bottom bar tab

DylanDylann avatar Dec 11 '24 10:12 DylanDylann

From my testing, I don't see a significant difference in the behavior compared to the main branch when clicking on bottom bar tab

@DylanDylann did you make a clean installation of node_modules to apply a modified patch and then re-assembled the app?

kirillzyusko avatar Dec 11 '24 11:12 kirillzyusko

🚧 @mountiny has triggered a test build. You can view the workflow run here.

github-actions[bot] avatar Dec 11 '24 11:12 github-actions[bot]

:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube:

Android :robot: iOS :apple:
https://ad-hoc-expensify-cash.s3.amazonaws.com/android/53754/index.html https://ad-hoc-expensify-cash.s3.amazonaws.com/ios/53754/index.html
Android iOS
Desktop :computer: Web :spider_web:
https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/53754/NewExpensify.dmg https://53754.pr-testing.expensify.com
Desktop Web

:eyes: View the workflow run that generated this build :eyes:

github-actions[bot] avatar Dec 11 '24 12:12 github-actions[bot]

Would love to have @dubielzyk-expensify and @shawnborton test the latest build too. Testing the iOS ad hoc build, it still feels a little slow to me? It also kinda feels like the transition to the search tab takes longer than the other tabs... but maybe that's just in my head?

It doesn't feel bad to me, but it doesn't feel just right either. Generally I think it's shippable but could still use some improvement.

dannymcclain avatar Dec 11 '24 14:12 dannymcclain

It also kinda feels like the transition to the search tab takes longer than the other tabs... but maybe that's just in my head?

This is a separate issue. We tracked it here https://github.com/Expensify/App/issues/53818

This PR just focuses on reducing animation duration (I haven't optimized slow rendering of Search page in this PR, we decided that it would be better to solve different problems in different PRs).

kirillzyusko avatar Dec 11 '24 14:12 kirillzyusko

@kirillzyusko Ahh thanks, I had the same thought with @dannymcclain

DylanDylann avatar Dec 11 '24 14:12 DylanDylann

Hmm I think things are still broken? I was consistently tapping back and forth between Inbox and Settings and then the bottom tabs became totally unresponsive and now I can't change the tabs anymore. Can you reproduce on your end too?

shawnborton avatar Dec 11 '24 19:12 shawnborton

When it works though, I think it feels better? Honestly I wouldn't hate it a tad faster though I think.

shawnborton avatar Dec 11 '24 19:12 shawnborton

Tested it on both Android and iOS:

  • On iOS the transition timing looks almost fine, but the delay of the tap is now even more evident
  • On Android the delay can be seen even more clearly:

https://github.com/user-attachments/assets/74fdba84-cfe4-426f-8053-e55e096f0616

Part of me wonders if we should set the animation to like 50ms or lower (or even remove it), then figure out the timing of the tap -> animation start -> animation end. That way we can figure out what feels sluggish.

dubielzyk-expensify avatar Dec 12 '24 01:12 dubielzyk-expensify

On Android the delay can be seen even more clearly:

Yes, because Android are typically less optimized and works slower comparing to iOS.

Part of me wonders if we should set the animation to like 50ms or lower (or even remove it), then figure out the timing of the tap -> animation start -> animation end. That way we can figure out what feels sluggish.

Yeah, for testing purposes we can set duration to 0 or completely remove the animation. But again, optimization of transitions should be made in a separate PR. The current problem is that after native-stack PR merge screens in bottom tabs are getting re-created whenever user changes them, but these screens should be created just once and then we should just change zIndex to show a correct screens (in this case transitions should be immediate).

Maybe @chrispader can shed more light on why the behavior has been changed 👀

kirillzyusko avatar Dec 12 '24 09:12 kirillzyusko

Maybe @chrispader can shed more light on why the behavior has been changed 👀

I think we've been discussing this at some point in the Native Stack PR too, i think this delay is mostly due to internals in the Native Stack implementation compared to stack navigator.

You are right, but I think it's only Search tab that doesn't switch immediately, right? Inbox/Settings switch happens almost immediately. When I debugged Search page it had some slow re-renders, so I think it's causing this 😔

From what i've seen, i agree with @kirillzyusko, i think this can mostly be seen for the SearchPage which is especially slow to render.

What we can try is loading the bottom tab screens statically instead of lazily (component prop instead of getComponent in the navigator). This will at least speed it up for the first tap. We can of course reduce the fade animation time, but the slight delay will still be noticeable, especially for the Search Page

chrispader avatar Dec 13 '24 09:12 chrispader

Potentially problem with slow tab switching has been fixed in https://github.com/Expensify/App/pull/54030

kirillzyusko avatar Dec 16 '24 11:12 kirillzyusko

Yes, because Android are typically less optimized and works slower comparing to iOS.

Testing it on iPhone 15 Pro and I'm still seeing a pretty big lag.

I don't know the technicals deeply but what you're all saying above sounds worth looking into

dubielzyk-expensify avatar Dec 17 '24 05:12 dubielzyk-expensify

The current problem is that after native-stack PR merge screens in bottom tabs are getting re-created whenever user changes them, but these screens should be created just once and then we should just change zIndex to show a correct screens (in this case transitions should be immediate).

@kirillzyusko If that, we should mark this PR as NO QA and move test step to https://github.com/Expensify/App/pull/54030

DylanDylann avatar Dec 17 '24 08:12 DylanDylann

@kirillzyusko When clicking on the search tab and then clicking on the settings or chat tab, it is unresponsive

https://github.com/user-attachments/assets/c1559ad4-f94e-4d12-bfb2-ae985534f4d8

DylanDylann avatar Dec 17 '24 08:12 DylanDylann

@DylanDylann the same problem exists on main as well, so I don't think it should prevent this PR from being merged:

https://github.com/user-attachments/assets/17c1e14f-b924-4768-b03e-1826a4ba0506

kirillzyusko avatar Dec 17 '24 10:12 kirillzyusko

If that, we should mark this PR as NO QA and move test step to https://github.com/Expensify/App/pull/54030

Okay, I marked it as NoQA 👍

cc @mountiny

kirillzyusko avatar Dec 17 '24 10:12 kirillzyusko

@DylanDylann can you please complete the checklist and testing?

mountiny avatar Dec 17 '24 23:12 mountiny