Commit Graph
5909 Commits
Author SHA1 Message Date
aiongg 4e6ca12daa craft-ui: a sizing pass keeps the real run's enabled state, so memoized views replay there
egui's invisible() also disables the Ui, and every sizing Ui is invisible. Env::of
folded that into enabled = false, which the memo key's scope key holds, so a view's
sizing call never matched its real run and decided a run for the whole pass.
2026-11-19 14:03:30 +00:00
aiongg bf187376d2 craft-ui-panels: note why the dock's tab row and column bar replay at rest 2026-11-19 13:36:11 +00:00
aiongg 7e754a6742 craft-ui: a replayed view registers its revealed rects with the shell
ShellCx's revealed rects live in a pass-stamped record per viewport, keyed
by the shell's id, and each registration is journaled, so a memoized view
in a slot that replays registers the rects its run did. reveal_rect skips
measuring runs itself.
2026-11-19 13:36:11 +00:00
aiongg 587590fec7 craft-ui: dock chrome and shell slots as memoized views
Each dock group's tab row, each column's bar and each iconic column's bar is a memoized view on the spec values,
the arrangement and the look; what the user did on them leaves through an outbox. The containers (DockGroup,
DockColumn, IconicColumn) and the host's body, group view and group header run every pass, and the host memoizes
inside them; shell slots the same way. The group menu is one popup, opened by the panel menu button or by a
context request on a tab, and its rows are built only while it is open.

Removed: DockPanels::content and spec_version, the chrome key, DockColumn::content, IconicColumn::content,
Slot::content, Slot::content_version, AppShell::content, Lazy::show_or and Run::unkept. The gallery's mock
Navigator body is a memoized view.
2026-11-19 13:34:57 +00:00
aiongg a9929bc06d craft-ui: Outbox, the event channel out of a memoized view; replays note their widgets and nodes for the bypass walk
A run sends what its components reported in the pass; a replay sends nothing, which is complete because input
reaches only an engaged view, and an engaged view runs. The outbox feeds nothing into the key.

The testing notes of runtime-made widgets, nodes and scroll regions are journaled, so a replayed view's nodes
pass the bypass walk as its run's did.
2026-11-19 13:34:45 +00:00
aiongg 1657ce1b31 craft-ui-macros: a type parameter only hash-escaped memo props fields name is bound by Hash + Sync
A dock's chrome props hold the host's panel type through #[memo_props(hash)]; the derive bound it by MemoProps,
which a plain panel id does not implement.
2026-11-19 13:34:45 +00:00
aiongg e31c08f0f6 docs: regenerate contract-api.md 2026-11-19 13:33:23 +00:00
aiongg 52c1f953ea craft-ui: env word sets, Units, formats and the host key memoized views by generation
A word set written by words! keeps the generation of the Words it was localized in and keys by it. Format, DateFormat
and Host get a generation per instance built (clones keep it), and Units keys by its format, words and point size.
The scope key and the host's word cache use these generations, not pointers. Checks that captured env words, units
or other locals take them as check_with inputs (page range, path field, print preview and font picker stories).
2026-11-19 13:31:20 +00:00
aiongg adfc725e21 craft-ui: a replayed view reports its nested rows' places to the scroll area
The area's anchor, glide target and axes are the area's own state: lazy::begin keeps them in its Placed, and View
holds only what the children decide by. Places are journaled as offsets from the view's start, so a replayed memoized
view keeps the area's anchor where its run put it. The Scroll trial moves the scrolling body so the view's room stays
the same while its nested rows' decisions change.
2026-11-19 13:31:16 +00:00
aiongg a7869f4faf craft-ui: memoized views follow the framework inputs they read outside their props
- Tracked inputs (runtime::inputs): the modifiers, the pointer, the keys held, the window facts, the keyboard
  layout, the keymap, a drag, the focus, the open layers and the scroll view of a nested Lazy. Each accessor notes
  its input into the open records; each input has a generation per viewport. A memoized view's replay is refused
  when an input its run read has another generation, so a change runs only its readers, absent views included.
  The keymap generation replaces the keymap-change unsettle for memoized views; an old Lazy keeps it.
- pointer::mods and frame::stepped_clock (a view reading the clock runs at the next step). In-crate pointer reads of
  the component under the pointer use unnoted reads.
- Scope key: what a scope hands down beyond the style inputs (enabled, read-only, size, ink, the command chain,
  motion, every app value) feeds a memoized view's key. EnvValue requires MemoProps.
- A memoized view's content starts a layout room: room reaches it only through its place.
- A command queued for a command scope instance inside a replayed view runs the view (Facts.instances,
  commands::queued_for).
- Count trials in ui-widgets body/memo_reads.rs.
2026-11-19 11:00:52 +00:00
aiongg f15c3ea8ee craft-ui-panels: InDock and Arrangement derive MemoProps
A memoized view keys on every app value its scope sets; the dock's InDock value feeds its arrangement (dock id and revision).
2026-11-19 10:56:53 +00:00
aiongg c832163e10 craft-ui: memoized views refuse replays of evicted memory, outside saved writes and discarded passes
A kept run records the memory owners it registered and the generation of
ended shown lives; a view whose components' shown memory was evicted or
ended since runs when it is shown again. A kept or saved binding in a view's
props feeds the context's count of writes made outside a component's edit
(set_saved_value and forget_saved per key, forget for session memory), read
through the view's key, and those writes note the edit for the frame.

