Skip to content

[codex] simplify Photos image viewer#80

Open
philipnee wants to merge 3 commits into
mainfrom
fix/photos-load-queue
Open

[codex] simplify Photos image viewer#80
philipnee wants to merge 3 commits into
mainfrom
fix/photos-load-queue

Conversation

@philipnee

@philipnee philipnee commented May 16, 2026

Copy link
Copy Markdown
Owner

Why

The Photos app should feel like a dedicated image viewer, not another dashboard table. In relay testing, burst-loading many images dropped the tunnel and left broken thumbnail placeholders. Refresh made this worse: browsers may revalidate cached images, so even fast 304 responses can still traverse the relay and hit rate limits.

What changed

  • Restyles the Photos app into a sparse masonry image viewer with the same visual language as pnee.uk/life.
  • Removes dashboard chrome, sidebar, status text, captions, download controls, and the visible “show more” control.
  • Keeps only breadcrumb/source navigation, clickable folders, the photo grid, and a full-screen lightbox.
  • Loads only a smaller DOM batch at a time and appends additional tiles instead of re-rendering already-loaded images.
  • Uses an IntersectionObserver so image network requests start only when tiles approach the viewport.
  • Keeps the capped FIFO image queue and paces image starts by 250ms so cached 304 responses cannot drain the whole queue in one burst.
  • Drops HEIC/HEIF from browser-previewable images for now to avoid guaranteed broken previews in Chrome.

How

Photos still uses only the shared cookie-authenticated FS API: /api/fs/sources, /api/fs/list, and /api/fs/file. It renders folder buttons separately from the masonry photo grid, observes each photo tile before assigning src, and pushes image tasks through a paced queue. Infinite scrolling appends the next batch of tiles instead of rebuilding the grid, so scrolling does not replay old cached image requests. Clicking a photo opens the same file URL in a minimal lightbox.

Out of scope: server-side thumbnails, HEIC transcoding, relay-side rate-limit splitting, /api/fs/list pagination, and a separate photo metadata API.

Changed files

  • src/apps/photos/manifest.ts - replaces the dashboard-style Photos UI with the minimal masonry/lightbox viewer, viewport-driven image loading, and paced request queue.
  • tests/server.test.ts - updates app-serving assertions for the simplified viewer, queue, auto-load sentinel, viewport observer, and no extra dashboard chrome.

Verification

npm test -- tests/server.test.ts

Test Files  1 passed (1)
Tests  103 passed (103)

npm run verify

Test Files  44 passed (44)
Tests  456 passed (456)
ok: test
ok: diff whitespace
ok: package dry-run
ok: runtime smoke
verify passed

@philipnee philipnee changed the title [codex] throttle Photos image loads [codex] simplify Photos image viewer May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant