3725 Commits
Author SHA1 Message Date
FredApps d06ad73271 Naming: use RAW Develop for PhotoCraft's raw-processing feature (#12403)
Related to #5310. Display labels only; command ids (filter.cameraRaw, edit.preferences.rawDefaults), preference keys, serialized settings, PSD/action/XMP Adobe Camera Raw identifiers and .atn step names are unchanged.

- Camera Raw / Camera Raw Filter / Camera Raw Defaults -> RAW Develop / RAW Develop Filter / RAW Defaults in menus, preferences, filter names, diagnostics and all 34 catalogs.
- Saved Photoshop actions keep the "Camera Raw Filter" step name, so .atn files round-trip byte for byte (test extended).
- "Camera Raw" stays a command-search keyword.
- Removes dormant Adobe/Photoshop-branded catalog rows; display-name guard tests.
2026-11-09 08:30:33 +01:00
David Mann bade1134b2 Merge branch 'main' into fix/11775-count-record-label (merge queue) 2026-11-09 01:45:17 +01:00
David Mann a76bb72b1f Merge pull request #10569 from hectorviov/feat/layer-copy-css
Layer › Copy CSS
2026-11-09 00:17:21 +01:00
David MannandClaude Opus 5.5 c571f81b1c Merge main into fix/11905-bg-eraser-transparency-lock
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-11-08 23:25:35 +01:00
David Mann 118fc0da6b Merge remote-tracking branch 'origin/main' into HEAD 2026-11-08 22:17:36 +01:00
David Mann dff5d29584 Merge remote-tracking branch 'origin/main' into fix/12397-wand-seed-tests-antialias 2026-11-08 21:03:43 +01:00
David MannandClaude Opus 5.5 bfe5d2a671 Magic Wand seed-outside tests: keep Anti-alias on, expect the measured fringe (#12397)
Instead of turning Anti-alias off, the tests keep the default setup and
expect the reference application's measured results (#11776, #11779):
the selection ends at 381, Subtract at 219, Intersect runs 219-381.
Suggested by hectorviov on #12399.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 21:03:37 +01:00
David MannandClaude Opus 5.5 4e43c23e43 Magic Wand seed-outside tests: Anti-alias off, so they test the modes with hard edges (#12397)
#12146 gives near-matching neighbours a soft fringe when Anti-alias is on.
The #11848 tests left Anti-alias at its default and expected exact column
bounds, so main's engine tests failed (381 instead of 380).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 20:31:42 +01:00
David Mann a879c6ac0a Merge main into #10569
# Conflicts:
#	crates/ui-egui/src/menu_catalog.rs
2026-11-08 20:20:12 +01:00
David Mann a17acfa7a7 Merge pull request #12049 from DuBearte/fix/11897-clear-on-background
Brush: Clear on the Background paints as Normal and the Mode reads Normal
2026-11-08 20:16:11 +01:00
David Mann 3ef886c2e0 Merge pull request #12382 from TrevorBrown-dev/fix/layer-via-copy-capital-12357
Menus: Layer Via Copy and Layer Via Cut with a capital V, as in the reference (#12357)
2026-11-08 20:10:52 +01:00
David Mann 8acd45bfa9 Merge pull request #12298 from TrevorBrown-dev/fix/patch-destination-selection-12119
Patch: in Destination mode the selection moves with the patch (#12119)
2026-11-08 19:56:56 +01:00
David Mann 83e2172336 Merge pull request #11848 from DuBearte/fix/11779-wand-seed-outside
fix(engine): Magic Wand Subtract and Intersect grow from the seed through the selection (#11779)
2026-11-08 19:33:29 +01:00
David Mann fa41efebc5 Merge pull request #9348 from VoiceLessQ/pattern-preview-wrap-tools
paint: 12 more painting tools wrap across the canvas edges in Pattern Preview (#8883)
2026-11-08 19:22:34 +01:00
David MannandClaude Opus 5.5 3d2667d0e6 Background Eraser: channel-target preview mixes back unlocked like its commit (#12191)
On a transparency-locked layer with a colour-channel target, the live
preview mixed the dabs back with the lock (straight mix) while the commit
mixes premultiplied without it, so at 32 bits partly transparent pixels
rounded differently in the preview. The channel branch now builds the
LiveDab unlocked and pushes the points afterwards, as the RGB branch does.
The test now runs at 8, 16 and 32 bits over a half-transparent strip at
half opacity; it failed at 32 bits before the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 19:12:17 +01:00
8535cfb7e6 test(engine): exact labels for every Record Measurements source (#11853)
The review on #11853 noted that the tests checked only that a selection
row's label did not start with "Count", never tested `auto` choosing a
selection, never tested a ruler row, and read only the first row. Now
each record must give exactly one row, the selection and ruler rows must
be "Measurement N", `auto` with a selection must stay "Measurement N",
and the shared counter is checked across all three sources.

Co-Authored-By: DuBearte <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 19:03:58 +01:00
David Mann d351491e93 Merge remote-tracking branch 'origin/main' into pr-12191 2026-11-08 19:03:22 +01:00
David Mann 5a194128b1 Merge remote-tracking branch 'origin/main' into pr-11853
# Conflicts:
#	crates/engine/src/cmd.rs
2026-11-08 18:53:37 +01:00
Trevor BrownandClaude Sonnet 5.5 76ad52bf47 Patch Destination: the rectangle check is capped and scans in bands (#12119)
Cause: is_hard_rect read selection coverage over the selection's own content bounds in one buffer. After a transform those bounds can reach far past the canvas, while the patch-size guard only measures the on-canvas part, so a huge mostly-off-canvas selection could stall or exhaust memory.

Fix: is_hard_rect now calls is_hard_rect_within with MAX_PIXELS (the patch's own cap); bounds over the cap are not a hard rectangle and the selection stays in place. Otherwise coverage is scanned in 64-row bands, stopping at the first pixel below 1.0.

Verified: new test covers a limit below and at the pixel count and a hole in the third band; patch (25) and retouch (126) lib tests pass, clippy -D warnings and fmt clean.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove and briefed; Sonnet 5.5 wrote at medium
2026-11-08 12:38:04 -05:00
b5501b9bd1 PR #12049: keep a held ~ erasing on the Background, keep Clear on a locked one
The engine turned every "mode": "clear" stroke on the Background into
Normal, so a held ~ painted the foreground there instead of erasing to
the background colour as on main. The options bar already turns a chosen
Clear off at the press, so the engine conversion was not needed: drop it
and keep the one check in clear_off_on_background.

A Background with locked pixels refuses the stroke, so a chosen Clear now
stays chosen there. The "Tool state machine" doc line is back on
tool_event.

Co-Authored-By: DuBearte <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 18:20:55 +01:00
David Mann bb7a1289b0 Merge remote-tracking branch 'origin/main' into pr-12049 2026-11-08 18:05:36 +01:00
David MannandClaude Opus 5.5 62c5d6283c Copy CSS: groups, fill layers and point type as the reference application writes them
Measured in the reference application:
- A group writes its box (the canvas) and z-index, then the rule of each
  layer in it, top first, with no blank line between rules. A group's end
  takes a place in the stack, so z-index counts it.
- A Solid Color fill layer without a shape greys Copy CSS out; so does a
  selection with no layer that has CSS.
- Point type is placed by its line box: left is the pixel left less the
  ink's offset from the origin; top centres the line box on the pixels, or
  on half the cap height above the baseline when the text has a
  descender. Left and top are cut after three decimals, not rounded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 17:34:32 +01:00
David Mann 532421aa2a Merge pull request #12212 from TrevorBrown-dev/feat/open-as-smart-object-11678
File: Open as Smart Object... opens a file as a new document holding one embedded smart object (#11678)
2026-11-08 16:59:25 +01:00
David Mann 8c94ba8a15 Merge pull request #12203 from hectorviov/fix/count-history-names
Count tool: History names Add/Drag/Delete Count Object, Add Count Group and one name per group setting (#11763)
2026-11-08 16:58:51 +01:00
David Mann 89660c82fe Merge pull request #12231 from hectorviov/fix/note-stored-values
Notes: new notes store the reference application's colour, popup rectangle and local-time date
2026-11-08 16:57:08 +01:00
David Mann b0953546ca Merge pull request #12148 from hnoerenberg/fix/straighten-layer-states-12033
fix(engine): Straighten Layer greys out and refuses the states the reference does
2026-11-08 16:56:18 +01:00
David Mann 45c76d5c5c Merge pull request #12144 from hnoerenberg/fix/indexed-type-selection-12041
fix(engine): the Type tool leaves a selection in Indexed Color
2026-11-08 16:56:00 +01:00
David Mann 32ce08364b Merge pull request #9991 from ljkx/feat/raw-xmp-crop
Camera Raw sidecars: apply the crop, stop reporting RawFileName (#9985)
2026-11-08 16:55:43 +01:00
Trevor BrownandClaude Sonnet 5.5 66d5ebed89 Menus: Layer Via Copy and Layer Via Cut with a capital V, as in the reference (#12357)
Cause: the menu bar, the command labels and the selection tools' canvas menu spelled the two commands "Layer via Copy" and "Layer via Cut", while the reference application (and PhotoCraft's own History names and ATN event table) use a capital V.

Fix: renamed the labels in crates/ui-egui/src/menu_catalog.rs, the two spec! labels in crates/engine/src/cmd/edit_cmds.rs, and the rows in crates/ui-egui/src/canvas/canvas_tool_menu.rs with its test assertions. In the 33 locale files crates/ui-egui/src/i18n/*.tsv that carry the keys, only the key column of those two rows changed (66 rows), so every translation is kept and no language falls back to English. New tests are in crates/ui-egui/src/layer_via_label_tests.rs, registered with one mod line in lib.rs like the other *_tests.rs files.

Verified: the 5 new tests pass; canvas_tool_menu 51 passed; engine edit_cmds 112 passed; i18n 66 passed and 8 live_tests failed with the known local font panic in epaint fonts.rs (font-dependent, green on CI); cargo xtask parity left docs/parity-checklist.md unchanged; clippy -D warnings and fmt are clean. TSV check against HEAD: 34 files, same row count in each, exactly 66 rows differ (2 per file in 33 files, Hindi has none), only the key column of those rows differs, the translation column is byte-identical, no old key remains, and no CR bytes in any touched file.

Not changed: the translations' text, the History names and the ATN event table (already the capital V), docs/ui-parity.md and the other parity docs.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove and briefed; Sonnet 5.5 wrote at medium
2026-11-08 10:14:55 -05:00
Trevor BrownandClaude Opus 5.5 1483d5193d Merge upstream/main into fix/patch-destination-selection-12119
Conflict in retouch_cmds/patch.rs with #12255 (one History name, "Patch Selection", for every mode): kept the Destination branch that moves a hard rectangular selection with the patch and gave it HISTORY_NAME, and restored Plan's destination flag, which #12255 had removed as unused. patch tests 24 passed (including #12255's history-name test), clippy and fmt clean.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove and resolved
2026-11-08 09:51:27 -05:00
David Mann eaaa84b04b Merge remote-tracking branch 'origin/main' into fix/11905-bg-eraser-transparency-lock 2026-11-08 15:49:56 +01:00
David MannandClaude Opus 5.5 fcba4c875b Background Eraser: pin preview = commit for a channel target on a locked layer; LiveDab::unlocked usage
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 15:49:52 +01:00
Trevor BrownandClaude Sonnet 5.5 f3de619549 Patch Destination: a hard rectangle partly off the canvas moves with the patch (#12119)
Cause: is_hard_rect required the selection's bounds to equal plan.area, which is clipped to the canvas. A hard rectangle reaching past the canvas (e.g. moved there with select.transformSelection, which keeps the off-canvas pixels) has bounds larger than the area, so the pixels were patched but the selection was left behind.

Fix: treat the selection as a hard rectangle when nothing is selected outside its own bounds and every pixel inside those bounds is fully selected, then translate the whole selection by the drag offset. Feathered, non-rectangular and holed selections still stay in place.

Verified: new test destination_moves_a_hard_rectangle_that_extends_past_the_canvas failed before the change (selection stayed at -20,100..40,140 while the pixels changed) and passes after, including one-undo restore of pixels and selection. cargo test -p photocraft-engine --lib patch (19 passed) and retouch (120 passed), clippy -D warnings and fmt clean.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove and briefed; Sonnet 5.5 wrote at medium
2026-11-08 09:47:11 -05:00
David Mann 848fa306f5 Merge pull request #12255 from SBaksa/patch-history-names
Patch: History names as the tool's (fixes #12117)
2026-11-08 15:25:52 +01:00
David Mann 7acc08cbb9 Merge pull request #12306 from hectorviov/fix/mixer-indexed-bitmap
Mixer Brush: refuse Indexed Color and Bitmap documents with the alert (#11958)
2026-11-08 15:09:44 +01:00
0c6b564536 Magic Wand: skip the selection mask when Contiguous is off; more tests (#11848)
PR #11848 built the full-area selection mask for every Subtract and
Intersect click, though the global match (Contiguous off) ignores it.
Build it only when the fill is contiguous.

Tests for the review: Contiguous off keeps the global match, Subtract and
Intersect without a selection select nothing, the row check fails on a hole
in the selected run, and the fill's half-selected threshold (0.49 vs 0.5)
at the seed and at the fill's edge.

Co-Authored-By: DuBearte <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 15:04:43 +01:00
David Mann 7d8c18c34e Merge pull request #12265 from hectorviov/fix/color-replacement-refuses-modes
Color Replacement: refuse RGB/32, Grayscale, Bitmap and Indexed documents
2026-11-08 14:56:43 +01:00
David Mann e5decd0b85 Merge remote-tracking branch 'origin/main' into pr-11848 2026-11-08 14:54:13 +01:00
Trevor BrownandClaude Sonnet 5.5 fec4980c7b Patch Destination: clone only the selection; guard, error path and redo tests (#12119)
The Destination branch of the Patch command no longer clones the whole document: it takes only the selection before the target surface borrows the document, and computes the selection's content bounds once, passing them to `is_hard_rect` and reusing them for the translate. Behaviour is unchanged.

Tests are split and extended: Destination with a feathered, ellipse, lasso and holed-rectangle selection leaves the selection in place while the patch still lands; Destination with no selection fails, adds no history entry and a following undo reverts the previous step, not the setup; redo restores both the patched pixels and the moved selection; Source and Content-Aware are separate tests, the latter asserting a pixel change; the main test also asserts source pixels unchanged, the destination carrying the source texture, the moved selection still hard-edged, and the returned damage and offset. A rectangle larger than the patched area and a partly covering selection without a hole cannot be built, because the patched area is the selection's own content bounds; an inverted selection makes the area the whole canvas, which Patch refuses.

Verified: `cargo test -p photocraft-engine --lib patch` 18 passed; `--lib retouch` 119 passed; clippy `--all-targets -D warnings` clean; `cargo fmt -p photocraft-engine` clean.

Not changed: the coverage pass in `is_hard_rect` (one pass over the patched area per command, the same order of work as the patch itself).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove and briefed; Sonnet 5.5 wrote at medium
2026-11-08 08:44:18 -05:00
David Mann dada110838 Merge pull request #12263 from hectorviov/fix/color-replacement-history-name
Color Replacement: History names each edit "Color Replacement Tool"
2026-11-08 14:35:37 +01:00
SBaksa 28d2d9095d History and plug-in names: trim the fillers and blank padding at the ends too
trim_name drops white space, ZWNJ/ZWJ and the blank characters (Braille blank, Hangul fillers,
invisible operators, tag and other default-ignorable blanks) from both ends. A variation or
Mongolian free variation selector or CGJ that belongs to a kept character stays, and so do Hangul
filler jamo that complete a syllable. History names use the same trim as plug-in names.
2026-11-08 22:40:53 +11:00
David Mann 320d285e1a Merge pull request #9887 from Firstbober/feat/indexed-color-matte
feat: add Indexed Color Matte options
2026-11-08 12:20:27 +01:00
SBaksa c2f85a590f Plug-in names: store the name trimmed, count U+2800 and unassigned ignorables as blank
A manifest name such as "\nTone" was checked trimmed but shown as given, so a line break reached
the menu; padding also got past the 64-character limit. The name is now stored trimmed.
The blank Braille pattern and the unassigned default-ignorable ranges no longer count as visible,
in plug-in names and History names. Applying a patch no longer takes the selection icon, and the
History source column has its doc comment back.
2026-11-08 19:59:43 +11:00
SBaksa be7ebc078a Lasso: refuse a history name that shows nothing or hides formatting
A historyName of zero-width, filler or BOM characters showed an empty History
row, and a bidi control or line separator could make a row read differently
from its name. A history name now has no control or line-break character
anywhere, loses white space and ZWNJ/ZWJ at its ends, and is then held to the
plug-in menu-label rule, now shared as
photocraft_plugins::manifest::printable_name (1-64 characters with a visible
one, no hidden format characters; plug-in names also refuse U+2028/U+2029).
2026-11-08 17:55:02 +11:00
Hector Villarreal 8272e6b9f4 Mixer Brush: refuse Indexed Color and Bitmap documents with the alert (#11958)
A Mixer Brush stroke in an Indexed Color or Bitmap document now fails before
anything is painted, with the reference's alert texts (convert to RGB Color /
Grayscale mode to edit); paint.mixerBrush returns that error and leaves the
document and History unchanged. A press on the canvas shows it as an Error
alert instead of a status-bar message. RGB, CMYK, Lab and Grayscale still
paint.
2026-11-08 00:28:08 -06:00
Trevor BrownandClaude Sonnet 5.5 4f629dc4dd Patch: in Destination mode the selection moves with the patch (#12119)
A plain rectangular selection is translated by the drag offset in the same history state as the pixel change. Source, Content-Aware, feathered and non-rectangular selections keep today's behaviour.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
2026-11-08 00:57:48 -05:00
Hector VillarrealandClaude Opus 5.5 0f6524ffbd Copy CSS: write no border-radius for an unequally scaled rounded rectangle (CodeRabbit review on layer_css_cmds.rs:144)
Scaled 200 % across and 100 % down, a live rounded rectangle keeps one
radius per corner (r times the smaller scale), while its path, which is
what renders, has r·sx by r·sy elliptical corners. The rule wrote the
single circular radius. It now writes border-radius only when the path's
anchors are the ones the live radii draw (in any order, so a flipped
shape still writes its corners); otherwise none, as the module doc says.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 13e7b0fe0e Copy CSS: test a rounded rectangle's border-radius after a 2x scale (CodeRabbit review on layer_css_cmds/tests.rs:165)
No test checked the copied border-radius after `shape.edit`'s
`transform` scales the live radii. With radii 12 and a uniform 2x scale
the rule now has to say `border-radius: 24px;`, so a regression in that
scaling fails the test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 1bdba8264d Copy CSS: write border-radius: 50% for a live ellipse (CodeRabbit review on layer_css_cmds.rs:147)
A solid live ellipse got the plain rectangle rule, so pasting it showed a
rectangle. It now writes `border-radius: 50%;` where a rounded rectangle
writes its radii, before the fill. The module doc lists it, and lists the
geometry of other shapes (live polygons, stars and lines, custom paths)
as not written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 d4622f78f2 Copy CSS: test a comment closer in a name and a layer with a drop shadow (FredApps review)
A layer named `a */ b` writes no `*/` outside its quoted image name and a
sanitised class; a layer with a drop shadow writes the same rule as
without it, with no shadow and no panic.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 23:23:58 -06:00