Repository navigation
[LegendList 5/12] refactor: prepare report list refs and recycled row state - #104978
roryabraham merged 3 commits into
Conversation
Share the report list imperative contract while retaining a compatibility export for inverted FlashList. Keep row-local preview state tied to its action and let money-report edit scroll requests survive until the list commits its layout. Co-authored-by: Codex <noreply@openai.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot request review from @roryabraham and @dmkt9 and assign them here. |
|
Done. I requested reviews from |
Keep shared list refs compatible with main's live-range badge tracking. Co-authored-by: Codex <noreply@openai.com>
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. |
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
Preserve row identity resets alongside expanded system-message focus. Co-authored-by: Codex <noreply@openai.com>
| fullPolicySnapshot: report?.policyID && fullPolicySnapshotLastModified ? {policyID: report.policyID, lastModified: fullPolicySnapshotLastModified} : undefined, | ||
| }); | ||
|
|
||
| const [editScrollRequestID, setEditScrollRequestID] = useState(0); |
There was a problem hiding this comment.
I'm pretty confused by this variable name. What's an "edit scroll request"?
There was a problem hiding this comment.
Chris's AI teammate here. 🤖
Renamed it to scrollToNewestRequestID in #100733, with lastHandledScrollToNewestRequestIDRef tracking which request was handled. It requests a scroll to the newest action after closing its editor. I also added a comment explaining why FlashList must measure the updated rows before scrolling.
|
@MelvinBot review |
Review: no blocking issuesThe refactor looks correct. I found no bugs, and all CI checks pass except the reviewer checklist. The notes below are small follow-ups, not blockers. What I verified
Suggestions
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safarichrome.mp4 |
|
🚧 roryabraham 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/roryabraham in version: 9.5.26-0 🚀
|
|
No help site update needed. This PR is an internal list-refactor (shared list ref types, row and preview state reset for reuse, and edit-scroll timing), so it adds no new feature and doesn't change any workflow, label, or behavior described in a help article. |
Message rows can be reused for another action, and the shared list ref still describes a legacy FlatList. This PR adds a common ref contract and prepares row and preview state for reuse. It also lets money reports finish edit scrolling after the list layout commits.
@roryabraham @dmkt9
Explanation of Change
This is layer 5 of the twelve-part LegendList series, extracted from #100733. It is independent of layer 4. The main chat continues to use inverted FlashList; layer 9 introduces LegendList rendering. A temporary type export keeps the existing FlashList wrapper compatible until that migration removes it. Closing an edit in the main chat now calls the scroll manager's
scrollToBottominstead ofscrollToIndex(0), so on web the list jumps to the newest message instead of animating.Review and merge order: twelve-part LegendList rollout. Layers 6 to 8 are independent preparations; merge all three before layer 9.
Fixed Issues
$ #98994
Part of the migration split from #98270. No approved proposal is linked.
Tests
All platforms means desktop web, mobile web, Android, and iOS.
All platforms, attachment previews after scrolling
All platforms, switching between expenses
Use an expense report containing two expenses with different amounts and receipt images.
All platforms, save, cancel, and delete an expense-report comment
one.two.twoand remain visible at the bottom.All platforms, edit the newest chat message
Offline tests
All platforms, save a cached comment offline
Offline edit.All platforms, attachment previews offline
QA Steps
Run the All platforms cases and the blocks for the platform being tested, including Offline tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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
All platforms, edit the newest chat message
pr5-ios-newest-chat-edit-upload.mp4
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
All platforms, attachment previews after scrolling
attachments.mp4
All platforms, switching between expenses
reports.mp4
All platforms, save, cancel, and delete an expense-report comment
longedit.mp4
All platforms, edit the newest chat message
edit1.mp4
MacOS: Chrome / Safari
All platforms, attachment previews after scrolling
Screen.Recording.2026-10-28.at.10.45.11.mov
All platforms, switching between expenses
Screen.Recording.2026-10-28.at.11.14.51.mov
All platforms, save, cancel, and delete an expense-report comment
Screen.Recording.2026-10-28.at.10.48.19.mov
All platforms, edit the newest chat message
Screen.Recording.2026-10-28.at.10.49.10.mov