FIX: Performance and heat issues on the 'Troubleshoot' page#38093
FIX: Performance and heat issues on the 'Troubleshoot' page#38093hayata-suenaga merged 6 commits intoExpensify:mainfrom
Conversation
|
@hoangzinh Please 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] |
src/components/Lottie/index.tsx
Outdated
| // If the image fails to load or app is in background state, we'll just render an empty view | ||
| // using the fallback in case of a Lottie error or (isFocused || isBackground) to prevent | ||
| // memory leaks, see issue: https://github.com/Expensify/App/issues/36645 | ||
| if (isError || !isFocused || appState.isBackground) { |
There was a problem hiding this comment.
Sorry @ikevin127 I think we need to remove isFocus. Otherwise, in Web the Lottie animation of About page is hidden when we open Troubleshoot page

There was a problem hiding this comment.
@hoangzinh Good catch, removed it.
From my tests I could not see any difference in performance with the additional !isFocused, so removing it does not affect the performance of the proposed fix any way 👍
Reviewer Checklist
Screenshots/VideosAndroid: NativeXRecorder_12032024_210458.mp4Android: mWeb ChromeScreen.Recording.2024-03-12.at.20.54.25.android.chrome.moviOS: NativeRPReplay_Final1710254000.mp4iOS: mWeb SafariScreen.Recording.2024-03-12.at.20.57.14.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-03-12.at.21.00.46.web.movMacOS: DesktopScreen.Recording.2024-03-12.at.21.02.17.desktop.mov |
|
🚨 Typecheck fail caused by PR #37956, confirmed in #37956 (comment). ♻ Will merge w/ main again when fixed. |
hayata-suenaga
left a comment
There was a problem hiding this comment.
please create types.ts file to define the shared interface between native and web implementations of useAppState 🙇
|
@hayata-suenaga Sorry, missed that one. All good now! 🚀 |
|
@ikevin127 nice thank you! next, could you use the type you defined in the web implementation of |
|
hayata-suenaga
left a comment
There was a problem hiding this comment.
thank you for the quick fix 🙇
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.4.52-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.52-6 🚀
|
Details
Because of the way our navigation stack pages implementation (
transparentModal), when app goes into the background then back to the foreground on pages with Lottie animations it causes UI performance / device heating issues -> this PR addresses the issue by un-mounting the Lottie animation component when the app goes into the background and re-mounting when app comes back to the foreground.Fixed Issues
$ #36645
PROPOSAL: #36645 (comment)
Tests
Offline tests
TLDR: same as Tests.
QA Steps
TLDR: same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
android-mweb.mov
iOS: Native
ios.MP4
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov