Commit Graph
1891 Commits
Author SHA1 Message Date
Mex d22b67d418 fix: follow selections when resolving tracked changes 2026-11-15 20:02:25 +01:00
Mex 543ba8888d fix: preserve book style source across chapter edits (#2841)
Adjust the stored style-source index when inserting or removing earlier chapters, retaining existing source-removal fallback behavior.
2026-11-15 16:09:59 +00:00
Mex ca463bab52 cli: report failures after keep-going scripts (#2836)
* cli: report failures after keep-going scripts

Keep executing requested steps while retaining the first failure in Report, so failed scripts return nonzero before save/export.

* docs: describe first script failure in Report

Describe the first failing step without assuming all callers stop immediately.

* test: cover keep-going failure reporting and output guards

Exercise failures before and after a successful step, preserve the first failure, and require both output paths to remain absent.
2026-11-15 14:59:06 +00:00
jayzed80 9f8e166f8d Pages: a new page takes the parent of the page it follows (#2788) (#2817) 2026-11-15 06:23:32 +00:00
.CooCoo bcebb83a93 Captions: a live caption update gives the document a new revision (#2773)
When a command leaves a live caption behind its source, the pass after
the command rewrites the caption's text but kept the document's
revision. The Pages panel thumbnails, the separations preview, the
preflight worker and the Links panel key their caches by (uid,
revision), so they kept drawing the old caption. The pass now bumps the
revision when it changes the document, as Smart Text Reflow and
auto-size already do.
2026-11-15 05:51:45 +00:00
.CooCoo 59c6fa1b49 Recovery: test that a write queued behind a cancelled one keeps its place (#2771)
worker::submit answers Conflict when this session's write is cancelled
and another session's write waits to follow it, so a later edit cannot
replace that waiting write. No test covered that answer. The new test
fails when the check is removed.
2026-11-15 03:14:34 +00:00
.CooCoo 147cf23a7b Tables: table.setCell records no undo step when the cells already have the values (#2778)
* Tables: table.setCell records no undo step when the cells already have the values

When every value table.setCell sets already matches the target cells, the
command leaves the document as it is: no undo step and no new revision.
Setting a cell's text to the text it already holds keeps its story, and a
stroke the chosen edges already show as their highest-priority local
stroke is not renumbered. The edited table replaces the old one directly,
so a change copies the table once, as before.

* Tables: table.setCell keeps a cell's character formats when the text is the same

A table.setCell call whose text matched a cell with more than one character format replaced the text anyway: every character took the first character's format and the call recorded an undo step. The cell's story is now left as it is when its text already matches.

* Tables: table.setCell applies a stroke when a neighbor draws the shared edge

When both copies of a shared edge had the table's highest priority and the neighboring cell won the tie, a stroke edit whose result matched the selected cell's own copy was skipped, and the edge kept the neighbor's stroke. The edit is now skipped only when the selected cell's stroke is the one drawn.

* Tables: table.setCell checks the whole drawn side before skipping a stroke

A repeated stroke edit was applied again, with a new undo step, after any other edge in the table had been edited, because the check required the edge to hold the table's highest priority. The check now compares the cell's stroke with every part of the side as drawn, so an edit elsewhere does not count, and a merged cell's side still takes the edit when a neighbor draws a different stroke along part of it.
2026-11-15 03:13:35 +00:00
.CooCoo ad4683c5ff Paste: params text gives the pasted image's size as its stored resolution (#2783)
File › Place now sizes a raster by the resolution stored in the file,
and one point per pixel only when the file stores none. edit.pasteImage
uses the same size, so its params text and comment say so, and a test
pastes a 144 ppi PNG and checks that it comes in at half its pixel size.
2026-11-15 03:11:52 +00:00
.CooCoo 83cda16bd0 Captions: live captions follow a gesture when it commits (#2786)
* Captions: live captions follow a gesture when it commits

A preview skips the live caption refresh, and committing the gesture ran
none, so a caption kept its old text until the next command. Committing
an interaction now brings live captions up to date in the same undo
step, auto-sizes the caption frames it changed, and gives the document
a new revision.

* Captions: a live caption inside a group follows its source

The refresh after a command and after a committed gesture looked for live
captions only at the top of each spread, so a document whose only live
caption was grouped never refreshed it. Both checks now look inside groups,
as the refresh itself does.

* Captions: keep the caret inside a live caption that refreshes

When a live caption's story is replaced with its source's text, the text
selection kept its old offsets. Typing into a live caption, or a source
change that shortens one, left the caret past the end of the story, and
the IME text context reported nothing. The selection is now clamped to
the refreshed story, after a command and after a committed gesture.
2026-11-15 03:09:04 +00:00
Dylan M. Taylor d5f82c2143 links: allow only web and mail URLs (#2809)
Hyperlinks and buttons accepted any scheme and passed it to the PDF exporter, so an imported file could emit file:, javascript: or UNC links that a recipient's viewer may follow. Add a shared http/https/mailto check at both command entry points and use the same check at export.
2026-11-14 17:31:42 -05:00
FredApps 8b8837bcf1 Tests: a FIFO read may end or report would-block, as long as it returns (FreeBSD) 2026-11-14 16:28:03 +01:00
autocraft-bot[bot] fca649eda8 Merge pull request #2787 from dotCooCoo/fix/stroke-rejects-out-of-range-values
Stroke: object.stroke refuses out-of-range numbers and unknown names
2026-11-14 14:25:09 +00:00
autocraft-bot[bot] b5a4e784c8 Merge main into fix/stroke-rejects-out-of-range-values 2026-11-14 14:08:21 +00:00
aiongg 7ac9cafa7e DES-10: a save waits for the open-time checks of linked files
File > Save, Save As, Save a Copy and the saves before close and quit,
asked for while the open-time link or migration checks of the document
run, wait for them and then write, so the first save of a document saved
before linked storage already writes links. The UI defers the save and
re-issues it once links.checking() turns false; the status line counts
the files left ("Checking N linked images…"), Esc saves at once.
Recovery snapshots and the control channel's file.save don't wait.
links.progress reports how many files are left.
2026-11-14 13:57:06 +00:00
aiongg bcb0711a7c Merge remote-tracking branch 'upstream/main' into perf-main 2026-11-14 13:50:31 +00:00
aiongg 357c9dcd8c DES-10: exports check kept linked bytes against the file; PDF output cache only for links
- AssetData::load_for_output uses linked bytes already in memory only while
  the file still holds them (Loader::holds: fingerprint, else hash, else the
  kept bytes); a changed file is exported from disk with the warning.
- PDF export keeps output bytes per asset only for linked assets, and tells a
  placed PDF by its bytes (a proxy by the asset's type).
- links.list reports a link outside the automation read roots as missing
  while the open-time check still runs.
2026-11-14 13:40:37 +00:00
FredApps e230c4e406 Merge pull request #2751 from AlPaka1234/fix/2743-pdf-cmyk-profile
PDF export: attach working CMYK profile as /DefaultCMYK (#2743)
2026-11-14 14:37:17 +01:00
aiongg d380fca0d0 DES-10: link placed files at once; saves make missing proxies, never hashes
A file placed from a path becomes a link immediately, with its size and
time as the fingerprint and its bytes kept resident. The background job
adds the content hash and proxy to the live document, undo history and
saved state without changing storage. Saves (file.save, saveACopy,
serialize, recovery snapshots) make the proxies still missing and write
links without a hash. An open hashes a no-hash link whose file matches by
size and time. embed:true placements hash while placing. The embed-until-
hashed path (settle_pending, settle_copy, keep_embedded) is gone.
2026-11-14 13:10:36 +00:00
aiongg 03169f1ca5 DES-10 review: clippy (needless borrows, split preflight's modified-link check) 2026-11-14 12:57:16 +00:00
aiongg c9c0f6deb4 DES-10 review: placing returns before proxies and hashes are made
Placing from files (file.place, place.load, table and media posters)
embeds each graphic with its link record and queues its content hash
and proxy on the link-check thread; the poll links it under the same
key, in the live document, the undo history and the saved state. A
save before then hashes the pending graphics from their bytes and
writes them embedded. crop_pdf checks the crop choice and mime before
reading, and place and relink pass the bytes they already hold.
2026-11-14 12:51:26 +00:00
aiongg 7a2efd9c6d DES-10 review: IDML stored previews are checked before they become proxies
A linked graphic's stored preview is decoded, re-encoded within the
proxy limits when bigger (1024 px, 512 KiB) and dropped when it doesn't
decode. It is used only when it shows the whole raster image; otherwise
(a PDF, whose preview shows its crop, or other proportions) the proxy is
made from the file, with the preview as the fallback. Graphics that stay
embedded keep no proxy.
2026-11-14 12:48:13 +00:00
aiongg 3bd9332a6c DES-10 review: export linked graphics in EPUB/HTML, PPTX, IDML and packages; cache output bytes in PDF export 2026-11-14 12:47:03 +00:00
aiongg b8be148b4c DES-10 review: link status after open, preflight without reading originals
- Open queues every linked file's lookup (stat, then hash) for the background
  check instead of stating candidates on the UI thread.
- links.list, links.update and relinkFolder use the open's status only while
  its check is still running; afterwards the file is looked at as it is now.
- Preflight tells Modified from size, time and the remembered hash checks
  (the worker keeps them between passes) and the vector test from the mime
  type; it never loads a linked original.
- A modification time of 0 never vouches for a file's bytes.
- Migration keeps an unsettled time as UNVERIFIED_MTIME; recovery snapshots
  keep images not yet saved as links embedded.
- Links panel test fixture has real files, so its Embedded assertions hold.
2026-11-14 12:46:23 +00:00
aiongg b73c3dd87a Build: restore designcraft_format::write; render decode without the image crate (#2780)
* Build: restore designcraft_format::write for recovery; render decodes without naming the image crate

* Build: collapse the nested if in images tone (clippy)

* IDML export: placements in cells and footnotes embed their PDF layer choices

* Tests: Word fixtures carry the document relationships part

* PDF/X-4: untagged WebP images carry sRGB

* Images: CMYK TIFFs with other inks fall back to RGB; associated alpha keeps its inks

craft-image-codecs' TiffPage lists InkSet (storytold/craft-libs#1307), so decode_cmyk_tiff
again refuses InkSet 2 instead of reading other inks as C, M, Y and K. Associated alpha
is made straight by the decoder; the PDF tests check those inks and that alpha.

* PDF tests: CMYK fallback expects the screen's RGB; alpha images read the masked image

The RGB fallback for other inks converts through the working CMYK space, as decode_rgba
does, so the test takes its expected samples from decode_rgba. image_color_samples took the
first image stream, which for an image with alpha is its soft mask.

* Images: repin craft-image-codecs to the InkSet enum (storytold/craft-libs#1307)

* Pin craft-image-codecs to storytold/craft-libs ea1c842 (#1307)
2026-11-14 07:42:07 -05:00
FredApps f07bf58d5b 2743: integrate DefaultCMYK export with shared PDF APIs
Resolve main dependency migration; retain flate2 production usage and route new PDF parsing through craft-pdf. Owner directs hosted CI validation for this integration; full local gate not run.
2026-11-14 13:17:29 +01:00
aiongg e3f14a8552 DES-10 T8: export, package and preflight handle linked assets
Export and package read a linked original from disk (hash-checked), a package copies it and keeps a link to the copy, preflight reports a missing link as an error and a modified one as a warning, and a linked alpha-wrap image opens without reading its original.
2026-11-14 11:58:21 +00:00
aiongg 9c66115fce DES-10: linked graphics from IDML, packages and file checks agree with T6 linking
IDML imports link the files they read through links::link_to_file, the
path File > Place takes, so a file read just after it was written keeps
an unverified fingerprint and its status comes from the hash instead of
reading as missing. File > Package and Links > Copy Links To point a
linked graphic's record (paths, unverified fingerprint) at its copy.
Regular-file metadata goes through io::file_metadata, which the file
guard accepts.
2026-11-14 11:56:59 +00:00
dotCooCoo b6835aa4f2 Stroke: object.stroke refuses out-of-range numbers and unknown names
object.stroke clamped tint, gapTint, weight and miterLimit into range
and skipped an align, cap, join, start or end value it could not read,
so a bad value still reported a change. It now refuses a tint or gap
tint outside 0 to 1, a weight outside 0 to 1000 pt, a miter limit
outside 1 to 500, a gapOverprint that is not true or false, and a name
the stroke does not have, with or without a selection, and leaves the
document as it was. The Stroke panel's Weight and Miter Limit fields
keep their values in those ranges.
2026-11-14 02:46:50 -08:00
aiongg dadb2993e9 DES-10 T6: Links status by hash, update, embed and unembed for linked graphics
links.list gains storage; a linked graphic's status comes from the open
check while its bytes are unchanged, else from its files: OK by size and
time without reading, else by content hash; Modified or Missing. Update,
Relink and Relink to Folder read the file into a new linked version with
a new hash and proxy. Embed checks the file first and keeps the link
record; links.unembed links to the original when it holds the same
bytes, else writes them into dir. Not on the web.

(cherry picked from commit 8d617b872f7d7b01b9551d07a3e82be03e1c1362)
2026-11-14 06:46:11 +00:00
aiongg ade2d3cfd4 DES-10 T6: graphics placed from a file link to it by default
File > Place, the place cursor (place.load, grid, contact sheet), media,
media posters and table graphic cells record the file's absolute path,
its path relative to the document, size, time and content hash, and a
proxy image, and keep the bytes read for placing in the linked-bytes
store for the first draw. embed: true keeps the bytes in the document
with the link record. base64 bytes and the web always embed.

(cherry picked from commit 4f5bd99088b2f32bece3be08258ec66c15dd3b44)
2026-11-14 06:46:11 +00:00
aiongg 957e073664 DES-10 T9: IDML and INDD imports link the graphics they reference
(cherry picked from commit 995b248cd3b591cae6dd7dd0f9a1b10cac89f22d)
2026-11-14 06:45:09 +00:00
aiongg da524dec9b DES-10 T7: save, open, recovery and migration for linked assets
Save records each link's absolute path and its path relative to the
destination; linked assets write their record and proxy only, and Save a
Copy {embedLinks: true} copies every linked file in (failing on a missing
or changed one). On the web, links stay links with a warning.

Recovery snapshots record links as a save to the document's own file
would, never their originals; recovered documents resolve relative links
against the recorded document path.

Open (and Revert, Open Bytes, Recover) points each linked asset at its
file without reading it: a file with the recorded size and time is the
one; one with the recorded size and another time is hashed on a
cancellable background thread (native_links), absolute path first, and
the first hash match wins and keeps its new time. No match is Modified.
Status is kept on DocState::links for the Links panel; links.progress
applies results and gives the status-line notice once.

Documents saved before linked storage (embedded assets with a link and
no content hash), opened from a file, get a background byte comparison;
confirmed images get their hash and a proxy and save as links, and their
in-memory bytes become a link after that save. Changed or missing files
stay embedded.

Based on #1108 by ForestParks.

(cherry picked from commit 3a453b7f3752d255b6f74cfb55ea2459c5d9a074)
2026-11-14 06:25:01 +00:00
aiongg 3f1cbb4d23 Tests: Word fixtures carry the document relationships part
(cherry picked from commit 0ba9ad4fe5)
2026-11-14 06:23:07 +00:00
aiongg 7579d0d987 Place: test helper avoids unwrap; fmt 2026-11-14 06:22:51 +00:00
aiongg f024edb544 Place: arrow keys cycle the loaded images between drags (place.cycle) 2026-11-14 05:56:46 +00:00
aiongg 91f78b2db9 Place: Escape drops the current loaded image and loads the next (place.skip) 2026-11-14 05:54:59 +00:00
aiongg 7f0c2818f2 Place: closing a background document keeps the active document's place cursor 2026-11-14 05:50:35 +00:00
aiongg c8f105dd65 Merge pr-2308 (place contact sheet) into multi-place 2026-11-14 05:49:47 +00:00
aiongg 2ee301bd4b Merge pr-2302 (place cursor queue) into multi-place 2026-11-14 05:49:14 +00:00
aiongg b9a5bcbecc DES-10 T3: linked asset store and the engine's file loader
AssetData::linked carries a LinkedSource (absolute and relative path, document,
size, fingerprint, content hash). Linked bytes load through a process-wide
single-flight LRU store (512 MiB, 1 GiB per file) and the Loader the engine
installs in Session:🆕 absolute path first, then relative; a changed
fingerprint is checked against the hash, and other bytes are Modified.
Proxy.data is an AssetData so its decodes have a key of their own.
2026-11-14 05:37:36 +00:00
aiongg 55a0c7da3d DES-10 T2: port asset byte users to AssetData
Export, import, links, preflight, alpha wrap and the UI read bytes with
AssetData::load; every asset is still embedded.
2026-11-14 05:15:03 +00:00
Dylan M. Taylor 32274e843a Merge codex/designcraft-craft-libs into origin/main: cut over document formats and codecs to craft-libs 2026-11-14 02:13:28 +00:00
Dylan M. Taylor 77991abe6f fix(file): preserve legacy JSON on INDD paths 2026-11-14 00:40:59 +00:00
Dylan M. Taylor b681b10733 Pin DesignCraft shared codecs to merged fixes 2026-11-13 23:53:29 +00:00
AlPaka1234 3753d9498f Merge remote-tracking branch 'origin/main' into fix/2743-pdf-cmyk-profile
# Conflicts:
#	ROADMAP.md
2026-11-13 22:56:36 +01:00
AlPaka1234 dbdc5b697a Tools: snap Gap tool drags to active snapping settings (#2637) (#2749)
* Tools: snap Gap tool drags to active snapping settings (#2637)

* Tools: reject unreachable Gap tool snap targets beyond resize clamp

* Tools: preserve raw Gap tool delta when no reachable snap matches
2026-11-13 20:58:31 +01:00
AlPaka1234 a905cb64e1 PDF export: attach working CMYK profile as /DefaultCMYK (#2743)
Fixes #2743.

Attach /DefaultCMYK [/ICCBased ...] referencing the CMYK working space profile on every page, inherited /Pages resource dict, Form XObject, SMask form, tiling pattern, and Type3 font resource scope outside PDF/X-1a and PDF/A-2b. Plain print exports and booklets embed one shared Flate-compressed /N 4 ICC profile stream without adding /OutputIntents or /Trapped; PDF/X-4 reuses the catalog GTS_PDFX /DestOutputProfile stream; RGB-blend documents attach /DefaultCMYK only when content or resources use DeviceCMYK.
2026-11-13 20:33:05 +01:00
Dylan M. Taylor bfbb831e54 Use shared neutral SVG scene for paste 2026-11-13 04:25:01 -05:00
Dylan M. Taylor 2769d0b88f Move DTD and raster encoding to craft-libs 2026-11-13 04:13:55 -05:00
Dylan M. Taylor 916749b2d0 Delegate XML parsing and PPTX writing to craft-libs 2026-11-13 02:13:35 -05:00