-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
FIX: Performance and heat issues on the 'Troubleshoot' page #38093
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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