decompose ReportScreen 7: extract rendering orchestrators#87245
decompose ReportScreen 7: extract rendering orchestrators#87245rlinoz merged 11 commits intoExpensify:mainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nsList orchestrator 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: 2d4a5b9995
ℹ️ 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".
…sList orchestrator 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] |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…irectly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6159d07171
ℹ️ 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".
|
|
||
| const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportIDFromRoute}`); | ||
| const isReportArchived = useReportIsArchived(report?.reportID); | ||
| const isEditingDisabled = !canUserPerformWriteAction(report, isReportArchived); |
There was a problem hiding this comment.
This is different than the old logic
const {isEditingDisabled} = useIsReportReadyToDisplay(report, reportIDFromRoute, isReportArchived);
There was a problem hiding this comment.
imo it is, I extracted this directly from useIsReportReadyToDisplay which imo hacks around the problem. Our current definition ensures the report is already there - and even if it were a problem (it isn't from the JSX tree), we're defensive for disabling the drag and drop.
There was a problem hiding this comment.
Ah, thanks. However, I still lean toward using useIsReportReadyToDisplay. I believe it will make the code easier to maintain since the logic is centralized in one place.
There was a problem hiding this comment.
I'd be oposed to that given how it relies on false data really - this should be decoupled and report data should be simply guarded up the tree before being accessed.
There was a problem hiding this comment.
Our current definition ensures the report is already there
when you say this do you mean we don't have to care about this problem anymore here?
report?.reportID?.toString() !== reportIDFromRoute;
| <OfflineWithFeedback | ||
| pendingAction={pendingAction} | ||
| errors={reportErrors} | ||
| shouldShowErrorMessages={false} | ||
| needsOffscreenAlphaCompositing |
There was a problem hiding this comment.
avoid duplicate OfflineWithFeedback wrapper, let's dry it
There was a problem hiding this comment.
I think this is far more readable than any abstraction over this:
<OfflineWithFeedback
pendingAction={pendingAction}
errors={reportErrors}
shouldShowErrorMessages={false}
needsOffscreenAlphaCompositing
>There was a problem hiding this comment.
It’s not a big problem, I’m fine with the current approach, but I personally prefer to keep it DRY 😄
cc @rlinoz for the second thought
There was a problem hiding this comment.
I think something like this would look nicer, but either way is fine for me.
function ReportHeader() {
<OfflineFeedback>
<ReportHeaderContent/>
</OfflineFeedback>
}
|
The rest looks fine |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-04-08.at.00.00.59.movAndroid: mWeb ChromeScreen.Recording.2026-04-07.at.23.59.07.moviOS: HybridAppScreen.Recording.2026-04-08.at.00.04.18.moviOS: mWeb SafariScreen.Recording.2026-04-08.at.00.00.25.movMacOS: Chrome / SafariScreen.Recording.2026-04-07.at.23.56.35.mov |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@adhorodyski I got crashed 💣💣💣💣 because of this problem
|
|
Adding |
|
As I recall, we can fix it in other ways |
|
Oh I was not running into this one myself 😅 let me fix that, sorry. |
| const {reportActions: unfilteredReportActions, hasNewerActions, hasOlderActions} = usePaginatedReportActions(reportID, route?.params?.reportActionID); | ||
| const reportActions = useMemo(() => getFilteredReportActionsForReportView(unfilteredReportActions), [unfilteredReportActions]); | ||
|
|
||
| const allReportTransactions = useReportTransactionsCollection(reportIDProp); |
There was a problem hiding this comment.
should this be using reportID instead?
|
|
||
| const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportIDFromRoute}`); | ||
| const isReportArchived = useReportIsArchived(report?.reportID); | ||
| const isEditingDisabled = !canUserPerformWriteAction(report, isReportArchived); |
There was a problem hiding this comment.
Our current definition ensures the report is already there
when you say this do you mean we don't have to care about this problem anymore here?
report?.reportID?.toString() !== reportIDFromRoute;
| <OfflineWithFeedback | ||
| pendingAction={pendingAction} | ||
| errors={reportErrors} | ||
| shouldShowErrorMessages={false} | ||
| needsOffscreenAlphaCompositing |
There was a problem hiding this comment.
I think something like this would look nicer, but either way is fine for me.
function ReportHeader() {
<OfflineFeedback>
<ReportHeaderContent/>
</OfflineFeedback>
}
|
🚧 @rlinoz has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.3.54-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed all changes in this PR. This is a pure internal refactoring — it extracts rendering orchestrators ( No help site changes are required. There are no new features, no UI changes, no terminology changes, and no modifications to user-facing flows or settings. The help site docs under |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.54-7 🚀
|

Explanation of Change
This is the final PR in the 7-part ReportScreen decomposition series. It extracts the remaining rendering orchestrators out of
ReportScreen:ReportActionsListbecomes a pure orchestrator: it no longer subscribes to Onyx itself — it receives only the props it needs and delegates rendering to its children.MoneyRequestReportActionsListbecomes self-subscribing: it owns its own Onyx connection for theisLoadingInitialReportActions/hasLoadingOnyxValuedata it previously required the parent to pass down.The net result:
ReportScreenis slimmed down further and the subscription blast radius for list re-renders is scoped to the components that actually need that data.Fixed Issues
$ #84895
PROPOSAL:
Tests
ReportHeader (variant selection + back button)
HeaderViewrenders with correct avatar and nameMoneyReportHeaderrenders with amount, status, and action buttonsMoneyRequestHeaderrenders with merchant/amountOfflineWithFeedbackstripe appears on the headerReportActionsList (skeleton / actions list / money request list)
MoneyRequestReportActionsList) renders, not the chat viewReportActionsView) renders, not the table viewReportActionsViewrenders with messagesWideRHPReceiptPanel (wide layout receipt)
ReportDragAndDropProvider
MoneyRequestReportActionsList (self-subscribing)
AgentZeroStatusProvider
General regression
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