Skip useTransactionInlineEdit on narrow transaction rows to reduce scroll jank#91810
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@parasharrajat 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] |
|
@jayeshmangwani @rlinoz One of you needs to 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] |
|
Assigning to @aimane-chnaif as this is a follow up to another PR they are reviewing |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
| if (isNarrowLayout) { | ||
| return <MoneyRequestReportTransactionItemBody {...props} />; | ||
| } | ||
|
|
||
| return <MoneyRequestReportTransactionItemWithInlineEdit {...props} />; |
There was a problem hiding this comment.
This switching causes unmount/remount on web browser resizing.
So it causes issues like losing the highlight animation state from useAnimatedHighlightStyle.
Rare in practice but worth flagging — the original kept a single component instance across layouts.
|
@codex review |
Code ReviewOverall this is a well-structured performance optimization. Moving 1. Unmount/remount on resize (flagged by
|
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Please check above comments |
|
updated the PR |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb ChromeiOS: HybridAppios.moviOS: mWeb SafariMacOS: Chrome / Safariweb.mov |
|
No regressions found. Here's a summary of what was verified: Layout check consistency — The Undefined edit props on narrow — All edit props ( Hook arguments after the move — MoneyRequestReportTransactionItem omitting
Event handler type change — |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @mountiny 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! 🧪🧪
|
Explanation of Change
useTransactionInlineEditsubscribes to 12+ Onyx keys per row. On iOS narrow-layout transaction rows (TransactionItemRowNarrow), none of those subscriptions are consumed — the narrow layout has no inline-edit cells — so every row was paying a pure subscription overhead cost, which manifested as blank cells during fast-scroll on large reports.Two surfaces are fixed:
MoneyRequestReportTransactionItem— split into a router component, aWithInlineEditwrapper (wide path only, calls the hook), and a sharedBodycomponent that renders the Pressable scaffold. Narrow path skips the hook entirely; a localuseRef(false)replaceswasEditingOnMouseDownRefso the press-handler shape stays identical.Search/SearchList/ListItem/TransactionListItem— the parent (index.tsx) no longer callsuseTransactionInlineEdit.TransactionListItemWidenow calls the hook internally and owns its own press/mousedown/hoverIn handlers +shouldDisableHoverStylestate.TransactionListItemNarrowgets a simplified press handler with no editing-dismissal logic (unnecessary since narrow has no inline-edit cells). TheTransactionListItemInlineEditPropstype is removed;currentSearchHashis passed as a prop to wide so it can forward it to the hook.Fixed Issues
$ #91823
PROPOSAL:
Tests
Web
Rest of the platforms
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
Untitled.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-05-27.at.12.11.18.mov