You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Router shim as a standalone PR. Originally planned as PR 1. Rejected: introducing a router before its data layer is reusable would force either heavy duplication against MRR's subscriptions or a speculative shared selector hook. Router lands in PR 6 as part of the orchestrator replacement, after hooks exist.
MRR migration to shared router. Out of scope for this series. See memory: project_report_actions_list_unification.md.
PR 1 — Extract presentation components
Goal. Pull ReportActionsListHeader and ShowPreviousMessagesButton out of the 915-LOC monolith at src/pages/inbox/report/ReportActionsList.tsx. Components own their own rendering gates (CLEAN-REACT-PATTERNS-2). Call-site behavior gates stay in place — the monolith gets smaller, nothing changes user-visible.
Self-subscribes: report via Onyx, conciergeReportID, isInSidePanel
Computes isConciergeSidePanel internally
Gates ConciergeThinkingMessage on isConciergeSidePanel; always renders ListBoundaryLoader
Modified:
src/pages/inbox/report/ReportActionsList.tsx
In renderItem: replace inline button JSX with <ShowPreviousMessagesButton .../> wrapped by the existing isConciergeSidePanel && gate (preserved; removal belongs with later concierge cleanup).
In listHeaderComponent: replace inline fragment with <ReportActionsListHeader reportID={report.reportID} onRetry={retryLoadNewerChatsError} />. Keep the canShowHeader gate + hasHeaderRendered ref unchanged (removal belongs with PR 10 compiler cleanup).
Drop imports now unused locally: ConciergeThinkingMessage, ListBoundaryLoader, and any icon/button imports used only by the extracted JSX.
Tests.
tests/unit/ShowPreviousMessagesButtonTest.tsx — renders when all gates pass; returns null per each failing gate; fires onPress.
tests/unit/ReportActionsListHeaderTest.tsx — renders ListBoundaryLoader unconditionally; renders ConciergeThinkingMessage only when in concierge side panel; forwards onRetry.
Verification.
npx prettier --write <changed files>
npx eslint <changed files> --max-warnings=0
npm run typecheck-tsgo
npm run react-compiler-compliance-check check-changed
npx jest tests/unit/ShowPreviousMessagesButtonTest.tsx tests/unit/ReportActionsListHeaderTest.tsx tests/ui/ReportActionsViewTest.tsx
Risk. Low. Pure code movement with call-site behavior gates preserved.
PR 2 — Extract data hooks
Goal. Pull useTransactionThread + useReportActionsPagination out of the monolith. Pagination consumes transaction-thread output; coupled, ship together.
Files.
New: src/hooks/useTransactionThread.ts
New: src/hooks/useReportActionsPagination.ts
Modified: src/pages/inbox/report/ReportActionsView.tsx (delegate to hooks; drop inline pagination + optimistic CREATED + thread stitching)
Note: ReportActionsList.tsx still receives data via props in this PR; List moves to direct hook calls in PR 6 with the orchestrator swap.
Modified: src/hooks/useLoadReportActions.ts (new imperative surface)
Tests.tests/unit/useReportActionsVisibilityTest.tsx — concierge filtering, "show full history" toggle, archived/non-archived variants.
Risk. Low-medium. Concierge session filter is behaviour-sensitive — QA concierge side panel.
PR 4 — Extract unread marker hooks
Goal. Pull useUnreadMarker (marker position + read-event subscription) and useMarkAsRead (report-change + visibility-change triggers) out of the monolith. Coupled via unreadMarkerTime state; ship together.
Risk. Medium. Marker behavior is visible; QA mark-as-read on open / scroll / focus.
PR 5 — Extract useReportActionsScroll
Goal. Pull scroll state + Pusher new-action handler + scroll imperatives out of the monolith. Biggest hook, most entangled; last in the extraction series. At this point the monolith is a shell consuming five hooks.
Files.
New: src/hooks/useReportActionsScroll.ts
Modified: src/pages/inbox/report/ReportActionsList.tsx (now a thin body)
PR 6 — Replace ReportActionsView with ReportActions orchestrator
Goal. Introduce src/pages/inbox/ReportActions.tsx — the orchestrator that owns skeleton branching, money-request-vs-chat decision for non-MRR entry points, and UserTypingEventListener mount. Swap consumers to mount <ReportActions> in place of <ReportActionsView>. Delete ReportActionsView.tsx. Rewrite UI + perf tests against the new surface.
Why here. By this point the hooks exist, so the orchestrator subscribes to the same data sources the children use — no speculative duplication. ReportActionsView's responsibilities split cleanly: skeleton/branch → ReportActions; list body → ReportActionsList (already hook-driven).
Note. MRR branching stays put — the blueprint does not migrate MRR to use ReportActions. Unification of the two list surfaces is out of scope for this series.
Tests. Extend tests/ui/ReportActionsTest.tsx — assert maintainVisibleContentPosition is passed with startRenderingFromBottom: true only for reports that mount at top and have no linkedReportActionID.
Risk. Medium-high. QA first paint + deep-link + chat swap on web + native.
PR 8 — Inverted-wheel handler for InvertedFlashList
Goal. Port RN-Web's invertedWheelEventHandler patch into InvertedFlashList. Without it, wheel scroll feels reversed on every inverted list on web.
Tests.tests/unit/InvertedFlashListWheelHandlerTest.tsx — web variant: onWheel invokes handler that inverts deltaY; native variant: no-op.
Risk. Low-medium. QA web wheel across inverted surfaces.
PR 9 — Scope VISIBLE_REPORT_ACTIONS selector per report
Goal. Hook currently subscribes to the whole derived collection; scope it via a module-level selector factory keyed on reportID. Kills LHN + tooltip render cascade.
Files.
Modified: src/hooks/useReportActionsVisibility.ts
Tests.tests/unit/selectVisibleReportActionsTest.ts — writes to report B do not notify subscribers of report A.
Profiler delta. Run before/after (5 trials each). Expect OptionRowLHN, Tooltip, ActiveHoverable, GenericTooltip render counts to drop.
Risk. Low. Pure perf fix.
PR 10 — Compiler-clean pipeline hooks
Goal. Drop every react-hooks/* eslint-disable across pipeline hooks. Convert useEffect/useLayoutEffect legacy patterns to useEffectEvent or render-time state adjustment. Drop dead returns + redundant identity guards. Also removes the canShowHeader + hasHeaderRendered gate from PR 1 once it's safe to always-render the header (ListBoundaryLoader self-renders null outside error/loading).
Files.
src/hooks/useMarkAsRead.ts
src/hooks/useUnreadMarker.ts
src/hooks/useReportActionsScroll.ts
src/hooks/useReportActionsPagination.ts
src/hooks/useTransactionThread.ts
src/pages/inbox/report/ReportActionsList.tsx (drop canShowHeader gate and hasHeaderRendered ref; call-site simplification)
Tests. Existing hook tests stay green. Compiler gate (check-compiler.sh) is the primary pass condition.
tests/unit/ReportActionsUtilsTest.ts — add explicit test for the new rule: chat with unreads, user reads, user sends own message → marker clears entirely, does NOT land on own message.
Extend tests/unit/useUnreadMarkerTest.tsx — marker suppression consistent across initial mount + subsequent updates.
Risk. Low-medium. User-visible change; document in PR body + flag for QA.
PR 12 — Flip list-ref ownership on ActionListContext
Goal. Remove the last React Compiler bail in ReportActionsList. ActionListContext stops exposing a RefObject; exposes registerListRef(ref) + getListRef() callbacks. Each list owns its useRef locally.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
Activity
adhorodyski commentedon Apr 20, 2026
Split plan —
decompose/report-actions-list→ PR seriesDependency graph
Deferred / rejected splits
project_report_actions_list_unification.md.PR 1 — Extract presentation components
Goal. Pull
ReportActionsListHeaderandShowPreviousMessagesButtonout of the 915-LOC monolith atsrc/pages/inbox/report/ReportActionsList.tsx. Components own their own rendering gates (CLEAN-REACT-PATTERNS-2). Call-site behavior gates stay in place — the monolith gets smaller, nothing changes user-visible.Files.
New:
src/pages/inbox/report/ShowPreviousMessagesButton.tsxreportAction,hasPreviousMessages,showFullHistory,onPressactionName !== CREATED,!hasPreviousMessages, orshowFullHistorysrc/pages/inbox/report/ReportActionsListHeader.tsxreportID: string,onRetry: () => voidreportvia Onyx,conciergeReportID,isInSidePanelisConciergeSidePanelinternallyConciergeThinkingMessageonisConciergeSidePanel; always rendersListBoundaryLoaderModified:
src/pages/inbox/report/ReportActionsList.tsxrenderItem: replace inline button JSX with<ShowPreviousMessagesButton .../>wrapped by the existingisConciergeSidePanel &&gate (preserved; removal belongs with later concierge cleanup).listHeaderComponent: replace inline fragment with<ReportActionsListHeader reportID={report.reportID} onRetry={retryLoadNewerChatsError} />. Keep thecanShowHeadergate +hasHeaderRenderedref unchanged (removal belongs with PR 10 compiler cleanup).ConciergeThinkingMessage,ListBoundaryLoader, and any icon/button imports used only by the extracted JSX.Tests.
tests/unit/ShowPreviousMessagesButtonTest.tsx— renders when all gates pass; returns null per each failing gate; firesonPress.tests/unit/ReportActionsListHeaderTest.tsx— rendersListBoundaryLoaderunconditionally; rendersConciergeThinkingMessageonly when in concierge side panel; forwardsonRetry.Verification.
Risk. Low. Pure code movement with call-site behavior gates preserved.
PR 2 — Extract data hooks
Goal. Pull
useTransactionThread+useReportActionsPaginationout of the monolith. Pagination consumes transaction-thread output; coupled, ship together.Files.
src/hooks/useTransactionThread.tssrc/hooks/useReportActionsPagination.tssrc/pages/inbox/report/ReportActionsView.tsx(delegate to hooks; drop inline pagination + optimistic CREATED + thread stitching)ReportActionsList.tsxstill receives data via props in this PR; List moves to direct hook calls in PR 6 with the orchestrator swap.src/hooks/useLoadReportActions.ts(new imperative surface)src/hooks/useTransactionsAndViolationsForReport.ts(exposeisLoaded)Tests. Integration coverage via existing
tests/ui/ReportActionsViewTest.tsx. Updatetests/unit/useLoadReportActionsTest.tsxfor the new signature.Risk. Medium. Touches pagination — high-traffic path. QA deep-links + older/newer loads.
PR 3 — Extract
useReportActionsVisibilityGoal. Pull session / concierge filtering + "show full history" toggle out of the monolith.
Files.
src/hooks/useReportActionsVisibility.tssrc/pages/inbox/report/ReportActionsList.tsxTests.
tests/unit/useReportActionsVisibilityTest.tsx— concierge filtering, "show full history" toggle, archived/non-archived variants.Risk. Low-medium. Concierge session filter is behaviour-sensitive — QA concierge side panel.
PR 4 — Extract unread marker hooks
Goal. Pull
useUnreadMarker(marker position + read-event subscription) anduseMarkAsRead(report-change + visibility-change triggers) out of the monolith. Coupled viaunreadMarkerTimestate; ship together.Files.
src/hooks/useUnreadMarker.tssrc/hooks/useMarkAsRead.tssrc/pages/inbox/report/ReportActionsList.tsxsrc/pages/inbox/report/shouldDisplayNewMarkerOnReportAction.ts(if signature changes)Tests.
tests/unit/useUnreadMarkerTest.tsx,tests/unit/useMarkAsReadTest.tsx.Risk. Medium. Marker behavior is visible; QA mark-as-read on open / scroll / focus.
PR 5 — Extract
useReportActionsScrollGoal. Pull scroll state + Pusher new-action handler + scroll imperatives out of the monolith. Biggest hook, most entangled; last in the extraction series. At this point the monolith is a shell consuming five hooks.
Files.
src/hooks/useReportActionsScroll.tssrc/pages/inbox/report/ReportActionsList.tsx(now a thin body)Tests.
tests/unit/useReportActionsScrollTest.tsx— Pusher handler firing, scroll imperative API, IOU-error effect.Risk. Medium. Pusher callback + scroll anchor are sensitive. QA incoming messages + scroll-to-newest.
PR 6 — Replace
ReportActionsViewwithReportActionsorchestratorGoal. Introduce
src/pages/inbox/ReportActions.tsx— the orchestrator that owns skeleton branching, money-request-vs-chat decision for non-MRR entry points, andUserTypingEventListenermount. Swap consumers to mount<ReportActions>in place of<ReportActionsView>. DeleteReportActionsView.tsx. Rewrite UI + perf tests against the new surface.Why here. By this point the hooks exist, so the orchestrator subscribes to the same data sources the children use — no speculative duplication.
ReportActionsView's responsibilities split cleanly: skeleton/branch →ReportActions; list body →ReportActionsList(already hook-driven).Note. MRR branching stays put — the blueprint does not migrate MRR to use
ReportActions. Unification of the two list surfaces is out of scope for this series.Files.
src/pages/inbox/ReportActions.tsxsrc/pages/inbox/report/ReportActionsView.tsx— deleted.src/pages/inbox/report/getReportActionsListInitialNumToRender.ts(obsolete — FlashList has nomaxToRenderPerBatch)tests/unit/getReportActionsListInitialNumToRenderTest.tssrc/pages/inbox/ReportActionsList.tsx(the 56-LOC wrapper) or direct consumers — point atReportActionssrc/libs/ReportActionsUtils.ts,src/libs/actions/Report/index.ts,src/pages/inbox/report/ReportActionCompose/ReportActionCompose.tsx(signature follow-through)Tests.
tests/ui/ReportActionsViewTest.tsx→tests/ui/ReportActionsTest.tsx. Same assertions against the new orchestrator.tests/perf-test/ReportActionsList.perf-test.tsxagainst the current list surface.Risk. Medium. Surgery happens here but the hooks already absorbed most of the risky logic in PRs 2–5.
PR 7 — Drop FlashList hidden-render workaround
Goal. Replace
StaticReportActionsPreviewhidden-render + 200ms reveal timer withmaintainVisibleContentPosition.startRenderingFromBottom. Declarative mount-at-top for transaction thread / money request reports.Files.
src/pages/inbox/report/ReportActionsList.tsx(drop hide-render branch, declarative MVCP)src/hooks/useReportActionsScroll.ts(dropLIST_SCROLLING_DEBOUNCE_TIMElogic)src/hooks/useTransactionThread.ts(canPerformWriteActiontype fix if needed)src/pages/inbox/report/StaticReportActionsPreview/{index.tsx, index.native.tsx, types.ts}Tests. Extend
tests/ui/ReportActionsTest.tsx— assertmaintainVisibleContentPositionis passed withstartRenderingFromBottom: trueonly for reports that mount at top and have nolinkedReportActionID.Risk. Medium-high. QA first paint + deep-link + chat swap on web + native.
PR 8 — Inverted-wheel handler for
InvertedFlashListGoal. Port RN-Web's
invertedWheelEventHandlerpatch intoInvertedFlashList. Without it, wheel scroll feels reversed on every inverted list on web.Files.
src/components/FlashList/InvertedFlashList/useInvertedWheelHandler.ts(native no-op)src/components/FlashList/InvertedFlashList/useInvertedWheelHandler.web.tssrc/components/FlashList/InvertedFlashList/index.tsxsrc/components/FlashList/index.tsxTests.
tests/unit/InvertedFlashListWheelHandlerTest.tsx— web variant:onWheelinvokes handler that invertsdeltaY; native variant: no-op.Risk. Low-medium. QA web wheel across inverted surfaces.
PR 9 — Scope
VISIBLE_REPORT_ACTIONSselector per reportGoal. Hook currently subscribes to the whole derived collection; scope it via a module-level selector factory keyed on
reportID. Kills LHN + tooltip render cascade.Files.
src/hooks/useReportActionsVisibility.tsTests.
tests/unit/selectVisibleReportActionsTest.ts— writes to report B do not notify subscribers of report A.Profiler delta. Run before/after (5 trials each). Expect
OptionRowLHN,Tooltip,ActiveHoverable,GenericTooltiprender counts to drop.Risk. Low. Pure perf fix.
PR 10 — Compiler-clean pipeline hooks
Goal. Drop every
react-hooks/*eslint-disable across pipeline hooks. ConvertuseEffect/useLayoutEffectlegacy patterns touseEffectEventor render-time state adjustment. Drop dead returns + redundant identity guards. Also removes thecanShowHeader+hasHeaderRenderedgate from PR 1 once it's safe to always-render the header (ListBoundaryLoader self-renders null outside error/loading).Files.
src/hooks/useMarkAsRead.tssrc/hooks/useUnreadMarker.tssrc/hooks/useReportActionsScroll.tssrc/hooks/useReportActionsPagination.tssrc/hooks/useTransactionThread.tssrc/pages/inbox/report/ReportActionsList.tsx(dropcanShowHeadergate andhasHeaderRenderedref; call-site simplification)Tests. Existing hook tests stay green. Compiler gate (
check-compiler.sh) is the primary pass condition.Risk. Low. Tooling-only change; behaviour-preserving.
PR 11 — Simplify unread marker suppression rule
Goal. Drop
prevUnreadMarkerReportActionIDself-referential ref. Suppression rule becomes consistent; narrow-edge-case bug fixed (marker no longer lands on user's own just-sent message).Files.
src/hooks/useUnreadMarker.tssrc/pages/inbox/report/shouldDisplayNewMarkerOnReportAction.ts(inline comment documenting the behavior change)src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx(drop pass-through)Tests.
tests/unit/ReportActionsUtilsTest.ts— add explicit test for the new rule: chat with unreads, user reads, user sends own message → marker clears entirely, does NOT land on own message.tests/unit/useUnreadMarkerTest.tsx— marker suppression consistent across initial mount + subsequent updates.Risk. Low-medium. User-visible change; document in PR body + flag for QA.
PR 12 — Flip list-ref ownership on
ActionListContextGoal. Remove the last React Compiler bail in
ReportActionsList.ActionListContextstops exposing aRefObject; exposesregisterListRef(ref)+getListRef()callbacks. Each list owns itsuseReflocally.Files.
src/pages/inbox/ReportScreenContext.tssrc/hooks/useActionListContextValue.tssrc/hooks/useReportScrollManager/{index.ts, index.native.ts, types.ts}src/pages/inbox/report/ReportActionsList.tsxsrc/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsxsrc/pages/inbox/report/ReportActionItemMessageEdit.tsxTests.
tests/unit/useActionListContextValueTest.tsx— lifecycle: register → read → unmount → getter returnsnull.tests/unit/useReportScrollManagerTest.tsx— imperatives resolve ref at call time, not init.Verification.
./.claude/scripts/check-compiler.sh src/pages/inbox/report/ReportActionsList.tsx # must pass ./.claude/scripts/check-compiler.sh src/hooks/useActionListContextValue.ts ./.claude/scripts/check-compiler.sh src/hooks/useReportScrollManager/index.tsRisk. Low-medium. Context shape change.
melvin-bot commentedon Apr 23, 2026
@adhorodyski Whoops! This issue is 2 days overdue. Let's get this updated quick!
rlinoz commentedon Apr 24, 2026
Not overdue @adhorodyski is working on the first draft PR?
rlinoz commentedon Apr 27, 2026
Not overdue, waiting first PR.
49 remaining items
mountiny commentedon Jul 20, 2026
@LukasMod @adhorodyski Are we complete done here? can we close?
melvin-bot commentedon Jul 20, 2026
This issue has not been updated in over 15 days. @rlinoz, @adhorodyski, @DylanDylann eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
rlinoz commentedon Jul 20, 2026
Yeah, everything here is done and we are waiting just on payments for the sub issues, we can close this one.
LukasMod commentedon Jul 21, 2026
Ah, missed that question, sorry. Yes, we are done here with presented plan