Decompose ReportActionsList: 9#94043
Open
LukasMod wants to merge 2 commits into
Open
Conversation
|
@DylanDylann 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
The useReportActionsVisibility hook subscribed to the entire VISIBLE_REPORT_ACTIONS derived value — a collection containing visible actions for every report. That meant any change to any report's actions re-ran the hook for all reports, causing unnecessary re-renders.
Before this change: if you're viewing Report A and Report B receives an update (e.g. a new message), Report A's visibility logic re-runs and re-renders. Now Report A only reacts to its own updates. Profiler results from such scenario below:
Before (ReportActionsList rerenders)

After (LHN rerenders, ReportActionsList main component stays stable)

Fixed Issues
$ #89770
PROPOSAL:
Tests
Prerequisites: two accounts (A = you, B = sender) signed into separate sessions/devices; at least two shared reports (Report A and Report B)
Test 1: New message in the OPEN report
main(no jump or glitch).Test 2: New message in a DIFFERENT report (the optimization)
Prerequisite: account A is viewing Report A; Report B is visible in the LHN.
Test 3: Rapid report switching
Prerequisite: several reports open-able from LHN, including an expense report and Concierge.
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso 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.native.mov
Android: mWeb Chrome
android.chrome.mov
iOS: Native
ios.native.mov
iOS: mWeb Safari
ios.safari.mov
MacOS: Chrome / Safari
web.mov