Skip to content

feat(layouts): two more ready-made page backgrounds - #64

Open
patriksimms wants to merge 2 commits into
mainfrom
feat/more-layout-backgrounds
Open

feat(layouts): two more ready-made page backgrounds#64
patriksimms wants to merge 2 commits into
mainfrom
feat/more-layout-backgrounds

Conversation

@patriksimms

Copy link
Copy Markdown
Owner

Problem

Organizers had one decorated starting point when creating a page layout, so books were either bare pages or the same geometric collage repeated.

Solution

Two more backgrounds in the "Choose a background" dialog:

  • Sunset arches — warm dusk band with overlapping arches on the right, left two thirds free for text and photos.
  • Postcard frame — ruled postcard back with divider, stamp block and address rules, for text-heavy pages.

Both are locked, axis-aligned rectangles and circles only, so they preview and print identically and can be unlocked like the existing collage. The picker moved to two columns so four options stay readable, and the analytics background_id now derives from BackgroundPresetId instead of a hand-kept union.

Two constraints shaped the shapes, both noted in code:

  • rotation is avoided: the browser rotates around an element's top-left corner and the PDF export around the bottom-left
  • frames are thin filled rectangles, not stroked outlines, because the PDF renderer paints a transparent fill as black

Every element stays inside the media box, so neither preset triggers a bleed warning.

Evidence

Before and after of the background picker, plus both new pages at full size, are in visual-artifacts/issues/63/.

Before After
before after
Sunset arches Postcard frame
sunset arches postcard frame

Validation

bun run verify equivalent run locally: format check, lint, typecheck, 216 unit tests, 20 e2e (2 skipped), build, compose checks.

No configuration outside the repository is required.

Closes #63


Changes made with Claude Code (harness) using Claude Opus 5 (1M context).

Summary:
- add two ready-made page backgrounds to the layout background
  picker, built only from locked rectangles and circles
- show the picker as a two-column grid so four options stay
  readable
- derive the analytics background_id from BackgroundPresetId so it
  cannot drift from the offered presets
- cover the new presets with unit and end-to-end assertions and add
  before/after evidence for issue 63

Rationale:
- organizers previously had one decorated starting point, so pages
  were either bare or repeated the same collage
- both presets are axis-aligned: the browser rotates shapes around
  their top-left corner and the PDF export around the bottom-left,
  so rotation-free compositions print the way they preview
- rules are thin filled rectangles rather than stroked outlines
  because the PDF renderer paints a "transparent" fill as black
- every element stays inside the media box, so neither preset
  triggers a bleed warning

Tests:
- bun run format:check, lint, typecheck
- bun run test (216 passed)
- SAKEKEEP_E2E_PORT=3100 bun run test:e2e (20 passed, 2 skipped)
- bun run build, docker compose config, check-production-compose

Related to #63

AI-Assisted-By: Codex
AI-Assisted: true
AI-Agent: claude-code
AI-Model: anthropic/claude-opus-5
@patriksimms

Copy link
Copy Markdown
Owner Author

CI on this branch fails at bun run setup:icc with EACCES: permission denied, mkdir '.local/icc'. That failure predates this change: main has been red since ddd2194 ("fix(dev): persist local RustFS media"), because docker compose up -d --wait now creates a root-owned .local before the ICC step runs. #61 fixes it by reordering those two steps.

To prove this change itself is green, I pushed a throwaway branch with this commit plus #61's fix and ran full CI on it: https://github.com/patriksimms/sakekeep/actions/runs/32188127162bun run verify passed (3m3s). The throwaway branch has been deleted.

This PR will go green on its own once #61 lands on main and this branch is rebased.

@patriksimms
patriksimms marked this pull request as ready for review August 18, 2026 21:34
@patriksimms

Copy link
Copy Markdown
Owner Author

Merged main (which now carries #61) into this branch: 42b8502.

That fixed the original failure. CI now clears the steps that previously blew up — bun run setup:icc, docker compose up -d --wait, db:migrate, db:seed all pass.

It now stalls on the next step, bunx playwright install --with-deps chromium, which never finishes. Two attempts (the original push run and a cancel + rerun) both sat on that step for 20-40 minutes with no output. This is not specific to this branch: the main push run 32229784123 (started 07:51) and the feat/more-fonts push run 32230298722 have been stuck on the same step for over an hour and 20+ minutes respectively, while other runs today passed it in seconds. GitHub reports all systems operational, so it looks like the apt step inside --with-deps is hanging on the runners.

Full bun run verify passes locally for this merge, minus e2e, which cannot run here because the local Docker daemon is unresponsive. The same tree passed complete CI yesterday: https://github.com/patriksimms/sakekeep/actions/runs/32188127162

Leaving the reruns in flight. If the runners keep hanging, worth considering a timeout-minutes on that step plus a Playwright browser cache so a stuck apt fails fast instead of eating the job.

@patriksimms

Copy link
Copy Markdown
Owner Author

Green now: verify passes on 42b8502 in 2m51s (push) and 2m46s (PR). The earlier hang was the runner-side playwright install wedge, tracked and mitigated in #67, not anything on this branch.

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.

Offer more ready-made page backgrounds when creating a layout

1 participant