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

Poc/split navs #49539

Draft
wants to merge 277 commits into
base: main
Choose a base branch
from

Conversation

adamgrzybowski
Copy link
Contributor

Details

Fixed Issues

$
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • 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)
    • 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).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • 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)
  • I followed proper code patterns (see Reviewing the code)
    • 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)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • 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.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • 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.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • 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
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • 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.
  • 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)
  • 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.
  • 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.
  • 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:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • 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.
  • 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

This comment has been minimized.

@mountiny
Copy link
Contributor

trim.EDC2126F-EA24-40D4-87A4-E252B86DA87A.MOV

There are no page animations in the settings stack

@JmillsExpensify
Copy link

I took this for a quick spin on Chrome/web and it worked fairly well, including properly accounting for the browser back case. One thing I noticed, though I'm not sure if it's related to this PR or not: I occasionally experienced performance issues, where the responsiveness of the page would slow down and almost freeze up for a second or two. I saw this on the Settings pages. I can do a profile trace if helpful, just let me know.

@mountiny
Copy link
Contributor

Definitely performance is something we need to keep in mind

@adamgrzybowski
Copy link
Contributor Author

@mountiny If I understand correctly this is something that we want. Those screens have the bottom tab bar. Other bottom tab screens don't have animations from the beginning.

@JmillsExpensify we are still working on adjusting performance tricks for these changes. Please point us to flows that feels slower than before so we can investigate it 🙇

@mountiny
Copy link
Contributor

If I understand correctly this is something that we want. Those screens have the bottom tab bar. Other bottom tab screens don't have animations from the beginning.

Hmm, I dont think we want that, going deeper in the settings should have animations, same as going to a report from LHN has animation @Expensify/design @trjExpensify @JmillsExpensify

@mountiny
Copy link
Contributor

@adamgrzybowski Wanted to report here as well that I think the performance on web for me is gradually getting worse and this morning it's noticeably slow, you can see it here as well which I have recorded for a different bug

Screen.Recording.2024-09-25.at.10.12.04.mp4

@adamgrzybowski
Copy link
Contributor Author

Hmm, I dont think we want that, going deeper in the settings should have animations, same as going to a report from LHN has animation

Screen.Recording.2024-09-25.at.11.52.59.mov

But doesn't that look weird? You can see how one bottom tab bar covers the previous one with animation.

cc: @mountiny

@trjExpensify
Copy link
Contributor

trjExpensify commented Sep 25, 2024

Yeah, I think that does look weird. The bottom tab bar feels like it's part of page being animated in, rather than persisting across the different pages.

@dubielzyk-expensify
Copy link
Contributor

Yeah that looks a bit off. The view should go over the bottom navigation instead. Though there's another issue to put the bottom navigation on top in workspaces.

Which should give us this:

CleanShot.2024-09-26.at.11.06.21.mp4

@mountiny
Copy link
Contributor

I agree that the bottom tab should not animate if it's staying on another page, too. I would defer to @dubielzyk-expensify and the design team to see how we want to handle this.

@dannymcclain
Copy link
Contributor

The video that Jon shared is what I would expect and prefer. But if that's not technically feasible at the moment, I would rather have the bottom tabs than the animation.

@adamgrzybowski
Copy link
Contributor Author

#49539 (comment) is what I would expect and prefer. But if that's not technically feasible at the moment, I would rather have the bottom tabs than the animation.

That's the problem. It may be tough to implement and if that's okay I would investigate this as follow-up. But let me explain why this is problematic at all.

Previously, we had a navigator that displayed a bottom tab bar over every screen within itself. This approach did not allow us to place the bottom tab bar on every screen in the app. Only on screens in this particular navigator. And it definitely did not allow us to display the bottom tab bar conditionally, as in the "Workspaces screen" case.

We decided to render the bottom on every screen that requires it instead. This approach gives us a lot of flexibility.

We did know that we couldn't create an animation of sliding screen with the bottom tab onto another screen with the bottom tab. But we assumed that as in current use cases, we won't animate screens with the bottom tab so that's not a problem.

Let's assume that we want to have this animation and we won't display it on every page but we will figure out a way to do it smarter.

#49539 (comment)

All screens that you can open from the menu visible in the video above are on the same level. Screen containing this menu is also on the same level. If that doesn't make sense, please consider the fact that we also need to handle the wide layout with this structure.

That means they are rendered with one <StackView />. In the case of workspaces screen and settings root we would need to render the bottom tab bar on top of this stack view. For other screens, we would need to render it somewhere between these cards to have proper animation. But we can't really put anything between these cards. The task will be even harder given the incoming which leaves us with even less wiggle room.

I am not saying it is impossible. I just want to give you context on how complex is adding this little animation. I have a few tricks in my mind but I would rather focus on this after migrating to the new structure.

