decompose ReportActionsList: 4#91179
Draft
adhorodyski wants to merge 14 commits into
Draft
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d1a700335
ℹ️ 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".
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
|
# Conflicts: # Mobile-Expensify # config/eslint/eslint.seatbelt.tsv # src/CONST/index.ts # src/components/ParentNavigationSubtitle.tsx # src/components/Search/SearchList/ListItem/TransactionListItem/TransactionListItemNarrow.tsx # src/components/Search/SearchList/ListItem/TransactionListItem/TransactionListItemWide.tsx # src/components/Search/SearchList/ListItem/TransactionListItem/types.ts # src/components/Search/index.tsx # src/languages/de.ts # src/languages/en.ts # src/languages/es.ts # src/languages/fr.ts # src/languages/it.ts # src/languages/ja.ts # src/languages/nl.ts # src/languages/pl.ts # src/languages/pt-BR.ts # src/languages/zh-hans.ts # src/libs/CardUtils.ts # src/libs/actions/IOU/BulkEdit.ts # src/libs/actions/connections/MergeHR.ts # src/pages/Search/SearchEditMultiple/SearchEditMultiplePage.tsx # src/pages/inbox/report/ReportActionsList.tsx # src/pages/settings/Copilot/CopilotPage.tsx # src/pages/settings/Wallet/ExpensifyCardPage/index.tsx # src/pages/workspace/DynamicWorkspaceInviteMessageRolePage.tsx # src/pages/workspace/WorkspaceMembersPage.tsx # src/pages/workspace/WorkspaceMoreFeaturesPage/index.tsx # src/pages/workspace/accounting/AccountingContext/index.tsx # src/pages/workspace/hr/WorkspaceHRPage.tsx # src/pages/workspace/hr/gusto/GustoApprovalModePage.tsx # src/pages/workspace/hr/gusto/GustoFinalApproverPage.tsx # src/pages/workspace/hr/merge/MergeHRApprovalModePage.tsx # src/pages/workspace/hr/merge/MergeHRFinalApproverPage.tsx # src/pages/workspace/members/ImportedMembersConfirmationPage.tsx # src/pages/workspace/members/WorkspaceInviteMessageComponent.tsx # src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx # src/pages/workspace/members/WorkspaceMemberDetailsRolePage.tsx # src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx # tests/actions/IOUTest.ts # tests/unit/ReportUtilsTest.ts
# Conflicts: # src/pages/inbox/report/ReportActionsList.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
PR 4 of the ReportActionsList decomposition series (tracker #88320, blueprint PR #87506). PRs 1–3 merged: #88392, #89598, #91048.
Extracts the unread-marker scan logic and the mark-as-read trigger logic out of
ReportActionsList.tsxinto two new focused hooks.Pipeline state after PR4.
ReportActionsListnow consumes:useUnreadMarker,useMarkAsRead,useReportActionsNewActionLiveTail,useReportUnreadMessageScrollTracking,useReportScrollManager,useScrollToEndOnNewMessageReceived,useReportIsArchived,useShouldShowComposerForActiveEditDraft, and others. Remaining: scroll hook (PR5), then PR6 collapses the View into aReportActionsorchestrator.Extracting
useUnreadMarkerinto a standalone, React Compiler–compliant hook required removing the path-dependentprevUnreadMarkerReportActionIDstate (it read a ref during render, which the compiler rejects in a new file). Dropping it changes one user-visible edge case:This is the only behavior difference. Everything else (marker placement for others' messages, offline-received messages, pagination anchoring, mark-as-read triggers) is unchanged. The change applies to both the chat report list and the money-request report list, since they share
shouldDisplayNewMarkerOnReportAction. This matches the behavior in blueprint PR #87506.Fixed Issues
$ #89765
PROPOSAL:
Tests
Two hooks (
useUnreadMarker,useMarkAsRead) extracted fromReportActionsList.tsx. Aside from the unread-marker edge case documented above (marker no longer lands on your own just-sent message), behavior is unchanged. The plan exercises every behavior the extracted code owns plus the cross-reportprevReportID(now module-level), and step L below verifies the edge case explicitly.A. Unread marker — basic scan
B. Unread marker — pagination anchor
C. Unread marker — incoming messages
ACTION_VISIBLE_THRESHOLDreadNewestActionfires, marker clearsD. Unread marker — offline-received messages
E. Mark as read — initial open
readNewestActionfires once on mountF. Mark as read — report switch (module-level
prevReportID)ReportActionsListinstance is reused)userActiveSinceresets and no stale callbacks from A fireprevReportID === Bbefore any mark-read runsG. Mark as read — app visibility (web/desktop)
readActionSkippedflips correctly when scrolled away from bottomH. Mark as read — notification referrer (desktop)
referrer=NOTIFICATIONisVisiblereturns false (notification center open)referrerparam is cleared after marking readI. Anonymous user
DeviceEventEmittersubscriptions forunreadAction_/readNewestAction_are createdJ.
lastReadTimelazy hydrationreport.lastReadTimeinitially emptylastReadTimeresolves, marker recomputes with the real timestamp (not empty string)K. Floating message counter integration
readActionSkippedRef.currentresets tofalse,readNewestActionis calledL. Unread marker — own-message edge case (behavior change)
lastReadTime) so it is no longer unreadRegression sanity
Run A–K on iOS native, Android native, mWeb, MacOS web — same chat with unread + offline mix
React DevTools Profiler: per-message render count should match pre-PR (no extra commits from the hook split)
Verify that no errors appear in the JS console
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