Commit Graph
63 Commits
Author SHA1 Message Date
Marco Arnulfo 9e15d5a17e fix(cli): accept a UTF-8 BOM in scripts and document the syntax in script --help (fixes #654) 2026-10-13 00:41:46 +02: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 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 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
d020b4e85d fix(ui): preserve documents when quitting is cancelled
Prompt for unsaved documents on window close and application/menu quit. Defer discarding documents until all approvals are current, retaining every tab when a later decision cancels quitting.

Refs #544. Cancelable macOS Dock Quit remains separate.

Co-authored-by: aiongg <[email protected]>
Co-authored-by: skylar taylor-barrick <[email protected]>
2026-10-12 09:31:24 -06:00
Noah Scholzandskylar taylor-barrick 328b4d5a52 fix(recovery): isolate recovery data between app instances
Keep each app's recovery data in an owned run folder. Validate current folder and lock ownership and disable recovery when isolation fails instead of using the shared root.

Fixes #496.

Co-authored-by: noah1400 <[email protected]>
Co-authored-by: skylar taylor-barrick <[email protected]>
2026-10-12 09:26:34 -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 c62866443c UI.9: integrate shared panel docking and preserve workspace behavior 2026-10-10 14:42:40 -06:00
736acffe5f Desktop: pick the graphics backend before the window exists; DirectX 12 on Windows (#297)
* Desktop: pick the graphics backend before the window exists; DirectX 12 on Windows

On an AMD hybrid-graphics laptop (Radeon RX 6800M beside an integrated
Radeon, with two versions of amdvlk64.dll loaded into one process) the
app died a few seconds after launch with an access violation inside
AMD's Vulkan driver at the first swapchain present. Nothing reached the
log: a fault inside a driver is a native crash the engine's panic guard
never sees. wgpu's default backend set (PRIMARY | GL) enumerates Vulkan
first, so every start on that machine went down the same path, while
WGPU_BACKEND=dx12 and WGPU_BACKEND=gl ran fine and the headless CPU
renderer was never affected.

The desktop app now chooses the backend before creating the window
(apps/designcraft/src/gpu.rs): DirectX 12 first on Windows, then Vulkan,
then OpenGL; Vulkan then OpenGL on Linux; Metal on macOS. OpenGL stays
in the set as the in-process fallback when the chosen backend has no
adapter. WGPU_BACKEND still overrides everything and turns the fallback
off.

Start-up fallback: gpu.json in the settings directory records the
backend being tried until the third frame begins (the first has been
presented by then) or the app exits normally. A record left behind means
that backend never showed a frame, so the next start skips it, tries the
next candidate and says so in the status bar. The list starts over when
every candidate has failed or the app version changes;
DESIGNCRAFT_NO_PREFS records nothing. The adapter, backend and driver
version are logged at start-up for bug reports.

Verified on the affected machine: a default start runs on DirectX 12; a
simulated crashed DX12 start moved to Vulkan, which faulted for real,
and the start after that came up on OpenGL with the status line. Nine
unit tests cover the chooser and the record; cargo xtask ci passes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* Merge origin/main; on Windows OpenGL isn't added to the DX12 or Vulkan instance (#167)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: Brandon Thomas <[email protected]>
2026-10-10 04:11:47 -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 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-10 02:02:57 -04:00
Vikram Bhaskaran 3de58750cd Add PDF/X-4 validation command (#200) 2026-10-10 01:51:17 -04:00
Gert Pellin - GPE 3d2bda4d6b Desktop: write log records to standard error and a rotating log file (#122)
* Desktop: write log records to standard error and a rotating log file

The desktop app installed no logger, so every log::warn!/log::error! in
the workspace was discarded: the crash guard's panic report, a failed
crash-recovery save, font folders that can't be read. A launch from a
desktop menu has no terminal either, so there was nothing to attach to a
bug report.

apps/designcraft/src/logging.rs (no new dependency):
- standard error plus <settings dir>/logs/designcraft.log (beside
  ui.json and prefs.json); each launch rotates the previous log to
  designcraft.1.log and .2.log, so the log of a run that crashed
  survives the next start; the file is capped at 16 MiB
- records logged before the settings directory is known are buffered
  (bounded) and written once the file is attached
- default levels: info for designcraft*, warn for everything else;
  RUST_LOG replaces them with env_logger-style directives
- never panics: an unusable directory or a failed write leaves standard
  error as the only sink

The logger is installed first in main (before the engine's panic hook)
and the file is opened after argument parsing (--version leaves no
file). The settings directory moves out of prefs_path into config_dir.
A --control or DESIGNCRAFT_CONTROL_PORT value that is not a port is now
logged instead of silently leaving the control channel off. Documented
in README.md (Quick start > Logs).

* Desktop: no eprintln! on the log and panic paths

eprintln! panics when standard error is a broken pipe (a GUI launch on
Windows), and a panic inside the panic hook aborts. The "no log file"
message goes through log::warn! (standard error only by then); the panic
hook's fallback writes to standard error with write_fmt and ignores the
error. Same fix as storytold/vectorcraft#465.
2026-10-10 01:50:38 -04:00
5369687497 fix(cli): --help prints usage to stdout and exits 0 (#254)
Asking for help is not an error, but `designcraft-cli --help` shared the
catch-all arm with unknown commands, so it wrote the usage block to
stderr and exited 1 — unusable in a pipeline and wrong by convention
(`--version` already exits 0).

Split the arm: `--help`, `-h` and `help` now print the same usage block
to stdout and succeed, while an unknown command keeps it on stderr and
still fails. The usage text and links line are hoisted into a shared
`USAGE` const and `usage_footer()` so the two paths can't drift.

Fixes #243

🤖 Generated with Codebuff

Co-authored-by: Codebuff <[email protected]>
Co-authored-by: Brandon Thomas <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-10 01:50:34 -04:00
jahalaandClaude Opus 5.5 d323b4e702 Web: AltGr and other named keys no longer type their names (#134) (#138)
In the browser, pressing AltGr while editing text on the canvas inserted
the word "AltGraph" into the story.

eframe's web backend (0.36.2, web/input.rs text_from_keyboard_event)
turns a keydown into a text event unless the key is on a fixed list of
names. Browsers report many more named keys than that list holds:
AltGraph, Dead, Unidentified, the media keys. Each one arrived as text.
Panel text fields are not affected, because a focused egui text field
takes its text from the browser's input events instead of keydown.

The web shell now drops a text event that is a key name (ASCII letters
and digits, starting with a capital, longer than one character) unless
an egui text field has the keyboard. One key press never types such a
word; a text field's input events can, so they are left alone.

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-10 01:13:59 -04:00
aiongg 3033c8cc64 CLI: export options after the last export are an error; MCP and README docs match the code (#127)
* CLI: run rejects an export option with no export after it (#67)

--page, --scale and --pdf-options apply to the exports that follow them; one
given after the last --export or --all-pages did nothing and said nothing.
The usage text and docs/agents.md say so.

* MCP: document that text offsets and story lengths are UTF-8 bytes (#68)

* MCP: docs name the UI-only commands precisely; app.links works headless (#62)

* README: PDF and EPUB export ship (#60)
2026-10-10 01:13:42 -04:00
skylar taylor-barrick 4c6aa4cd4b browser-correctness: fix print, startup flags, and document MIME (#117) 2026-10-10 01:13:23 -04:00
aiongg 4564ec6707 UI: text fields take Select All, Copy, Cut, Paste, Undo and Redo from the Mac menu (#30) (#111)
The macOS menu bar takes Cmd+A, Cmd+C, Cmd+X, Cmd+V, Cmd+Z and Cmd+Shift+Z
before the window sees them, so in a panel, dialog or search field they ran
the document's commands: Select All selected every frame, Paste pasted into
the layout, Undo undid the last document change.

While a text field has keyboard focus, these Edit items now act on the field,
whether chosen by shortcut or from the menu: Select All, Undo and Redo reach
it as their keys, Copy and Cut as clipboard events, and Paste asks the
window for the system clipboard. The items stay enabled for the field even
when the document has nothing to copy or undo. With no field focused, and
for every other item, the menu works as before.
2026-10-10 01:09:47 -04:00
aiongg 9fbd6d2402 Show an alert when a file can't be opened or placed (#80)
* Opening an InDesign document says to export IDML (#21)

.indd and .indt files (recognised by their published 16-byte signature)
failed to open or place with a confusing format error. They now explain
that the format is closed and how to export IDML from InDesign instead.

File › Open offers .indd and .indt files (desktop and web), and dropping
one on the window opens it like a .designcraft or .idml file. A file that
can't be opened or placed from File › Open, Place, a drop, the command
line or the control channel's app.open shows an alert with the reason, as
well as the status line.

* File open: an .indd file is an unreadable file like any other

Remove the INDD signature check and message, and .indd/.indt from the
Open filters and drop routing. The alert tests use a generic unreadable
file.

* Control channel: a failed app.open answers with the error and opens no alert

An alert waits for a click that a control client can't give. app.open
reports the error in its response, as engine.execute does; File › Open,
drops and the command line still show the alert.
2026-10-10 01:09:41 -04:00
Brandon ThomasandClaude Opus 5.5 48dfbcfd19 Merge origin/main into data-merge
Resolve conflicts keeping both sides: doc gains both `cjk` and
`datamerge` modules; file.open resolves data-merge sources and loads the
document's fonts; DocState keeps preview_stash/preview_record and fonts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 22:28:15 -04:00
Cameron Gilroy a2078ece67 Data merge: add the panel and the source file dialog
Window, Utilities, Data Merge lists the linked fields and previews a
record without merging. Create Merged Document runs the merge. The
desktop open dialog offers CSV, TSV, tab, text, and Excel files. The
roadmap records this phase of the feature.
2026-10-07 21:22:06 +11:00
Luskish 7100bf9ec3 Control: close the connection on input that isn't a request
A line that is not a JSON object with a string `method` (an HTTP request
line, other non-JSON text, a JSON array, invalid UTF-8, a line over 4 MiB)
now gets one error reply and the connection is closed, so a browser's
cross-origin fetch can't smuggle a command in its body. Connections are
capped at 16. Same transport as LightCraft (storytold/lightcraft#129) and
FilmCraft (storytold/filmcraft#123).
2026-10-06 22:54:21 -04:00
japbcoelhoandClaude Opus 5.5 337e2ab113 CLI: a closed stdout ends designcraft-cli quietly
`designcraft-cli commands | head -1` panicked and exited with status 101:

  thread 'main' panicked at library/std/src/io/stdio.rs:1168:9:
  failed printing to stdout: Broken pipe (os error 32)

println! panics when stdout is closed. Output now goes through outln!, which
ends the program with status 0 on a broken pipe (the reader has what it
wanted) and reports any other write error on stderr with status 1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 09:05:16 -04:00
Brandon ThomasandClaude Opus 5.5 60de09f1bb Windows packaging: Start Menu/Add-Remove icon, no console window, correct description
The MSI Icon id had no .ico/.exe extension, which Windows Installer needs for
advertised shortcuts and ARPPRODUCTICON, so both showed a blank icon. Release
builds of the desktop app are now GUI-subsystem (no console window; the CLI stays
a console program), the shortcut/summary description names what DesignCraft does, and
packaging-lint rejects an Icon id without an extension. Found in printcraft#57.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 07:50:34 -04:00
Brandon ThomasandClaude Opus 5.5 811b0d8846 FreeBSD: CI job and X11 drag-and-drop on every non-Apple Unix
A FreeBSD workflow builds and tests the workspace in a FreeBSD 14 VM
(vmactions/freebsd-vm) on pushes to main, dependency changes and on
demand. The X11 backend choice for file drag-and-drop covered only
Linux; FreeBSD desktops use the same X11/Wayland stack, so it now applies
to all(unix, not(macos)).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 07:45:05 -04:00
Brandon ThomasandClaude Opus 5.5 59d7982780 Never crash: apps (desktop, CLI, web)
perf/bench return errors instead of expect() (bench runs on any document),
and the Windows resource build step fails the build without panic!. The
three app crates deny the panicking lints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 12:43:34 -04:00
Brandon ThomasandClaude Opus 5.5 192b72054d Linux: use the X11 backend under XWayland so files can be dropped (#2)
winit 0.30 has no file drag-and-drop on Wayland. DESIGNCRAFT_WAYLAND=1
keeps the native Wayland backend.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 11:38:26 -04:00
Brandon ThomasandClaude Opus 5.5 b13135472a V: Rotate Spread per spread — canvas layout through per-spread transforms
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 00:25:16 -04:00
Brandon ThomasandClaude Opus 5.5 0d02222dab W: Scripts panel and script.run (one undo step)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 10:48:58 -04:00
Brandon ThomasandClaude Opus 5.5 fb747c5fa5 C: Color Settings, Proof Setup and Proof Colors
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 07:44:40 -04:00
Brandon ThomasandClaude Opus 5.5 bfbe9661e1 P: place EPS through its preview or a bounding-box placeholder
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 07:19:54 -04:00
Brandon ThomasandClaude Opus 5.5 428ac5a922 W: interface language — German, French, Spanish, Japanese menus and panels
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 05:37:21 -04:00
Brandon ThomasandClaude Opus 5.5 839887eb04 I: video and sound — media frames, posters, EPUB players (+ Media panel)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 05:20:35 -04:00
Brandon ThomasandClaude Opus 5.5 60a8fefe37 L: books — continuous numbering, style sync, merged PDF (+ panel)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 03:49:25 -04:00
Brandon ThomasandClaude Opus 5.5 d6d9c385ea X: XML basics — tags, style-to-tag map, structure, export/import, tagged frame markers
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 03:21:30 -04:00
Brandon ThomasandClaude Opus 5.5 faf23fc74b H: place a page of an IDML/DesignCraft document as a group
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 02:46:35 -04:00
Brandon ThomasandClaude Opus 5.5 c9785ae1ed U: Font menu with search, favourites and previews; persist engine preferences
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 00:27:52 -04:00
Brandon ThomasandClaude Opus 5.5 2f54f0b53d O: Frame Fitting Options — auto-fit on resize, align from, crop (+ dialog, IDML)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 00:14:47 -04:00
Brandon ThomasandClaude Opus 5.5 68e624cba4 O: Object Library — .dclib files of snippets, Library panel
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 23:39:11 -04:00
Brandon ThomasandClaude Opus 5.5 dd68539cb0 I: place Excel workbooks as tables
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 23:33:59 -04:00
Brandon ThomasandClaude Opus 5.5 175aaf28fd H: place a chosen PDF page (Image Import Options)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 20:57:38 -04:00
Brandon ThomasandClaude Opus 5.5 67dd4852ca F: Load/Save Swatches (.ase) — swatch.load, swatch.save, Swatches panel menu
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 15:49:27 -04:00
Brandon ThomasandClaude Opus 5.5 4b2417a8c0 designcraft-cli: support --version (the release packaging smoke tests call it)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 12:34:06 -04:00
Brandon ThomasandClaude Opus 5.5 5971553d60 H: place SVG (vector PDF export), PSD, BMP, AI — designcraft-images crate
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 10:51:48 -04:00
Brandon ThomasandClaude Opus 5.5 b97828eb50 app icon: calico cat in a polka-dot scarf (owner's ArtCraft drawing), Dock/taskbar/launcher wiring, palette docs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 09:44:07 -04:00
Brandon ThomasandClaude Opus 5.5 da0e87b86b H: place PDF — sized by crop box, hayro on screen, vector form XObjects in PDF export
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 09:11:04 -04:00
Brandon ThomasandClaude Opus 5.5 446c70af04 H: place text files — Word (.docx), RTF, plain text; autoflow
- designcraft-textimport (L3): DOCX (styles by name with spacing/indents/alignment and font,
  size, bold/italic/underline/strike/caps/position; runs, tabs, breaks, footnotes, tables,
  hyperlink/field results; used styles only), RTF (text, paragraphs, bold/italic/underline/
  strike, size, Unicode/cp1252, skipped destinations), plain text (+ tests)
- engine: file.place routes text files into the insertion point, the selected frame or a new
  frame on the page; imported styles added (existing win); removeStyles; autoflow adds pages
  with threaded frames until the story fits (+ test)
- app/web: Place dialogs accept .docx/.rtf/.txt/.md

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 08:55:28 -04:00
Brandon ThomasandClaude Opus 5.5 f8ccff2470 F: Color panel, Color Picker, unnamed colours
- color: Swatch.hidden — unnamed colours (applied, not listed in Swatches until added)
- engine: object.color (reuses a swatch with the same colour, else an unnamed one; fill or
  stroke), swatch.addToSwatches (optionally named; users follow the rename),
  swatch.addUnnamed (+ test)
- UI: Color panel with fill/stroke proxy, CMYK/RGB/Lab, channel sliders with gradient tracks and
  value fields, tint slider for named swatches, spectrum ramp, Add to Swatches; Color Picker
  dialog (double-click a proxy chip); Swatches hides unnamed colours

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 08:45:39 -04:00
Brandon ThomasandClaude Opus 5.5 4696178f62 R: crash recovery, Revert, Save a Copy
- engine::recovery: unsaved documents written to a recovery folder (atomic write + metadata),
  reopened as unsaved documents that remember their files; entries dropped on save/close
  (+ tests); file.recovery.list/save/open, file.revert, file.saveACopy (+ test)
- app: recovery folder per platform, recovered on launch with a status message; UI writes
  recovery data every 30 s while documents are unsaved; File › Save a Copy…, Revert
- parity: recovery, revert, save a copy done

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 08:11:25 -04:00
Brandon ThomasandClaude Opus 5.5 7145107896 Agents: command scripts with result references (CLI, MCP, app); parity estimate
- engine::script: parse scripts (lines, JSON lines, JSON arrays), resolve "$N.path" /
  "${N.path}" references to earlier results, run with a failure report (+ tests)
- CLI: script [FILE|-] (headless or --connect to the running app; --save/--export,
  --keep-going), app COMMAND [JSON] / --method, describe ID, commands FILTER, $N references in
  run --cmd (+ integration tests)
- MCP batch: references and a script-text alternative (+ test)
- docs/agents.md; docs/parity.md scored over 275 catalogue features with cargo xtask parity;
  ROADMAP: parity ~63% breadth / ~55% overall, ~600 agent-hours remaining

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 08:06:42 -04:00
Brandon ThomasandClaude Opus 5.5 ded7c7ad04 M9: damage-region repaint — re-render only changed frames and patch the canvas texture
- render: damage()/damage_with() — changed items and only the frames whose composition changed
  (cache keeps the composition each edit replaced; Cache::composed_for matches a document
  version exactly); conservative full repaint for styles, swatches, layers, parents, wrap,
  effects and cross-story text (+ tests incl. pixel-identical patch vs full render)
- UI: canvas patches its texture after edits with the view unchanged (0.6 ms vs 22 ms on the
  sample when typing); perf harness row for the damage repaint

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 00:54:31 -04:00