@adamgrzybowski
Copy link
Contributor Author

When it comes to performance. I started digging and couldn't reproduce the laggy RHP that you filmed @mountiny. I might have to try the high traffic account or something like that.

However, I discovered a different issue when switching to the "Reports" tab.

What you can notice in our POC is that you can't see the skeleton loading. The first render of the report screen is delayed in comparison to the main.

before.mp4

It doesn't look like a big delay but it feels laggy when you click it yourself.

I investigate that and it looks like this doesn't happen on the main only by coincidence. I figured out a solution for that and tomorrow I will work on PR that we could merge to the main. It should help with the initial render of heavy screens in general and improve the user experience.

Below you can see the test result

after.mp4

@mountiny
Copy link
Contributor

I am fine exploring the animation later

@adamgrzybowski, you should definitely test with a high-traffic account at least; you could even try the heavy performance testing account we provided to SWM. Testing with a fresh account is not representative of the users we care about the most.

@adamgrzybowski
Copy link
Contributor Author

FYI: I played around with a solution I found yesterday regarding performance, and it may need more work and investigation. For now, I'll focus on other work left for this PR and get back to perf closer to review.

@adamgrzybowski
Copy link
Contributor Author

@mountiny We finally implemented the bottom tab with proper animations and swipes back. It's time to test if it works as you expect.

Conflicts should be resolved. We want to do a final self review, but there shouldn't be any work left before removing the draft label besides removing/adding some comments and improving a few names.

I think there were at least a few other issues that this PR was supposed to solve. Let me know if you remember any and I will look for them in the meantime. Thanks for your patience! 🙇

@adamgrzybowski
Copy link
Contributor Author

Screen.Recording.2024-12-20.at.16.00.58.mp4

@shawnborton
Copy link
Contributor

Amazing! Let me run a test build quickly.

Copy link
Contributor

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

Copy link
Contributor

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

Android 🤖 iOS 🍎
https://ad-hoc-expensify-cash.s3.amazonaws.com/android/49539/index.html ❌ FAILED ❌
Android The QR code can't be generated, because the iOS build failed
Desktop 💻 Web 🕸️
https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/49539/NewExpensify.dmg https://49539.pr-testing.expensify.com
Desktop Web

👀 View the workflow run that generated this build 👀

@shawnborton
Copy link
Contributor

It looks like the not-found view is a bit borked on desktop? Notice how it has a back button in the main pane and the empty state illustration isn't centered:
CleanShot 2024-12-20 at 10 59 28@2x

@shawnborton
Copy link
Contributor

shawnborton commented Dec 20, 2024

Not related to navigation but our Categories simple illustration got borked somehow? Are we passing colors through or something that we shouldn't be?
CleanShot 2024-12-20 at 11 04 02@2x

Same with others too:
CleanShot 2024-12-20 at 11 04 49@2x

@shawnborton
Copy link
Contributor

Otherwise this is feeling pretty good to me. Bummer that iOS builds are failing but I tried on mWeb and things seem to be working as expected. Curious what the rest of @Expensify/design thinks as well as @mountiny

@adamgrzybowski
Copy link
Contributor Author

There were a lot of merge conflicts, so maybe we broke something there. I'll check it out. Thank you for finding these issues

@dannymcclain
Copy link
Contributor

Other than the issues Shawn pointed out (and obviously not being able to test on iOS) it's feeling pretty good to me too. This is such a good improvement IMO.

@adamgrzybowski
Copy link
Contributor Author

@shawnborton there may be something wrong with the build. I don't see problems with icons locally
image

@adamgrzybowski
Copy link
Contributor Author

Same for the issue with not found page
image

@shawnborton
Copy link
Contributor

Hmm no idea there, though that is concerning that dev and the build are so out of sync like that?

@adamgrzybowski
Copy link
Contributor Author

Yeah, that's really weird. Is the screenshot with the not found page a screenshot of the desktop electron version?

@shawnborton
Copy link
Contributor

Nope, that was from Chrome web.

@mountiny
Copy link
Contributor

Could be some caching issue on the build hard to say, i can kick off a new one

Copy link
Contributor

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

Copy link
Contributor

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

Android 🤖 iOS 🍎
https://ad-hoc-expensify-cash.s3.amazonaws.com/android/49539/index.html ❌ FAILED ❌
Android The QR code can't be generated, because the iOS build failed
Desktop 💻 Web 🕸️
https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/49539/NewExpensify.dmg https://49539.pr-testing.expensify.com
Desktop Web

👀 View the workflow run that generated this build 👀

@shawnborton
Copy link
Contributor

Still getting the not found found page weirdness when I go here: https://49539.pr-testing.expensify.com/not-found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.