Commit Graph
1349 Commits
Author SHA1 Message Date
autocraft-bot[bot] 2ba369f5d8 Apply review fixes
- crates/ui-egui/src/dialogs/tests.rs
2026-11-18 03:20:42 +00:00
Hamza 370b38e69a A date with no field to keep takes the deck's remembered format
My previous commit withheld the format from `set_date` whenever the caller had
not named one, so a field the slide already had would not be rewritten. That is
right where there is a field. A placeholder showing a fixed date holds plain
text and no date field at all, so there was no format to preserve and the
withheld format left `date_kind("")` to build a `datetime1`: a slide taken from
`datetime11` to fixed text and back came away on the short date (noted in
review).

The deck's format now always reaches `set_date`, and `format_given` is what
decides whether it may rewrite an existing field. With no field, there is
nothing to preserve and the remembered format is what a new one takes.

`a_fixed_date_turned_automatic_again_comes_back_on_the_remembered_format` walks
that transition with no `dateFormat` in the call, which is what the dialog
sends, and goes on to assert the guard still holds where a field does exist. It
is a test of its own rather than more of `the_automatic_date_takes_the_format_it_is_given`,
because setting a format for one slide also moves the deck's global one, which
that test's later assertions depend on.
2026-11-02 15:57:14 +05:00
Hamza 372c0e6c44 Apply only a date format the caller asked for
The dialog always sends `dateText`, so an Apply with no format selection
reached `set_date` carrying the deck's global format, and rewrote a slide's own
date field to it. Measured on two slides, the first on the time format and the
second on the short date:

    before   [datetime11, datetime5]
    apply {"date": true, "dateText": "", "all": true}
    after    [datetime5,  datetime5]

The first slide's format was never mentioned by the caller, and it was gone.
`set_date` already keeps an existing field when the format is empty, so it now
gets an empty format unless `dateFormat` was supplied; a format that is
supplied still reaches every slide, which the test checks so the guard cannot
quietly become a block.
2026-10-29 16:48:32 +05:00
Hamza 64d3127fe8 Header & Footer: an automatic date's format comes back on import
`header_footer()` recorded a Date placeholder's text only when it held no field,
and never looked at the field itself, so an automatic date's format was dropped
on import: `date_format` stayed empty whatever the deck used.

With the dialog of the previous commit that is not only cosmetic. Opening a deck
whose dates are `datetime5` showed `datetime1` selected, and pressing Apply then
sent that back and reformatted the deck's dates — a silent change to a file the
user only opened to look at.

The reader now remembers which of the thirteen formats the field is, so the
dialog opens on the deck's own choice. An unknown spelling (`datetime`,
`datetimeFigureOut`, which both render as the short date) is left as no choice
rather than guessed at, since the command only accepts the thirteen and would
refuse it. A fixed date still comes back as its text, as before.

`crates/pptx` gains a dependency on `crates/text` for `datetime::DATE_KINDS`,
which layer 3 may take on layer 2; `cargo xtask layers` passes.
2026-10-28 20:29:33 +05:00
Dylan M. Taylor 8c6c72e39f Refactor ui-egui for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor 1a203c4a73 Refactor engine for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor 7f1ebc2a5c Refactor render for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor 8e4d0e6b4c Refactor pptx for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor 3f853db3f6 Refactor av1 for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor d9749fbcc5 Refactor h264 for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor 0e7cd01381 Refactor hevc for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor 9c52950536 Refactor vp9 for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor c58f19f1b5 Refactor opus for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor 4de3a4dc8b Refactor text for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor f441ea93a2 Refactor metafile for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor 6a59eb8cef Refactor model for strict Clippy checks 2026-10-28 06:02:27 +00:00
Dylan M. Taylor e03ff82504 Refactor geom for strict Clippy checks 2026-10-28 06:02:27 +00:00
aiongg 88c2ceff5f Merge pull request #1461 from Silvertree2010/perf/export-speed
Speed up PDF export by reusing equal slide backdrops
2026-10-27 13:42:02 -04:00
NetterSilverandClaude Opus 5.5 2f4a6d906a Speed up PDF export by reusing equal slide backdrops
PDF export rasterises every slide as a backdrop and a content layer and
hands both to the writer. Profiling (gdb stack sampling) showed most of
the main thread outside rendering going to per-pixel work on those
rasters: compositing the backdrop onto white (not vectorised), the
writer hashing every backdrop to deduplicate it, and the straight-alpha
conversion scanning every content pixel.

- Composite the backdrop with saturating adds and skip 16-pixel blocks
  that are already opaque; skip blocks with no partly transparent pixel
  in the straight-alpha conversion. Same formulas, same bytes.
- Keep the last opaque backdrops (up to 32 MiB of pixels) and hand the
  writer the same image again when a slide renders an identical
  backdrop. The writer stored equal backdrops once already; now it also
  skips hashing and compressing the copies. Output is byte-identical.

deckcraft-cli bench, export .pdf step, 15 interleaved runs each on a
16-thread Ryzen (A/A noise +0.9 %):
- sample x4 (32 slides): median 531 -> 322 ms (-39 %), min 529 -> 317 ms
- same deck, every slide a different background: 557 -> 441 ms (-21 %)
- sample (8 slides): 149 -> 103 ms (-31 %)
Exported PDFs are byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:39:31 +01:00
aiongg 2c9edcc394 refactor(ui): use craft-ui's ComboBox for every dropdown (#1457)
* ui: use craft_ui::ComboBox so dropdown menus grow back (egui#5225); repin craft-libs

* chore(deps): craft-libs 60d60d48 (dropdown fixes)

* chore(deps): craft-libs 6af63481 (dropdown fixes)

* chore(deps): craft-libs 4d7b82f7 (dropdown fixes)

* chore(deps): craft-libs 92d392cf (#387 merged)

* chore(xtask): pdf-deps expects craft-libs 92d392cf
2026-10-27 10:26:51 -04:00
aiongg 12001d14e7 refactor(engine): split cmd/shape.rs into cmd/shape/{size,appearance,picture,freeform}.rs 2026-10-26 22:10:40 +00:00
aiongg 96f0ac204e test(engine): read past #[cfg(test)] imports in the file-system scan 2026-10-26 22:08:44 +00:00
aiongg 6b57773373 refactor(geom): split preset.rs into preset/{catalog,builder,build,shapes}.rs 2026-10-26 22:08:44 +00:00
aiongg 838d51ed59 refactor(text): split lib.rs into {run,style,autonum,shape,symbol,breaking,layout}.rs 2026-10-26 22:08:44 +00:00
aiongg 5b02b1744c refactor(render): split lib.rs into {raster,opts,slide,renderer,geometry,stroke,text_draw}.rs 2026-10-26 22:08:44 +00:00
aiongg 8b456dce41 refactor(engine): split tools.rs into tools/{hit,pointer,drag,click,geometry}.rs 2026-10-26 22:08:44 +00:00
aiongg 15bf821535 refactor(engine): split cmd/text.rs into cmd/text/{ime,layout,editing,autocorrect,caret,formatting}.rs 2026-10-26 22:08:44 +00:00
aiongg d7c06b53eb refactor(engine): split cmd/smartart.rs into cmd/smartart/{nodes,paint,layout,diagrams,edit}.rs 2026-10-26 22:08:44 +00:00
aiongg 97b98767f1 refactor(engine): split cmd/insert.rs into cmd/insert/{picture,album,chart,text_fields,links}.rs 2026-10-26 22:08:44 +00:00
aiongg d5180fbb70 refactor(engine): split cmd/format.rs into cmd/format/{font,text_effects,paragraph,painter,ruler}.rs 2026-10-26 22:08:44 +00:00
aiongg 9c222be711 refactor(engine): split cmd/design.rs into cmd/design/{colors,slide_background,slide_setup,master_view}.rs 2026-10-26 22:08:44 +00:00
aiongg 28371e27d7 refactor(ui-egui): split backstage.rs into backstage/{files,info,print}.rs 2026-10-26 22:08:44 +00:00
aiongg 4bdd5b5bee refactor(ui-egui): split icons.rs into icons/{geometry,draw}.rs 2026-10-26 22:08:44 +00:00
aiongg 99688fe45a refactor(ui-egui): split show.rs into show/{render,keys,ui,media,presenter,zoom}.rs 2026-10-26 22:08:44 +00:00
aiongg ada66524a2 refactor(ui-egui): split panels.rs into one file per pane under panels/ 2026-10-26 22:08:44 +00:00
aiongg e84ba9def1 refactor(ui-egui): split ribbon.rs into one file per tab under ribbon/ 2026-10-26 22:08:44 +00:00
aiongg 9545ff4d61 refactor(ui-egui): move the zoom, trim, about and alt-text test modules to their dialog files 2026-10-26 22:08:44 +00:00
aiongg c8a6363a0f refactor(ui-egui): split dialogs.rs into one file per dialog under dialogs/ 2026-10-26 22:08:44 +00:00
aiongg 462310faed refactor(ui-egui): split canvas.rs into canvas/{input,scroll,ime,media,rulers,guides,overlays,context_menu}.rs 2026-10-26 22:08:44 +00:00
aiongg d428b4804a refactor(ui-egui): move the backstage test files beside backstage.rs 2026-10-26 22:08:44 +00:00
aiongg 9ab4ed9581 refactor(ui-egui): move the sorter test files beside sorter.rs 2026-10-26 22:08:44 +00:00
aiongg a094f37ed9 refactor(ui-egui): move the ribbon test files beside ribbon.rs 2026-10-26 22:08:44 +00:00
aiongg 742e660afd refactor(ui-egui): move the dialogs test files beside dialogs.rs 2026-10-26 22:08:44 +00:00
aiongg 8338e21ecf refactor(ui-egui): move the canvas test files beside canvas.rs 2026-10-26 22:08:44 +00:00
aiongg 7ab59a0cd3 refactor(ui-egui): move qat to ribbon/qat.rs 2026-10-26 22:08:44 +00:00
aiongg a730e66757 refactor(ui-egui): move updates_ui to dialogs/updates_ui.rs 2026-10-26 22:08:44 +00:00
aiongg ac3c3b7b2a refactor(ui-egui): move credits to dialogs/credits.rs 2026-10-26 22:08:44 +00:00
aiongg 1368d06eeb refactor(ui-egui): move squiggles to canvas/squiggles.rs 2026-10-26 22:08:44 +00:00
aiongg af61c1cf3a refactor(ui-egui): move preview to canvas/preview.rs 2026-10-26 22:08:44 +00:00
aiongg 099dfa7670 refactor(ui-egui): move the panels test files beside panels.rs 2026-10-26 22:08:44 +00:00