Skip to content

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

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

sosek108 wants to merge 3301 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.

yuwenmemon and others added 29 commits October 20, 2026 15:01
…s-engine-setrule-reapply

 Reapply SetRule and DeleteRule commands
fix Copilot - Not here page when click Create expense in delegate mode
…8-remove-getReportTransactions-p9

Remove getReportTransactions callers' reliance on the deprecated default in submitReport (Part 9)
…licker-recyclingkey

Key native attachment thumbnails on the attachment ID so they stay on screen after send
…me tests

Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
…ibeRuleAgentFallback

[Payment due @Krishna2323] Describe a rule from New rule and fall back to an agent rule
…-deprecatedAllTransactions-in-hasExpenses

# Conflicts:
#	src/components/ReportActionItem/MoneyReportView.tsx
Co-authored-by: huult <huult@users.noreply.github.com>
…rkspace picker

Co-authored-by: huult <huult@users.noreply.github.com>
…rts too

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

Co-authored-by: daledah <daledah@users.noreply.github.com>
…nModalBatch1

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>

# Conflicts:
#	src/pages/workspace/WorkspaceMembersPage.tsx
…sionModalBatch1

Migrate batch 1 one-button alerts from DecisionModal to useDecisionModal
yuwenmemon and others added 30 commits October 21, 2026 23:31
…mTagList

Add Append custom tag list for accounting-connected workspaces on the indirectTagUploads beta
…adFileName

Use the original file name when downloading chat videos
…nlyToExpensify

[Payment due @situchan] Updates to authtokens in url
…port-name-skeleton-offline

Fix - Android-Expense-Report name shows 'Chat Report' briefly on expense opened offline via growl
…ckerTestCrash

[No QA] Mock useLoadPolicyCategories in CategoryPickerTest to fix failing test
…tReplaceDuringManualExpenseScan

Allow replacing a manual expense receipt while the backend scans it
…/fix-resize-sticky-filter-bar

fix: "Find Member" input and "Filters" button are moved while resizing members table
…sers

[Payment due @nkdengineer] Set user-level office arrangements
…eExpenseReportViewToggle

[CP Staging] Revert "Reapply "Add a More menu option to switch single-expense reports between expense view and table view""
…r-row-onyx-reads

[No QA] Update list-row Onyx rules: PERF-3, PERF-11, new PERF-21 and PERF-22
…x-tab-span-source-tab

[No QA] perf: record source tab and preload wait on the Inbox tab span
…/numeric-input-layout-tests

[No QA] add comprehensive layout and responsiveness tests for NumericInput
cspell rejected "recognise" and failed the spellcheck gate.
The record was added to App.ts's KEYS_TO_PRESERVE, which only guards the
reconnect and full-reset paths. User-initiated sign-out goes through
signOutAndRedirectToSignIn -> redirectToSignIn -> clearStorageAndRedirect,
which clears with KEYS_TO_PRESERVE_ON_SIGN_OUT instead. The record was
therefore wiped on every sign-out and the prompt came back on the next
sign-in, which is the loop this PR is meant to close.

The regression test passed anyway because it cleared Onyx with a
hand-written [APP_REVIEW_LAST_PROMPT] list, so it asserted the gate while
assuming the thing under test. It now clears with the real
KEYS_TO_PRESERVE_ON_SIGN_OUT and fails if the key is dropped from it.
…-prompt-loop

Stop the app review prompt from reappearing after the user answers it
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.