Commit Graph
26 Commits
Author SHA1 Message Date
FredApps 17db1ba448 Merge remote-tracking branch 'upstream/main' into inbox-15255 2026-11-23 10:57:42 +01:00
aiongg 715a8876b0 Merge pull request #16478 from aiongg/engine-split-step6
Engine split step 6: session slots and extension traits
2026-11-23 01:10:33 -05:00
FredApps 5b1214ab8a Keep the huge-canvas selection time bound at 90s
The 20s bound failed main's required artcraft-k8s-main gate after 26.86s
while the tile-count and sample assertions passed. Coverage runs have
been 20.6-24.8s. 90s still fails a canvas-wide paint.

Fixes #13620
2026-11-23 11:10:23 +07:00
aiongg cf80a283f2 Engine split step 6: cargo fmt 2026-11-23 03:28:48 +00:00
aiongg 3f9eb0d59d Engine split step 6: compile fixes the script can't make
presets::patterns::sync keeps the library's ids in a local while the presets
change (the accessor borrows the whole session); two atn_cmds tests read a step
into a local before pushing it, and clone an ActionState out of the other session.
Part of #15710.
2026-11-23 03:28:27 +00:00
aiongg 3cbd7b155a Engine split step 6: slot_access.py and its rewrite (slot fields to accessors, trait imports, doc links)
scripts/engine_split/slot_access.py rewrites the slot fields to their accessors
(Tracked presets deref through one more *), adds the trait imports, turns
s.presets_changed() into presets::presets_changed(s) and points Session::method doc
links at the trait methods. Its fix mode applies what cargo check reports; branch
mode serves open branches and lists their edits to the moved methods. The
definition-span helpers session_state.py uses move to rust_source.py so both
scripts share them (session_state.py's output is unchanged).

This commit is split plus the fix rounds against cargo check of engine-core,
engine, ui-egui and automation (lib and tests). Part of #15710.
2026-11-23 03:28:27 +00:00
aiongg f314928e1d Engine split step 6: session slots for colour, presets, actions, Object Finder, Select Subject, print; extension traits for the upper crates' Session methods
ColorState, Tracked<PresetState>, ActionState, ObjectFinderCache, SubjectCache,
Option<Spooler> and Option<PrinterSource> leave Session and become slots, registered
in their owner crate's group of install.rs. Each owner module reads its slots through
one extension trait (ColorExt, PresetsExt, ActionsExt, SmartSelectExt, PrintExt), and
the inherent Session methods outside core-bound files move onto traits (ColorExt,
LinkWatchExt, PresetsExt, PresetStoreExt, SavedPrefsExt). Private helpers become free
functions; presets_changed stays crate-private as a free function.

A session without a slot (made before the install, or after a conflicting one) reads
it at its default and gets it on the first write, as its fields did; its commands
still fail with the install's error. Part of #15710.
2026-11-23 03:10:48 +00:00
aiongg f9438dbdad Engine split step 5: session slots, state types in core, action recording split, prefs file document, closing hooks
- slots.rs: SlotInit, Install::slot, Session::slot/slot_mut (a missing slot is the registry's error); the preset store is the first slot (preset_store::PresetStoreExt)
- state.rs: the small Session state types and what they need; their modules re-export them
- actions_record.rs: ActionRecording (s.recording) takes the recording and playback fields out of ActionState
- action_history::history_policy_in_use; Clip::from_svg becomes edit_cmds::clip_from_svg
- prefs/saved.rs: SavedPrefs, its readers and the methods that combine preferences, colour settings and presets; ScriptEvents and ShortcutSet move into prefs
- hooks: document_closing, doc_id_reserved, pixels_edited
- tests that compare a whole ActionState also compare s.recording
2026-11-23 01:12:57 +00:00
aiongg 30bb60592b Engine split step 5: session_state.py and its rewrite (recording fields to s.recording, Clip::from_svg callers, preset store reads) 2026-11-23 01:05:50 +00:00
aiongg 691d27ae39 Engine split step 5: action history bookkeeping to crates/engine-core/src/action_history.rs 2026-11-23 01:05:31 +00:00
FredApps 7d433e98ef Merge branch 'main' into feat/param-schema-dispatch 2026-11-23 08:04:41 +07:00
FredApps b6241783b4 fix(engine): accept Action layer selectors in adjustment param checks
#7597 started value-checking image.adjustments.*. The new checker only
allowed layer to be an id or a string, so a recorded Action's
{"name":"Receiver"} was rejected and preview_document returned None
in review_mask_action_context_matches_the_addressed_layer. Accept the
same selectors explicit_layer already reads.
2026-11-23 08:04:37 +07:00
aiongg b9c9462462 Merge pull request #16466 from aiongg/engine-split-step4
Engine split step 4: pipeline hooks
2026-11-22 19:57:01 -05:00
FredApps 60910bb9bb fix(ui-egui): strip undocumented dialog keys only after reshaping
The closed-schema filter dropped Image Processor's jpeg/width rows
before nest() turned them into the jpeg object the command takes, so
OK wrote only a full-size JPEG. Apply Image is still on the incomplete
list and needs sourceLayer, which the same filter had also removed.

The filter now runs after nest() and the other command-specific
rewrites, and it skips commands whose docs are still incomplete.
2026-11-23 07:08:01 +07:00
FredApps f2cb19e91d fix(engine): install the registry in schema tests and drop dialog chrome keys
engine-core's command_specs() does not install commands, so the schema
and param-check tests that walked the registry failed with NotInstalled
after param_schema moved into that crate. They now call install() first,
as crate::session() already does.

Filter dialogs also no longer send keys a closed schema does not take,
including Bitmap's display-only inputResolution row, whose presence made
OK leave the document in Grayscale.
2026-11-23 06:40:14 +07:00
FredApps 6498e7ab53 fix(engine): move param_schema into engine-core after the crate split
Merging main #16449 carried this PR's lib.rs module declaration into
engine-core (photocraft#15710), but the new source file stayed under
crates/engine/src, so the crate would not compile.
2026-11-23 06:02:53 +07:00
FredApps fcdbb38a31 Merge branch 'main' into feat/param-schema-dispatch
Take the Properties mask id-salt change from the craft-libs pin. Keep
layer.vectorMask.edit from receiving a document key it does not take.
2026-11-23 05:56:42 +07:00
FredApps 01bce7a310 Merge branch 'main' into feat/param-schema-dispatch
Keep the parameter-schema dispatch, including Clean Brush refusing
unknown keys and the batch test that does not pass steps to Image
Processor. Take main's engine-core split and its new session helper.
2026-11-23 05:55:52 +07:00
David Mann 5f83433d8b Merge pull request #16289 from aiongg/set-d-pin
Pin craft-libs next: dialogs, menus, panels, docking and frame-cost fixes from the release epic
2026-11-22 23:54:49 +01:00
aiongg f0477a595f Engine split step 4: pipeline hooks
Core runs every command; the steps that belong to crates above core now run as hooks those
crates register with their command tables (Install.hooks, crates/engine-core/src/hooks.rs):
request params (batch open), redirect (Last Filter), parameter checks (file.new values, filter
params, through validate_params in dispatch and precheck), before the command (the floating
selection drops), run params (Shape Blur's path), after the command (mask view, Fade, script
events and slices, preset store sync), recorded steps keyed by command id with a default, step
origin, journal coalescing, recording flush and preferences applied. install.rs registers every
hook, grouped by the crate that will own it. Before an install there are no hooks, as the
registry lists no commands.

The recording predicates replayable, tool_stroke, shell_view_command and shell_save_command,
and recorded_params, move to actions_record, beside the rest of the recording normalisation;
actions_cmds re-exports the public ones.
2026-11-22 22:21:04 +00:00
aiongg 80d7c000a0 Engine split step 4: damage helpers to crates/engine-core/src/damage.rs
The redraw-area helpers (step_damage and the rest of cmd/layer_multi_cmds/damage.rs) are
pipeline logic that dispatch, edit, undo and redo use, so they leave the module the model
crate will take. layer_multi_cmds keeps its public re-exports.
2026-11-22 22:21:04 +00:00
aiongg 75cbe5c4eb Merge remote-tracking branch 'upstream/main' into set-d-pin
# Conflicts:
#	crates/engine/Cargo.toml
2026-11-22 21:49:29 +00:00
aiongg bc727036dd Merge remote-tracking branch 'upstream/main' into engine-precheck-params 2026-11-22 21:47:28 +00:00
aiongg b132a7f9ff Merge remote-tracking branch 'upstream/main' into engine-split-step3 2026-11-22 20:20:50 +00:00
aiongg 519a0c22a3 Engine split step 3: top crate with the wrapper Session
crates/engine keeps the package photocraft-engine: src/facade.rs re-exports
photocraft-engine-core, and its Session wraps core's and installs every engine
command. Core's Session::new() installs nothing; core gets install() and session().
The command registry keeps main's behaviour (empty before an install).

The top crate's dev-dependencies cover tests/ and examples/, including
craft-develop-model (camera raw baseline test) and photocraft-testkit (the
corpus-gated Photoshop oracle test). Dependents that need the core type or
borrowed two fields through the wrapper are fixed at the call site, and tests
that reach the registry before any session install first.

Tooling follows the package: workspace dependency, cl selection, xtask layers,
i18n report, scorecard and corpus paths, nextest overrides, ci-test-times rows,
display-names roots, prefs_usage paths, the engine split scripts, docs, and the
two release-perf steps in ci.yml.

Corpus .atn paths, the layer_menu registry read and the craft-develop-model
dev-dependency are FredApps' fixes from #16431.

Part of #15710
2026-11-22 19:29:06 +00:00
aiongg b69ad02ccc Engine split step 3: move the engine sources to crates/engine-core
python3 scripts/engine_split/crate_shell.py split, then rustfmt on the files it edited.
The sources and the manifest move to crates/engine-core; core's tests start from
crate::session() (1,673 sites), 32 tests that read the registry first install with
crate::install(), and 12 Session imports the rewrite left unused are dropped.
2026-11-22 19:19:11 +00:00