Skip to content

refactor: extract MoneyRequestReportTransactionList presentational components - #101199

Merged
mountiny merged 5 commits into
Expensify:mainfrom
callstack-internal:decompose/money-request-report-transactions-b1-v2
Sep 17, 2026
Merged

mountiny merged 5 commits into
Expensify:mainfrom
callstack-internal:decompose/money-request-report-transactions-b1-v2

Conversation

@sosek108

@sosek108 sosek108 commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

This is PR 7 of a 10-PR stack decomposing the MoneyRequestReport list components (MoneyRequestReportActionsList / MoneyRequestReportTransactionList) into focused hooks and presentational sub-components (issue #99919, superseding drafts #99307 and #99417).

This slice starts Track B by extracting the transaction list's presentational chrome into dedicated components.

image

Another pass:

image

No renders and actual measurable perf change. unrelated report update differs on separate run so this is not the signal.

Fixed Issues

$ #99919
PROPOSAL:

Tests

  1. Open an expense report with transactions — verify the transaction table renders as before (columns, sorting, totals)
  2. On a wide screen, click a column header — verify the table sorts by that column and the sort direction toggles
  3. Click the select-all checkbox in the table header — verify all transactions get selected; click again to clear
  4. Open the "Group by" dropdown — pick Category, Tag, and None — verify the grouping and the dropdown label update accordingly
  5. As the report submitter on an open report, verify the Add Expense button below the table works and its dropdown options open the right flows
  6. On a report with company-card (non-reimbursable) spend, verify the out-of-pocket/company-spend breakdown and the report total render below the table
  7. Run npx jest tests/ui/MoneyRequestReportActionsListRejectModalTest.tsx and verify it passes
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline and add an expense to the report — verify the report total and breakdown show with the offline pending style
  2. Go offline and delete an expense — verify the select-all checkbox ignores the pending-delete row when selecting all

QA Steps

  1. Open an expense report with transactions — verify the transaction table renders as before (columns, sorting, totals)
  2. On a wide screen, click a column header — verify the table sorts by that column and the sort direction toggles
  3. Click the select-all checkbox in the table header — verify all transactions get selected; click again to clear
  4. Open the "Group by" dropdown — pick Category, Tag, and None — verify the grouping and the dropdown label update accordingly
  5. As the report submitter on an open report, verify the Add Expense button below the table works and its dropdown options open the right flows
  6. On a report with company-card (non-reimbursable) spend, verify the out-of-pocket/company-spend breakdown and the report total render below the table

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 followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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 followed the guidelines as stated in the Review Guidelines
  • 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 a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • 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.
  • 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
Nagranie.z.ekranu.2026-09-16.o.12.21.35.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-09-16.o.12.13.56.mov

@sosek108

Copy link
Copy Markdown
Contributor Author

@codex review

@codecov

codecov Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
...stReportView/MoneyRequestReportTransactionList.tsx 0.35% <0.00%> (+0.07%) ⬆️
...uestReportView/MoneyRequestReportGroupByButton.tsx 0.00% <0.00%> (ø)
...estReportView/MoneyRequestReportTableHeaderRow.tsx 0.00% <0.00%> (ø)
...RequestReportView/MoneyRequestReportListFooter.tsx 0.00% <0.00%> (ø)
... and 8 files with indirect coverage changes

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: f3a5dc0c78

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@sosek108
sosek108 marked this pull request as ready for review September 16, 2026 10:23
@sosek108
sosek108 requested review from a team as code owners September 16, 2026 10:23
@melvin-bot
melvin-bot Bot requested review from heyjennahay and suneox and removed request for a team and suneox September 16, 2026 10:23
@melvin-bot

melvin-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

@suneox 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]

@melvin-bot
melvin-bot Bot removed the request for review from a team September 16, 2026 10:23
@suneox

suneox commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

I'm starting to review this pr

@suneox

suneox commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • 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.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
CleanShot.2026-09-16.at.23.28.38.3.mp4
Android: mWeb Chrome
CleanShot.2026-09-16.at.22.47.14.2.mp4
iOS: HybridApp
CleanShot.2026-09-16.at.23.49.51.5.mp4
iOS: mWeb Safari
CleanShot.2026-09-16.at.23.51.37.6.mp4
MacOS: Chrome / Safari
CleanShot.2026-09-16.at.23.35.37.4.mp4

@suneox

suneox commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