A record whose run asked for a discard pass is never replayed: egui's count
of discard requests is compared between open and close, and layout memory,
whose ask reaches egui only in the end hook, notes its own. A run keeps the
key from before it, so a view that writes through its props runs once more
from the written value before it replays. A memoized view's entry id is
claimed once per pass, as stage bases are.

Check inputs are keyed only when a view takes the key (NameCheck and the
binding check box their inputs), PresetNames borrows the library and walks
its names, a Tracked field binding keys by address and write count, and
caption icons read again take the next generation.
2026-11-19 10:29:58 +00:00
aiongg 460bb5de7d craft-ui: MemoView, memoized views keyed by their props
A memoized view's content is a fn and its props are its only input, so the
framework sees every input it reads. While its key (the props type, the fn's
address and the props' inputs) equals the key after its last run, it adds
that run again and returns what the run returned. Lazy and MemoView share
one runner and one settled test; a memo view ignores the two rules that infer
a change of app data (input arrived, a repaint was asked), replays a run of an
earlier pass of the same frame when nothing it read was edited after the run
started and the run asked for no discard pass, and keeps its entry through
absence up to twice the shown views per viewport.

MemoProps gains identity() (the props type with its lifetimes erased, through
the typeid crate), &mut Tracked<T> by revision and Bind by value and place.
A binding's check takes its inputs as props: check(fn) and
check_with(inputs, fn), one mechanism; a composite hands its check on through
BindMut::check_of. The preset name check (NameCheck) takes inputs the same
way, with PresetNames as a library's names. Glyph is Any + MemoProps, and an
icon keys a glyph by its type, then by its key; the caption glyph owns an
Arc<CaptionIcons>.

Facts::register is journaled, layout memory notes discard asks into the open
record, and the settle counters become MemoRun and last_pass_memo_runs. The
idle-frame trial moves onto memo views, beside count trials of the mechanism.
2026-11-19 10:04:00 +00:00
aiongg f9c149b497 craft-ui: journal entries are data, comparable by call and arguments
`runtime::journal(ctx, args, again)` notes a registration as its arguments and a capture-free `again` (a function or
a closure without captures; a capture fails to compile). Two entries are equal when they come from the same `again`
with equal arguments, and `Debug` names the call and its arguments, so a replay can be compared with a real run.

The focus `Transcript` and the records it holds (`StopRec`, `ScopeRec`, `RowGroups`, `Stop`, `Group`, `KeyUse`,
`KeyRole`) derive `PartialEq`. The journal's argument types gain `PartialEq` or `Debug` where they lacked them;
`UiTokens` compares by its content key. The docking generics that journal drop spots require `PartialEq + Debug` of
the panel type.
2026-11-19 09:44:06 +00:00
aiongg 1e7aff5638 Keep the counters in pass-local state; mark Settle non_exhaustive 2026-11-19 09:44:06 +00:00
aiongg be39bb3857 Gate the counters on the testing feature 2026-11-19 09:44:06 +00:00
aiongg 2dc15b3ec2 Add count-trial counters for settling, text layout and measure asks, and an idle-frame trial 2026-11-19 09:44:06 +00:00
aiongg 3a815c9657 ui-contract: MemoProps, MemoKey, Stateless and the MemoProps derive
MemoProps keys every input of a memoized view. The derive builds on the
plain-data field check, with #[memo_props(hash = "reason")] for foreign
plain types and #[memo_props(stateless)] for the type parameter of a
Stateless callback, which no fn item implements MemoProps for: the shared
check takes an optional per-parameter escape beside the field escape, and
PlainData passes none. FitKeep derives Hash.
2026-11-19 08:04:49 +00:00
aiongg ee0798cda0 craft: facade features table from the member manifests; PlainData derive reaches craft-tracked through contract 2026-11-19 08:04:36 +00:00
aiongg 02b3ea4a34 craft-ui: bind_tracked! binds several fields of one Tracked at once
bind_tracked!(doc => title, style.size) splits the Tracked into its value and
its write count (a Cell over the count) and gives each field path its own
write-through binding, so the borrow checker rejects overlapping paths. A
binding moves the count at each write that changes its field; making and
reading bindings every pass leaves the revision. Bind::tracked, Field, Place,
Projection and field! are gone: this is the one way to bind a tracked field.
2026-11-19 07:00:52 +00:00
aiongg c0df034524 ui-macros: plain-data check bounds type parameters and checks every field
The impl bounds each type parameter by the derive's trait, and every field is
checked under those bounds, so a generic recursive type derives without
overflowing and a Cell<T> field fails at the derive, naming the field. A field
type written with Self is checked as the type itself. The escape is an Escape
{ attr, keyword } parsed by escaped(), and the check item is a separate output a
derive may leave out. A direct craft-tracked dependency is preferred over the
facade when finding the crate path.
2026-11-19 06:57:03 +00:00
aiongg b083a40316 craft-tracked: Tracked<T>, PlainData and its derive, field! and Bind::tracked
Tracked<T> owns its value, a process-unique source id and a write count. Deref
reads; DerefMut, edit and a Field's writes move the count, and a clone is a new
source. T must be PlainData, a marker with no implementation for interior
mutability, raw pointers, dyn objects or closures, so no write can bypass the
count. #[derive(PlainData)] in ui-macros checks every field through a field-check
helper the plain-data derives share; #[plain_data(assume = "reason")] skips one
field of a foreign plain type.

field!(a.b) builds a read and a write projection from a field path only.
Bind::tracked(&mut t, field!(a.b)) reads through the read projection and moves
the revision only when an edit changes the field.
2026-11-19 06:47:09 +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