From 6b972d36ec4681aca141e9d408cafc9f6c56a028 Mon Sep 17 00:00:00 2001 From: jtrzupek Date: Wed, 1 Jul 2026 10:37:19 +0200 Subject: [PATCH] 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) --- mobile/src/components/SceneTile.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mobile/src/components/SceneTile.tsx b/mobile/src/components/SceneTile.tsx index 1068cc9..f0668ea 100644 --- a/mobile/src/components/SceneTile.tsx +++ b/mobile/src/components/SceneTile.tsx @@ -269,5 +269,10 @@ export function sceneGridProps(cols: number) { maxToRenderPerBatch: 8, initialNumToRender: 8, 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 }, }; }