Skip to content

Read transaction row data per row in the money request report - #88

Draft
sosek108 wants to merge 1214 commits into
feature/onyx-store-pr-5-recutfrom
perf/3039-transaction-rows-item-level-useonyx
Draft

sosek108 wants to merge 1214 commits into
feature/onyx-store-pr-5-recutfrom
perf/3039-transaction-rows-item-level-useonyx

Conversation

@sosek108

Copy link
Copy Markdown

Explanation of Change

This targets the Onyx store bump in Expensify#98956.

FlashList re-runs renderTransactionListItem for every transaction row on almost any list render, and the row component isn't memoized. So every row re-rendered on a write to one transaction, a new comment on the report, or an unrelated personal details write, even when that row's data didn't change. The list also handed every row a fresh empty cards object, press and toggle handlers that changed with click-time data, and a new columns array.

The row now takes a transaction ID, reads its transaction and violations by member key, gets its card from the existing card list context, and passes explicit props to its body, so React Compiler reuses the body element when nothing for that row changed. The list no longer computes violations; the visibility filter moved to getVisibleReportRowViolations. Row props are stable: a shared empty cards object, press and toggle handlers called through refs, and the columns array kept while the visible columns are the same.

With 10 transactions, the heavy row component re-renders 1 time instead of 10 for a write to one transaction or a violation on one transaction, and 0 times instead of 10 for a new comment or an unrelated personal details write. Timed with reassure, the violation case goes from 221.0 ms to 172.4 ms. The other cases are 6 to 9% faster, within noise at this row count. Writes to the report total, the policy, its categories and the card list still re-render every row, because all rows receive the same changed object.

The new perf test overrides the global Reanimated mock's useAnimatedStyle to return one object per component. The global mock returns a new object on every render, while real Reanimated returns a stable handle, so without the override no row can skip a render in tests.

Fixed Issues

$ https://github.com/callstack-internal/expensify-issues/issues/3039
PROPOSAL:

Tests

  1. Open an expense report with several expenses.
  2. On a wide layout, edit one expense's amount inline. Verify that row updates and the others don't change.
  3. On a workspace that requires categories, remove the category from one expense. Verify that row shows the violation.
  4. Select expenses with the checkbox, shift-click a range, and use select all. Verify the selection matches in each case.
  5. Press a row. Verify the expense opens and prev/next navigation works.
  6. On a narrow layout, long press a row. Verify the selection modal opens.
  7. Change the sort and the grouping, and change the visible columns from Columns. Verify the rows follow.
  8. Open a report with a card expense. Verify the card name shows on that row.
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline.
  2. Edit an expense's amount inline. Verify the row shows the pending change.
  3. Go back online. Verify the change is saved.

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

jmusial and others added 29 commits October 14, 2026 15:25
…ntains-operator

# Conflicts:
#	src/hooks/useSearchBulkActions.ts
The draft is shared across bank accounts, so values entered for one bank
account were prefilled when enabling Global Reimbursement for another.

Co-authored-by: cretadn22 <cretadn22@users.noreply.github.com>
…yStateWorkspaceName

Show workspace name in per diem empty state for members
…tegory-popover-add-button

Add create button on category dropdown
…ty-docs

[No QA] Document the Auditor role in the security philosophy
…yx-store-pr-5-recut

Bump Onyx to 3.0.117
…pack-android-fonts-raw

Match Metro's Android release assets in Re.Pack
…chBulkActionsDecisionModals

Use useDecisionModal for Search bulk actions and SelectionToolbar alerts
…pe on Add existing expense

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
The upstream issue was closed as an app concern and neither upstream PR
is the fix, so the patch stays across Skia upgrades.
…pie-patch

victory-native remove pie patch
…imbursed-search-snapshot

[No QA] fix: hide redundant MARKED_REIMBURSED row in Search when sibling PAY
…hoose file stay reachable in landscape

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…cle-part16-navigation-linking-split

[NoQA] Fix import/no-cycle - part 16
wrangler looks up the zone before syncing routes, which the CI deploy token cannot do, so the deploy job failed after the Worker was already live. The route stays in place in Cloudflare; wrangler only replaces routes when some are configured.
…am-links

[No QA] Note that upstream declined a fix for the Skia sizing patch
…tains-operator

[Payment due @truph01] fix: Add Contains / Equal to match type for the Merchant filter [80823]
Allow creation and management of multiple offices
Co-authored-by: Eskalifer1 <Eskalifer1@users.noreply.github.com>
Dismiss action badge pill when composer is expanded
…ts/limit-group-by

[NoQA] [Insights polish] Only offer Group by options on Spend over time that fit the Date range
neil-marcellini and others added 30 commits October 15, 2026 14:12
…QuickFilterPopupNative

[CP staging] Fix Merchant quick filter popup collapsing on native
…dSearchResultsData

Guard search snapshot data reads that crash while a search is loading
…pload-retry-track-expense

Add Try again logic for track expense flow
…ntHelpDocs

[No QA] Update AI Agent help docs
Remove unsafe type assertions from deployment and UI flows
[Part 1.6] Remove Onyx.connect(ONYXKEYS.SESSION) in ReportActionsUtils: thread currentUserAccountID through getReimbursedMessage- Expensify#99826
…8389-admins-merge

[Payment due @daledah] Allow admins to merge card + cash expenses across draft reports
…isplayName

[No QA] Docs updates for E/A#100727 Document how admins set a member's display name
[Part 2.8] Remove Onyx.connect(ONYXKEYS.SESSION) in ReportActionsUtils: thread currentUserAccountID through isWhisperActionTargetedToOthers
…dTransactionsHelpDocs

[No QA] Update help docs for Release 1: Add pending BYOC transactions (Plaid)
…geIntacctInactiveUserArticle

[No QA] Add INT133 help article for inactive Sage Intacct web services user
…eWorkspacePlanAdminPermissions

[No QA] Update help articles: any Workspace Admin can change the workspace plan
Co-authored-by: dmkt9 <dmkt9@users.noreply.github.com>
…edirectToHome

Redirect to Home instead of Inbox after a share error
…ows-item-level-useonyx

# Conflicts:
#	src/components/MoneyRequestReportView/MoneyRequestReportTransactionItem.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.