aboutsummaryrefslogtreecommitdiffstats
path: root/docs/superpowers/specs
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-22 11:39:34 +0200
committerDanilo M. <danix@danix.xyz>2026-10-22 11:39:34 +0200
commit1ffa52946d8de76806b0b467ccd60f4b2fe57683 (patch)
tree52892e10f178225edd51bdd3b5c174c7e3de2513 /docs/superpowers/specs
parent40b12e5b4cd6a4352e37cd1b6e85b1da10624436 (diff)
downloadmygram-droid-1ffa52946d8de76806b0b467ccd60f4b2fe57683.tar.gz
mygram-droid-1ffa52946d8de76806b0b467ccd60f4b2fe57683.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'docs/superpowers/specs')
-rw-r--r--docs/superpowers/specs/2026-10-22-mygram-droid-design.md14
1 files changed, 8 insertions, 6 deletions
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