[WIP] [HOLD on #100884] [LegendList 4/7] feat: migrate report actions to chronological LegendList - #100733
[WIP] [HOLD on #100884] [LegendList 4/7] feat: migrate report actions to chronological LegendList#100733chrispader wants to merge 13 commits into
Conversation
1bac411 to
c067b0c
Compare
c067b0c to
e784ebe
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f616302cdb
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f616302 to
2a3323a
Compare
|
|
# Conflicts: # src/pages/inbox/report/ReportActionsList.tsx
|
Last TO-DOs for me on this one: Add the remaining screen recordings/comparison videos for Android and Web. @roryabraham feel free to review and assign a C+ already! |
roryabraham
left a comment
There was a problem hiding this comment.
Sorry, I don't have time for a very thorough review today, but I'll give a few quick comments.
Also, please check if any of the components you modified were not compiling with React Compiler on main but are compiling on this branch. If so, let's see if we can remove manual memoization from them an simplify.
|
Thanks for the quick review @roryabraham. I'm going to address this in a bit. I'm also going to extract some more logic into two separate PRs, things related to...
|
|
reindex the x/5 PR sequence accordingly, please. Or if some can be reviewed in parallel, create a mermaid flowchart for the rollout. |
|
The list-aware message-edit scrolling fix and the generic report-actions loading-skeleton consistency work are being extracted into #100883 and #100884. Their code remains in this branch for now so the current review state stays intact. Once both extraction PRs merge, I will merge main here and let those changes drop out of this PR’s effective diff. Answered by Codex, instructed by Chris. |
The report-actions list currently uses inversion, so rendering order and scroll coordinates differ from chronological message order. This PR moves the main chat list to LegendList and updates pagination, unread tracking, message editing, recycling, and initial loading behavior to work with chronological data.
@roryabraham @dmkt9
@Expensify/design Please review the initial chat-loading skeleton shown below.
Explanation of Change
This is layer 4 of the seven-part LegendList and chat pagination stack. It migrates
ReportActionsListto chronological LegendList data through a direct{LegendList}import from@legendapp/list/react-native, updates the shared action-list ref contract, preserves cached pages during hydration, and includes the Android anchor patch. It also covers pagination thresholds, targeted scrolling, unread tracking, live-tail updates, badge targets, message editing, and recycled rows. Other FlashList consumers remain unchanged, and layer 5 adds the separate loading indicators and pagination-scroll behavior.Initial loading now uses one shared, bottom-padded skeleton cover across the Inbox and Search expense-report entry paths. The cover remains visible while the initial request is pending and until the current LegendList viewport reports that it loaded. LegendList also keeps newly assigned rows hidden until native measurement finishes, which prevents estimated off-screen rows such as the chat start message from briefly overlapping visible content. A terminal initial-load failure can clear the cover instead of leaving it stuck.
The review follow-up restores
onStartReachedso short chats can load older pages before the viewport becomes scrollable, names the comment-size recycling thresholds, and keeps newest-message edits in large money reports on the list's indexed bottom-scroll path. The Reassure scenario now has a LegendList-specific name because the LegendList Jest mock eagerly renders its supplied data while the previous FlashList harness used virtualization; this establishes a renderer-specific baseline instead of comparing incompatible test harnesses. Layer 1 is now merged, and this branch includes its final edge-callback latch changes plus the latestmain.The list-aware message-edit scrolling and shared loading-skeleton cover remain in this branch for now, but are being extracted into #100883 and #100884. Once those PRs merge, merging main here will remove those duplicated changes from this PR's effective diff.
Review order: 1. Foundation → 2. Message edit scrolling → 3. Loading skeleton consistency → 4. Report actions → 5. Chat pagination loading → 6. Remaining FlashList consumers → 7. Remaining FlatList consumers and restrictions. Review and merge the layers in this order.
Fixed Issues
$ #98994
$ #99202
This PR is part of the migration split from #98270. No approved proposal is linked.
Tests
Offline tests
QA Steps
Same as Tests and Offline tests.
PR Author Checklist
I reviewed every item for this PR. A checked conditional item means I verified it or determined that it does not apply. I attached the available native evidence below; Android screen recordings are still TBD, and web recordings are deferred. The checked recordings item records that review and the available evidence, not that every platform has a video.
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
iOS: Native
Cold chat open and initial loading
FlashList is on the left and LegendList is on the right. FlashList leaves the report body blank during loading; LegendList shows the report-action skeleton before messages appear.
LegendListLoadingSkeletonVsFlashList.mp4
Cold expense-chat open
FlashList is on the left and LegendList is on the right. Both progress from the loading skeleton to an expense preview and its surrounding report actions.
ExpenseChatCold.mp4
Warm expense-chat open
FlashList is on the left and LegendList is on the right. Both open the cached expense preview and report actions from the inbox.
ExpenseChatWarm.mp4
Warm chat open
Side-by-side opens of the same cached chat, ending on the same report-action history. The implementations are not labeled in this recording.
LegendListWarmReportOpen.mp4
Android: Native
Cold chat open and initial loading
FlashList is on the left and LegendList is on the right. FlashList leaves the report body blank during loading; LegendList shows the report-action skeleton before messages appear.
ColdOpenLoading.mp4
Cold expense-chat open
FlashList is on the left and LegendList is on the right. Both progress from the loading skeleton to an expense preview and its surrounding report actions.
Android screen recording TBD.
Warm expense-chat open
FlashList is on the left and LegendList is on the right. Both open the cached expense preview and report actions from the inbox.
Android screen recording TBD.
Warm chat open
Side-by-side opens of the same cached chat, ending on the same report-action history. The implementations are not labeled in this recording.
Android screen recording TBD.
Web recordings are deferred.