Commit Graph
226 Commits
Author SHA1 Message Date
aiongg f6fe64981a Merge branch 'keymap-adoption' into keymap-shortcuts-dialog
# Conflicts:
#	Cargo.toml
2026-10-26 03:29:29 +00:00
aiongg ea5a706ef8 Merge remote-tracking branch 'upstream/main' into keymap-adoption
# Conflicts:
#	Cargo.lock
2026-10-26 03:15:52 +00:00
aiongg 3fc0bf83fd Merge branch 'keymap-adoption' into keymap-shortcuts-dialog
# Conflicts:
#	Cargo.toml
#	xtask/src/pdf_deps.rs
2026-10-26 02:06:51 +00:00
aiongg 23173b9065 Merge remote-tracking branch 'upstream/main' into keymap-adoption
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	xtask/src/pdf_deps.rs
2026-10-26 02:06:25 +00:00
aiongg 2e6df922c8 Merge remote-tracking branch 'upstream/main' into print-color-separations
# Conflicts:
#	Cargo.lock
#	crates/engine/src/cmd/export.rs
2026-10-26 02:05:49 +00:00
aiongg ada39e78d7 Keyboard Shortcuts: Assign takes a held shortcut in one step (craft-libs#352) 2026-10-26 01:39:22 +00:00
aiongg d28271b489 Merge branch 'keymap-adoption' into keymap-shortcuts-dialog
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-10-26 01:16:37 +00:00
aiongg 1a52593d0d Merge remote-tracking branch 'upstream/main' into keymap-adoption
# Conflicts:
#	Cargo.toml
2026-10-26 01:15:41 +00:00
aiongg d90881a8a9 Merge branch 'print-color' into print-color-separations
# Conflicts:
#	Cargo.toml
2026-10-26 01:11:35 +00:00
aiongg c856db68f1 Merge branch 'print-color' into print-color-x1a
# Conflicts:
#	Cargo.toml
2026-10-26 01:11:11 +00:00
aiongg 240dbcf731 Merge remote-tracking branch 'upstream/main' into print-color
# Conflicts:
#	Cargo.toml
#	crates/idml/src/export.rs
2026-10-26 01:10:39 +00:00
aiongg e91f830116 chore(deps): safe dependency refresh (#1844)
cargo update with semver-compatible updates only. Git dependencies keep their revisions (indd stays at 7f3060e5).
2026-10-25 20:54:46 -04:00
Dylan M. Taylor 18246dddd2 build: pin craft-update to craft-libs main (495e597) (#1837)
Picks up the startup prompt without the glyphs a font may lack (storytold/craft-libs#343, #344): the close mark is painted and the version pill is ASCII, so apps that panic on a missing glyph no longer take the prompt down.

Part of tracking issue storytold/craft-libs#319
2026-10-25 17:55:34 -04:00
aiongg 074db00079 Merge print-color into print-color-x1a
Brings in #1374 with upstream main merged (egui 0.37, craft-libs at
storytold/craft-libs e3b9e239).

Conflicts:
- Cargo.toml: print-color's pins (storytold/craft-libs e3b9e239 for
  craft-pdf, craft-prepress, krilla and the hayro crates; winit and egui
  patches), with craft-prepress keeping the `flatten` feature.
- xtask/src/pdf_deps.rs: print-color's REPO/REV.
- Cargo.lock: print-color's, relocked with cargo metadata; adds only
  craft-prepress and linesweeper.
- crates/pdf/src/export.rs: main's optional-content registration and
  add_form_fields helper; the helper leaves form fields and media out of
  PDF/X-1a with a warning.
- crates/engine/src/cmd/export.rs: the X-1a parameter docs plus main's
  `created`; the X-1a flatten and shadow-mask path on top of main's
  PDF/A-2b-only rasterize_layered.

Also: x1a_tests builds FlattenTotals through Default, since the struct is
non_exhaustive at e3b9e239.
2026-10-25 19:55:21 +00:00
aiongg 9c977f41a6 Merge print-color (#1374 with main: egui 0.37, craft-libs e3b9e239) into print-color-separations
print_pdf, shared by Export PDF, File › Print and Separations Preview, takes main's two
changes to the inline export pipeline: rasterize_layered runs only for PDF/A-2b (other
standards keep hidden placed-PDF layers as optional content), and the report gets
GRAPHIC_LAYER_RENDERING_WARNING when the source document has graphic layer visibility
overrides and the writer did not report it. The Separations Preview command matches
craft_prepress::Conversion with a fallback arm, since the enum is non-exhaustive at
craft-libs e3b9e239.
2026-10-25 19:54:40 +00:00
aiongg 65c387732d Merge upstream/main into print-color
PDF/X and CMYK groups keep this branch's approach: krilla's serialize
settings (pdfx::print_settings) write the CMYK page and transparency
groups, the GTS_PDFX output intent and the PDF/X Info and XMP entries.
make_pdfx4 adds only the XMP dates, so main's title argument and its
output-intent, Info and pdfxid XMP edits are dropped, and both
cmyk_group_spaces calls after writer.finish() (Export PDF, Print
Booklet) stay removed. Main's new parts are kept: file_info_metadata
(also for Print Booklet, on top of the print settings), optional content
registration and layer errors, add_form_fields, and pdfx's fonts module.
Main's metadata panic test calls the two-argument make_pdfx4.

craft-libs and the krilla patch are pinned to storytold/craft-libs
e3b9e239; Cargo.lock is main's, relocked without updates.
2026-10-25 19:47:27 +00:00
aiongg 77c718aa68 Merge keymap-adoption (#1298, on main) into keymap-shortcuts-dialog
craft-keymap with the dialog comes from storytold/craft-libs main e3b9e239. egui 0.37's
shaper owns bidi, so the dialog's labels go to it in logical order: rtl::visual_text and the
dialog's visual hook are gone. ForeignSet keeps the dropped-entry count through its builder.
2026-10-25 19:39:58 +00:00
aiongg 073ac98694 Merge upstream main into keymap-adoption; pin craft-libs to main e3b9e239
Main's shortcut dispatch (shortcut_key, used for keys forwarded from floating panel windows)
becomes the keymap's: shortcuts and forwarded_shortcuts both take their presses through the
key dispatcher and run them once the input is released. craft-keymap comes from
storytold/craft-libs, ForeignSet is built through its constructor, and the panel shortcut test
asks the docking layout which panel shows.
2026-10-25 19:36:33 +00:00
Dylan M. Taylor 2b74ecaded build: pin craft-update to craft-libs main (db19c37) 2026-10-25 15:08:35 -04:00
Dylan M. Taylor c784a9db66 refactor(updates): hold the install back while documents are unsaved 2026-10-25 15:02:26 -04:00
aiongg 1da1f7028b Merge designcraft#1810 (egui 0.37) into docking-trial; pin craft-libs to main a0916808 2026-10-25 17:16:25 +00:00
aiongg 56f15a600d Merge upstream main into docking-trial; pin craft-libs to main 5bbe9f62 2026-10-25 16:25:57 +00:00
aiongg fec0897a5d Application bar: use craft-window's shared title bar (#1811)
* UI: the application bar uses craft-window's title bar

DesignCraft's title-bar code moved to craft-libs as craft_window::title_bar.
The application bar calls it instead of its own copy, and the macOS shell
takes sync_movable from it. Differences: a drag on an in-window panel lying
over the bar no longer moves the window, full screen ignores the bar's drag
and double-click, and floating panels in their own windows keep their own
movable flag.

* UI: craft-window from craft-libs main

* UI: the application bar ignores the title bar's response
2026-10-25 12:06:36 -04:00
aiongg d9f96f6cbb Docking: pin craft-libs to pin-round3 d24e4bcce; craft-ui focuses the main window for a modal 2026-10-25 14:01:43 +00:00
Brandon ThomasandClaude Opus 5.5 dcce40fb87 Release 0.13.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 09:03:51 -04:00
aiongg 9397ee57d4 Docking: pin craft-libs to cdc671313 (craft-libs#313, owner test round) 2026-10-25 07:16:46 +00:00
aiongg 0fc055ee37 Docking: pin craft-libs to 4dc543cb4 (craft-libs#312, owner test round) 2026-10-25 06:00:48 +00:00
aiongg e4341d29a2 Docking: pin craft-libs to 8a503cfe7 (main) 2026-10-25 04:11:51 +00:00
aiongg 43c4f7e8a2 Docking: pin craft-libs to 869928d2a (main) 2026-10-25 00:38:07 +00:00
aiongg 6053b099bc Docking: pin craft-libs to 6e7f28518dd1 (main)
Every craft-libs crate and the Krilla/Hayro patches use one revision, which
also vendors hayro-postscript. Clipping text paints nothing in the PDF bounds
device; its clip arrives through push_clip_path.
2026-10-24 22:58:49 +00:00
skylartaylor a2db858e7d egui037: Port DesignCraft to egui 0.37
Pin the final egui, winit and shared UI revisions and reconcile current main.
Preserve document-epoch input and screenshot boundaries, host action ordering,
and Windows path regression coverage. Add click/End batch characterization.

Validation: all nine Linux CI stages pass (3230 tests, zero failures); Windows
CI and bounded native editing workflows pass on the same production source.
2026-10-25 00:52:21 +02:00
aiongg 67bfdde682 build: pin only craft-ui to craft-libs 16fb3d46e; other craft-libs crates stay at main's revs 2026-10-24 20:29:28 +00:00
aiongg f6bca1d85b build: craft-libs 16fb3d46e (shared docking and native windows); PDF clip text draws nothing 2026-10-24 19:24:58 +00:00
aiongg 4823b59492 PDF: shared reader from craft-libs 9f75d3dc (input bounds and crash fixes) (#1701)
* PDF: craft-pdf, krilla and hayro from craft-libs main (input bounds and crash fixes)

* PDF: craft-libs 9f75d3dc, with hayro-cmap from its vendored copy
2026-10-23 23:03:36 -04:00
aiongg 0409bbf9aa Merge branch 'print-color' into print-color-x1a
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	xtask/src/pdf_deps.rs
2026-10-23 08:16:07 +00:00
aiongg 3dbbcf2d07 Merge branch 'print-color' into print-color-separations
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/engine/src/cmd/export.rs
#	crates/ui-egui/src/lib.rs
2026-10-23 05:52:56 +00:00
aiongg 7ac286e6d2 Merge branch 'keymap-adoption' into keymap-shortcuts-dialog
# Conflicts:
#	Cargo.toml
#	apps/designcraft/src/native_menu.rs
#	crates/ui-egui/src/i18n.rs
2026-10-23 05:41:18 +00:00
aiongg a30b71cd36 Merge remote-tracking branch 'upstream/main' into print-color
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	xtask/src/pdf_deps.rs
2026-10-23 05:40:13 +00:00
aiongg 3c38c84438 Merge remote-tracking branch 'upstream/main' into keymap-adoption
# Conflicts:
#	Cargo.toml
#	crates/ui-egui/src/menus.rs
#	crates/ui-egui/src/shortcut_import.rs
#	docs/target-app-parity.md
#	docs/ui-parity.md
2026-10-23 05:10:57 +00:00
Brandon ThomasandClaude Opus 5.5 5e8ef67832 Release 0.12.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:38:12 -04:00
Zuujis 438d7b6d79 Dedupe the 400-year-cycle UTC conversion and the EPUB package writer (#1537)
* Dedupe the 400-year-cycle UTC conversion and the EPUB package writer

SonarCloud flagged new-code duplication on main (17%): five copies of the
"move the instant into chrono's range by whole 400-year cycles" conversion
and two copies of the EPUB OPF/container/zip writer.

- designcraft-doc gains a `time` module: `date_parts(days)` and
  `utc_parts(secs, nanos)`. App logging, EPUB `iso8601`, PDF `civil`, PPTX
  `civil` and text-variable `civil` are now thin callers; each keeps its own
  format string and year clamp. The app reaches it through
  `designcraft_engine::doc`, so its direct chrono dependency is dropped.
- EPUB: `package_opf` + `write_package` shared by fixed-layout and
  reflowable export (same entry order and compression).
- Boundary tests on the helper: pre-1970, year 9999 -> 10000, i64 extremes,
  nanos past a second.

Output is unchanged: existing date tests pass, and fixed/reflowable EPUBs
(with/without cover, author, pre-1970 and i64::MAX dates) are byte-identical
to origin/main.

* time: drop the unreachable i128 clamp and match arms in utc_parts

Whole 400-year cycles times 400 stay under 2.6e16 for any i64 day count,
so the year can't overflow i64 and the i128 + saturate was dead code
(carried over from the copies this replaced). The date and time lookups
can't fail either; each keeps one unwrap_or_default instead of a match
with a fake 1970 fallback. Output and tests unchanged.
2026-10-21 21:46:38 -04:00
Dylan M. Taylor 3b985e3813 Use chrono instead of hand-rolled UTC conversion (#1479)
* Use chrono for UTC/calendar conversion instead of hand-rolled copies

Replaces the hand-rolled civil / civil_from_days / days_from_civil copies (the
146_097 / 719_468 magic numbers) across the logging timestamp, text-variable
dates, EPUB dcterms:modified, PDF metadata dates and PPTX core.xml dates with
chrono, added as a workspace dependency (default-features = false, std only, so
wasm is unaffected).

- apps/designcraft logging `timestamp` (private civil_from_days deleted).
- doc text variables: `civil` and `days_from_civil` use chrono::NaiveDate;
  `format_date` and `parse_iso_date` keep their own format/parse logic and
  still call these helpers.
- epub `iso8601`, pdf `civil`, pptx `civil`: UTC datetime via
  chrono::DateTime::from_timestamp.

Output is byte-identical and pinned by the existing date, ISO-date, EPUB,
image, EPS and logging tests. The OOXML/EPUB dcterms timestamps keep their
exact strings. Each converted helper keeps a proleptic-Gregorian fallback for
dates outside chrono's NaiveDate range (and for the serial/overflow dates
parse_iso_date can hand days_from_civil), so no input changes or panics.
AGENTS.md now says time goes through chrono.

Follow-up to storytold/cadcraft#1785

* Never panic on a clock outside chrono's range; keep 5-digit years unprefixed

logging.rs timestamp(): chrono's From<SystemTime> unwraps, so a clock past
year 262143 panicked inside the logger. Use the fallible DateTime::from_timestamp
and read such a clock, or a pre-epoch clock, as the epoch like the old saturating
code did. Years past 9999 are written with {:04} like before, because %Y adds a
'+'. Tests cover both cases.

epub iso8601(): write the year with {:04} instead of %Y, matching the old
{year:04} output, so years past 9999 are not prefixed with '+'. Test added.

AGENTS.md: the "Time goes through chrono" rule now notes the narrow fallback
for dates outside chrono::NaiveDate's range, which crates/doc/src/vars.rs
retains (Howard Hinnant's algorithm).

* Don't build an unrepresentable SystemTime in the far-future test

UNIX_EPOCH + Duration::from_secs(u64::MAX / 2) overflows Windows'
SystemTime and panicked before timestamp() ran, failing the Windows
test job. Build it with checked_add and only assert where it exists.

* Route out-of-range dates through chrono's 400-year cycle, not hand-rolled copies

doc/vars.rs kept hand-rolled Hinnant `civil_fallback`/`days_from_civil_fallback`
copies for dates outside chrono's ±262143-year range, and AGENTS.md carved a
"narrow fallback" exception for them, which left calendar arithmetic outside
chrono after all.

Replace both copies with the Gregorian 400-year cycle (146_097 days): chrono
converts the day/year within one cycle and whole cycles are added back via i128
(so i64::MIN/MAX can't overflow). `civil` is reached by the system clock through
`format_date(now(), ..)`, so it must stay exact; `days_from_civil` only ever
sees a 4-digit parsed year via `parse_iso_date`, but it uses the same cycle form
for consistency. Both reproduce the pre-chrono proleptic Gregorian result, so
outputs are unchanged (verified against the old formula over wide ranges and at
the i64 extremes).

New test pins dates past chrono's range on both sides of the epoch, through the
public `format_date` and round-tripping `days_from_civil`/`civil`, with values
from the old formula. Removed the AGENTS.md "narrow fallback" exception.

epub/pdf/pptx `civil`/`iso8601` are left as-is: the PR already dropped their
hand-rolled copies for pure chrono, and their remaining epoch (`unwrap_or_default`)
fallback only triggers for a metadata/clock timestamp past year 262143 -- the
live-clock/file-mtime case FredApps accepted, with outputs that clamp the year
anyway (pptx 0..9999, PDF DateTime). No hand-rolled copy remains there to replace.

Tested: cargo test -p designcraft-doc; fmt --check; clippy --all-targets -D warnings.

* Carry an overflowing day into the next month again in parse_iso_date

parse_iso_date accepts any day 1..=31, and the old days_from_civil
carried a day past the end of its month into the next one (2019-02-30 is
2019-03-02). from_ymd_opt rejects such a day, and unwrap_or(0) turned it
into 1970-01-01. chrono now places the 1st of the month and the day is
added on, which restores the old normalization. Tested through days_from_civil
and parse_iso_date.

* time: preserve old out-of-range date conversion (no epoch fallback)

`DateTime::from_timestamp(...).unwrap_or_default()` silently reset any
instant past chrono's year range to 1970-01-01, changing output the old
hand-rolled Howard-Hinnant code converted exactly (e.g. 10_000_000_000_000 s
was 318857-05-20 17:46:40, not the epoch). Restore the old conversion domain
with a cycle-based helper that routes the calendar through chrono (the
calendar repeats every 400 years = 146_097 days, so month/day/time come from
chrono and only the year is carried, keeping every i64 exact), then apply each
format's existing year clamp afterwards.

- apps/designcraft/src/logging.rs: `timestamp` via `utc_parts`; keep the
  pre-1970 epoch clamp; u64 secs past i64::MAX saturate, not epoch.
- crates/epub/src/lib.rs: `iso8601` via `utc_parts`.
- crates/pdf/src/export.rs: `civil` cycle-based; `date_time` keeps its
  0..=9999 year clamp.
- crates/pptx/src/package.rs: `civil` cycle-based, keeps its 0..=9999 year
  clamp on the year only (month/day/time keep the real instant).

Pinned old outputs in tests (through the public helpers):
  logging u64::MAX/2 s -> 292277026596-12-04T15:30:07.000Z (was epoch)
  epub 10_000_000_000_000 -> 318857-05-20T17:46:40Z
       -10_000_000_000_000 -> -314918-08-13T06:13:20Z
       i64::MAX -> 292277026596-12-04T15:30:07Z
       i64::MIN -> -292277022657-01-27T08:29:52Z
  pdf  civil(10_000_000_000_000) -> (318857,5,20,17,46,40)
  pptx civil(10_000_000_000_000) -> (9999,5,20,17,46,40) (year clamped)

* Don't build a year-318857 SystemTime unchecked in the logging test

Windows' SystemTime only reaches about year 30828, so
UNIX_EPOCH + Duration::from_secs(10_000_000_000_000) panicked before
timestamp() ran and failed the Windows test job. Build it with
checked_add and assert where the platform can hold it. The year-10000
case fits everywhere and stays unconditional.

* Name the 400-year range extension as the one exception to the time rule

The rule said never to hand-roll calendar math, but the range fix
(shifting by whole 400-year Gregorian cycles so dates past chrono's year
range keep their old output) is cycle arithmetic, so the rule and the code
disagreed. The rule now names that exception: the library still computes
month, day and time, and only whole cycles are carried in the year.

* Say the library computes month and day; time-of-day is plain arithmetic

Narrows the range-extension wording: the date library computes the
calendar fields, and splitting seconds into hours, minutes and seconds
is ordinary arithmetic, which is what the code does.
2026-10-21 19:36:27 -04:00
Brandon ThomasandClaude Opus 5.5 4d62a501c1 Release 0.11.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 13:57:30 -04: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
aiongg ec336377ee Shortcuts: craft-keymap f9a65e8 (craft-libs#186): hidden internal commands, import paths, dialog errors 2026-10-20 22:47:35 +00:00
aiongg 7f77e3cb7c Shortcuts: craft-keymap d9b1a89 with the ui feature (craft-libs#186) 2026-10-20 18:37:20 +00:00
aiongg c464072ee7 #1298: craft-keymap 9aaf9df (craft-libs#164 review fixes)
Keymap::catalog(), Platform's non-exhaustive match, and the web
platform from craft_keymap::egui::platform.
2026-10-20 16:07:19 +00:00
aiongg c50321c852 Print color: X-1a written by craft-pdf at PDF 1.4 (craft-libs#194 d30598d)
Repin craft-pdf, craft-prepress, krilla and the hayro crates to d30598d.
flatten_document writes the X-1a file at PDF 1.4 with GTS_PDFXVersion
PDF/X-1:2003 in the Info dictionary and XMP, so DesignCraft's header
rewrite and incremental update are gone. check_pdfx1a refuses DeviceN
NChannel attributes and warns about an ICC v4 output intent profile in a
file of PDF 1.5 or lower; the export names the built-in Coated FOGRA39
(v4) when it is the intent. validate-pdf lists warnings apart from issues.
2026-10-20 16:00:38 +00:00
aiongg 12e80a7a70 Print color: pin craft-libs#194 (craft-prepress flatten) and its hayro crates 2026-10-20 14:53:52 +00:00