QR codes and labels for guides and categories (#94) #120

Merged
miko merged 2 commits from feature/94-qr-labels into development 2026-11-05 17:32:01 +01:00
Owner

Closes #94.

  • QR code button next to a guide's Print / Download PDF, and on every category page, for everyone who may see it: downloads a label PDF drawn with react-pdf (ADR-0019) with the QR code, title, kataba mark and instance name.
  • The QR code leads to an id-based address that survives renaming and moving: /guides/<id>, or the new /categories/<id>, which redirects to the category's /c/… path. Guests get a real 404 for hidden content through hiddenFromGuest, as before.
  • Label size is a new setting, 50 × 30 mm by default, from 30 × 20 up to 300 × 300 mm, in whole millimetres. Landscape labels put the QR code on the left, capped at 55 % of the width; portrait and square labels put it on top. The text takes the largest size that fits.
  • Reserved names: guides can no longer take the slug label (a stored one now reads at label-2), and pages can no longer take categories.
  • New dependency qrcode 1.5.4. GLOSSARY now has a "Label" entry, ADR-0019 has a note on labels, and the CHANGELOG has an entry.

Tests: settings validation, the layout rule, the label PDF response (404, headers, id-based /URI, page size) and the guest gate for categories and labels. Typecheck, lint and all 542 unit tests pass; the routes were also checked against the dev server.

🤖 Generated with Claude Code

Closes #94. - **QR code** button next to a guide's Print / Download PDF, and on every category page, for everyone who may see it: downloads a label PDF drawn with react-pdf (ADR-0019) with the QR code, title, kataba mark and instance name. - The QR code leads to an id-based address that survives renaming and moving: `/guides/<id>`, or the new `/categories/<id>`, which redirects to the category's `/c/…` path. Guests get a real 404 for hidden content through `hiddenFromGuest`, as before. - **Label size** is a new setting, 50 × 30 mm by default, from 30 × 20 up to 300 × 300 mm, in whole millimetres. Landscape labels put the QR code on the left, capped at 55 % of the width; portrait and square labels put it on top. The text takes the largest size that fits. - Reserved names: guides can no longer take the slug `label` (a stored one now reads at `label-2`), and pages can no longer take `categories`. - New dependency `qrcode` 1.5.4. GLOSSARY now has a "Label" entry, ADR-0019 has a note on labels, and the CHANGELOG has an entry. Tests: settings validation, the layout rule, the label PDF response (404, headers, id-based `/URI`, page size) and the guest gate for categories and labels. Typecheck, lint and all 542 unit tests pass; the routes were also checked against the dev server. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
"QR code" next to a guide's Print / Download PDF and on every category
page downloads a label PDF (react-pdf, ADR-0019): QR code to the id-based
address, title, kataba mark and instance name; landscape labels put the
code beside the text, others above it. New /categories/<id> redirects to
the category page; the label size is a new setting (50 × 30 mm default,
from 30 × 20 mm).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Landscape labels cap the QR code at 55 % of the width, so a label barely
wider than high still shows its title. Named the renderer's constants,
added labelSize(settings), shared the guest check for category chains,
and aligned the German wording with its neighbours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit 6146cf9a66 into development 2026-11-05 17:32:01 +01:00
Sign in to join this conversation.
No reviewers
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
MassiveDynamic/kataba!120
No description provided.