Skip to content

[Due for payment 2026-10-07] perf: decompose MoneyRequestReportView list components into compiler compliant hooks #99919

Closed

Description

@mountiny

Background

MoneyRequestReportView renders the money request report screen with the transactions table and the report actions chat feed. Onyx pushes updates to it continuously (chat messages, transaction changes), and the components derive everything they render: sorting, grouping, violations, columns, selection state.

The view is made of two very large components:

  • MoneyRequestReportActionsList.tsx — 817 lines
  • MoneyRequestReportTransactionList.tsx — 1138 lines

Problem

When a money request report is open, any Onyx update that touches the report (opening it, sending a message, a background sync) makes both list components re-derive and re-render everything. Measured cost: ~1.5s of total re-render time on report open, ~1.0s per message send cycle.

Solution

Decompose both components into small, single purpose hooks and presentational components that the React Compiler can compile and memoize, so each Onyx update re-runs only the derivation chain it affects.

The complete end state is implemented and measured on branch decompose/money-request-report-transaction-list. Land it as ten small, independently mergeable PRs, each a pure refactor with no behavior change.

The tracks are sequential only because Track B reuses Track A's extraction patterns and perf test setup. Pausing between any two PRs leaves main consistent.

Track A: refactor MoneyRequestReportActionsList

  1. PR A0: add performance test. The reassure perf test with Onyx seeding, derived value registration, and the mount + update (send message and unrelated report) scenarios.
  2. PR A1: extract MoneyRequestReportEmptyStateView. Small presentational component (~45 lines). Trims the empty state branch out of the monolith.
  3. PR A2: extract useMoneyRequestReportVisibleActions and adapt useMarkAsRead / useUnreadMarker. Moves the visible actions filtering into a hook and makes the two shared chat hooks consumable from this view.
  4. PR A3: extract useMoneyRequestReportPagination. Older and newer action loading cursors, onStartReached and onEndReached.
  5. PR A4: extract useMoneyRequestReportScroll. Scroll tracking, floating message counter, viewability, and scroll to latest.
  6. PR A5: extract useMoneyRequestReportData.

Track B: refactor MoneyRequestReportTransactionList (after Track A)

  1. PR B1: extract presentational components. MoneyRequestReportGroupByButton, MoneyRequestReportTableHeaderRow, MoneyRequestReportListFooter.
  2. PR B2: extract useMoneyRequestReportColumns and useMoneyRequestReportLayout. Column visibility and sizing, plus the group by layout state.
  3. PR B3: extract the transaction data derivation chain. useMoneyRequestReportSortedTransactions, useMoneyRequestReportGroupedTransactions, useMoneyRequestReportActiveTransactionIDs: sorting, violations, grouping, visual order.
  4. PR B4: extract useMoneyRequestReportTransactionSelection and useMoneyRequestReportPendingExpense, then finish wiring. Selection state, pending expense placeholder, and the final unified list controller shape.

Measured impact (iOS simulator)

Warm report open:

  • ManualOpenReport span: 791ms to 607ms (−23%)
  • Total re-render time: 1517ms to 1239ms (−18%)

Message send:

  • Total re-render time: 1008ms to 743ms (−26%)
  • Track A alone cuts the send and type cycle by ~10.8% (~90ms)
  • ManualSendMessageVisible span: no significant change (743ms vs 706ms, within noise)

References

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. melvin-bot commented on Sep 8, 2026

    @melvin-bot

    @mountiny @sosek108

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.73-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

  2. 81 remaining items

  3. suneox commented on Oct 9, 2026

    @suneox
    Contributor

    Linked deploy blockers

    All three deploy blockers linked to this issue were caused by PRs outside it:

    Neither #98744 nor #100735 is among this issue's resolving PRs, so the reduction doesn't apply here.

  4. mallenexpensify commented on Oct 13, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @suneox due $250 via NewDot

    This issue is a bit messy, assuming payment is correct, if not, and/or if anyone else is due payment please comment. Never seen so many resolving PRs before

    Image
  5. suneox commented on Oct 14, 2026

    @suneox
    Contributor

    Price increase request

    @mallenexpensify The summary pays this as one $250 review job, but this issue was executed as a 10 slice PR stack. The payment should be the same as one of these PRs: #100025 (comment)

    Mandatory

    Proposed amount: $2,000

    Why the work exceeded the issue: The issue asked for one decomposition refactor, which reads as a single review, but it shipped as 10 sequenced PRs over 4 weeks and I reviewed 8 of them, several through a second round after author updates. Because every slice stripped manual useCallback/useMemo/memo(), perf check from the same hot report view, each review had to confirm the React Compiler still memoized everything

    Regressions caused by this PR: None, all 3 linked deploy blockers were caused by PRs outside this issue, analysis here: #99919 (comment)

    Optional

    Multiple PRs: 8 reviews, each with its own checklist:
    #100024 (A1, merged 09-09) — #100030 (A3, 17-09) — #100033 (A4, 22-09) — #100035 (A5, 24-09)
    #101199 (B1, merged 17-09) — #101200 (B2, 21-09) — #101201 (B3, 24-09) — #101202 (B4, 29-09)

  6. mallenexpensify commented on Oct 14, 2026

    @mallenexpensify
    Contributor

    @mountiny 👀 above on the price increase request plz.

  7. mountiny commented on Oct 15, 2026

    @mountiny
    ContributorAuthor

    Ok I think that is fine!

  8. mallenexpensify commented on Oct 16, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @suneox due $2,000 via NewDot

  9. garrettmknight commented on Oct 19, 2026

    @garrettmknight
    Contributor

    $2000 approved for @suneox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2Task

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions