Add the list block and the module layer with the note module
Security / Vulnerability check (push) Successful in 41s
Test / Lint and test (push) Successful in 1m50s

The list block prints items with a dot, dash, number or checkbox bullet,
wrapping a long item with a hanging indent; a checkbox list ticks its
done items as [√], or [x] on code pages without √. It stands alone or
inside a box, and its items, bullet and done fields carry their enums
and limits as jsonschema tags.

internal/pkg/modules holds modules that build ordinary jobs from their
own payloads: a registry by name, an Env with the clock, time zone and
time layout, strict payload decoding that reports every problem, ErrSkip
and PayloadError. The note module prints a boxed note with an optional
checklist and a time stamp in the footer.

Three routes join the route table: POST /api/v1/print/{module} and
POST /api/v1/preview/{module}, which take ?copies and a reserved
?printer, and GET /api/v1/modules. Print and the module route share one
submit path, and preview shares one too. New error codes:
invalid_payload, invalid_query, unknown_printer, module_not_found and
module_failed; a module that builds an invalid receipt is logged and
reported to Sentry once. [format] gains timezone and time_layout, the
binary embeds the time zone database, and uberbringer preview takes
--module.

The note receipt passed on the TM-T88IV, and its bytes are pinned in
TestPaperReceipts. docs/api.md describes the list block, the module
routes and the note payload; docs/swagger.json is regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-11-30 10:55:50 -06:00
1 parent 6b2e402f1a
commit 3e9779f71a
69 files changed
+3092 -262

No files matched your search

+1
View File
@@ -0,0 +1 @@
{"title": "Packing", "text": "All done.", "items": ["Passport", "Charger", "Tickets"], "done": [0, 1, 2]}
+8
View File
@@ -0,0 +1,8 @@
┌─ Packing ──────────────────────────────┐
│ All done. │
│ │
│ [√] Passport │
│ [√] Charger │
│ [√] Tickets │
└──────────────────────── 29 Nov 21:04 ──┘
- - - - - - - partial cut - - - - - - - -
+1
View File
@@ -0,0 +1 @@
{"title": "Footer", "text": "A footer replaces the time.", "footer": "from the kitchen"}
+4
View File
@@ -0,0 +1,4 @@
┌─ Footer ───────────────────────────────┐
│ A footer replaces the time. │
└──────────────────── from the kitchen ──┘
- - - - - - - partial cut - - - - - - - -
@@ -0,0 +1 @@
{"text": "No title, but a checklist.", "items": ["One", "Two"]}
+7
View File
@@ -0,0 +1,7 @@
┌────────────────────────────────────────┐
│ No title, but a checklist. │
│ │
│ [ ] One │
│ [ ] Two │
└──────────────────────── 29 Nov 21:04 ──┘
- - - - - - - partial cut - - - - - - - -
+1
View File
@@ -0,0 +1 @@
{"title": "A title that is far too long to fit into the top border of the box", "text": "First paragraph.\nSecond paragraph, which is long enough to wrap inside the box.", "items": ["An item that is long enough to wrap onto a second line with a hanging indent", "“Curly quotes” — and an emoji 🎉"], "done": [1]}
+13
View File
@@ -0,0 +1,13 @@
┌─ A title that is far too long to f... ─┐
│ First paragraph. │
│ Second paragraph, which is long enough │
│ to wrap inside the box. │
│ │
│ [ ] An item that is long enough to │
│ wrap onto a second line with a │
│ hanging indent │
│ [√] "Curly quotes" -- and an emoji ? │
└──────────────────────── 29 Nov 21:04 ──┘
- - - - - - - partial cut - - - - - - - -
=== warnings
elements[0]: 1 character not in cp437 printed as ?
+1
View File
@@ -0,0 +1 @@
{"title": "Shopping", "text": "Milk, eggs and the good bread from the bakery on Elm St.", "items": ["Milk", "Eggs", "Bread"], "done": [2]}
+9
View File
@@ -0,0 +1,9 @@
┌─ Shopping ─────────────────────────────┐
│ Milk, eggs and the good bread from the │
│ bakery on Elm St. │
│ │
│ [ ] Milk │
│ [ ] Eggs │
│ [√] Bread │
└──────────────────────── 29 Nov 21:04 ──┘
- - - - - - - partial cut - - - - - - - -
+1
View File
@@ -0,0 +1 @@
{"title": "No stamp", "text": "stamp false leaves the bottom border plain.", "stamp": false}
+5
View File
@@ -0,0 +1,5 @@
┌─ No stamp ─────────────────────────────┐
│ stamp false leaves the bottom border │
│ plain. │
└────────────────────────────────────────┘
- - - - - - - partial cut - - - - - - - -
@@ -0,0 +1 @@
{"title": "Double-h", "text": "style double-h", "style": "double-h", "items": ["a"]}
+6
View File
@@ -0,0 +1,6 @@
╒═ Double-h ═════════════════════════════╕
│ style double-h │
│ │
│ [ ] a │
╘════════════════════════ 29 Nov 21:04 ══╛
- - - - - - - partial cut - - - - - - - -
@@ -0,0 +1 @@
{"title": "Double-v", "text": "style double-v", "style": "double-v", "items": ["a"]}
+6
View File
@@ -0,0 +1,6 @@
╓─ Double-v ─────────────────────────────╖
║ style double-v ║
║ ║
║ [ ] a ║
╙──────────────────────── 29 Nov 21:04 ──╜
- - - - - - - partial cut - - - - - - - -
+1
View File
@@ -0,0 +1 @@
{"title": "Double", "text": "style double", "style": "double", "items": ["a"], "done": [0]}
+6
View File
@@ -0,0 +1,6 @@
╔═ Double ═══════════════════════════════╗
║ style double ║
║ ║
║ [√] a ║
╚════════════════════════ 29 Nov 21:04 ══╝
- - - - - - - partial cut - - - - - - - -
+1
View File
@@ -0,0 +1 @@
{"title": "Single", "text": "style single, written in capitals", "style": "SINGLE"}
+4
View File
@@ -0,0 +1,4 @@
┌─ Single ───────────────────────────────┐
│ style single, written in capitals │
└──────────────────────── 29 Nov 21:04 ──┘
- - - - - - - partial cut - - - - - - - -
+1
View File
@@ -0,0 +1 @@
{"text": "Back at 3."}
+4
View File
@@ -0,0 +1,4 @@
┌────────────────────────────────────────┐
│ Back at 3. │
└──────────────────────── 29 Nov 21:04 ──┘
- - - - - - - partial cut - - - - - - - -
@@ -0,0 +1 @@
{"title": "Reminder", "text": "Call the plumber about the kitchen tap before Friday."}
+5
View File
@@ -0,0 +1,5 @@
┌─ Reminder ─────────────────────────────┐
│ Call the plumber about the kitchen tap │
│ before Friday. │
└──────────────────────── 29 Nov 21:04 ──┘
- - - - - - - partial cut - - - - - - - -