perf: scope draft/reaction Onyx subscriptions to per-item level in report actions list#83547
Conversation
|
@ShridharGoel 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] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@waterim Let's add QA steps as well, just some sanity tests since they will probably not be able to check the render count. |
|
@waterim Can you have a look? Is this the correct way to test? Screen.Recording.2026-02-26.at.5.08.14.PM.mov |
|
@ShridharGoel yes, seems correct, profile send message |
|
@ShridharGoel updated QA steps with focus on ensuring no regressions in |
|
FYI: I created a subissue for this PR #83891 |
|
But sending a message seems to have re-rendered other items as well in this |
|
@ShridharGoel The re-renders you see on send message are expected, updated tests, 1st test was wrong for this PR. |
|
@waterim Isn't it still rendering all messages on adding an emoji? Screen.Recording.2026-03-06.at.5.44.28.PM.mov |
|
@ShridharGoel Just rechecked the profiler and you are right, all the messages are rerendering in the end. When you add an emoji, the optimistic update correctly re-renders only the affected message and that's what I was trying to achieve here in the PR by scoping draft/reaction subscriptions to the per-item level. However, when the server response arrives and updates the reportActions Onyx collection, new object references flow through, ReportActionsView → ReportActionsList → all items get a new reportAction prop, even for actions whose data didn't actually change. That's a separate issue with report action reference stability that I'm working on in a different PR. Let me add a note to test steps not to confuse |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-03-11.at.11.30.09.PM.movScreen.Recording.2026-03-11.at.11.36.42.PM.mov |
|
@waterim, could you please resolve conflicts? |
…-subs-2 # Conflicts: # src/pages/inbox/report/ReportActionsList.tsx # src/pages/inbox/report/ReportActionsListItemRenderer.tsx
|
@cristipaval done |
heyjennahay
left a comment
There was a problem hiding this comment.
Product review not required
|
@waterim , lint fails |
|
@cristipaval fixed and resolved |
|
🚧 @cristipaval 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/cristipaval in version: 9.3.39-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.39-3 🚀
|
Details
This PR scopes draft/reaction Onyx subscriptions to per-item level in report actions list
ListItemRenderer renders:
Before = 155, After = 40Fixed Issues
$ #83891
Tests
Note: all of these changes works optimistically
Test 1:
Test 2:
Test 3:
Offline tests
N/A
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Details