perf: Defer EditableCell interactivity#91034
Conversation
|
@codex review |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This PR improves first-load performance for editable transaction/report cells by deferring the expensive interactive pressable subtree until after the initial render.
Changes:
- Adds
useDeferredValue(true, false)to gate initial interactivity. - Renders the existing non-interactive layout fallback while interactivity is deferred.
- Updates comments to explain the performance motivation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c03d6e948
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| if (!canEdit || !isInteractive) { | ||
| return <View style={[styles.editableCell]}>{children}</View>; |
There was a problem hiding this comment.
Keep deferred cells from falling through to row press
On wide search rows these cells are nested inside TransactionListItemWide's row-level PressableWithFeedback, so while useDeferredValue(true, false) is still false this plain View has no handler to consume the click. A user who clicks a visible editable cell immediately after the row renders can therefore trigger the parent row press/select navigation instead of editing the cell until the deferred render commits, which is a regression from always mounting the inner pressable when canEdit is true.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I think this is an acceptable tradeoff for the screen loading faster.
Reviewer Checklist
Screenshots/VideosAndroid: HybridApptelegram-cloud-document-5-6080074468653277064.mp4Android: mWeb ChromeiOS: HybridAppScreen.Recording.2026-05-19.at.16.04.31.moviOS: mWeb SafariScreen.Recording.2026-05-19.at.15.55.14.movMacOS: Chrome / SafariScreen.Recording.2026-05-19.at.15.51.23.mov
|
|
@jmusial The change only affects web. Could you please mention that in the QA steps? |
|
🚧 @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! 🧪🧪
|
|
✋ 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/mountiny in version: 9.3.78-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is a purely internal performance optimization that defers mounting the |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.78-1 🚀
|


Explanation of Change
This PR defers rendering of
EditableCellsPressableWithFeedbacktree. This avoids mounting the expensiveTooltip/Hoverable/BoundsObserversubtree during the initial skeleton render, unblocking the main thread so the network response can be processed sooner.Perf gains
Each run = 3 navigations: #1 is the first (cold) navigate, #2–#3 are repeat navigations to the already-mounted screen.
Branch:
deferredBranch:
mainSummary
Takeaway:
deferredis ~330 ms (~9%) faster on the cold/first navigation to Reports. Subsequent navigations are effectively identical between the two branches (~72 ms), as expected — the screen is already mounted, so deferral has nothing left to defer.Fixed Issues
$ #91037
PROPOSAL:
Tests
Note: This change only affects web release.
HomeSpendOffline tests
Note: This change only affects web release.
Same as tests
QA Steps
Note: This change only affects web release.
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
MacOS: Chrome / Safari
Screen.Recording.2026-05-19.at.08.00.29.mov