Commit Graph
23 Commits
Author SHA1 Message Date
jessikittyandClaude Opus 5 fbfd66d889 Hand-built label groups, and text that grows when you ask it to
parse_group_spec / spec_from_groups let the page combine any parts onto
one label, and plan_groups never breaks a hand-made group up.

Text size now goes to 3x and means it: the name is sized first, the
image shrinks out of its way, and the floor no longer rises with the
setting - which is what truncated long names at large sizes. The meta
line takes the leftover room instead of pushing itself off the label.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vunz4VLxAYDBnU5tLciLDC
2026-10-13 10:30:10 +11:00
jessikittyandClaude Opus 5 deb009b80e Treat "busy" as retryable and pace jobs behind the printer
The VC-500W accepts one job at a time; anything sent while the tape is
moving comes back server-error-busy. Add IPPBusy, wait_until_idle and
print_job_paced so a batch goes through instead of failing from the
second label on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vunz4VLxAYDBnU5tLciLDC
2026-10-13 10:27:14 +11:00
jessikitty d86a71de67 Fixed 40 x 15mm drawer labels, 40 x 20mm for a shared drawer
Drawer labels are now a set physical size rather than however long the
text happens to be:

  one part type in the drawer    40 x 15 mm
  two part types                 40 x 20 mm

They lie across the tape, so the 40mm spans the width and each label only
costs its height in tape length - 1.5m per 100 standard labels instead of
4m. That needs 50mm tape, which is now the default; a narrower tape is
detected and warned about rather than silently clipping.

Two part types in one drawer are matched on the location field and
combined onto a single taller label. Nothing is ever dropped: in
"always 40 x 15" a shared drawer simply yields two labels, and a third
part type grows the label by 5mm rather than vanishing.

Part names are wrapped to two lines and the type auto-sized to fit, so
"Plate, Modified with Clip" prints in full instead of truncating.

"Fit the tape width" keeps the previous content-sized behaviour.
2026-10-12 22:42:01 +11:00
jessikitty 5319870a7c Fix: unticking every sheet field silently reset to the defaults
Same absent-checkbox bug as the tape page, caught alongside it. The
hidden form marker lets an empty field list be honoured as a real
choice instead of being treated as "nothing was submitted".
2026-10-12 22:09:41 +11:00
jessikitty 4a1bfc4acd Fix: unticking "Rotate for tape feed" had no effect
An unticked checkbox is absent from a form submission entirely, so
"rotate unticked" and "rotate never mentioned" arrived at the parser
looking identical - and rotate defaults to on, so it snapped straight
back every time. Add a hidden marker the options form always sends, so
absent-but-submitted can be read as unticked.

Same bug silently reset the field list when every field was unticked;
that is fixed by the same marker. rotate_default lets a saved site-wide
preference apply on a fresh arrival without overriding an explicit
untick on the page.
2026-10-12 22:08:51 +11:00
jessikitty f86efd875d Create parts catalogue tables at boot 2026-10-12 21:30:13 +11:00
jessikitty 7d32ad8fd6 Add 313dpi continuous-tape rendering for the VC-500W 2026-10-12 21:26:02 +11:00
jessikitty 832ab97d08 Add minimal IPP client for AirPrint label printers 2026-10-12 21:25:12 +11:00
jessikitty f6f1f4e2bc Add the Update button: Rebrickable CSV dump sync 2026-10-12 21:24:28 +11:00
jessikitty dcafe2b408 Create part label tables at boot 2026-10-03 00:58:15 +10:00
jessikitty b0614a11f7 Add label sheet geometry, layout engine and optional PDF export 2026-10-03 00:54:25 +10:00
jessikitty 2cedb68d6d Add part catalogue service (taxonomy seeding, Rebrickable lookup) 2026-10-03 00:53:39 +10:00
jessikitty 42956cff97 Register instructions.organise as an owner-only editing surface 2026-10-02 19:55:38 +10:00
jessikitty 9e0fc343f7 Add page_order service for ordering image instruction pages 2026-10-02 19:53:38 +10:00
jessikitty f7c20de5ac Add owner-only logging and Brickset API call tracking
LIM configured no logging at all, so the instruction fetcher had no trail to follow. Adds a rotating file handler on the root logger plus two owner-only admin pages.

- Admin > Logs: filter by level, source and text; tracebacks kept with their error; auto-refresh, raw download, rotated-file browsing and rotate-now

- Admin > Logs > Brickset API calls: every outbound call recorded with method, params, caller, duration, result count and error, plus daily quota accounting (only getSets counts) and a comparison against getKeyUsageStats

- New owner concept (services/ownership.py): a single account, distinct from is_admin, since these pages expose other admins activity. Defaults to the first admin; flask owner show/set to change

- Services now log through module loggers; retention setting and pruning for call records

- New CLI: flask owner show/set, flask logs path/prune

- New table brickset_api_calls, created automatically at boot; LOG_* env vars, /data/logs in Docker
2026-09-27 10:42:49 +10:00
jessikitty 89f65e2d74 Add automatic instruction fetcher for official sets
Downloads official instruction PDFs from LEGO, located via the Brickset API, one set per interval (10 minutes by default) so neither API gets hammered. Official sets only; MOCs are excluded throughout.

- New admin page at /admin/instruction-fetch: queue builder, pacing controls, live countdown and per-set job history

- Database-backed queue (instruction_fetch_jobs) and last-run timestamp, so pacing survives restarts

- Background worker thread, plus 'flask instructions queue/run/status' for Task Scheduler or cron

- SHA-256 dedupe (instructions.sha256), PDF header check, size cap and streaming downloads via temp files

- brickset_api: getInstructions2 by set number and getInstructions by setID (the old code sent a set number to the setID method); getSets params now proper JSON; getKeyUsageStats added

- Schema top-ups applied automatically at boot: new table plus instructions.sha256/source

- Docker: fetcher env vars passed through compose, no worker thread in the entrypoint bootstrap
2026-09-26 13:43:17 +10:00
jessikitty 19a2d7ad9e Add idempotent additive schema upgrader 2026-09-25 00:44:00 +10:00
jessikitty 8d5cccc4e3 Add central access guard for set-scoped routes 2026-09-25 00:43:50 +10:00
jessikitty c9ef418cdd Add backup/restore service: full archive of DB + all uploaded files 2026-09-24 14:31:07 +10:00
jessikitty cd0b5f17f5 Add MOC generator with leading zeros support (MOC-0001 format) 2025-12-15 09:23:53 +11:00
jessikitty a72346b68c Add MOCNumberGenerator to services exports 2025-12-15 00:36:07 +11:00
jessikitty 944a679372 Add MOC auto-generation service with sequential numbering 2025-12-15 00:34:34 +11:00
jessikitty 63496b1ccd Initial commit - LEGO Instructions Manager v1.5.0 2025-12-09 17:20:41 +11:00