P1 Static studio: render core, generator, scannability, exports, library #2

Closed
xpltd_admin wants to merge 6 commits from feature/p1-studio into feature/p0-foundations
Owner

Phase 1 of docs/PLAN.md. This PR is stacked on #1. Merge #1 first, then retarget this PR to main.

What's in it

  • Shared render core (src/shared/render):
    • One scene model, emitted as SVG, PDF (pdfkit, exact point sizes) and raster formats (resvg, then sharp for format conversion and DPI metadata).
    • The browser preview, every export and the decode test all use the same core.
  • Decode test: zxing-wasm runs on the server against clean, blurred, low-light and small renders. The wasm file is loaded from the installed package, never from a CDN.
  • Design generator:
    • Three archetypes per roll (minimal, bold, playful), using curated palettes plus palettes generated in OKLCH that must clear a contrast floor.
    • Seeded, so a roll can be reproduced; locks keep chosen aspects of the selected design. Candidates that fail any decode test are discarded before the user sees them.
  • Scannability rating: decode result, contrast (including gradient ends), inverted colors, quiet zone, density, print size and style risk, each with a one-click fix where possible.
  • Library: search, folders, tags, duplicate, trash with a 30-day purge, version history with restore, and a reprint warning when the encoded content changes.
  • UI:
    • New-code flow: content, then 3-up designs with re-roll history and locks.
    • Editor: style tabs, undo/redo, autosave, live scannability panel, "shuffle shapes", phone test view.
    • Export dialog: SVG/PNG/PDF/JPG/WebP/TIFF in px, in or mm, with DPI presets plus a recommendation, a background toggle, and a print-ready true-size PDF on Letter or A4.
  • Docker: the image shrank from about 810 MB to 568 MB. The read-only permissions are now set at copy time instead of in a separate layer that copied every file again.

Verification

  • Unit and API tests: 105 pass. They include:
    • every dot shape and every eye-frame/eye-center combination decodes;
    • a 200-roll generation property test (run at 500 locally) with zero unscannable designs;
    • a 2 in PDF has a MediaBox of exactly 144×144 pt and decodes after rasterizing;
    • PNG exports have exact pixel sizes and DPI metadata;
    • codes stay private to their owner;
    • versions coalesce correctly, and trash purges after 30 days.
  • Playwright (desktop and Pixel 7 viewports): sign in, paste a URL, generate, re-roll, pick, edit (autosave), download the SVG and check it is exactly 2 in. Takes about 1.5 s against the brief's under-a-minute target.
  • Container smoke test: generation returns three Good designs, and PNG, PDF and TIFF exports return 200.

Not in this PR

  • Tracked codes are shown as "Coming soon" in the UI; they arrive in P2.
  • Logos, frames, labels and the remaining formats (EPS) arrive in P5.
  • Scannability thresholds are the initial values from PLAN.md and still need calibrating against real phones.

🤖 Generated with Claude Code

Phase 1 of `docs/PLAN.md`. **This PR is stacked on #1.** Merge #1 first, then retarget this PR to `main`. ## What's in it - **Shared render core** (`src/shared/render`): - One scene model, emitted as SVG, PDF (pdfkit, exact point sizes) and raster formats (resvg, then sharp for format conversion and DPI metadata). - The browser preview, every export and the decode test all use the same core. - **Decode test:** zxing-wasm runs on the server against clean, blurred, low-light and small renders. The wasm file is loaded from the installed package, never from a CDN. - **Design generator:** - Three archetypes per roll (minimal, bold, playful), using curated palettes plus palettes generated in OKLCH that must clear a contrast floor. - Seeded, so a roll can be reproduced; locks keep chosen aspects of the selected design. Candidates that fail any decode test are discarded before the user sees them. - **Scannability rating:** decode result, contrast (including gradient ends), inverted colors, quiet zone, density, print size and style risk, each with a one-click fix where possible. - **Library:** search, folders, tags, duplicate, trash with a 30-day purge, version history with restore, and a reprint warning when the encoded content changes. - **UI:** - New-code flow: content, then 3-up designs with re-roll history and locks. - Editor: style tabs, undo/redo, autosave, live scannability panel, "shuffle shapes", phone test view. - Export dialog: SVG/PNG/PDF/JPG/WebP/TIFF in px, in or mm, with DPI presets plus a recommendation, a background toggle, and a print-ready true-size PDF on Letter or A4. - **Docker:** the image shrank from about 810 MB to 568 MB. The read-only permissions are now set at copy time instead of in a separate layer that copied every file again. ## Verification - **Unit and API tests:** 105 pass. They include: - every dot shape and every eye-frame/eye-center combination decodes; - a 200-roll generation property test (run at 500 locally) with zero unscannable designs; - a 2 in PDF has a MediaBox of exactly 144×144 pt and decodes after rasterizing; - PNG exports have exact pixel sizes and DPI metadata; - codes stay private to their owner; - versions coalesce correctly, and trash purges after 30 days. - **Playwright (desktop and Pixel 7 viewports):** sign in, paste a URL, generate, re-roll, pick, edit (autosave), download the SVG and check it is exactly 2 in. Takes about 1.5 s against the brief's under-a-minute target. - **Container smoke test:** generation returns three Good designs, and PNG, PDF and TIFF exports return 200. ## Not in this PR - Tracked codes are shown as "Coming soon" in the UI; they arrive in P2. - Logos, frames, labels and the remaining formats (EPS) arrive in P5. - Scannability thresholds are the initial values from PLAN.md and still need calibrating against real phones. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
One isomorphic scene model feeds the SVG preview, every export format and
the decode test, so what users see is exactly what prints and what gets
verified. Generated designs are only shown after passing clean, blurred
and low-light decodes, meeting the brief's 'never show a failure' rule.
Every code is saved with a version history so it can be restyled and
reprinted later; rapid autosaves coalesce into one version, and the API
flags encoded-content changes so the UI can warn about reprints.
Covers the brief's core flow from content to printed code: generate and
re-roll designs with locks, fine-tune with undo/redo and autosave, fix
scannability issues in one click, then export at exact sizes or print a
true-size PDF.
Guards the success criterion that a new user gets from a pasted URL to a
print-ready SVG in under a minute, on both desktop and phone viewports.
A recursive chmod in its own layer duplicated every app file, inflating
the image by ~240 MB.
Update changelog and project state for P1
Some checks failed
CI / check (pull_request) Successful in 1m19s
CI / docker (pull_request) Failing after 38s
ad07c0dd67
Author
Owner

Superseded by #3 (same branch, targeting main, so CI runs). Closing.

Superseded by #3 (same branch, targeting `main`, so CI runs). Closing.
xpltd_admin closed this pull request 2026-11-16 21:04:36 -07:00
Some checks failed
CI / check (pull_request) Successful in 1m19s
CI / docker (pull_request) Failing after 38s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
xpltdco/GlyphlabQR!2
No description provided.