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

Closed
xpltd_admin wants to merge 0 commits from feature/p1-studio into main
Owner

Phase 1 of docs/PLAN.md. Replaces #2, which was stacked on #1 (now merged) and could not be retargeted.

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`. Replaces #2, which was stacked on #1 (now merged) and could not be retargeted. ## 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
Give each CI Docker run its own container and image name
Some checks failed
CI / check (pull_request) Successful in 1m16s
CI / docker (pull_request) Failing after 13s
3362457bd9
The PR and main-branch Docker jobs ran at the same time on the shared host
daemon and both used glyphlabqr-ci, so one run's cleanup removed the other's
container mid-healthcheck.
Build the image without BuildKit-only COPY --chmod
All checks were successful
CI / check (pull_request) Successful in 1m18s
CI / docker (pull_request) Successful in 1m13s
5cbd9433e5
The CI host builds with the classic builder, which rejects --chmod. Setting the
read-only modes in the build stage keeps the smaller single-copy layers and
works with either builder.
Author
Owner

CI green (check + docker). Merged into main with a merge commit, pushed directly. Two CI fixes landed here first: per-run Docker names (3362457), and read-only modes set in the build stage because the runner's classic builder rejects COPY --chmod (5cbd943). Closing.

CI green (check + docker). Merged into `main` with a merge commit, pushed directly. Two CI fixes landed here first: per-run Docker names (3362457), and read-only modes set in the build stage because the runner's classic builder rejects `COPY --chmod` (5cbd943). Closing.
xpltd_admin closed this pull request 2026-11-16 21:18:23 -07:00
xpltd_admin referenced this pull request from a commit 2026-11-16 21:18:24 -07:00
All checks were successful
CI / check (pull_request) Successful in 1m18s
CI / docker (pull_request) Successful in 1m13s

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!3
No description provided.