diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d3705f..a7c6aeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Added +- Label designer: a "Match printer size" button on the printer size note rescales the whole design to the paired printer's label (positions, boxes and text size), and a rejected Width or Length change now says fields extend past the new size and what to do. - Test labels: the cooldown is now 15 seconds and a refused re-print in the designer reads "Printer is busy, try again in Ns" instead of an error; the designer rechecks an offline printer every 15 seconds (plus a "Check again" button), re-saves once if the design changed mid-save, says when the saved design could not be used, and notes that Feie printers print the standard label. The test-print online check honours the virtual printer's longer window. - Label design: a "Print test label" button in the designer that saves a changed design, then sends a sample order to the booth's printer (off with a reason when the booth has no printer or it is offline). A booth picker replaces the 404 for vendors with several booths. New fields and logos land in a free spot instead of on top of existing ones. The rendered preview stays visible until the design changes and no longer waits forever on a stalled request. diff --git a/README.md b/README.md index 9a1fca6..12c80bb 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,12 @@ and as a table from the `md` (768px) breakpoint up. An "All labels / Needs a boo control (a client component, `src/app/dashboard/history/history-filter.tsx`) filters the list (`?unrouted=1` still deep-links to it), test prints have no Reprint, and the copy says "labels" rather than "jobs". +In the sticker designer (`src/app/dashboard/printers/designer/`), when the +label size does not match the selected printer's media, the printer-fit notice +offers a "Match printer size" button that resizes the template to the printer +(`fitTemplateToSize` in `src/lib/sticker-fit.ts`). If fields extend past the new +edge the resize is refused with a specific message instead of a generic error. + `/reset-password` shows its form only to the session a fresh reset link created, within 15 minutes, through a signed recovery-window cookie set by `/auth/callback`. Any other signed-in session gets the expired card. See diff --git a/src/app/dashboard/printers/designer/README.md b/src/app/dashboard/printers/designer/README.md index 09f686b..3c7c1b6 100644 --- a/src/app/dashboard/printers/designer/README.md +++ b/src/app/dashboard/printers/designer/README.md @@ -22,3 +22,5 @@ The designer page carries the tab title "Label design", matching its heading. A failed save shows its message through the shared `@merqo/ui` `FormError`. `loading.tsx` is the route's skeleton, built from the shared `Skeleton`, using the page's `max-w-6xl` cap so the layout does not jump when data arrives; the shared skeleton pulses only when motion is allowed. + +The printer size note offers "Match printer size" (not for Feie), which calls `fitTemplateToSize` from `src/lib/sticker-fit.ts` through the designer's `update()` so undo and saved status keep working. A Width or Length change that would push fields past the margins is refused with a message that names the cause and suggests Match printer size when a printer is paired. diff --git a/src/app/dashboard/printers/designer/printer-fit-notice.tsx b/src/app/dashboard/printers/designer/printer-fit-notice.tsx index 0ac7f97..27bcf77 100644 --- a/src/app/dashboard/printers/designer/printer-fit-notice.tsx +++ b/src/app/dashboard/printers/designer/printer-fit-notice.tsx @@ -1,4 +1,5 @@ import type { StickerTemplate } from "@/lib/sticker-template"; +import { Button } from "@merqo/ui/primitives"; export type DesignerPrinter = { model: string; @@ -18,9 +19,11 @@ const close = (a: number, b: number) => Math.abs(a - b) < 0.05; export function PrinterFitNotice({ printer, template, + onMatch, }: { printer?: DesignerPrinter; template: StickerTemplate; + onMatch?: () => void; }) { if (!printer) return null; if (printer.connector === "vendor_cloud") @@ -36,11 +39,18 @@ export function PrinterFitNotice({ ) return null; return ( -
+