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:
jtrzupek 2026-07-01 10:37:19 +02:00
parent 9526d4d9f3
commit 6b972d36ec

View file

@ -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 },
}; };
} }