76 Commits
Author SHA1 Message Date
skylar taylor-barrick 5449bc4757 M6: preserve PDF catalogs and safely apply layer choices (#1670)
Preserve existing PDF catalog entries and full object generations. Accept literal null trailer entries while failing closed on encrypted/hybrid/ambiguous or unreadable history. Validate visibility variants atomically before document edits, suppress stale unsupported canvas overrides, and preserve conservative content cropping without overcropping empty optional-content stubs.

Local full CI: all 9 gates passed, 3063 tests passed and 6 skipped, all 16 WASM-safe crates checked. Independent qpdf/preservation/Poppler checks passed for17 supported inputs;6 refusal cases stayed refused. All11 additional Prev controls passed. GitHub CI and CodeRabbit passed on00d5fa5c; CodeRabbit confirmed the Prev finding addressed. Author history preserved; no native format changes.
2026-10-24 00:51:57 -06:00
skylar taylor-barrick 00d5fa5cdd M6: reject unreadable PDF trailer history links (#1670)
Reject a non-null Prev entry that cannot be read as an offset instead of silently treating it as the end of the guarded trailer chain. Keep absent/null end markers and readable numeric offsets unchanged.

Reproduced CodeRabbit discussion_r4366245854 with an independent probe and a failing native regression before the fix. The synthetic regression covers seven unreadable value types plus absent/null and integer/real history controls.

Validation: all 9 cargo xtask ci gates passed (3063 tests passed, 6 skipped; 16 WASM-safe crates). One unrelated GPU test was labelled leaky by nextest in that run and passed cleanly in an isolated rerun. Independent checks: 17 original supported PDF variants still pass qpdf, logical preservation and Poppler pixels; 6 original refusal cases remain refused. All 11 additional Prev controls pass (7 refused, 4 accepted).
2026-10-24 00:40:33 -06:00
skylar taylor-barrick 7427a15863 M6: harden placed PDF layer variants (#1670)
Integrate current main (d8d78851) without rewriting the contributor's commits, retaining craft-libs 9f75d3dc.

Accept literal null trailer entries while rejecting actual or ambiguous encryption/hybrid markers. Structurally inspect bounded xref/trailer history instead of adopting trailer-looking comments. Preflight all selected source variants before editing/undo; preserve reset-to-defaults. Suppress stale unrewritable canvas overrides rather than revealing source content. Keep conservative all-content crop fallback without overcropping layerless/null stubs.

Validation: cargo xtask ci, all 9 gates passed; 3062 tests passed, 6 skipped; all 16 WASM-safe crates checked. 17 supported variants passed independent qpdf, logical preservation and Poppler pixel checks; 6 unsupported/repair-only cases refused. Direct-harness Claude Opus 5 reviewed the exact main-relative delta with no blocking findings.

No native-format changes or unrelated layer features. Synthetic regression fixtures are generated in test code.
2026-10-24 00:18:22 -06:00
skylar taylor-barrick d9477695e2 #249: test that menu rows are selectable across their full width
A menu row only reacted over its text because the column used a plain top-down layout. The test renders a menu column with a short Preferences row and clicks near the right end of the row, expecting the dialog to open. Without the justified layout the click misses and the test fails.
2026-10-22 17:57:36 -06:00
skylar taylor-barrick fecf5906c3 #248: test that the start screen offers every print preset including A6
The start screen showed only the first ten presets and had no A6 sheet. The test checks that the start screen paints a card for each print preset, that A6 exists at 105 x 148 mm, and that the Properties page-size list agrees. Without the fix it fails because the B5 card is cut off by take(10) and there is no A6.
2026-10-22 17:57:36 -06:00
skylar taylor-barrick 15e4fdd124 #329: test that the Help menu works on the start screen
The Help menu's links were greyed out when no document was open, because UI commands outside app. and window. needed a document. The test checks every help.* UI command is enabled with an empty session while another UI command (view.rulers) stays disabled. Without the help. exemption it fails on "help.discord must work from the start screen".
2026-10-22 17:57:36 -06:00
skylar taylor-barrick 9f7504931d Merge pull request #1352 from FredApps/ci-xtask-ci-workflow
CI: run cargo xtask ci on pull requests and pushes to main
2026-10-20 22:40:42 -06:00
skylar taylor-barrick 63a68b3d49 Merge current main into CI workflow branch 2026-10-20 21:33:52 -06:00
skylar taylor-barrick 417ef40c4c Pin winit to storytold/winit (same commit) (#1113)
The fork moved from skylartaylor/winit to the storytold org. The pinned
revision 3d51077f is unchanged; only the repository URL differs.
2026-10-20 20:26:43 -06:00
skylar taylor-barrick 1420d8c79b refactor(pdf): share placed-PDF rendering (PDFR) (#876) 2026-10-20 19:52:28 -06:00
skylar taylor-barrick 5aeb4dd743 Merge pull request #1236 from skylartaylor/linked-path-checks
Follow paths stored in documents only on this computer or the document's share
2026-10-17 13:57:26 -06:00
skylar taylor-barrick 9fd0a881f7 Merge storytold/main into linked-path-checks
The conflict was in links.rs, where main's atomic relink work (b050343a) and
this branch's path gate both changed `update`. Kept main's mechanism (build the
replacement with relinked_asset, then insert it) and this branch's gate (a link
craft-docpath refuses is missing and never read).

relinked_asset now takes the path to read and the link to record separately.
Previously they were one argument, safe only because update passed the raw stored
link; passing the resolved path to the old signature would have rewritten every
relative link to an absolute one on each refresh.

Also passes None for the document in main's embedded-status test, where the asset
has no link so the document is irrelevant.
2026-10-17 12:39:14 -06:00
skylar taylor-barrick d149123cd3 Build: take craft-docpath from the merged craft-libs rev
craft-libs#169 is merged, so the fork pin is no longer needed. Pinned to
storytold/craft-libs 82a24b00 (main after the merge) rather than the older
12281d07, which predates resolve_absolute and the Windows colon refusal.
2026-10-17 12:02:18 -06:00
skylar taylor-barrick fc36957fe0 Ignore the local outputs/ folder
Scratch exports from running the app and the CLI land in outputs/. It is
not ignored, so `cargo xtask assets` — which scans tracked and untracked
files alike — reports every PNG and PDF in it as an asset with no row in
ASSETS.md, and the check cannot pass on a machine that has ever run the
app with an output directory.
2026-10-16 22:00:52 -06:00
skylar taylor-barrick 61b1a3b08d Merge pull request #150 from skylartaylor/codex/fix-relink-eps
Merges upstream/main into the branch, resolving 12 conflicted files, and reconciles where the two sides meant different things — notably the format version, where both had independently defined version 2 (EPS sources here, pinned paragraph defaults on main), so a document without EPS was being written as version 1 and re-upgraded on load.

Verified locally against main b17efb2d: cargo test --workspace --no-fail-fast 2869 passed / 0 failed, cargo fmt --check clean, cargo clippy --workspace --all-targets -D warnings clean, xtask layers and wasm ok.
2026-10-16 21:55:21 -06:00
skylar taylor-barrick b17efb2ddf Merge pull request #1164 from Hamza0101/fix/gpu-failed-fallback
Hamza's diagnosis of the forgotten OpenGL failure, with the filter reordered so it covers any backend and does not hold another machine's record against this one, plus a regression test.

No workflow runs on this PR: every one is path-filtered and apps/designcraft/src/gpu/backend.rs matches none. Verified locally on 653f83b8 instead — cargo test --workspace --no-fail-fast: 2847 passed, 0 failed, 5 pre-existing ignores; cargo fmt --check clean.
2026-10-16 20:51:25 -06:00
skylar taylor-barrick 653f83b8cb Startup: keep the backend a start was on, whichever it is, and cover it
Builds on the fix in this branch, which spotted that a failed OpenGL was
being forgotten because `failed` is filtered to this platform's
candidates and OpenGL is no candidate off Windows.

Rather than spare OpenGL from the filter, run the filter before the
previous start's backend is added. A stored entry that is no candidate
here came from another machine and still says nothing, so it is dropped
as before; the backend a start was actually running on is added
afterwards and stays, whichever backend it is. That keeps the same crash
out of the next instance without naming OpenGL or the platform, and
without holding a failure recorded on someone else's machine against
this one.

Adds the regression test: on macOS, where Metal is the only candidate, a
start left on OpenGL has to keep it out of the instance, while a stored
OpenGL entry that never ran here is dropped.
2026-10-16 20:46:40 -06:00
skylar taylor-barrick c43a63f71e Reconcile this branch's EPS work with main's placement and format changes
The merge compiled, but six tests showed where the two branches meant
different things. Fixes, in order of consequence:

- Format version: both branches had independently defined version 2 —
  here for retained EPS sources, on main for pinned Keep Lines Together
  and drop cap defaults, with an `upgrade` that runs below 2. Writing 1
  for documents without EPS then re-ran that upgrade on load and rewrote
  their paragraph styles, so saving and reloading changed the document.
  EPS now asks for version 3 and everything else stays at 2.

- place.drop into a frame: main turned Auto-Fit off so that resizing a
  frame crops rather than refits, and this branch had carried the older
  FillProportionally along while moving the geometry out of the edit.
  Main's behaviour is the intended one.

- save() compacts unreferenced assets now, so the format test has to
  place its EPS for the version sniff to see it at all.

- EPUB entries are named from the asset's file stem (asset_path), not
  its bare id: images/logo-<id>.png.

- Command parameters are validated strictly, so the PDF page test sends
  each command only the parameters it takes.

- The relink batch's "commits once" check read a process-wide revision
  counter, which a test running beside it can advance; the single undo
  step is what actually shows it committed once.

The EPS place tests move to cmd/file/eps_place_tests.rs: they write real
files, and main's file-system guard reads src files without seeing inline
#[cfg(test)] modules, but exempts _tests.rs ones.
2026-10-16 20:20:53 -06:00
skylar taylor-barrick bc840130a4 Satisfy clippy's nonminimal_bool on rustc 1.96
Four sites already on main that `cargo xtask ci` cannot get past with the
current toolchain; each rewrite is the one clippy suggests and changes no
behaviour. `!x.is_some_and(f)` becomes `x.is_none_or(!f)`, and pdf_bounds
folds `!(a && b) || !c` into `!(a && b && c)` by De Morgan.

Unrelated to the merge they are committed beside; separated so that merge
stays a merge.
2026-10-16 20:20:36 -06:00
skylar taylor-barrick 0d541deab7 Merge upstream/main into codex/fix-relink-eps
Resolve 12 conflicted files. Where both sides changed the same code:

- format: keep main's bounded-read load_zip (MAX_ENTRIES, read_entry) and
  this branch's u64 version reporting, so a version above u32::MAX is named
  as written rather than clamped. Both sides had fixed the same truncation.
- render: main's natural_size supersedes image_natural_size (it already
  reads an EPS bounding box and also handles PDF pages); callers in table
  and data merge now use it.
- images: keep the DSC-aware header scan and (atend) trailer lookup, take
  main's classic-Mac line endings, and carry its overflow guard into
  parse_box. eps_proxy draws main's simple rectangles before falling back
  to the placeholder, still over a retained EPS source.
- engine/file: take main's placement shape (add_asset, crop box geometry,
  place cursor, finite_rect, object effects) and keep this branch's
  validate_placement in both branches; edit() works on a clone and commits
  only on Ok, so validating inside it stays all-or-nothing.
- engine/links: keep building the replacement before edit() so a file that
  cannot be read leaves the document untouched, and move main's crop_pdf
  refresh into relinked_asset, which both relink and update go through.
- engine/export: EPS preview warnings join the font-embedding warnings
  rather than shadowing them.
- idml: an EPS element keeps ActualPpi (its pixels are a preview raster);
  main's PDF exclusion is unchanged.

Cargo.lock regenerated. Tests and doc strings from both sides kept.
2026-10-16 19:57:08 -06:00
skylar taylor-barrick 9673682cc2 Merge pull request #1101 from dylanmtaylor/ci/craft-common-actions
ci: add nix check workflow
2026-10-15 21:25:05 -06:00
skylartaylor bdfb77baf2 feat(installer): unify Windows setup and completion screens (INSTALLER-UI) 2026-10-16 03:46:50 +02:00
skylar taylor-barrick a184db6f8f fix(export): reject oversized page selections (#1089)
Reject page selections that cannot fit the target index type before conversion, and return an error for the largest direct PPTX page index.

Validated the combined main and PR tree with all seven cargo xtask ci stages (1,967 passing tests), four actual WASM export-page regressions, and successful FreeBSD, Windows ARM64, and packaging workflows.
2026-10-15 19:18:11 -06:00
skylar taylor-barrick 7ec5c8bc6d Merge pull request #1042 from Silvertree2010/fix/h1635-rtf-import-drops-a-that-directly
Keep '-' after an RTF control word when no digit follows
2026-10-15 18:30:39 -06:00
skylar taylor-barrick b7d549f7d7 refactor(pdf): use guarded shared writing (#875)
PDFW / #875: route document, booklet and book-merge exports through the
guarded shared PDF writer while retaining application export policy.

Validated the exact integration with all seven local CI gates, paired native
and WASM exports, and fresh FreeBSD and Windows ARM64 hosted checks.
2026-10-14 19:53:29 -06:00
skylar taylor-barrick 694e662547 fix(pdf): reconcile shared writer with main (PDFW)
Preserve the shared writer migration while incorporating the pinned main
changes and resolving the roadmap entry.

PR #875.
2026-10-14 18:18:19 -06:00
skylar taylor-barrick c68cb357e9 fix(pdf): preserve writer integration with main (PDFW)
Retain the PDF writer adoption and upstream text-threading changes. Keep both roadmap entries and use the accepted-socket fixture comment from main.
2026-10-14 00:18:33 -06:00
skylar taylor-barrick 9b7a0ec66d fix(text): preserve document state while threading and formatting
Merge current main into the text editing and layout work, retaining the original contributor commits. Preserve generated and linked stories, incoming text references, local IDs and locked frames when threading.

Keep pending formatting and text colours consistent, isolate deferred control clipboard input, and handle inherited IDML frame properties with bounded column allocations. Add focused state-preservation and round-trip regressions and correct the socket and swatch test fixtures.

M2; refs #84.
2026-10-13 19:54:50 -06:00
skylar taylor-barrick efd2310c83 refactor(pdf): share writer backend (PDFW) 2026-10-13 13:20:47 -06:00
skylar taylor-barrick 64f0ca8fa6 fix(macos): make Dock Quit cancelable
Route AppKit termination through the existing unsaved-document close transaction using the immutable winit patch. Restore pending prompts from hidden or minimized windows and preserve answers across repeated requests.

Validation: all six local gates, native cancellation/retry/save smoke, and hosted platform checks.

Fixes #544.

PR #623.
2026-10-12 14:52:12 -06:00
skylar taylor-barrick 17cf5b4e91 test(recovery): make failed republishing fixtures deterministic
Force actual failed recovery publication at the reserved destination so privileged runners exercise the intended retention path. Keep the normal writer, publication order and existing assertions; enable these fixtures across platforms.

Validation: all six local gates and the FreeBSD root VM workspace build/tests.

PR #627.
2026-10-12 13:57:37 -06:00
skylar taylor-barrick c3859c828b fix(recovery): preserve documents on orderly app exit
Checkpoint the latest document state during App::on_exit after honoring current quit approvals. Keep incomplete or stale plans, clear recovery for clean documents and report unavailable or failed storage.

Follow-up to #545; cancelable macOS Dock Quit remains open in #544.

PR #617.
2026-10-12 12:18:32 -06:00
skylar taylor-barrick 8e151a2fd4 fix(recovery): retain recovered checkpoints until save or close
Keep recovered snapshots available through a second crash before autosave. Track checkpoint ownership across folders and restarted IDs; Save, Close and Revert clean only checkpoints owned by that document.

Follow-up to #506 and the retention concern in #380.

PR #616.
2026-10-12 12:15:46 -06:00
skylar taylor-barrick 9509b2bcea fix(book): stage chapter updates before saving
Prepare and stage every chapter before a book update writes files. Preserve imported IDML sources, reject open native chapters and report completed paths after a later write failure.

Follow-up to #485.

PR #615.
2026-10-12 12:12:01 -06:00
skylar taylor-barrick e198eb5d1d fix(export): replace desktop and CLI outputs atomically
Route desktop writes and CLI raster exports through the engine atomic writer. Add actual-caller regressions for reader visibility, private modes, symlinks and valid long filenames.

Follow-up to #485.

PR #614.
2026-10-12 12:04:39 -06:00
skylar taylor-barrick b9048a5b08 fix(save): preserve live state when persistence fails
Preserve document paths, revisions and collection contents when persistence fails. Rebase Save a Copy paths without changing the open document.

Follow-up to #485.

PR #613.
2026-10-12 11:53:46 -06:00
skylar taylor-barrick 65ef027f9f Merge pull request #452 from storytold/codex/craft-print
M6: Adopt craft-print and support Windows PDF printing
2026-10-11 18:12:43 -06:00
skylar taylor-barrick 957890223a M6: Pin craft-print with native driver capability validation 2026-10-12 01:20:53 +02:00
skylar taylor-barrick 3ec5cef6a2 M6: Adopt merged craft-print with scaling and queue duplex defaults 2026-10-11 22:14:24 +02:00
skylar taylor-barrick 9f7da3f6ab M6: Adopt craft-print for CUPS and Windows PDF printing 2026-10-11 07:29:54 +02:00
skylar taylor-barrick 16a7365701 Merge pull request #409 from skylartaylor/codex/ui-suite-integration-20261010
Adopt shared panel docking and preserve workspace commands
2026-10-10 19:46:47 -06:00
skylar taylor-barrick 2bdb0ea01d UI.9: recover saved docking metadata and declare frontend MSRV 2026-10-10 18:52:20 -06:00
skylar taylor-barrick a77bf8bff5 UI.9: reconcile upstream before shared UI landing 2026-10-10 18:00:07 -06:00
skylar taylor-barrick c62866443c UI.9: integrate shared panel docking and preserve workspace behavior 2026-10-10 14:42:40 -06:00
92649ffdb0 Security: validate engine inputs and package paths (#155)
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 04:50:26 -04:00
1bccd0c9e4 Keep menus and dialogs usable at larger UI scales (#281)
* ci: simplify testkit dependency match for Clippy

* UI: keep menus and dialogs reachable at larger scales

* UI: share viewport-aware scrolling across menus

Incorporate @aiongg's shared menu-button, anchor-aware sizing, and
reopen-reset work from #279 (717ddb6), retaining #281's clipped-submenu
and scrollbar interaction fixes.

Use the wrapper for workspace, zoom, and panel menus as well as the
menu bar. Preserve checkbox dismissal and cover anchor placement,
scroll reset, and very short viewports with regression tests.

---------

Co-authored-by: skylartaylor <26588250+skylartaylor@users.noreply.github.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 03:53:23 -04:00
b581031d91 IDML: resolve table styles and correct cell height fitting (#288)
* ci: simplify testkit dependency match for Clippy

* IDML: resolve table styles and shared cell edges

* Compose: size table cells by baseline and physical bounds

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 03:50:09 -04:00
74a81f9fb0 Harden temporary files and release inputs (#153)
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 03:46:19 -04:00
e585f9495d Preserve browser import intent and document targets (#119)
* #89: preserve browser import context and PDF options

* #91: reject PDF pages before narrowing on Wasm

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 02:02:57 -04:00
skylar taylor-barrick 452134c13b FID2: preserve decoration color resets, geometry and paint order (#230) 2026-10-10 01:50:52 -04:00
skylar taylor-barrick cfac46a8d9 FID1: prevent mixed gradient color spaces from aborting PDF export (#229) 2026-10-10 01:50:47 -04:00
skylar taylor-barrick 06322045a5 Security: escape HTML and EPUB metadata (#152) 2026-10-10 01:14:22 -04:00
skylar taylor-barrick 691d0de183 #72: preserve typed generic dialog values (#120) 2026-10-10 01:13:35 -04:00
skylar taylor-barrick fc2739a8cd #61: honor MCP typing, story and page contracts (#118) 2026-10-10 01:13:29 -04:00
skylar taylor-barrick 4c6aa4cd4b browser-correctness: fix print, startup flags, and document MIME (#117) 2026-10-10 01:13:23 -04:00
skylartaylor 7b15baa215 Compose: size table cells by baseline and physical bounds 2026-10-09 22:19:14 -06:00
skylartaylor 56a8150709 IDML: resolve table styles and shared cell edges 2026-10-09 21:57:31 -06:00
skylartaylor 2a46d63d84 ci: simplify testkit dependency match for Clippy 2026-10-09 21:57:31 -06:00
skylar taylor-barrick 07b33edbef UI: keep menus and dialogs reachable at larger scales 2026-10-09 20:29:01 -06:00
skylar taylor-barrick 392f414322 ci: simplify testkit dependency match for Clippy 2026-10-09 20:28:56 -06:00
Skylar Taylor-Barrick a45375c335 FID2: preserve decoration color resets, geometry and paint order 2026-10-09 17:39:08 +00:00
Skylar Taylor-Barrick ee33fe3c35 FID1: prevent mixed gradient color spaces from aborting PDF export 2026-10-09 17:33:18 +00:00
skylar taylor-barrick 4e4eaad1c8 PERF-MEM: release retired layouts and trim edit-history capacity 2026-10-08 15:35:20 -06:00
skylar taylor-barrick abf9a40dc0 PERF-CI: use fixed-size chunks in PSD decoding 2026-10-08 15:29:32 -06:00
skylar taylor-barrick b050343a6c links.relink: make replacements atomic and retain EPS sources 2026-10-08 11:13:17 -06:00
Skylar Taylor-Barrick 6a53d95895 Security: escape HTML and EPUB metadata 2026-10-08 15:31:35 +00:00
skylar taylor-barrick 637d05e776 #91: reject PDF pages before narrowing on Wasm 2026-10-08 00:31:43 -06:00
skylar taylor-barrick bae5a92dbb #72: preserve typed generic dialog values 2026-10-08 00:23:35 -06:00
skylar taylor-barrick e3d2312f00 #89: preserve browser import context and PDF options 2026-10-08 00:15:24 -06:00
skylar taylor-barrick e9cc4b49ec #61: honor MCP typing, story and page contracts 2026-10-08 00:08:17 -06:00
skylar taylor-barrick 8662526736 browser-correctness: fix print, startup flags, and document MIME 2026-10-08 00:08:16 -06:00
skylar taylor-barrick 8d56e875eb Compose: fit horizontal text frames by the last baseline 2026-10-07 16:10:43 -06:00
skylar taylor-barrick 0629137ef7 IDML: import scalar InsetSpacing property values 2026-10-07 16:10:32 -06:00
skylar taylor-barrick 4910e42bcc Render: keep outside-aligned strokes out of closed interiors 2026-10-07 16:10:24 -06:00
skylar taylor-barrick 0f888ef794 IDML: honor explicit cell edges at table borders 2026-10-07 14:38:40 -06:00
skylar taylor-barrick 089b1ac28f IDML: resolve nested packaged image links after relocation 2026-10-07 14:27:50 -06:00