Commit Graph
5899 Commits
Author SHA1 Message Date
aiongg 0e93f7f97c Merge pull request #2341 from aiongg/lint-no-global-state
design-lint rule no-global-state (#2336)
2026-11-19 08:54:08 -05:00
aiongg b2456f91c6 Merge pull request #2328 from aiongg/space-and-uia-fixes
access: no dangling AccessKit controls id (Windows menu crash, from #2239)
2026-11-19 03:55:22 -05:00
aiongg d7804c73c2 access: the controls step reaches the tests through runtime::egui 2026-11-19 07:41:02 +00:00
aiongg 94c912daa9 design-lint: allow ui-contract's own MemoProps impls (#2336) 2026-11-19 07:08:11 +00:00
aiongg a5a337466c design-lint: no-global-state rejects __split_for_bind instead of __from_field_path (#2336) 2026-11-19 07:02:51 +00:00
aiongg 6d1d6bb6d1 design-lint: per-item no-global-state allowlist; motion:clock flags clock fn values (#2336) 2026-11-19 06:53:55 +00:00
aiongg 7199467079 design-lint: no-global-state rejects PlainData impls and __from_field_path (#2336) 2026-11-19 06:51:05 +00:00
aiongg fc4fce56a0 design-lint: contract/no-global-state (#2336) 2026-11-19 06:43:32 +00:00
aiongg fc8d1205ab Use const for immutable UI tables (#2336) 2026-11-19 06:40:20 +00:00
aiongg 4ec453ed5a access: the controls tests live in the integration binary 2026-11-19 06:38:55 +00:00
aiongg c6537b6d07 access: rustfmt 2026-11-19 04:09:37 +00:00
ussoewwin 326438a6f9 access: a popup's node this update does not carry leaves no dangling controls
accesskit_consumer's Node::controls() unwraps every id in the relation, so an update whose
controls names a node it does not carry aborts the app once the host's UIA adapter applies it.
In PhotoCraft on Windows, clicking Image, Edit or Layer in the menu bar did exactly that
(photocraft#15597), and on one machine Filter too — an ordering difference per menu.

emit.rs adds every open popup's id, and a menu reports its popup open on a frame where the
popup's own node is not emitted. The runtime plugin now prunes the finished update in
output_hook, keeping a controls id only when the same update carries its node. Other relations
are untouched: they are built from nodes the pass wrote.

The tests fail without the change: the relation keeps an id with no node.
2026-11-19 04:09:28 +00:00
aiongg 98b1810f8f Merge pull request #2320 from aiongg/stack-command-defs
ui-macros: CommandSet::defs builds each command in its own function
2026-11-18 22:41:15 -05:00
aiongg ee151c5758 Merge pull request #2319 from aiongg/docs-no-pr-cache
docs workflow: pull requests do not save a dependency cache
2026-11-18 22:41:03 -05:00
aiongg 9f234ae3ec Merge pull request #2299 from aiongg/next-sync-1118
Sync main into next (18 Nov)
2026-11-18 22:14:22 -05:00
aiongg 16e50264ca ui-macros: CommandSet::defs builds each command in its own function
The derive pushed every variant's definition inline, so one frame held a CommandDef temporary per variant (175 KB for the largest set in PhotoCraft at opt-level 0). Each variant is now a non-capturing closure in a table of function pointers, and defs loops over the table.
2026-11-19 02:27:44 +00:00
aiongg 3b4f5079e4 docs workflow: pull requests do not save a dependency cache 2026-11-19 02:23:06 +00:00
David Mann 815e6a2389 Merge pull request #2283 from davidmann4/anchor/12708-edit-existing
Add Anchor: select and edit existing anchors and handles (photocraft#12708)
2026-11-19 03:22:06 +01:00
aiongg 147e122d8e Merge remote-tracking branch 'upstream/next' into next-sync-1118 2026-11-19 01:56:16 +00:00
aiongg 43bf8e87bc Revert "Lazy::show_or: the first child takes room only when it shows, so a dock group's extent is the same run or replayed"
This reverts commit 4f3b9e8594.
2026-11-19 01:56:16 +00:00
aiongg 4f3b9e8594 Lazy::show_or: the first child takes room only when it shows, so a dock group's extent is the same run or replayed
A host view that leaves its group to the dock left an empty scope in the
settling view's Ui, which moved the group below it. The view's extent then
differed between a run of the group and a replay of it, and the pointer over
one tab ran every group again.
2026-11-19 01:47:46 +00:00
aiongg b013967b02 Sync fixes: main's JXL capability test, settling layer through runtime::egui 2026-11-19 01:35:39 +00:00
David Mann 93e68f35a1 Merge remote-tracking branch 'origin/next' into anchor/12708-edit-existing
# Conflicts:
#	crates/draw/src/ui/pen/bezier/mod.rs
#	crates/draw/tests/it/bezier.rs
2026-11-19 02:31:29 +01:00
David Mann ad32b91d50 Merge pull request #2284 from davidmann4/anchor/12709-alt-subpath
Add Anchor: Alt selects or copies the whole subpath (photocraft#12709)
2026-11-19 02:15:12 +01:00
David Mann 117389d4a1 Merge pull request #2306 from davidmann4/fix/next-red-dock-settle
Lazy::show_or: a view that leaves its room takes none (next is red since #2273)
2026-11-19 02:14:53 +01:00
aiongg 9d599676d1 Sync fix: name private items in public docs as code, not links 2026-11-19 00:48:51 +00:00
aiongg f6532f9835 Sync fix: keep main's uri_decode import in the glTF tests 2026-11-19 00:32:21 +00:00
aiongg 7086f23162 Sync fixes: restore the rust-cache lock entries, drop a duplicate import, format 2026-11-19 00:27:45 +00:00
David Mann 15fee07c8d Merge branch 'fix/next-red-dock-settle' into HEAD 2026-11-19 00:56:30 +01:00
David Mann 7fcf44cb93 Merge branch 'fix/next-red-dock-settle' into HEAD 2026-11-19 00:56:29 +01:00
David Mann b5b1300783 Lazy::show_or: a view that leaves its room takes none
next has been red since #2273 on two counts, both in the dock's settling
host view (3bcc5bec4):

- design-lint: contract/lazy.rs named `egui::LayerId` for the run's
  layer. The run now holds the runtime's `Layer`, the type `Place` and
  `replay::close` already use.
- hovering_a_tab_runs_only_its_group: the dock ran its host view in a
  `scope_builder`, which takes room and item spacing in the Lazy's
  child even when the host leaves the group to the dock. A replayed
  group then sat 4 points lower in flow than a group that ran, so the
  child's extent changed whenever a hovered group ran, layout memory
  asked for a discard pass, and that pass ran every group (5 runs
  where 1 is expected).

`show_or` now runs `add` in a child `Ui` that takes room only when it
returns `Some`, so `otherwise` takes the same place whether it runs or
replays.
2026-11-19 00:55:45 +01:00
aiongg e8e713ee26 Merge storytold main into next (18 Nov sync)
Merges main at 3b8e426a26.

- crates/ui: main's e-sign dialog (crates/ui/src/esign) moves to craft-cloud-ui beside the
  share dialog, behind craft-cloud-ui's esign feature; craft-ui forwards `esign` and
  re-exports the module.
- crates/proof: main's can_suggest_cased goes to affix/check.rs and its tests to
  affix/tests.rs (next split affix.rs); French wiring in lib.rs.
- crates/svg: main's validated resolver and raster validation stay under tree-render, which
  now also enables gif and image-webp; the shared image-codec helpers are gated on tree.
- craft-ai-agents: main's rev (craft-ai-integrations main), one entry.
- crates/craft: facade dependencies, features and re-exports for main's new crates.
2026-11-18 23:07:38 +00:00
David Mann 04ba41419b Merge pull request #2242 from ljkx/fix/15540-dialog-first-field-selected
Dialogs: a dialog that opens on a text field selects its text (photocraft#15540)
2026-11-18 23:27:59 +01:00
Dylan M. Taylor 3b8e426a26 feat(exr): add f32/f16 RGBA writer, compression modes, and chromaticities (#2281) 2026-11-18 17:20:52 -05:00
David MannandClaude Opus 5.5 4d78bb2de2 Add Anchor: Alt selects or copies the whole subpath
In the reference application Alt does not turn Add Anchor Point into
Delete Anchor Point: an Alt click on a segment selects every anchor of
its subpath and adds nothing, an Alt drag moves a copy of the subpath
(the copy ends up selected), an Alt click on an anchor deletes nothing,
and the cursor is the arrow with a plus.

The overlay now does the same under Add Anchor, reusing Direct
Selection's Alt segment press (`PathEdit::DuplicateSubpath`, or the
subpath itself on a path that takes no copies). Delete Anchor with Alt
still adds an anchor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 23:03:09 +01:00
David MannandClaude Opus 5.5 0274c3e5a0 Add Anchor: select and edit existing anchors and handles
In the reference application the Add Anchor Point tool edits the
anchors and handles a path already has as Direct Selection does; only
a press on a segment adds an anchor. The overlay took a press on an
anchor and did nothing with it, and never took a handle.

Under Add Anchor a press on an anchor now selects and drags it as
Direct does (Shift adds to the selection), a press on a shown handle
drags it (Alt moves it alone), and a click on empty canvas deselects
the anchors and keeps the path. Alt on an anchor is still Delete
Anchor's click, and a click on a segment still adds an anchor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:59:49 +01:00
Dylan M. Taylor 010702ee9b chore: sync Cargo.lock with workspace (#2279) 2026-11-18 16:37:32 -05:00
Dylan M. Taylorandtexjer 6c034902b2 craft-develop: extract spline, curve, and lut modules from LightCraft (#587) (#2274)
Co-authored-by: texjer <texjer@gmail.com>
2026-11-18 16:30:48 -05:00
FredApps bba249ecbf Merge pull request #2270 from FredApps/fix/786-psd-tagged-descriptor-prefix
psd: add bounded recovering descriptor-block prefixes
2026-11-19 04:28:10 +07:00
aiongg 18ffc07519 Merge pull request #2273 from aiongg/frame-cost
Frame cost: shown-chord table, settling host views, one gate answer per frame
2026-11-18 16:19:20 -05:00
Dylan M. Taylor 816f745c02 Merge pull request #2023 from el-j/feat/video-mjpeg-frame
craft-video: Motion JPEG frames convert to VideoFrame (#1231)
2026-11-18 16:11:50 -05:00
aiongg e79a3ed16e TransformBox: trial that a frame run twice reports each drag move once
A frame's second pass runs the box's update again with the press still
held at the same point. The proposal it makes equals the one the first
pass reported, and the gesture reports an equal proposal only once, so a
host that applies each Update applies it once per move. The trial runs
a drag with every frame run twice and counts the updates.
2026-11-18 20:59:41 +00:00
aiongg 0392fc439d Commands: the gate answers each command once per frame
The board asked the app's gate again for every resolution: each reader
of a command, the measuring and the real run of each component, and the
re-resolution of every shown reader at the start of each pass. The gate
is a snapshot of what the app knew before the frame, so the board keeps
its answers for the frame and asks once per command. CommandRef::key_text
gives the key without allocating for a command without parameters; the
keymap's lookups and the board's answers use it.
2026-11-18 20:59:41 +00:00
aiongg 3bcc5bec46 Dock: a host view settles under its panel's content version
DockPanels::group_view ran in every pass, while the dock's own groups
settle their bodies under DockPanels::content. A host view now runs in a
settling Lazy under the shown panel's content version, the group's
panels and its shown tab, and repaints its last run while they hold.

Lazy::show_or carries the host's answer: the view runs first, and where
the host leaves the group to the dock, the dock's group shows in the
same child and that run is not kept, so the next pass asks the host
again. The run-count trial checks that a settled frame runs neither the
view nor the versioned body.
2026-11-18 20:59:41 +00:00
aiongg a23d8c68c6 Menu bar: one MenuHelp constructor, over a function that lists the entries
MenuHelp had two constructors, one over a list the caller built every
frame and one over a function the bar calls only while the Help menu is
open. Only the second keeps closed menus from paying for the list, so it
is the one constructor: MenuHelp::new takes the function.
2026-11-18 20:59:16 +00:00
.CooCoo b130ac1fa4 image-codecs: find the JPEG-LS frame header past 64 segments, and add detect_prefix (#2178)
* image-codecs: find the JPEG-LS frame header past 64 segments, and add detect_prefix

detect walked at most 64 marker segments looking for the SOF55 frame
header, so a JPEG-LS file with more segments before its frame header,
such as an ICC profile split over 255 APP2 segments, was reported as
JPEG. The walk now runs until it reaches a frame or scan header or the
end of the bytes. Each step moves forward at least one byte, so the walk
takes at most one step per byte.

detect also reported JPEG for a buffer that ended before the frame
header, which is what a caller that reads only the start of a file
passes. The new detect_prefix returns Detection::NeedBytes(n) in that
case, with the length the next step reads, and otherwise the answer
detect gives. The doc comment on detect now says that it needs the bytes
up to the frame header.

* image-codecs: walk each JPEG marker segment once when detecting in steps

detect_prefix walks the marker segments from the SOI on every call, so a
caller that reads exactly the length each Detection::NeedBytes asks for
walks the earlier segments again on each call. Over a file with many
small segments before its frame header, the total walk grows with the
square of the segment count.

The new PrefixDetector keeps the offset of the marker where its last
walk stopped and starts the next walk there. Its detect gives the same
answer and asks for the same lengths as detect_prefix, and
detect_prefix now runs a single step of a new PrefixDetector.

* image-codecs: read past a JPEG-LS restart interval segment and stop at FF 00

The JPEG-LS frame walk treated a DRI segment before the SOF55 frame header
as the end of the walk, so a file with one was detected and decoded as
JPEG. DRI now takes the length-prefixed path. The decoder accepts a 2-, 3-
or 4-byte interval of 0, reports a nonzero interval as unsupported, and
rejects other segment sizes as malformed.

`FF 00` after the SOI is a stuffed zero, not a marker, so the walk now ends
there instead of asking for a length field.

A PrefixDetector whose walk stopped at another frame header answers JPEG
for bytes that start with `FF D8 FF`, without walking from the SOI again.

* image-codecs: apply the JPEG-LS restart interval in effect at each scan

A later DRI with an interval of 0 turns restarts off again, and an
interval of at least the frame height puts a non-interleaved scan in
one interval with no restart marker. Both decode again. A nonzero
interval shorter than the frame height is still unsupported.

* image-codecs: reject a restart marker after a JPEG-LS scan of one interval

A restart marker comes only between two restart intervals. When the
interval in effect is at least the frame height, the scan is one
interval, so a restart marker after it, with or without fill bytes
before it, is now an error instead of being skipped.

Adds a test that a PrefixDetector starts each call at the marker where
its previous walk stopped.
2026-11-18 15:52:55 -05:00
.CooCoo 37724ad48d craft-image-codecs: lossy WebP encoding no longer copies the luma plane for every macroblock (#1975)
The VP8 encoder cloned the whole luma reconstruction before each
macroblock's B_PRED trial and restored it when a whole-block mode won,
so encoding P pixels copied about P^2/256 bytes. The trial writes only
the current macroblock, and the whole-block path writes every pixel of
that macroblock again without reading the trial's values, so the copy
and the restore are removed.

The output is byte-identical: a new test pins the SHA-256 of ten
encoded files (1x1 to 640x480, sizes that are not multiples of 16,
qualities 10 to 95) taken before the change, and decodes each with
image-webp. An ignored test prints encode times for 512 to 4096
squares; in release on one machine, 4096x4096 took 162.9 s before and
1.36 s after.
2026-11-18 15:51:10 -05:00
aiongg 57ecf973e1 Keymap: shown chords from a table built when the bindings change
Keymap::shown_chord ran a lookup for each single-press binding of the
command, and Board::resolve calls it for every command it resolves, so
each frame repeated those lookups for every command row, tool and button.
The keymap works out each command's shown chord when it is built and
whenever its bindings change, and shown_chord reads the table. The lookup
and the table share one ranking (Keymap::winners), which replaces the
separate press_runs copy of it.
2026-11-18 20:43:24 +00:00
Kevin Joseph 041bafa259 craft-docx: keep a table style's w:tblInd on read and save (#2196)
* craft-docx: keep a table style's w:tblInd on read and save

A table style's own indent was dropped on read, so it was gone on save.
pandoc's Table style sets it to 0, and Word for Mac places a table whose
style chain sets no indent about 5.4 pt further right than one set to 0.

craft-wordmodel gains TableStyleParts::indent, merged through basedOn.
The reader takes a dxa indent (nil is 0; pct and auto set none) and the
writer emits it in schema order, 0 included.

Part of storytold/wordcraft#5767.

* craft-docx: a table style's w:tblInd without w:w is 0

CT_TblWidth's w:w defaults to 0, so the style resets a based-on style's
indent instead of inheriting it. The test helper now fails when a saved
style is missing rather than matching an empty string.

* craft-docx: the tblInd override test checks the base sets an indent

Without it the test would pass if the reader dropped the base style's
indent, since there would be nothing to override.
2026-11-18 15:35:42 -05:00
Kevin Joseph 0c3793eadd craft-docx: theme font slots survive a save (#2197)
* craft-docx: theme font slots survive a save

w:rFonts' w:eastAsiaTheme and w:cstheme slots are kept on read and written
back. Word picks the East Asian and complex-script fonts through them, so
dropping them changed which font Word used for East Asian punctuation and
its line breaks. The Latin slots (w:asciiTheme, w:hAnsiTheme) are kept when
the run's font came from them and written back only while they still name
that font in the document's theme, so a font chosen later is not hidden.

craft-wordmodel: a one-byte ThemeFont and CharProps font_ascii_theme,
font_hansi_theme, font_ea_theme and font_cs_theme. Overlaying a named font
without its slot clears the slot; minus keeps a slot whose font stays.

Ported from storytold/wordcraft#5772.

* craft-docx: keep the theme's East Asian and script fonts; exact slot replacement

The saved theme wrote empty a:ea and a:cs faces and no per-script fonts, so
a kept w:eastAsiaTheme or w:cstheme slot named no font in Word. The reader
now keeps the theme's ea, cs and a:font script entries (THEME_FONTS) and
the writer puts them back.

craft-wordmodel: a named font replaces both Latin slots with its own, so a
patch with one slot no longer leaves the other stale. minus keeps a font
equal to the base's when its slots differ, so a font that clears the
base's slots still clears them when overlaid. latin_slot compares the
theme face without cloning it.

* craft-docx: theme fonts keep faces and scripts apart; limit only usable scripts

THEME_FONTS lines now say whether they hold a default face (a:ea, a:cs) or a
per-script font, so an a:font script="cs" is no longer written back as the
a:cs face. The 256-entry limit applies to usable per-script fonts only, so
empty default faces no longer push the last one out.

A test pins down Latin slots that name different faces: the model has one
Latin font, so only the slot that still names it is written.

* craft-docx: a long theme script id never pushes out one font resolution uses

The kept per-script fonts count script ids of 8 characters or fewer (the
ones font resolution takes) and longer ones (language tags such as
zh-Hant-TW) apart, 256 each, so a long one can't use up the place of a
mapping resolution keeps.

* craft-docx: THEME_FONTS names both per-script caps
2026-11-18 15:35:36 -05:00