Commit Graph
1054 Commits
Author SHA1 Message Date
aiongg 5bc9594679 Merge #511: Place: PDF pages and SVGs keep their exact size
Conflict: crates/engine/src/cmd/file.rs: file_place keeps next's PdfCrop block (pdf_crop, Asset, crop_pdf, (nw, nh) fallback) with the PR's exact natural size for (nw, nh); the PR's crop_box match dropped; pdf_crop_tests keep both tests
2026-10-11 18:01:34 +00:00
aiongg 3fedc862f6 Merge #510: Color parsing: one scale per colour, not per component
Conflict: crates/engine/src/cmd/style.rs: parse_color object arm keeps next's early gray branch (per-value scale), then the PR's shared-scale CMYK
2026-10-11 18:01:14 +00:00
aiongg 1f6004505e Merge #506: Recovery: each running app keeps its own recovery data
Conflict: crates/engine/src/recovery.rs: run_dir takes the PR's DirBuilder (0o700 on Unix, create_dir elsewhere); rest is next's
2026-10-11 18:00:49 +00:00
noah1400 8119eece43 Recovery: run_dir passes clippy on Windows (#496)
The builder for a run's folder was `mut` only for the mode that Unix
sets, so `-D warnings` rejected it everywhere else. The folder is now
made the way `secure_recovery_dir` makes the recovery folder: with its
mode on Unix, and with `create_dir` elsewhere.
2026-10-11 19:39:09 +02:00
Sean HammondandClaude Opus 5.5 f23fa33e16 Parent-page items are composed for their page by index, not page name
A running header (or any text variable) in a parent-page frame was empty or
wrong on pages whose page number repeats an earlier one: with two sections
that both number from 1 (front matter 1-10, body 1-...), body pages 1-10
showed nothing. The renderer and PDF export passed only the page's name to
the composition cache, which looked the page up as the first page with
that name - in the front matter, before any heading.

CompositionCache::get now takes the absolute page index (None for a story's
own frames) and derives the name for page-number markers from it; the cache
is keyed by index, so two pages with the same name no longer share a
composed header. The renderer and PDF export pass first_page_of_spread + i.

Test: running_header_on_parent_page_with_repeated_page_numbers (pages named
1, 2, 1, 2; the only heading on the third page). Before the fix the third
page's header was empty (0 glyphs); with it, "Epsilon" (7).

Found with an InDesign IDML (a dictionary with two sections and Match
Character Style running headers on its parent page), together with #301.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CgGsJkVe5GYG9qK6VFdECa
2026-10-11 16:56:41 +00:00
moppeeerandClaude Opus 5.5 7234fd9080 feat(engine): Document Setup sets every page's margins; refuses impossible sizes
layout.documentSetup takes `margins` (a number or {top, bottom, inside,
outside}) for every page and parent page, in the same undo step as the
rest of the setup; with adjustLayout objects follow the new margins too.
It reports the first page's margins and whether the document has a
primary text frame. Widths and heights outside 0-216 in, and margins it
can't read or outside 0-216 in, are refused before anything changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:53:40 +02:00
japbcoelhoandClaude Opus 5.5 72bdc0a919 Place: PDF pages and SVGs keep their exact size
file.place sized a placed PDF page (and SVG) from its size rounded to
whole points, while the export draws the page into that size: a page of
91.774 x 613.276 pt became 92 x 613 and was drawn 0.25 % wider and
0.3 % shorter, so pieces laid edge to edge left gaps of up to 1.9 pt.
A 100.4 x 50.4 pt page placed 100.4 pt wide came out 50.2 pt tall:
`Rect { x0: 0.0, y0: 0.0, x1: 100.4, y1: 50.2 }`.

The graphic's natural size is now the exact page (crop box) or SVG size;
the rounded pixel size stays for display and preflight. place.load (the
place cursor) gets the same exact size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 13:52:46 -03:00
japbcoelhoandClaude Opus 5.5 5a1e9de92e Color parsing: one scale per colour, not per component
A CMYK component of 1 or less was read as a fraction even when the other
components were percentages, so {"c": 0.7, "m": 0, "y": 12.2, "k": 0}
(a pale cream) became C 70 % Y 12.2 % and exported as
`0.7019608 0 0.12156863 0 k`. The same applied to RGB arrays.

Now a colour is read as percentages (0..100, or 0..255 for RGB) when any
component is above 1, and as fractions only when every component is
within 0..1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 13:52:46 -03:00
aiongg 933cfb11e6 Integration: recovery folders build on Windows without an unused mut (#506) 2026-10-11 16:40:05 +00:00
aiongg ee2f4dffd6 Merge #506: Recovery: each running app keeps its own recovery data 2026-10-11 16:36:07 +00:00
noah1400 257fb08dbd Recovery: each running app keeps its own recovery data (#496)
Document uids start at 1 in every process, and every running app wrote
its recovery entries into the one recovery folder. Two apps wrote over
each other's `1.designcraft`, and an app that started reopened and
removed the entries of one still running.

A run now has a folder of its own in the recovery folder and holds a
lock in it for as long as it runs. An app that starts moves the entries
of runs that have ended, and those an earlier version wrote, into its
folder and reopens them. A locked folder is left alone.
2026-10-11 16:55:39 +02:00
aiongg a5b8d99164 Merge parent-margins: Layout: parent pages pass margins and guides to their pages
Conflict: crates/doc/src/page.rs: next's Spread::parent_page_for_side is the one parent-page choice (single-sided pages take the first page); the branch's parent_page_index is dropped and its IDML import caller (crates/idml/src/import.rs) uses parent_page_for_side
Conflict: crates/doc/src/build.rs: the branch's parent_page_of/parent_page/parent_guides/margin sync on next's parent_page_for_side; tests both
Conflict: crates/engine/src/cmd/layout.rs: test modules both
Conflict: crates/engine/src/tests_idml.rs: tests both
Conflict: crates/format/src/lib.rs: next's upgrade and duplicate-asset merge, then the branch's mark_differing_margins_local, in both loaders
Conflict: ROADMAP.md: both log lines
Conflict: docs/target-app-parity.md: next's snapping line plus the branch's parent-page guides
2026-10-11 13:12:06 +00:00
aiongg 1daf0a8ec8 Integration: custom wrap boundaries with graphic text wrap
wrap-boundary gives TextWrap a custom path (so it is no longer Copy) and drops it when
object.textWrap sets an offset or contour; next lets object.textWrap edit a placed graphic's
own wrap. The command drops the boundary of the wrap it edits, and next's graphic-wrap IDML
test clones the wrap it compares.
2026-10-11 13:11:02 +00:00
aiongg b6cc59d349 Merge wrap-boundary: IDML: import and wrap around custom text-wrap boundaries
Conflict: crates/compose/src/lib.rs: the custom boundary goes into next's shared wrap_exclusion(); free_slots keeps next's JumpObject handling outside it and takes the branch's combined BoundingBox/Contour arm
Conflict: crates/engine/src/cmd/object.rs: params doc has next's content flag and the branch's custom-boundary note
Conflict: crates/engine/src/tests.rs: both tests
Conflict: crates/idml/src/export.rs: the boundary goes into next's text_wrap_pref()
Conflict: crates/idml/src/import.rs: next's object-style-aware text_wrap() plus the branch's boundary parsing for the item's own wrap; pdf_page_in and wrap_path_of both kept
Conflict: crates/idml/src/tests.rs: both sides' tests
2026-10-11 13:08:12 +00:00
aiongg 25aa2735b8 Merge copy-notes: Text: footnotes insert into a story whose references lack footnotes
Conflict: crates/doc/src/slice.rs: tests module keeps next's append_story overflow test and the branch's copy/paste and hostile-marker tests
2026-10-11 13:04:05 +00:00
aiongg 470aac7d10 Layout: parent pages pass margins and guides to their pages 2026-10-11 13:02:23 +00:00
aiongg fe8a724da4 Text: footnotes insert into a story whose references lack footnotes 2026-10-11 12:54:42 +00:00
aiongg 47d17ca6f5 IDML: import and wrap around custom text-wrap boundaries 2026-10-11 12:53:50 +00:00
aiongg 6cf1933a13 Text: notes insert into a story whose markers lack payloads 2026-10-11 12:43:59 +00:00
aiongg d6309bae32 Text: copied text keeps its endnotes and editorial notes 2026-10-11 12:31:59 +00:00
aiongg 8acb2fbdce Merge #463: Docs: explain hyphenation defaults and image fitting modes to agents
Conflict: crates/engine/src/cmd/text.rs: text.formatParagraph params doc keeps next's drop-cap fields and adds the PR's "hyphenate?: bool (default true)"
2026-10-11 12:24:26 +00:00
aiongg 9ed4aba3da Merge #456: Wrap saved story revision counters consistently
Conflict: crates/doc/src/edit.rs: next's thread_frames (append_story); every rev += 1 is rev.wrapping_add(1)
Conflict: crates/engine/src/cmd/fonts.rs: next's replace (the local-formatting pass moved out of this hunk)
Conflict: crates/engine/src/cmd/text.rs: next's format_chars (apply_char_attrs, typing format); rev += 1 is rev.wrapping_add(1)
2026-10-11 12:20:08 +00:00
Middle DiscandClaude Haiku 5.5 2b55f2ed0d Layout: parent-page margins and guides, Create Guides on the current page, ruler-unit-aware Margins and Columns
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWRYQ5eieuUrtxhdbh6goq
2026-10-11 12:16:18 +03:30
KnottyDyes 97b753619a Docs: explain hyphenation defaults and image fitting modes to agents
Command descriptions left the new-text hyphenation default and image fitting outcomes implicit. State the default and each fitting mode's semantics, and add an MCP example that disables hyphenation. No behavior changes.
2026-10-11 01:26:26 -06:00
sanyamsingh001andCodex f58c212289 QA1: wrap saved story revisions consistently
Co-Authored-By: Codex <codex@openai.com>
2026-10-11 16:30:58 +10:00
skylar taylor-barrick 9f7da3f6ab M6: Adopt craft-print for CUPS and Windows PDF printing 2026-10-11 07:29:54 +02:00
aiongg c94d7ce8c8 Merge mojikumi-base: CJK: mojikumi tables based on Nothing and the one-em line-end set apply their rules
Conflict: crates/compose/src/tests.rs: next's tests, plus the branch's one-em line-end test after its neighbour
2026-10-11 05:18:58 +00:00
aiongg b77ed8c300 Merge fix/idml-interchange: PDF: Bounding Box crops are measured from the page's drawing, not a render 2026-10-11 05:18:36 +00:00
aiongg 2fae23fcc6 Merge atomic-save: MCP: exported files replace the target atomically (#436)
Conflict: ROADMAP.md: both progress-log entries, next's newer ones first
Conflict: apps/designcraft/src/gpu.rs: next's side; the branch's test fix targets the startup record tests next replaced
Conflict: apps/designcraft/src/main.rs: next's gpu startup and macOS IME helper; config_dir() dropped for the branch's profile::config_dir(), recovery_dir from profile::recovery_dir()
Conflict: crates/ui-egui/src/canvas.rs: next's guard (menu_open, keyboard_pane already limits keys to the focused pane)
Conflict: crates/ui-egui/src/lib.rs: modules from both sides
2026-10-11 05:16:10 +00:00
aiongg 0437ab27f5 PDF: Bounding Box crops are measured from the page's drawing, not a render
Finding a placed PDF's Bounding Box crop rendered its page at 2048
pixels and took the bounds of the painted pixels. PDF export measures
every such crop that import left unmeasured, so exporting a 17-page
document that places one complex illustration took about 4 s longer
than before crops were supported. The box is now the union of the
page's painted paths (strokes included), glyphs and images, each cut
to its clip, collected by interpreting the page without rasterizing
it: the same box, exact instead of to the nearest pixel, in
milliseconds.

Test: content_crop_box_is_measured_without_rendering_the_page.
2026-10-11 04:56:32 +00:00
aiongg 45032b527f CJK: mojikumi tables based on Nothing and the one-em line-end set apply their rules 2026-10-11 04:38:04 +00:00
aiongg 11f34a07f3 Files: saves and exports replace the file atomically
Documents, books, libraries, snippets, swatches and every export are
written to a temporary file beside the target, flushed, renamed over it
and the folder flushed, so a crash, kill or full disk mid-write leaves
the old file intact. Replaced files keep their permissions, symbolic
links keep pointing at their file, and Windows retries a rename that a
scanner briefly blocks.

Fixes #436
2026-10-11 04:01:22 +00:00
aiongg 1e1b0bcce0 Merge #362 update: placed PDFs cropped to their bounding box render only when drawn or exported 2026-10-11 03:01:04 +00:00
aiongg 607b2f4a34 Merge live-corners: Tools: live corners round a frame's corners by dragging
Conflicts:
- crates/tools/src/lib.rs: Overlay keeps next's ContentGhost and adds
  LiveCornerWidget and LiveCornerDiamond.
- crates/tools/src/select.rs: the module doc keeps next's threading and
  content paragraphs and adds the live-corner one. Drag keeps Place and
  adds Corner; SelectionTool holds both `loaded` and `live`. pointer()
  first ends live-corner editing when the selection changed, then runs
  next's loaded-text-cursor and double-click handling. An empty-canvas
  press clears `live` and keeps next's `content: false` Pending. drag()
  handles Place and Corner. overlays() keeps next's Place marquee and
  content ghost and appends the widget or diamonds.
- crates/ui-egui/src/canvas.rs: the overlay pass keeps next's doc/layout
  for ContentGhost and next's Path drawing, and adds the two live-corner
  arms (the branch's no-op Path arm is dropped). The live-corner render
  test goes before next's fast_harness tests.
- crates/engine/src/cmd/object.rs: next's text_wrap stays; the branch's
  corner_options function follows it.
- crates/engine/src/tests.rs, crates/tools/src/tests.rs: both sides'
  tests kept.
- ROADMAP.md: the live corners progress-log line goes first; the status
  line names it too.

Action::Handled is matched in engine tooling.rs; no other crate matches
Action or Overlay exhaustively.
2026-10-11 02:50:45 +00:00
aiongg 0f3f4e0634 Import: placed PDFs cropped to their bounding box render only when drawn or exported
IDML import found every Bounding Box crop by rendering the PDF page at
2048 pixels, once per placement, so opening a 17-page document that
places one Illustrator file 16 times took about 54 s of CPU. Import now
measures the box only for a graphic without GraphicBounds; drawing finds
it through designcraft_render::shown_box (cached per file, page and crop)
and PDF export through with_pdf_boxes.
2026-10-11 02:46:07 +00:00
aiongg 037771057e Merge #316 update: GREP styles with a pattern that can't compile are rejected, and imports warn
Conflicts:
- engine cmd/file.rs, cmd/interchange.rs: kept next's file.open and
  file.openIdml docs (content detection, INDD conversion, package parts)
  and added "GREP styles whose pattern can't compile" to their warnings.
  open_idml keeps next's conversion and import-report warnings and appends
  grep_style_warnings after the font warnings.
- engine cmd/style.rs: style.paragraph.create/edit docs combine next's
  startAt and kinsoku notes with the grepStyles rule. create_para and
  edit_para keep next's set_json_over, continue_numbering and
  explicit_default_kinsoku, then call check_grep_styles. The branch's
  grep_style_error, check_grep_styles and grep_style_warnings follow
  explicit_default_kinsoku. Kept next's delete_tests and
  swatch_options_tests; grep_style_tests goes at the end of the file.
- ui-egui dialogs.rs: kept next's style_section_edit tests and added the
  branch's bad-GREP-pattern test.

confirm_paragraph_style_options, grep_error and the dialog status line
merged without conflicts; next had not changed the OK arm they replace.
2026-10-11 02:19:10 +00:00
aiongg 3bda745a52 Tools: live corners round a frame's corners by dragging
A selected, unlocked rectangle frame at least 40 px on screen shows the
yellow widget near its top-right corner. Clicking it shows a diamond at
each corner. Dragging a diamond along its edge sets the size of all four
corners as one undo step (Shift: that corner only), clamped to half the
shorter side. Alt-click steps that corner's shape; Shift+Alt-click steps
every corner. Escape, a click on empty canvas, another selection or
another tool ends corner editing. Positions follow the frame's transform.

object.cornerOptions takes corners: four {shape, size} entries. Tools
gain Action::Handled and the LiveCornerWidget/LiveCornerDiamond overlays,
drawn by the canvas in the live_corner theme token. Fixes #186.
2026-10-11 02:16:21 +00:00
aiongg cf0ff4a034 Merge group-nested-panic: Objects: group siblings inside a group; refuse mixed levels and spreads
Conflicts in crates/engine/src/cmd/object.rs:
- Helpers: kept next's opt_u64, siblings_mut(d, spread, parent), reorder,
  set_layer_deep and set_layer, then added the branch's GroupPlan,
  group_plan, GROUP_SAME_LEVEL and can_group. The branch's
  siblings_mut(d, &GroupPlan) is dropped; group() calls next's helper as
  siblings_mut(d, plan.spread, &plan.parent).
- Tests: kept next's reorder_tests and the other test modules next added,
  followed by the branch's group_tests module.

group() and ungroup() were unchanged on next, so group() is the branch's
version. cmd/mod.rs (CANT_GROUP_SELECTION, selection_reason) and lib.rs
(execute_unguarded) merged without conflicts.
2026-10-11 02:15:58 +00:00
aiongg ae50689e27 GREP: styles with a pattern that can't compile are rejected, and imports warn
style.paragraph.create, style.paragraph.edit and type.para return the
compile error (bad GREP: ...) for a GREP style pattern that can't compile
and change nothing. Paragraph Style Options shows the error under the
pattern as it is typed, and on OK keeps the dialog open on the GREP Style
section with the command's error.

Opening an IDML or native document keeps such a style and reports a
warning naming the style (or paragraph) and the pattern; composition
keeps skipping it. Adds a lookbehind GREP style test.
2026-10-11 01:51:51 +00:00
aiongg 21a230e426 Merge pdf-effects-wrap: PDF: items with soft effects keep their text wrap 2026-10-11 01:47:49 +00:00
aiongg c014832572 Objects: group siblings inside a group; refuse mixed levels and spreads
Grouping objects that were not top-level items of the first object's
spread panicked (index out of bounds), through object.group, Group on a
content selection, and states.create. Objects nested at different levels
or on different spreads were silently left out of the new group.

Objects that share a spread and a parent group now group into a nested
group in that parent, keeping their stacking order and position. Objects
on different spreads or at different levels return an error and the
document is unchanged, as do objects inside a multi-state object. Group
is disabled in the menu for a selection it can't group; a call that
names its ids still runs whatever is selected.

Fixes #412
2026-10-11 01:46:19 +00:00
aiongg 814102ed35 Layout: items with soft effects keep their text wrap
PDF export replaces objects with soft effects by images of their
appearance. The image item carried no text wrap, so text recomposed
for the export ran under the object. Each rasterized object with a
wrap now stays in the export copy as a nonprinting stand-in that keeps
the wrap of the frame, its placed graphic and its grouped items, with
its text, form field, button and media removed.
2026-10-11 01:39:19 +00:00
aiongg f9985611bc Merge #411: Undo: a command that runs another is one undo step 2026-10-11 01:02:10 +00:00
aiongg 54b9a4d314 Merge mojikumi-base: CJK: custom mojikumi tables without a base set apply their rules
# Conflicts:
#	crates/engine/src/tests.rs
2026-10-11 00:47:10 +00:00
aiongg 11631cde12 CJK: custom mojikumi tables without a base set apply their rules 2026-10-11 00:42:47 +00:00
noah1400andClaude Opus 5.5 ad173006f7 Undo: a command that runs another is one undo step (#406)
Cut, Duplicate, Paste in Place, the Arrange commands and pasting text
run a second command inside themselves, and both recorded an undo
step: the second Undo did nothing. Only the outer command records now.
A command that fails after changing the document records its step
too; a script that stopped at a bad step left changes that could not
be undone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 02:34:43 +02:00
aiongg ecdb9b2dc2 Integration: rustfmt after merging #389-#392, indd 8 and 9 2026-10-10 23:52:24 +00:00
aiongg a386c73d82 Integration: PDF crop box is part of an asset's identity; clippings keep anchored graphics (#391)
Asset::same_file compares pdf_crop (#362) with type, page and bytes: one
PDF page shown with two crop boxes keeps two assets, so add_asset,
adopt_asset, insert_asset (IDML/INDD import) and the load/save merge
never point a placement at another crop. Test in
identical_files_share_one_asset.

The copy clipping (edit.rs clip_doc) keeps the assets used_assets finds
in it, so graphics anchored in copied text, graphic table cells (#379),
notes and media posters keep their files; it collected only graphics on
the copied items before. Test:
copied_text_frames_keep_the_graphics_anchored_in_their_text.
2026-10-10 23:44:15 +00:00
aiongg cfd57cb3ca Merge asset-dedupe: Assets: one asset per image, and saves leave out unused ones
Conflicts:
- crates/engine/src/cmd/{datamerge/fill.rs, file.rs, mathexpr.rs,
  media.rs, table.rs}: the branch's add_asset calls, with next's Asset
  fields (pdf_crop, pdf_box) through ..Default::default(); file.place
  keeps next's PdfCrop-aware asset (crop_pdf) and adds it with add_asset;
  the data merge graphic keeps next's wrap field.
- crates/format/src/lib.rs: load runs next's upgrade(doc, version), then
  merge_duplicate_assets (zip and legacy JSON); tests from both, with the
  round-trip test placing its asset (saves drop unused ones).
- crates/idml/src/import.rs graphic(): the branch's linked_assets reuse and
  insert_asset, with next's PDF page and PdfCrop on the asset and the
  graphic's text wrap (#389 integration) in the shared graphic closure.
  linked_assets is keyed by (path, page, crop), so placements of one PDF
  showing different pages or crop boxes keep separate assets.

Also, so the merge compiles: Asset/Graphic literals in the branch's tests
(crates/doc/src/assets.rs, format, engine links.rs) take next's pdf_crop,
pdf_box and wrap fields.
2026-10-10 23:41:30 +00:00
aiongg daf1a0ccb3 Assets: one asset per image, and saves leave out unused ones
Placing a file that the document already holds reuses its asset (same
bytes, type and PDF page), in file.place, place.load, media and poster
placement, graphic table cells, math, data merge image fields, IDML
import (a linked file is read once) and paste/duplicate between
documents (which also maps ids that collide in the target).

Saving merges identical assets into the first and leaves out assets
nothing references; the open document keeps them for undo. Opening a
file saved with one copy per placement shares the identical bytes as
they are read and merges the assets. Package and Copy Links write only
used files, and links.list lists only used assets.

Refs #391
2026-10-10 23:28:24 +00:00