preview-cuts #14

Merged
morgane merged 22 commits from preview-cuts into main 2026-10-18 10:24:06 +02:00
Owner
No description provided.
With the cut-out images there is no sheet: the panel now counts the images, one per mini, warns
before the download of the minis too large for Print Then Cut (their printed size, from the print
queue), and gives Design Space's steps instead of the "print at 100%" reminder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Images and colors converted from sRGB with Little CMS (lcms-wasm),
perceptual with black point compensation. ECI's PSO Coated v3 (default)
and PSO Uncoated v3 are bundled; a print shop's profile can be uploaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build/check-pdf-x.ts checks an exported PDF for what PDF/X-4 asks: the
output intent, XMP, boxes, embedded fonts, no RGB, and the total ink.
It found the 1.7 header pdf-lib writes: PDF/X-4 allows 1.6 at most.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Black and gray text prints in black ink only, at the darkness the
profile gives it, so small letters don't blur from the four inks being
slightly offset. Cut-out images are printed at home: the Colors option
is hidden and the print boost applies, whatever the setting says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PDF/X-4 asks each optional content configuration for a Name. The check
script now checks the layers: a name of its own, every layer in the
order, no AS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the cut layer or the cut files, nothing of the cuts is printed: the
Cuts button beside Margins hides them, to see the sheet as it prints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- PDF text keeps the layout's kerning: runs are drawn in pieces at
  their kerned positions, so the PDF matches the preview
- Fold lines are sized in points, not print pixels, so they no longer
  vanish at a high dpi
- Art editor: undo no longer reloads the whole image (watch sources
  compared one by one)
- The transformation worker takes the source image the chain was hashed
  from, instead of reading the mini again
- Deleting minis checks which images are still used inside its
  transaction
- Mini fields ignore the query of an earlier selection
- Print Then Cut exports the minis in the print queue, skipping the ones
  that fail

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each write applies what the tab changed since it last read its row to
the row as stored, in a transaction, and the row is followed with a
live query. Open tabs no longer undo each other's changes, a change
made before the row loads is kept, and a row is written only when it
changes. Stored rows are merged deeply over the defaults. The pending
write is flushed when the page is hidden or closed. A failed load
shows a toast and stops writing instead of leaving editors blank, and
a tab reloads when another one deletes the database.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An image no mini nor base uses (replaced, of a deleted base, of a
cancelled base draft) is deleted when a page that works on images
opens, if no other one is open: every such page holds a shared Web
Lock, as another page's undo or draft may still need the image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page plan (front and back line up at every rotation, cuts, order),
text layout with the bundled fonts (and the PDF's kerned pieces ending
where the layout measured), mat lines, ruler steps, units, rich runs,
and the settings merge, moved to utils/row-changes.ts to be tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- PDF images are embedded raw, PNG-predicted and compressed at once
  (utils/pdf-image.ts), in RGB as in CMYK: pdf-lib's embedPng kept
  every image decoded until the PDF was saved
- A cancelled transformation run stops after its current step, which
  is stored, instead of killing the worker (cancelOnAbort); a queued
  task rejects as soon as it is aborted
- Runs starting with the same step wait for each other instead of
  computing it twice (runChain)
- Distance transforms take 8 bytes a pixel instead of 24, exactly
- Stale page previews and thumbnails are cancelled; bitmaps freed when
  a page's images fail and after background removal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The landing page loads the database and the import code when it
  needs them: 154 kB to 119 kB of scripts (gzip) before it renders
- The French page preloads its messages, fetched with the page's
  scripts rather than once they run; the build fails when index.html
  loses its <!--page-head--> placeholder
- The art editor loads fontkit with its printed view: its chunk goes
  from 181 kB to 21 kB (gzip)
- Importing from the landing page in English now opens the minis page,
  in English (by route name, not the "/" path)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- useElementSize replaces nine hand-written ResizeObservers (the tool
  strip's, which watches its buttons, stays)
- useRemovalProgress replaces the two copies of the background removal
  progress channel
- MM_PER_INCH lives in utils/units.ts instead of nine copies and two
  bare 25.4
- French: "Aperçu imprimé" in the art editor's shortcuts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TemplateEditorForm holds the layout and the sticky actions with their
alert, and goes to the invalid field when saving fails;
useTemplateForm gives the shown error, the field it is about and its
id, and focuses the name on opening; TemplateNameField is the name with
its error under it (bases, paper formats). The three editors keep only
their fields, their checks and what they save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- On phones, a link of the open menu did not navigate: closing the menu
  took its history entry back while the navigation was pending, which
  cancelled it. Links over the open menu now replace its entry, and the
  menu closes once there
- A print shop's own profile is written as a Custom output intent,
  named in Info and in no registry, as preflight checks expect
- check-pdf-x decodes PNG predictors, so it checks the ink of the
  images again, and checks Custom output intents

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Adjust, BackLook, Mirror and MergeSides are stored only at the end of
  a chain: quicker to run again than to encode and store at full size
- A cached cut path is traced again when TRACE_VERSION or the smallest
  area kept changes (cutPathKey)
- Every transformation has a version, so a step can no longer be added
  without one (cached images of the steps that had none are made again
  once)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The worker already holds each mini's final pixels and cut mask: it now
draws the folds, whitens the paper, clears outside the cut, crops and
encodes the PNG there (utils/cut-out-image.ts), instead of the main
thread reading every pixel of each mini. The images are unchanged,
byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each lined-up image is keyed by the hash of its chain
(getMiniSideHash), which holds everything the image depends on,
instead of the whole mini: a name, a text, a back image or a setting
the front does not use no longer makes it again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
placeTexts (utils/text-placement.ts) lays each block out and gives
every run one matrix (placed in its region, turned with it, slanted
for a drawn italic) and every background its place on the image.
planPage puts them in its text items when given the fonts' metrics;
the canvas draws each run through its matrix, the PDF the same matrix
flipped to its y going up, instead of each working the turned regions
out on its own. The preview and the PDF are unchanged (same pixels,
same text transforms). The ruler's label is in the bundled Instrument
Sans on both, instead of sans-serif and Helvetica. Matrix helpers move
to utils/matrix.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The hash of a side's final image, from the real images store
  (happy-dom, fake-indexeddb): the same for the same image whatever
  the mini's id, name, copies or text; changed by the height, the
  source image, the dpi, the back on a merged front, an art edit; not
  by an edit that changes nothing
- The backup: everything comes back (image bytes included) but the
  images no one uses; importing some parts keeps the others; a file
  that is not a backup is refused
- The images store checks navigator.locks itself: some environments
  define it empty. A Vitest setup file adds Uint8Array.toHex for older
  Node versions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every hash of the image cache used Uint8Array.prototype.toHex (Safari
18.2, Chrome 140): in an older browser, no mini could be made. toHex
(utils/hash.ts) writes them by hand, as image hashes already were; the
hashes are the same, so no cached image is made again. The tests no
longer need it added for older Node versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
morgane deleted branch preview-cuts 2026-10-18 10:24:06 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
morgane/2dminis!14
No description provided.