fix(book): every image frame shows a different photo - #62
Merged
Conversation
patriksimms
force-pushed
the
feat/distribute-photos-across-frames
branch
from
August 18, 2026 21:48
11afa29 to
5c24033
Compare
Summary: - run setup:icc before docker compose so the runner still owns .local Rationale: - the RustFS bind mounts create .local as root, after which the workflow user can no longer create .local/icc, failing every run since ddd2194 Tests: - CI AI-Assisted: true AI-Agent: claude-code AI-Model: anthropic/claude-opus-5 AI-Assisted-By: Codex
Summary: - distribute a response's photos across the frames bound to each question, in visual reading order, from one shared assignment function - read preview, PDF export, and preflight from that single assignment - replace the blocking gallery-overflow problem with a non-blocking, question-scoped photo-slot-mismatch problem covering under- and overflow - warn in the layout editor when a question's slot count does not match its configured maximum image count Rationale: - every frame bound to a question rendered images[0], so a layout with three image frames printed the same photo three times - preflight compared the photo count against a single element's slots, so an image frame on a two-upload question blocked export outright - deriving preview, export, and preflight from one function keeps a reported problem describing the photo that actually prints Tests: - bun run verify Closes #60 AI-Assisted: true AI-Agent: claude-code AI-Model: anthropic/claude-opus-5 AI-Assisted-By: Codex
patriksimms
force-pushed
the
feat/distribute-photos-across-frames
branch
from
August 18, 2026 21:56
cc5e5ce to
37f7fd7
Compare
patriksimms
marked this pull request as ready for review
August 18, 2026 22:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
As an organizer I want each image frame in a layout to show a different contributor photo, so a page with three frames tells a story instead of printing the same photo three times.
Every frame bound to a question rendered
images[0], in three separately derived places. On top of that, preflight compared the photo count against a single element's slots, so an image frame on a question that allows two uploads raised a blockinggallery-overflowproblem and stopped the export outright.Solution
One shared assignment function (
src/domain/photo-assignment.ts) maps a response's photos to the frames bound to each question, in visual reading order (top to bottom, then left to right, element id as final tiebreak). Preview, PDF export, and preflight all read from it, so a preflight warning always describes the photo that actually prints, and the mapping is stable across regenerations and relayering.A gallery consumes its slots as one contiguous block at its position in that order.
Photo/slot mismatches in either direction now raise one non-blocking, question-scoped
photo-slot-mismatchpage problem instead of blocking export, and the layout editor flags a slot count that does not match a question's maximum image count while the layout is being designed.Closes #60
Notes for review
verifyhas failed onmainsince ddd2194: the RustFS bind mounts create.local/as root, after which the workflow user cannot create.local/icc. Runningsetup:iccbeforedocker compose uprestores it. Without it this branch could not reach a green gate.gallery-overflowstays accepted by the persisted-book validator so books written before the rename remain loadable and re-saveable; nothing produces it any more.Validation
bun run verifylocally (format, lint, typecheck, 231 unit tests, 21 Playwright tests, build, compose checks) and green CI on 37f7fd7.Before and after screenshots are attached to #60.
Delivered by Claude Opus 5 (1M context) in Claude Code.