Fixes#2223. Carries the in-place flat Save of #5865 (closed as superseded by this PR) and revives what #2515 (@kayrockscreenprinting, closed when its author stepped away) added beyond it.
File › Save now writes back over a flat file when that file still holds the document: one plain opaque layer the format can store, and only when the file held a single image. A JPEG (and a TIFF, Targa or DDS) asks its format options first, as Photoshop does; Cancel writes nothing. A JPEG whose lone layer has transparency it can't keep is offered as a PNG. Multi-image files (animations, multi-page TIFFs, multi-size icons, multi-part EXRs) still go through Save As; the source image count is kept through crash recovery.
Co-authored-by: kayrockscreenprinting <257643019+kayrockscreenprinting@users.noreply.github.com>
* Type: render a paragraph-box handle drag off the UI thread (#7032)
While a box handle is dragged the document is left alone: each move
records the wanted box, a worker lays out (holding the shared text engine
only for layout) and rasterizes a copy of the layer, and the canvas shows
the document with the newest finished render. One render runs at a time
and the latest box wins. Releasing, committing or any other end of the
drag applies the box with the same type.edit as before, so the final
document and its single history step are unchanged. Without background
jobs (web, tests, scripts) every move still runs type.edit.
* Address review: end a box drag before other commands, on a stale preview and for Type Mask edits
- A command other than a view command (Free Transform, a menu item, a
shortcut) applies the dragged box and ends the drag before it runs.
- A preview gone stale (the document changed some other way) ends the
gesture instead of applying the press-time box over that change.
- Type Mask edits keep the synchronous drag: their overlay is drawn from
the document's layout.
- apply_box keeps the stored size finite and documents its units.
- Tests: a width drag that rewraps, each of the above.
* Address review: Free Transform and Save mid-drag see the dragged box
UI_COMMANDS is every shell-handled command, not only view ones, so the
exemption skipped edit.freeTransform and file.save. Only view., window.
and help. commands now leave a box drag going. Adds a Free Transform test
and requires a box shape when the huge-box edit succeeds.
* Address review: the Free Transform test checks the command succeeds and its frame is the resized layer's
* Address review: only listed view commands leave a box drag going
view.clearSelectedGuides edits the document, so a prefix exemption for
view. commands let it make the preview stale and lose the dragged box.
The exemption is now an explicit list of commands that change nothing in
the document, and a test covers the guide command.
* Address review: switching documents, engine.execute and app.save end a box drag first
- window.* commands are no longer exempt: window.nextDocument and
window.previousDocument switch documents mid-drag.
- The control channel's engine.execute (engine commands) and app.save
bypass menus::invoke, so they end the drag themselves.
- Tests: a control engine.execute and app.save mid-drag, and a document
switch mid-drag.
* Address review: panel toggles leave a box drag going
Opening or closing a panel (Cmd+T toggles the Character panel while
typing) only lays out windows, so window.panel.*, window.toggle.* and
type.panels.* no longer end a drag. A test covers three of them.
* Address review: doc comments on the functions this change touches
CodeRabbit's docstring coverage check was at 73.68% against 80%. Adds a
doc comment to each touched function that had none: the new helpers and
tests, and the existing functions this change edits.
---------
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The cylinder is outlined and cut into a 3 × 2 grid (two horizontal curves and
the centre line) that hugs the warped picture. The handle in the middle of the
upper arc sets the bend of both arcs, the one in the middle of the lower arc the
lower edge's height, and the wrap handle sits at the grid's centre and slides to
the right (starting 15 % along), stretching the middle of the picture and
squeezing its sides round the back.
A smart object's stored warp used to enter Warp mode with the layer's already
warped render as the preview texels, which the mesh then warped again, so the
picture never sat on the grid: the session now previews the source placed
without the warp over the warp box. Edit › Transform › Warp carries a check
while the active layer is warped, as the reference's does.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review on #7809 asked for coverage of imported .kys bindings. The set moves
Cmd+M to Levels and gives Fill Cmd+, as its second key; the menu bar shows
Cmd+M on Levels only, Minimize keeps Ctrl+Cmd+M, Settings yields Cmd+, and
the clash is reported. Fails without app_layout's dispatch ownership pass.
Co-Authored-By: andeecollard <6765611+andeecollard@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main added a Layer menu item of its own, so after the rebase the menu
counts 663 items; raise the floor to match.
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 menu item with no path asks with File > Open's dialog (multi-select) and opens each chosen file as its own document; failures are reported as File > Open reports them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The merge of main into #10730 dropped the first line of the comment above the
filter-preview check in confirm_generic_command; it is back. The Batch test now
compares out/b.png with the hand-typed reference as well as out/a.png, so a
replay that stops after the first file fails it (review on #10730).
Co-Authored-By: Lcoding15 <Lcoding15@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Edit > Preferences > General…, Select > Inverse, Filter > Other without the
ellipsis, Layer > Rename Layer… with one, Proof Setup's color-blindness names
with a hyphen, the Layers panel's Quick Export as PNG, the toolbar's Default
Foreground and Background Colors (D) and Switch Foreground and Background
Colors (X), and the remaining British spellings in the English source. Keys
renamed in every catalog; rows dropped where the new key was already translated.
The Crop tool gets the reference application's contextual task bar: a small floating
bar centred 11 pt under the crop frame with a grip, the preset dropdown (the options
bar's own, so both stay in sync), Straighten, a ⋯ menu (Hide bar, Reset bar position,
Pin bar position) and, while a crop is pending, Cancel and Done. It follows the frame,
stays inside the canvas, and stays put once dragged or pinned. Window › Contextual Task
Bar (after Tools, as in the reference) shows and hides it.
The bar itself is a reusable widget (widgets/task_bar.rs): position rule, grip, ⋯ menu
and the hide/pin/place state in Panels (kept with the panel layout across restarts,
read by ui.inspect › taskBar, set by ui.set {panels}). A context supplies only its
controls and where ⋯ goes; the Crop contents are tools/crop_task_bar.rs. Generative
Expand stays out until #41.
Also: Lucide pin and rotate-ccw icons, six new strings in all 27 catalogues, parity
661/661 (FLOOR raised), control-protocol docs. Three tests about the options bar's
Ratio dropdown now hide the task bar, which shows the same dropdown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- menus/parity.rs: #11503 lowered FLOOR to 658 (two Warp rows went);
with #11497's two entries the batch has 660 live again.
- #11443: a nudge that changed nothing (zero offset) no longer renames
the state on top to "Nudge".
- #11295: a handle drag remembers its tool and ends on any tool switch,
also to another tool that shows the box; the release of a drag that was
just dropped is consumed instead of reaching the new tool; the box is
drawn only over the active document's view.
Tests for each (both new UI tests fail without their fix).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Channels: the panel menu has the channel commands, New Spot Channel among them (#11451)
The Channels panel's menu had no channel items, so New Spot Channel... and
the rest could only be reached from a row's right-click menu. It now lists
New Channel..., Duplicate Channel, Delete Channel, New Spot Channel...,
Merge Spot Channel, Channel Options..., Split Channels and Merge
Channels..., each acting on the targeted channel and greyed where it can't:
Duplicate takes a single colour, alpha or spot channel, the composite of a
one-channel image, the Quick Mask or a targeted layer mask. Channel
Options... in Quick Mask mode now opens the targeted alpha or spot
channel's options, not Quick Mask Options. The panel menus run their
commands through the menu bar's enabled rules, so the Layers panel menu
greys its dialog items the same way too. The labels are in every catalog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Channels: New Channel... and Merge Channels... ask first, from the panel and row menus (#11451)
The panel menu's Merge Channels... ran channel.merge with no parameters, and
the engine merged the first grayscale documents into RGB and closed them with
no choice; New Channel... added a channel straight away. Both now open a
dialog when called without parameters, as New Spot Channel... and Channel
Options... already did: New Channel... reuses the Channel Options dialog
(name, colour indicates, colour and opacity), and a new Merge Channels
dialog picks the mode and the open grayscale document for each channel. The
channel rows' menu had the same two items and goes through the same path.
With parameters (scripts, the New button) both still run at once.
The Merge Spot Channel test now checks pixels, so a delete couldn't pass it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Channels: Merge Channels waits for three grayscale documents and the dialog offers only modes they fill (#11451)
With two grayscale documents open, Merge Channels... was enabled and its
dialog repeated a document for the third channel; OK then failed in the
engine and the dialog closed. The engine's rule now needs three documents
of one size (no mode merges fewer), so the menus grey the item below that.
The dialog offers only the modes the open documents can fill (RGB and Lab
from three, CMYK from four), greys OK with the reason while the picks
repeat, keeps itself open when OK is refused, and comes back with the
engine's message if the merge itself fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Channels: the Merge Channels dialog keeps its picks by document id (#11451)
The dialog kept the picked source documents by tab index, and background
work can still run while it is open, so a document moved or closed in the
meantime could leave another one at a picked index; OK would then merge,
and close, the wrong document. The picks are now document ids, resolved to
the current tabs when OK is pressed: a closed pick, or one that is no
longer a grayscale document of the same size, is refused with the reason
and the dialog stays open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Main already has Add Path to Selection (⇧⌘↩) and Subtract Path from
Selection (⌥⌘↩) as engine commands (#8015). This adds the third,
path.intersectWithSelection (Cmd+Alt+Shift+Enter), next to them:
path.toSelection with mode "intersect", loading the path selected in
the Paths panel (or the one being drawn) from the UI as the other two do.
Tests: an engine test that the three fixed-mode commands match
path.toSelection with their mode whatever mode the params ask for, and
a UI test pressing ⇧⌘↩, ⌥⌘↩, ⇧⌥⌘↩ and ⌘↩ through the egui input, with
Photoshop 2025's areas for the same document (7200, 5200, 800, 2000 px).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Export to files: a Custom JPEG quality in Artboards, Layers and Layer Comps to Files (#11481)
The engine commands already took `quality` (0..12), but their dialogs
offered no way to set it. Each dialog now has a Quality row with a Custom
checkbox, shared with Batch: quality is sent only for JPEG with Custom on,
so an export left alone writes exactly what it wrote before (the source
JPEG's own quality, else the encoder default), and PNG, WebP (still
lossless), PSD, TIFF and BMP never get one. Alt+Reset restores the Custom
state too. The fields follow the reference dialog's order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Tests: the export quality tests go through the dialog's own controls (#11481)
Custom and Quality are now ticked and typed through their widgets, a new
test switches one dialog from JPEG to PNG and WebP and back and checks the
Custom quality survives, and Alt+Reset is clicked through the same path the
app uses instead of calling reset_form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>