The logic after separating components isn't change and still works the same as current staging LGTM
One thing I noticed while testing: when moving an expense from report have many expenses to another report, the total doesn't update until opening the expense details but this also happens on the latest staging so I think it should be separated into a separate issue

CleanShot.2026-09-16.at.23.35.37.4.mp4

@mountiny
mountiny requested a review from suneox September 17, 2026 13:31

@mountiny mountiny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suneox can you please complete the review too?

@mountiny

Copy link
Copy Markdown
Contributor

Seems like everything was tested

@mountiny
mountiny merged commit 68d8134 into Expensify:main Sep 17, 2026
34 of 35 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here.

@suneox

suneox commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

I've completed the review above, but I accidentally submitted it as a comment instead of approving it! 😅

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.82-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 cancelled 🔪
🍎 iOS 🍎 cancelled 🔪

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site changes are required for this PR, so I did not create a docs PR.

This is a pure internal refactor. It moves existing JSX out of MoneyRequestReportTransactionList.tsx into three new presentational components and changes nothing a customer sees or does.

What I checked

The diff touches four files, all under src/components/MoneyRequestReportView/:

Evidence that nothing user-facing moved:

  • No copy changes. No src/languages/*.ts file is touched. Every string still comes from an existing translation key — search.display.groupBy, reportLayout.groupBy.category, reportLayout.groupBy.tag, common.none, iou.addExpense, cardTransactions.outOfPocket, cardTransactions.companySpend, common.billable, common.tax, workspace.people.selectAll.
  • No new feature, setting, or flow. No new route, no new Onyx key, no new toggle. The "Group by" dropdown, select-all checkbox, sortable column headers, Add expense button, spend breakdown, and report total all render the same markup with the same props.
  • No behavior change. The extracted components receive the same values via props that the inline code read directly. The only semantic delta is isEmptyTransactions being hardcoded to false inside the footer, which matches the existing call site — the footer only renders when transactions exist.

I also searched docs/articles for content describing the expense report transaction table and its "Group by" control. The matches are about Search and Insights grouping, not the report view internals this PR restructures, and none of them describe anything this PR alters.

Help site updates are warranted when a customer-visible feature, label, setting, or workflow changes. Nothing here meets that bar, so there is no docs work to do for this PR. If a later PR in the 10-PR stack adds or renames something customers interact with, ask me again on that PR and I will scope the docs changes then.

@sosek108, there is no linked help site PR to review because no documentation change is needed. If you disagree — for example, if you know of a help article that already describes this part of the report view inaccurately — reply with the article path and I will open the draft PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.86-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site changes required

This PR is a pure structural refactor. Nothing a customer sees changed, so no file under App/docs/articles needs an update, and I did not create a docs PR.

What I checked

The diff moves existing JSX out of MoneyRequestReportTransactionList.tsx into three new presentational components:

New component What moved into it
MoneyRequestReportGroupByButton.tsx The Group by dropdown
MoneyRequestReportTableHeaderRow.tsx The select-all checkbox and sortable column headers
MoneyRequestReportListFooter.tsx The Add expense button, spend breakdown, and report total

Every documentation trigger came back negative:

  • No new or renamed user-facing copy. Each translate() call uses a key that already existed — search.display.groupBy, reportLayout.groupBy.category, reportLayout.groupBy.tag, common.none, iou.addExpense, workspace.people.selectAll, cardTransactions.outOfPocket, cardTransactions.companySpend, common.billable, common.tax. No src/languages/*.ts file is touched.
  • No new feature, setting, or entry point. No route, no menu item, no toggle.
  • No changed flow or steps. The Group by options are still Category, Tag, and None. Select-all still skips rows pending delete. The Add expense button still shows only for the submitter on a report that accepts transactions.
  • No changed visibility rules. shouldShowBreakdown, shouldShowAddExpenseButton, and shouldShowExpenseReportBreakDown are computed from the same inputs, just relocated.
  • No layout change. The style arrays are copied verbatim, including the responsive branches.

Existing articles stay accurate

The articles that describe this surface — Using-Reports-in-New-Expensify.md and Managing-Expenses-in-a-Report.md — still match the shipped behavior. Editing them would add churn without correcting anything, which HELP_AUTHORING_GUIDELINES.md advises against.


@sosek108, there is no linked help site PR to review or mark Ready for review, because this refactor needs no docs update. Please confirm you agree with that read. If you believe a behavior did change in a way customers would notice, tell me which one and I will open the draft PR.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.89-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/luacmartins in version: 9.4.89-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 failure ❌

Bundle Size Analysis (Sentry):

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.

5 participants