fix(mobile): anchor scene lists so prepended scenes don't jump the scroll
Lists sort by created_at desc, so scrapers add new scenes at the top; on refetch those prepend above the viewport and the whole list slid down under the user's thumb (jitter/ tearing while browsing filtered results). Added maintainVisibleContentPosition to the shared sceneGridProps() so RN pins the visible item and corrects the offset; a small autoscrollToTopThreshold still surfaces new items when the user is at the very top. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
82da87457a
commit
c029b7c687
1 changed files with 5 additions and 0 deletions
|
|
@ -269,5 +269,10 @@ export function sceneGridProps(cols: number) {
|
||||||
maxToRenderPerBatch: 8,
|
maxToRenderPerBatch: 8,
|
||||||
initialNumToRender: 8,
|
initialNumToRender: 8,
|
||||||
updateCellsBatchingPeriod: 50,
|
updateCellsBatchingPeriod: 50,
|
||||||
|
// Anti-jank (report): sort=created_at desc → scrapery dosypują nowe sceny NA GÓRĘ.
|
||||||
|
// Gdy refetch wstawi je nad viewportem, treść skacze/tearing pod palcem. RN pinuje
|
||||||
|
// widoczny element (minIndexForVisible:0) i sam koryguje offset. autoscrollToTopThreshold:
|
||||||
|
// gdy user jest przy samej górze (<48px), nowe wskakują normalnie; niżej lista stoi.
|
||||||
|
maintainVisibleContentPosition: { minIndexForVisible: 0, autoscrollToTopThreshold: 48 },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue