Repository navigation
Remove unused reportActions prop from PureReportActionItem - #82263
Conversation
The reportActions prop (entire sorted array of all report actions) was threaded through 4+ component levels to PureReportActionItem where it was never used in the render body. Its only usage was a deepEqual comparison in the memo comparator — an expensive O(n) check on 50-100+ objects that protected against a no-op re-render. This prop was originally used in a withOnyx HOC key function but that usage was removed in April 2024 when it was replaced by parentReportActionForTransactionThread. The prop, eslint-disable, and deepEqual were left behind as dead code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove reportActions from useCallback dependency arrays in ReportActionsList and MoneyRequestReportActionsList, and fix a missed test instance in PureReportActionItemTest. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🚧 @rlinoz has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 009eb24d41
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| prevProps.linkedReportActionID === nextProps.linkedReportActionID && | ||
| deepEqual(prevProps.report?.fieldList, nextProps.report?.fieldList) && | ||
| deepEqual(prevProps.transactionThreadReport, nextProps.transactionThreadReport) && | ||
| deepEqual(prevProps.reportActions, nextProps.reportActions) && | ||
| deepEqual(prevParentReportAction, nextParentReportAction) && |
There was a problem hiding this comment.
Compare
index in memoized report action item
The memo comparator no longer has any fallback that changes when list ordering changes, but it still does not compare index, so an action can skip re-render when new actions are inserted ahead of it. In that case ReportActionItemMessageEdit keeps using a stale index for scrollToIndex(...) (see src/pages/inbox/report/ReportActionItemMessageEdit.tsx), which can scroll/focus the wrong row while editing if another message arrives. Please include index (or another ordering signal) in the comparator to keep edit-mode behavior in sync with reordered items.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Yeah, added index to comparison
The removed deepEqual on reportActions was accidentally preventing stale index values — when new messages arrived, the array changed, every item re-rendered, and picked up its updated position. Without that check, index can go stale, causing scrollToIndex in ReportActionItemMessageEdit to target the wrong row during editing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-02-14.at.19.38.16.movAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-02-14.at.18.55.42.moviOS: mWeb SafariScreen.Recording.2026-02-14.at.19.08.32.movMacOS: Chrome / SafariScreen.Recording.2026-02-14.at.18.28.49.mov |
JmillsExpensify
left a comment
There was a problem hiding this comment.
Product review isn't required on this PR.
|
@rlinoz conflicts need to resovle |
|
@codex review |
|
@Pujan92 solved |
No idea how this happened? |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Most people are OOO today, so I am merging this one before we get more conflicts. I can address any other concern as a follow up! |
|
🚧 @rlinoz has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.3.21-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.21-4 🚀
|
Explanation of Change
The reportActions prop (entire sorted array of all report actions) was threaded through 4+ component levels to PureReportActionItem where it was never used in the render body. Its only usage was a deepEqual comparison in the memo comparator.
The
no-unused-prop-typeswas added here https://github.com/Expensify/App/pull/36934/changes#r1526813406 but the code referenced in that comment changed, see below.This prop was originally used in a withOnyx HOC key function but that usage was removed when it was replaced by parentReportActionForTransactionThread here 69cfe20b8e6#diff-f0bdc7ab41060e24e6bcdc847f25185b372c5f9a072251fe5d3cae2a27887920L942
This is a minor improvement but seems to make
OpenReport~100ms faster.Fixed Issues
$
PROPOSAL:
Tests
The test is mostly a smoke test to make sure nothing broke.
Have 2 tabs open with different accounts (submitter and approver)
Edit comment test
Offline tests
QA Steps
The test is mostly a smoke test to make sure nothing broke.
Have 2 tabs open with different accounts (submitter and approver)
Edit comment test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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