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.
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).
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.
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 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
The module doc said it writes CSS "as Photoshop writes it", but strokes,
layer effects, CSS gradients, blend modes and fill opacity are never
written. List what each kind of layer gives, in order, and what is left
out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A shape layer that is still a live rectangle with rounded corners now gets
`border-radius` before its fill, as Photoshop writes it: one value when all
four corners are equal, else top-left, top-right, bottom-right,
bottom-left, in px. Sharp rectangles write none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every type layer was written like point text: no width or height, placed at its first pixel.
Photoshop 2025 writes paragraph text differently. For a 200 × 120 box at (60, 40) whose two
lines span 156 × 51 px it writes `left: 59.937px; top: 36.948px; width: 156px; height: 51px;`:
placed at the box (within a few px, from its font metrics), moved down by an explicit leading
(36 px gives `top: 72.948px`), and sized by its text rather than the box (centred "Hi" in the
same box: `width: 19px; height: 17px;`). Do the same; point text keeps its position only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `"` in a layer name ended `url("…")` early, a backslash started an escape, and a `"` in a font
family was turned into `'`, which names another font. Write each name as a CSS string the way
CSSOM serializes one (`\"`, `\\`, hex escapes for control characters). Photoshop 2025 writes
these names unescaped (`url("Say "hi".png")`); ordinary names come out exactly as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A layer named "2nd Box" gave `.2nd_Box`, which isn't a valid class selector. Photoshop 2025
writes `._2nd_Box`: it puts a `_` in front of a leading digit and turns a hyphen into `_` like
the other punctuation ("-2x" is `._2x`, "my-box" `.my_box`). Do the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Photoshop's Layer › Copy CSS puts CSS for the selected layers on the
clipboard. The new engine command layer.copyCSS writes each layer as a
class named after it (characters CSS doesn't allow become _): a type
layer's font size, family, colour, line height and alignment, a solid
fill or shape's background colour, or an image named after the layer;
then its opacity under 100 %, its absolute position and size (none for
type) and its z-index from the bottom, in Photoshop's format and order.
The Layer menu item copies the result to the clipboard.
Fixes#9372
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Current Brush Load menu gets a separator and the checkable entry Load
Solid Colors Only, off by default and kept with the Mixer Brush's own brush
(MixerSettings.solid_colors_only). With it on, Alt+click loads the one
colour under the hotspot (paint.mixerLoad) instead of the sampled tip image;
off, it loads the tip image as before.
When an earlier document is held for its profile prompt and the next open skips the prompt, admission numbers the second document photo-1 again, but the reply reported the name read before admission (photo-2). The reply now reads the name from the admitted document.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
The Color Replacement options bar's Tolerance takes whole numbers 1-100
as the Background Eraser's does (its field, now shared): a value typed
past the range becomes the closest one with the reference application's
alert, a fraction the nearest whole number, text that isn't a number
nothing. paint.colorReplacement runs tolerance 0 and below as 1, and the
bar's Mode, Limits, Tolerance and Anti-alias get the reference tooltips.
paint.colorReplacement and its live stroke refuse the modes and depths
the reference application refuses, with its words: 32 bit per channel
RGB, Grayscale and Bitmap (only full color modes), and Indexed Color.
Nothing is painted and no history is added. RGB/8, RGB/16, CMYK and Lab
paint as before; cases that weren't measured keep today's behaviour.
CodeRabbit round 2 on #12212:
- 4504550937 (b): a PSD that recovered from damaged data is held for File > Open's confirmation (the app passes confirmDamage; headless callers open it as before).
- 4504550942: a document held for its prompt counts when numbering, and the number is re-taken when each document is admitted, so two held files with one stem no longer share a name.
- 4504550943 is not changed here (needs colour transforms at regeneration), as are 4504550937 (a), (c) and 4504550953.
- 4504550946: the successful reply carries smartObject, so a document queued behind another open prompt is admitted with the Open As Smart Object history label.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
A Color Replacement click, stroke or Shift+click segment adds one History
state named "Color Replacement Tool", as in the reference application.
The command's label is the same name, so a recorded action's step reads
the same as the History state.
Main's Equalize change (58d11d91ea) moved Equalize to map_pixels_in, and this PR
moves Average off map_pixels, so after merging main the wrapper had no caller and
clippy -D warnings failed on dead code. Fold its doc into map_pixels_in.
Co-Authored-By: ArjenS-LA <ArjenS-LA@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps main's Fade preview path in filter_preview.rs and passes the PR's
tool colours to the non-Fade preview; catalogs keep both sides' rows.
Co-Authored-By: Firstbober <firstbober@tutanota.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
select.lasso takes an optional historyName; the Patch tool sends "Patch Tool" so its
lasso is that step (the Lasso tool keeps "Lasso"). paint.patch records "Patch Selection"
in every mode; the content-aware job keeps its progress text.
Tests: patch_history_names_tests (engine) and patch_tool_history_names_tests (ui-egui).
The command is a job (inline under execute, a worker under start) that returns File > Open's result shape; the UI tracks it as an OpenTab so finish_open gives it the profile prompt (held, admitted with the smart object label) and after_open gives a raw the Camera Raw open dialog and the import warnings. Import options and the Color Settings policy match File > Open. The paths form is removed: the UI calls the command once per file.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Fable 5.1 briefed; Sonnet 5.5 wrote at medium
The smart object layer is built into the document before admission, so snapshot 0 holds it and the history is the single state "Open As Smart Object", as File > Open's is one state.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Fable 5.1 briefed; Sonnet 5.5 wrote at medium
Paragraph (box) text and vertical type are on the issue's *Not measured* list, whose rule is that
an unmeasured case keeps today's behaviour - and a coverage mask could not give back a box that
reflows or a column that stacks its lines, so their editable type layer stays. The commit converts
the measured case only: horizontal point text in an Indexed Color or a Bitmap document. The Type
Mask tools keep turning both into the selection, as they do today; there the user asked for one.
Also pin what happens when an edit that carries no coalesce key - the deliberately per-press
Alt+arrow kerning step - comes between the typing and the commit: the commit is a state of its own,
named for the type layer, exactly as the Type Mask commit and the plain layer's rename are in that
situation today. Nothing is mis-named; folding those states together would delete history the user
can undo today and belongs with #12039.
Tests: commits_as_selection across shape and orientation; the tool's commit of box and vertical text
in both modes; the split states and what each undo takes.
Main added a non-interactive RAW opener for Batch while #9991 was open. It refused a
sidecar whose crop keys were unsupported. #9991 moves those keys from the ignored list into
LoadReport::crop, so after the merge Batch would drop the crop without saying so. It now
passes the crop into RawTuning, as the interactive open does.
Co-Authored-By: ljkx <177671075+ljkx@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Session::edit` keeps the selected layers valid after an edit but not the active id, so an
edit that drops the active layer leaves one behind that the document does not hold. The new
enabled check read that id and answered "live", and with an explicit `crop` the command then
rotated and cropped the whole canvas for a layer that is not there - the one outcome of this
state that changes pixels. Refusing it is what `select_layer` and `restore_layer_selection`
already do with a gone id, and it costs the resolve check the target lookup was doing anyway.
No command shipped today drops the active layer without re-targeting, so no real document
changes behaviour: this is the guard the review asked for, and the test reaches it through
`Session::edit` directly.
#11795 didn't measure where the popup sits after a rotation, so that case keeps today's placement
(the top-left of the mapped rectangle) and only the size rule applies. Image Size and Canvas Size
still keep the popup's offset from the icon.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PSD export writes its default popup for an all-zero one; moving it with the icon turned it into
a 0 x 0 rectangle elsewhere, which export then wrote as is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Importing an .abr with select picked its first brush without the 1 %
opacity floor, so a preset saved at 0 % showed 1 % but painted nothing
(#11812).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A brush remembered at 0 % opacity (saved before the 1 % floor) read back
at 0: the options bar showed 1 % but strokes painted nothing. Restoring
now floors opacity at 1 %, like tools.setBrush (#11812).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>