perf: decompose OptionRowLHN press/context-menu into a separate component#89086
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@abdulrahuman5196 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] |
# Conflicts: # src/components/LHNOptionsList/OptionRowLHN.tsx
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.3.65-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes required. This PR is a pure internal performance refactoring — it extracts the right-click context menu and pressable interaction from |
|
@BartekObudzinski @abdulrahuman5196 No QA steps, OK to checkoff this one? |
Explanation of Change
Encapsulates the right-click context-menu state and
PressableWithSecondaryInteractioninto a child component (OptionRowPressable). The parent row no longer carriesuseState(isContextMenuActive)or theshowPopoverclosure on cold mount.useRef(popoverAnchor)stays in the parent becauseonSelectRowandEducationalTooltip.onTooltipPressconsume it; the ref is forwarded into the new component as a prop. TheHoverablewrapper moves into the child, with hover state surfaced via render-prop so the parent can still computesecondaryAvatarBgColorandsubscriptAvatarBorderColor.React.memo(OptionRowLHN)is preserved. Render output and behavior are identical.Measured impact
Fixed Issues
$ #89092
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari