Make header and footer components self-subscribe via reportID#85550
Conversation
…y#84895) Convert 5 header/footer components from receiving full report/policy objects as props to self-subscribing via reportID: - HeaderView: subscribe to report via useOnyx, get parentReportAction via useParentReportAction, get shouldUseNarrowLayout from useResponsiveLayout - MoneyReportHeader: subscribe to report/policy/metadata via useOnyx, get reportActions via usePaginatedReportActions, compute transactionThreadReportID internally - MoneyRequestHeader: subscribe to report/policy via useOnyx, get parentReportAction via useParentReportAction - ArchivedReportFooter: subscribe to report via useOnyx, get currentUserAccountID from useCurrentUserPersonalDetails - AnonymousReportFooter: subscribe to report via useOnyx, compute isSmallSizeLayout internally using useResponsiveLayout and useWindowDimensions Update all call sites (ReportScreen, MoneyRequestReportView, ReportFooter) to pass reportID instead of full objects. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@DylanDylann 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] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6c869dc7e
ℹ️ 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".
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-18.at.15.25.48.movAndroid: mWeb ChromeScreen.Recording.2026-03-18.at.15.19.37.moviOS: HybridAppScreen.Recording.2026-03-18.at.15.23.35.moviOS: mWeb SafariScreen.Recording.2026-03-18.at.15.18.55.movMacOS: Chrome / SafariScreen.Recording.2026-03-18.at.15.16.15.mov |
|
The rest looks fine to me |
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Replace the local reportToUse memoization with a dedicated hydrateReportCurrencyFromSnapshot action so self-subscribing child components (e.g. MoneyReportHeader) can read the currency directly from Onyx. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… collections The Search API returns main Onyx collections alongside snapshot data, so by the time the user opens a search result, useOnyx already has the full report with currency. The snapshot fallback is unnecessary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d8feb1357
ℹ️ 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".
|
🚧 @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.42-0 🚀
Bundle Size Analysis (Sentry): |
@rlinoz @mountiny @TMisiukiewicz
Explanation of Change
This PR moves 5 header/footer components from receiving full report and policy objects as props to self-subscribing via
useOnyxwith just areportID. This is part of the ongoing decomposition ofReportScreento reduce prop drilling and allow each component to own its own data dependencies.Components updated:
report,parentReportAction,shouldUseNarrowLayoutprops — now self-subscribes viauseOnyx+useParentReportAction+useResponsiveLayoutreport,policy,reportActions,transactionThreadReportID,isLoadingInitialReportActions— now self-subscribes viauseOnyx+usePaginatedReportActions+useReportTransactionsCollectionreport,policy,parentReportAction— now self-subscribes viauseOnyx+useParentReportActionreport,currentUserAccountID— now self-subscribes viauseOnyx+useCurrentUserPersonalDetailsreport,isSmallSizeLayout— now self-subscribes and computes layout internallyCall sites updated:
ReportScreen,MoneyRequestReportView,ReportFooter. Tests updated. Net result: 9 files changed, +72/-124 lines.Fixed Issues
$ #84895
PROPOSAL:
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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