[No QA] chore: LHNOptionsList cleanup — hoist isWeb, deduplicate reportAttributes, remove duplicate guard#86647
Conversation
…utes, remove duplicate guard
|
@eVoloshchak 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] |
Reviewer Checklist
Screenshots/Videos |
|
🚧 @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! 🧪🧪
|
|
✋ 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/JS00001 in version: 9.3.52-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are needed for this PR. This is a code-quality cleanup (hoisting |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.52-9 🚀
|





Explanation of Change
Three small dead-code and code-quality cleanups in
LHNOptionsList.tsxwith no behavior change:Hoist
getPlatform()/isWebto module level.getPlatform()returns a stable constant — the platform never changes at runtime. Calling it inside the component body on every render, then listingisWebinuseCallbackdep arrays, is unnecessary churn. Moving both to module scope removes them from two dep arrays (onScroll,onLayout) without changing behavior.Remove dead
!reportnull check and deduplicatereportAttributeslookup. Thedata.find()callback receives items directly from thedataarray, soreportis always truthy at that point — the guard was unreachable. The samereportAttributes?.[report.reportID]lookup was also written twice in the same callback; it is now read once intoattrsand reused.Remove duplicate
!flashListRef.currentguard. TheuseEffectthat scrolls to the top on option mode change already checks!flashListRef.currentin the leading condition on line 225. The second identical guard four lines later was dead code.Fixed Issues
$ #86648
PROPOSAL:
Tests
Offline tests
N/A
QA Steps
Same as tests
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