Repository navigation
[LegendList 5/12] refactor: prepare report list refs and recycled row state #104978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
roryabraham
merged 3 commits into
Expensify:main
from
margelo:@chrispader/refactor/legend-list-row-preparation
Oct 29, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,3 @@ | ||
| import type {FlashListRef} from '@shopify/flash-list'; | ||
| import type {RefObject} from 'react'; | ||
| import type ActionListRefType from '@pages/inbox/ActionListTypes'; | ||
|
|
||
| /** Ref to the underlying list instance attached via `ref={}`. */ | ||
| type FlatListRefType = RefObject<FlashListRef<unknown> | null> | null; | ||
|
|
||
| export default FlatListRefType; | ||
| export default ActionListRefType; |
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import type {RefObject} from 'react'; | ||
|
|
||
| type ScrollToIndexParams = { | ||
| animated?: boolean; | ||
| index: number; | ||
| viewOffset?: number; | ||
| viewPosition?: number; | ||
| }; | ||
|
|
||
| type ScrollToOffsetParams = { | ||
| animated?: boolean; | ||
| offset: number; | ||
| }; | ||
|
|
||
| type ScrollToEndParams = { | ||
| animated?: boolean; | ||
| }; | ||
|
|
||
| /** Common imperative API used by the report scroll manager across FlatList, FlashList, and LegendList. */ | ||
| type ActionListRef = { | ||
| scrollToIndex: (params: ScrollToIndexParams) => void; | ||
| scrollToOffset: (params: ScrollToOffsetParams) => void; | ||
| scrollToEnd: (params?: ScrollToEndParams) => void; | ||
| getNativeScrollRef?: () => {scrollToEnd?: (params?: ScrollToEndParams) => void} | null | undefined; | ||
| getScrollableNode?: () => unknown; | ||
| getLayout?: (index: number) => unknown; | ||
| computeVisibleIndices?: () => {startIndex: number; endIndex: number} | undefined; | ||
| /** Measured item positions supplied by LegendList. Other list implementations can omit this. */ | ||
| getState?: () => {positionByKey: (key: string) => number | undefined; scroll?: number; contentLength?: number; scrollLength?: number} | undefined; | ||
| }; | ||
|
|
||
| /** Ref to the underlying list instance attached via `ref={}`. */ | ||
| type ActionListRefType = RefObject<ActionListRef | null> | null; | ||
|
|
||
| export default ActionListRefType; | ||
| export type {ActionListRef}; |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty confused by this variable name. What's an "edit scroll request"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming this in #100733
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chris's AI teammate here. 🤖
Renamed it to
scrollToNewestRequestIDin #100733, withlastHandledScrollToNewestRequestIDReftracking 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.