From 1ffa52946d8de76806b0b467ccd60f4b2fe57683 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 22 Oct 2026 11:39:34 +0200 Subject: Lazy-load folder content in random page order A folder with several thousand posts took ~10 s to open because FolderActivity and the Home row OK handler fetched every page before showing anything. Pages are now fetched one at a time in a shuffled page order (each page shuffled locally), the grid shows after the first page, and the viewer shares the list and pager so it keeps paging the folder. Reels use the same generic pager. Not a full shuffle: neighbours within a page stay together. Co-Authored-By: Claude Opus 5.5 --- docs/superpowers/specs/2026-10-22-mygram-droid-design.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'docs/superpowers') diff --git a/docs/superpowers/specs/2026-10-22-mygram-droid-design.md b/docs/superpowers/specs/2026-10-22-mygram-droid-design.md index 69d0b8a..76bbbdb 100644 --- a/docs/superpowers/specs/2026-10-22-mygram-droid-design.md +++ b/docs/superpowers/specs/2026-10-22-mygram-droid-design.md @@ -78,8 +78,8 @@ reaches it. `latestImageMtimeMs` descending, rows loaded lazily on scroll. - Each row: about 10 random items from that folder, then a **Continue** tile. -- OK on an item: viewer at that item, continuing through the folder's - shuffled list. OK on Continue: folder grid. +- OK on an item: viewer at that item at once, then the folder pages in + lazily (random page order, shuffled within each page). OK on Continue: folder grid. ### Folders @@ -87,10 +87,12 @@ Grid of all folders as avatar tiles (`avatarUrl`). OK: folder grid. ### Folder grid -- Fetches every page of `GET /api/folders/:slug/images` (60 per request) - and shuffles locally once per open. The API has no random mode for - folders. -- OK: viewer at that item, continuing in grid order. +- Lazy: `GET /api/folders/:slug/images` (60 per request) pages are fetched + in a random order (page numbers from `imageCount`, empty pages skipped), + each shuffled locally; the next page loads when the last visible tile is + within 12 of the end. The API has no random mode for folders. +- Ceiling: not a full shuffle, neighbours within a page stay together. +- OK: viewer at that item, continuing through the same list and pager. ### Liked -- cgit v1.2.3