MEGAINFRA-WEBAPP/src/app
DEls 068f622c0a feat(clock): photograph several pages, send them as one document
A delivery note that runs to two or three sheets has to arrive as ONE
batch. Sent a page at a time it became separate batches, and then
nothing could tell that page 2's line items belonged to page 1's note —
the totals sat on one batch and the items on another, with no way back.

Pages now accumulate. Take one, then Retake, Add page, or Send all.
A thumbnail strip shows what has been taken so far, ringed green or red
by how each page measured, so a mis-shot can be dropped without starting
the document over and nobody has to remember whether they got page 2.

Several pages are bundled into a single PDF and enter the pipeline
exactly like a scanned multi-page document: split.ts rasterises each
page, extract.ts reads each in isolation, and segment.ts decides from
the printed document numbers whether it is one note over three pages or
three separate notes. The person holding the phone does not have to know
which, which matters, because standing next to a truck they often can't.

The bundle is verified against the pipeline's own tools rather than
assumed compatible: the test writes one and runs pdfinfo and pdftoppm
over it — the exact binaries split.ts shells out to — checking the page
count, that every page rasterises, that portrait stays portrait, and
that page order survives. A bundle the pipeline could not open would
otherwise fail at the far end of an upload, on site, after the truck had
gone.

One page still uploads as its own JPEG: smaller, and it never loads the
PDF library at all. pdf-lib is imported dynamically and webpack keeps it
in a 412K chunk of its own, leaving the clock page's bundle at 24K —
checked in the build output, not hoped for.

Size is checked before sending, mirroring MAX_FILE_BYTES on the upload
route, so an oversized bundle is caught while the document is still in
front of the person rather than as a 400 afterwards.

1027 tests, typecheck clean, production build clean. The capture path
itself still needs a real phone — the browser pane here has no camera
and cannot reach localhost.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 19:10:16 +02:00
..
api fix(financial): stop counting supplier invoices as deliveries 2026-09-18 00:58:15 +02:00
clock feat(clock): photograph several pages, send them as one document 2026-09-18 19:10:16 +02:00
dashboard feat(delivery-notes): let an operator pick the purchase order themselves 2026-09-18 08:48:38 +02:00
login fix(auth): return to the originating page after PIN unlock 2026-09-12 00:14:55 +02:00
apple-icon.png chore(assets): resize apple-touch-icon to the new logo mark 2026-09-11 21:51:49 +02:00
apple-icon_old.png chore(assets): update application icons and logo with new designs 2026-09-11 20:54:44 +02:00
favicon.ico fix(employee-details): enhance detail drawer scrolling and layout 2026-08-25 23:38:35 +02:00
globals.css feat(clock): add orange viewfinder + scanning state to the QR screen 2026-09-14 00:28:47 +02:00
layout.tsx fix(pwa): emit apple-mobile-web-app-capable for iOS Add-to-Home-Screen standalone mode 2026-08-30 23:28:48 +02:00
page.tsx