The canvas-bounds check in `image.crop` and `document.pixel` ran whenever
an automation gate was installed, also on the desktop control channel and
for actions an agent wrote. It refused Reveal All, whose frame is always
larger than the canvas, and every crop that extends the canvas. Remove it.
Headless MCP no longer offers the `ui_*` tools: update the CLI test and the
control protocol doc, and keep the bridge-only hint in the instructions
for sessions that still list them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Layers to Files moved to engine-core and now walks groups. The adjustment
rule moves into plan_layer_exports: PNG and JPEG export a top-level,
unmasked adjustment like an empty layer; one inside a group (not
measured) keeps the skip, pinned by a new test. PNG names now use dashes
for spaces, so the PNG test expects doc_0000_Levels-1.png.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The engine moved to crates/engine-core, so the group walk is ported onto
its export.rs and kept together with main's later Layers to Files changes
(Include ICC Profile, dashes in PNG names, the Background-only alert). The
group tests use crate::session() and the PNG dash names. The MCP tool
description no longer says groups export merged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since #15449 File › New is the shared NewDocumentDialog, so the old
app-local Recent heading, grid and tests are dropped in favour of main's
dialog code; that part now goes through storytold/craft-libs#2261.
Kept: document.recent.add and load_recent keep equal settings as
separate entries, now in crates/engine-core.
The PR snapped shapes with a per-edge heuristic (pixel_align.rs, dash-cap tie
rules, a PSD coordinate-frame field threaded through engine, format and caches),
defaulted the option to off, and renamed the existing Rectangle/Triangle
"Align Edges" checkbox to "Snap Bounding Box" next to a second checkbox.
The reference application fits the whole shape at render time: the bounds of
what it paints (fill, or the stroke's outer edge) get a whole-pixel left/top
(a half rounds up) and a whole width/height, and the path is translated and
scaled into that box. Fill and stroke take one transform; curves stay
antialiased; inner edges of several subpaths are not snapped.
- photocraft_vector::align_edges implements that rule; CompiledShape applies it,
so caches, the compositor, previews and extents agree; the fill/stroke split
under layer effects starts from the whole shape's transform.
- Removed pixel_align.rs, the rasterizer helpers it needed, the document-space
drag preview and psd_coordinate_frame (rounding the bounds absorbs the PSD
quantization it was for).
- One Align Edges checkbox (ToolOptions::align_edges, stored and scripted as
useAlignedRendering, older align_edges still read) on every shape tool and the
Pen, on by default and after Reset Tool; it snaps the drag and sets the layer.
- PSD sn2P: written as 1 when on and left out when off, as the reference saves it.
- Dropped the dead path.set param, moved the control-protocol paragraph,
rewrote docs/pixel-aligned-strokes.md, reverted the unrelated raw, font,
Cargo and test-harness changes.
- Tests reproduce the measured cases (rectangles at .25/.4/.5/.6/.75, ellipse
extremes and curve symmetry, 1/2/3 px strokes, rotated rect, Pen triangle,
two subpaths, toggle off, stored path unchanged, one checkbox, Reset Tool).
Co-Authored-By: superplay2021 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With Preferences > AI Integrations' folders empty, agents had no file
access, and the launcher starts `mcp` with no root flags.
- An empty folder setting named by no flag uses the shared default agent
folder Documents/ArtCraft/Agents/PhotoCraft (craft-libs#2550), in the
open window (agent link, --control) and in the live headless session.
- agent_folders tells the agent which folders it may use: the headless
session's roots, or the open window's saved folders with the default.
- Pin craft-libs to bafb452 + the craft-libs#2550 commit until it reaches
next.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since the move onto the craft UI framework, four dialogs could not be
driven by the id the control channel gave for them:
- Keyboard Shortcuts and Menus draws outside the framework's dialog host,
so ui.inspect never listed it and ui.dialog.cancel {"dialog":
"shortcuts"} failed, leaving every command refused behind its modal.
It is now listed under "shortcuts" while open (first: it draws beneath
the host's dialogs), and ui.dialog.cancel with that id closes it without
saving, as its Cancel does. ui.dialog.set/confirm/apply refuse it with a
pointer to edit.keyboardShortcuts params.
- Preferences replied "preferences" but is listed under its host id. It
now replies with that id, or with the reason it did not open.
- Select > Color Range replied {"dialog": {"Ok": id}}: json! serialised the
Result. It now replies through dialog_reply like every other dialog, and
an open that fails is an error instead of ok with {"Err": ...} inside.
- The unsaved-changes prompt was listed under a number with only
`choice`. It is listed as "discard" again with the documented command,
document, remaining, choices and default, and ui.dialog.confirm/cancel
resolve "discard" to it (docs/control-protocol.md, #4920).
Tests drive each through the control channel (handle with a
ControlRequest). Two existing tests change with the documented ids: the
Preferences apply test asserted the old "preferences" reply, and the
save-authorization helper fed the listed prompt id to the host lookup.
docs/control-protocol.md now says which dialogs have fixed ids and what
menu items reply.
PhotoCraft's UI moves onto the shared craft UI framework in storytold/craft-libs (next branch): shell, dock and panels, hosted dialogs, keyboard, focus, IME and pointer routing, the canvas's view commands, themes and tokens. The engine, document model, file formats, commands and automation stay. PhotoCraft pins storytold/craft-libs next.
Groups are walked: each layer in a group gets <prefix>_<group index>s_
<index>_<name>, repeated per level, art layers and groups counted
separately at each level. A group gets no file; a layer's file keeps it
inside its groups. With visibleOnly, a hidden group's layers are skipped
and reported; without it they are exported. Nesting is bounded.
Conflicted in file_cmds/export.rs and three layers-to-files tests: numbering is main's panel-order enumerate, and the branch's rule that an adjustment layer exports for png/jpg/jpeg is kept. Test setups are Hidden(0), Levels(1), Background(2), so the expected files are 0001_Levels and 0002_Background.
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
The Recent tab of File > New is headed "YOUR RECENT ITEMS (n)" while it
lists recent documents, shows them 4 cards per row, and no longer appends
the built-in defaults after them. document.recent.add and the preferences
reload keep equal entries, so two documents created alike give two cards
(still capped at 20). With no recent items the tab keeps today's defaults,
heading and 3-column grid. A size line wider than its narrower card breaks
before "@" onto a second row.
The Save Preset… button under Preset Details is gone. An icon right of
the Name field turns the pane into SAVE DOCUMENT PRESET, proposing the
next free "Saved N" with its text selected, with Save Preset / Cancel.
Cancel returns to Preset Details without saving.
Only PNG and JPEG were measured; the issue keeps today's behaviour for the other formats (PSD, TIFF, BMP, Targa, PDF), so the skip with "adjustment layer has no pixels of its own" stays for them, the layer keeping its number. New test other_formats_still_skip_the_adjustment_and_keep_its_number (PSD). docs/control-protocol.md says which formats skip it (CodeRabbit on #14041).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
export_layers_report_with no longer skips an adjustment layer. It is numbered in panel order and exported like an empty layer: a fully transparent full-canvas PNG with Trim on, a white full-canvas JPEG. A hidden one with visibleOnly is still skipped. Tests that pinned the old skip are updated.
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
Answers CodeRabbit on #13533: size defaults to Point Sample and sampleLayer to all,
so the zoom alone doesn't reproduce a 3 by 3 Average.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Answers CodeRabbit on #13533: the side is (N+1)/zoom rounded, the box starts
ceil(side/2)-1 pixels before the sampled pixel, and it is clipped to the canvas,
as sample_rect_at does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The command's params text already describes `zoom`; the protocol doc listed only
x, y, size and sampleLayer, so an agent following it got the centred square
instead of the Eyedropper's zoom-dependent box (4 x 4 for a 3 by 3 Average at
100 %).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
In closed-app headless MCP mode, a given --automation-read-root or
--automation-write-root replaces the app's agent folder for that
direction only. Say so in control-protocol.md and mcp.md, and pin it
with a test for each direction.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Plain `photocraft-cli mcp` now works in the open window while the ArtCraft
Launcher's agents switch is on, and may start PhotoCraft, also on a
developer's machine. AGENTS.md says scripts, tests and agent sessions pass
`--headless` (and tests give the CLI their own settings, launcher and flags
folders); the headless examples in docs/development.md, docs/mcp.md,
docs/control-protocol.md, the book and the README use it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
As agreed in craft-ai-integrations#195: one switch for every Craft app, in
the launcher; only the launcher writes MCP client configurations; plain
`<app>-cli mcp` works in the open app.
- Consent: with the AI-MCP flag, the launcher's switch alone decides,
read through `craft-ai-agents` (craft-ai-integrations#197), the crate the
launcher writes the app list with and the gateway reads it with. The
"Let AI agents connect" box is gone; without the flag everything is as on
main (a saved Control Port keeps its connection).
- `photocraft-cli mcp`: works in the open window while agents may use it
(what `--live` did), and headless otherwise, exactly as before (only the
roots given to it; the app is never started). `--headless` forces that;
`--bridge` / PHOTOCRAFT_CONTROL_PORT as before. `--live` and `mcp install`
are gone. Several read roots work again, invalid roots stop the start, and
`--gpu` applies to the headless session.
- Client setup is the launcher's: the client code (Claude Desktop, Claude
Code, Cursor, JSON), Copy Configuration, its service and its docs are
removed (about 740 lines net).
- CLI tests run with their own settings, launcher and flags folders: plain
`mcp` would otherwise find (or start) the developer's own PhotoCraft.
- Docs, book, README, scorecard row, packaging comments follow.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Turning on ArtCraft Launcher > Settings > AI agents is the person's consent
for every Craft app (craft-ai-integrations#195). While the AI-MCP flag is on
and the launcher's app list (ArtCraft/mcp/apps.json) names photocraft,
PhotoCraft accepts agents as if Let AI agents connect were ticked: the
desktop app watches those files every 2 s and starts or stops the
connection, and `mcp --live` checks them before every call. The page shows
the box ticked and says the launcher turned it on; PhotoCraft's own choice
is kept. Allow Agent Control off still refuses agents.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Integrations page holds more than the agent connection: open PRs add the
AI services for Generative Fill and other AI features to it (#10903, #12391,
#7007). The menu item stays "AI Integrations…" and the page "Integrations", as
on main; messages and docs say Edit › Preferences › AI Integrations.
The page only holds the MCP connection, so Edit › Preferences › AI Integrations… is now
Edit › Preferences › MCP… (command id and the `integrations` preference keys unchanged).
Copy Prompt for an Agent puts a text on the clipboard that an agent with a terminal
(Claude Code, Codex, Cursor's agent) pastes to register `photocraft-cli mcp --live` itself
and check the connection; Claude Desktop has no terminal and keeps Add to Claude Desktop.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported onto current main and #11363:
- The dialog moved into prefs/prefs_ui/agents.rs (prefs_ui.rs was split on main); the port
field is labelled for the accessibility check.
- One agent connection: Preferences start and stop it live (agent_link service); only
--control opens a port at launch. #11363's token reuse, folder rules (absolute paths,
warnings) and readRoot/writeRoot names are kept; a saved controlPort from before loads
with connectAgents on.
- agent_link.rs: #11363's connection file code plus #5525's client install code.
- CLI: mcp --live, --when-closed and mcp install --client on main's clap parser.
- control_server: listen()/Listening on top of main's challenge authentication.
- app_dirs: main's resolver moved to photocraft-automation so the CLI finds the same folder.
- Interface catalogs moved to craft-i18n on main; the PR's rows are not carried over.
Co-Authored-By: Furoxfufu <[email protected]>
Co-Authored-By: ingling <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>