diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c3d207..36aa13c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,10 +31,37 @@ ADR-007 and ADR-002. - **Contents can be positioned inside the label without moving the label.** Align and Vertical place the code and caption block anywhere on the stock, and Content X/Y nudge it from there. The existing X/Y nudge kept its - behaviour and is now labelled Media X/Y: it moves the whole printed area, for + behavior and is now labeled Media X/Y: it moves the whole printed area, for a printer whose origin is off, which is a different problem from composing a label. +- **A picture can go on the label.** Pick an image once and it prints on every + label - above the code, beside it, or behind everything as a watermark - on + the front, the back, or both. The file never leaves the browser, so an + air-gapped site can use it, and it is deliberately not saved between visits: + a data URL runs to megabytes and would take every sizing value with it when + the storage quota gave out. +- **The back can carry its own code, in its own symbology.** "Back carries" now + defaults to a code rather than text, takes per-row content from the CSV + `back` column, and has its own QR/CODE128 choice - a QR on the front that + opens the record, a CODE128 on the back that the bench scanner already reads. + A back set to carry a code can no longer be laid out as text-only: that + combination printed a blank card that looked like the code had failed, and it + is corrected on load for anyone who already saved it. + +### Fixed + +- **The generator prints from inside the app shell.** It was a full-screen + route with no sidebar and a narrow column of controls on the left. It is now + an ordinary page - navigation, full width - and `style.css` hides the shell at + print time, so the stock still gets nothing but labels. Verified against a + real print PDF rather than a preview. +- A test print paired each page with a code by loop position while the codes + are keyed to position in the whole run, so a two-sided test card could carry + the wrong code. The page index now travels with the page. +- The back label's dotted preview outline outspecified the print reset and drew + a dashed rule down the edge of every second card. + ### Changed - CSV parsing and page building moved out of the generator component into diff --git a/frontend/src/assets/style.css b/frontend/src/assets/style.css index 36e9d98..5038c54 100644 --- a/frontend/src/assets/style.css +++ b/frontend/src/assets/style.css @@ -1763,3 +1763,31 @@ td.actions .btn + .btn { independently. */ .clickable-row { cursor: pointer; } .clickable-row:hover td { background: var(--bg); } + +/* --- Printing from inside the app shell ------------------------------------- + * + * Core's label pages are full-screen routes precisely so the shell cannot reach + * the stock. A tool someone works in for ten minutes wants the navigation + * though, so the shell is hidden here instead: the sidebar goes, the content + * column gives back the margin it was holding for it, and the notification + * banner - which is chrome, not content - goes with them. + * + * Anything the page itself must keep off the paper marks itself .no-print. */ +@media print { + .sidebar, + .notification-banner, + .no-print { + display: none !important; + } + + .app-layout { + display: block !important; + min-height: 0 !important; + } + + .main-content { + margin-left: 0 !important; + padding: 0 !important; + overflow: visible !important; + } +} diff --git a/plugins/tools/frontend/routes.js b/plugins/tools/frontend/routes.js index aa15285..e17ac47 100644 --- a/plugins/tools/frontend/routes.js +++ b/plugins/tools/frontend/routes.js @@ -3,9 +3,12 @@ * * `default` = AppLayout child routes; `toplevel` = full-screen routes. * - * The index sits inside the app shell. Each tool that PRINTS is toplevel, the - * way every other label page in this repo is: printing from inside AppLayout - * would put the sidebar and header on the label stock. + * The generator sits INSIDE the app shell, unlike the label pages in core. + * Those are toplevel because a print from inside AppLayout would put the + * sidebar on the label stock - which is true unless the print stylesheet says + * otherwise, and style.css now does: the shell is hidden at print time so only + * the labels reach the page. A tool someone spends ten minutes in wants the + * navigation; a one-shot print page does not. */ export default [ { @@ -14,11 +17,8 @@ export default [ component: () => import('./views/ToolsIndex.vue'), meta: { requiresAuth: true, plugin: 'tools' } }, -] - -export const toplevel = [ { - path: '/tools/codes', + path: 'tools/codes', name: 'tools-codes', component: () => import('./views/CodeGenerator.vue'), meta: { requiresAuth: true, plugin: 'tools' } diff --git a/plugins/tools/frontend/views/CodeGenerator.vue b/plugins/tools/frontend/views/CodeGenerator.vue index 9b1cac6..78fb6a6 100644 --- a/plugins/tools/frontend/views/CodeGenerator.vue +++ b/plugins/tools/frontend/views/CodeGenerator.vue @@ -1,12 +1,12 @@