From eec4af65513b52084926f3c679fc6ac7821cafaf Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 02:36:08 -0400
Subject: [PATCH 01/18] Fix main: classify the Direct Selection path commands;
Czech for "{n} layer" (#1074)
Two tests on main fail on every OS:
- automation: path.moveAnchors/moveHandle/bendSegment/convertPoint (#865) take
a document vector path ("name"/"layer"), not a host file, so they join the
list of vector-path commands the filesystem-param audit skips.
- xtask i18n: the plural "{n} layer|{n} layers" key reached every complete
catalog but cs.
Co-authored-by: Claude Opus 5.5
---
crates/automation/src/workspace.rs | 4 ++++
crates/ui-egui/src/i18n/cs.tsv | 1 +
2 files changed, 5 insertions(+)
diff --git a/crates/automation/src/workspace.rs b/crates/automation/src/workspace.rs
index adbba4c9af..3427a7c293 100644
--- a/crates/automation/src/workspace.rs
+++ b/crates/automation/src/workspace.rs
@@ -576,6 +576,10 @@ mod tests {
| "path.info"
| "path.set"
| "path.transform"
+ | "path.moveAnchors"
+ | "path.moveHandle"
+ | "path.bendSegment"
+ | "path.convertPoint"
| "path.clippingPath.set"
| "path.rename"
| "select.toWorkPath"
diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv
index 66f6333e79..cd0b4d35a0 100644
--- a/crates/ui-egui/src/i18n/cs.tsv
+++ b/crates/ui-egui/src/i18n/cs.tsv
@@ -1714,6 +1714,7 @@
Constraints ({n}) Omezení ({n})
Align {what} Zarovnat: {what}
@plural {n} Layer|{n} Layers {n} vrstva|{n} vrstvy|{n} vrstev
+@plural {n} layer|{n} layers {n} vrstva|{n} vrstvy|{n} vrstev
@plural Group · {n} layer|Group · {n} layers Skupina · {n} vrstva|Skupina · {n} vrstvy|Skupina · {n} vrstev
# Preferences (labels are generated from the setting names)
From 62b0d0bd601040faed125bbec099e129a337fe6e Mon Sep 17 00:00:00 2001
From: Tanish Manku
Date: Wed, 7 Oct 2026 23:58:26 -0700
Subject: [PATCH 02/18] Automation: an allowed command can't run a denied one
on its behalf (#861)
Untrusted sessions (MCP, the control channel) checked only the top-level command and the steps of
`actions.play`. Any other command that runs commands internally ran them unchecked, so the allowed
`file.automate.conditionalModeChange` could run `image.mode.*`, which the desktop gate denies
because it resolves the user's configured colour profiles.
`Session::dispatch` now applies `Session::authorize` to every command before any side effect,
nested ones included, which closes the class rather than this one command. Sessions without a
gate (local UI, `photocraft-cli run`) are unchanged.
---
book/src/security/automation-security.md | 4 +++-
crates/automation/src/workspace.rs | 8 ++++++++
crates/engine/src/file_cmds/tests.rs | 15 +++++++++++++++
crates/engine/src/jobs.rs | 6 ++++++
crates/engine/src/lib.rs | 5 +++--
5 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/book/src/security/automation-security.md b/book/src/security/automation-security.md
index 15ac5f9b07..49be151ff1 100644
--- a/book/src/security/automation-security.md
+++ b/book/src/security/automation-security.md
@@ -33,7 +33,9 @@ Automation is a privilege boundary because requests can cause filesystem access,
are rejected before file effects.
- Engine commands that still use ambient paths fail closed at the automation boundary. Synthetic
UI input reaches the same command policy, and automation-triggered file hooks do not run
- user-configured script-event paths.
+ user-configured script-event paths. The policy also covers every command a command runs on its
+ own behalf (an action's steps, `file.automate.conditionalModeChange` running `image.mode.*`), so
+ an allowed command can't reach a denied one.
- `prefs.set` applies the engine's dotted-path normalization before checking for filesystem-bearing
preference sections, including paths with leading or repeated dots. It refuses whole-preferences
updates and those sections; individual safe preference keys remain available.
diff --git a/crates/automation/src/workspace.rs b/crates/automation/src/workspace.rs
index 3427a7c293..2244a2b88a 100644
--- a/crates/automation/src/workspace.rs
+++ b/crates/automation/src/workspace.rs
@@ -460,6 +460,14 @@ mod tests {
assert!(authorize_engine_command("prefs.set", &serde_json::json!({"path": "colorSettings.workingRgb", "value": "outside.icc"})).is_err());
assert!(authorize_engine_step("file.open", &serde_json::json!({})).is_err());
assert!(authorize_engine_step("actions.play", &serde_json::json!({})).is_ok());
+ // An allowed command can't reach a denied one by running it on its own behalf.
+ let mut session = photocraft_engine::Session::new();
+ session.execute("file.new", serde_json::json!({"width": 4, "height": 4})).unwrap();
+ session.authorize = Some(authorize_desktop_engine_step);
+ let params = serde_json::json!({"to": "grayscale"});
+ assert!(authorize_desktop_engine_command("file.automate.conditionalModeChange", ¶ms).is_ok());
+ assert!(session.execute("file.automate.conditionalModeChange", params).is_err());
+ assert_eq!(session.active().unwrap().doc.mode, photocraft_engine::doc::ColorMode::Rgb);
assert!(authorize_desktop_engine_step("file.saveACopy", &serde_json::json!({})).is_err());
}
diff --git a/crates/engine/src/file_cmds/tests.rs b/crates/engine/src/file_cmds/tests.rs
index 8de181fbd1..2b5f8f9ff4 100644
--- a/crates/engine/src/file_cmds/tests.rs
+++ b/crates/engine/src/file_cmds/tests.rs
@@ -239,6 +239,21 @@ fn fit_image_and_conditional_mode_change() {
assert!(s.execute("file.automate.conditionalModeChange", json!({"to": "duotone"})).is_err());
}
+#[test]
+fn conditional_mode_change_cannot_run_a_mode_change_the_gate_denies() {
+ fn deny_mode(id: &str, _: &Value) -> Result<()> {
+ if id.starts_with("image.mode.") { Err(EngineError::Other(format!("automation command `{id}` is disabled"))) } else { Ok(()) }
+ }
+ let mut s = session(4, 4, 8);
+ s.authorize = Some(deny_mode);
+ let e = s.execute("file.automate.conditionalModeChange", json!({"to": "grayscale"})).unwrap_err();
+ assert!(e.to_string().contains("image.mode.grayscale"), "{e}");
+ assert_eq!(doc(&s).mode, ColorMode::Rgb, "the refused nested step leaves the document alone");
+ // Commands that compose only allowed steps still run.
+ s.execute("file.automate.fitImage", json!({"width": 2, "height": 2})).unwrap();
+ assert_eq!(doc(&s).size.width, 2);
+}
+
#[test]
fn flatten_all_layer_effects_and_masks() {
for depth in [8, 16, 32] {
diff --git a/crates/engine/src/jobs.rs b/crates/engine/src/jobs.rs
index f3f78d047e..0bbacbecfc 100644
--- a/crates/engine/src/jobs.rs
+++ b/crates/engine/src/jobs.rs
@@ -594,6 +594,12 @@ impl Session {
if !(params.is_object() || params.is_null()) {
return Err(EngineError::BadParams { cmd: id.to_string(), msg: "params must be a JSON object".into() });
}
+ // Untrusted sessions gate every command, including the ones a command runs on its own
+ // behalf (`file.automate.conditionalModeChange` runs `image.mode.*`), before any side
+ // effect.
+ if let Some(gate) = self.authorize {
+ gate(id, ¶ms)?;
+ }
// A floating selection drops before any other command (Undo puts it back instead).
if let Some(v) = crate::float_cmds::before_command(self, id)? {
return Ok(Started::Done(v));
diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs
index 9dd1fa1faa..48aad05159 100644
--- a/crates/engine/src/lib.rs
+++ b/crates/engine/src/lib.rs
@@ -303,8 +303,9 @@ pub struct Session {
pub preset_store: Option,
/// Window › Actions. The list persists with the preset store when one is attached.
pub actions: actions_cmds::ActionState,
- /// Per-step gate for `actions.play`. Untrusted sessions (MCP, the control channel) install
- /// the same check a top-level command sees. `None` runs every step, which is what a local
+ /// Gate for every command the session runs, including the ones a command runs on its own
+ /// behalf and `actions.play` steps. Untrusted sessions (MCP, the control channel) install
+ /// the same check a top-level request sees. `None` runs everything, which is what a local
/// UI and `photocraft-cli run` do.
pub authorize: Option Result<()>>,
/// Background jobs (see [`jobs`]).
From 11f6f00ccc888cb12caa95ab70dcadc231fda90f Mon Sep 17 00:00:00 2001
From: Tanish Manku
Date: Wed, 7 Oct 2026 23:58:31 -0700
Subject: [PATCH 03/18] Variables dialog: malformed entries can't crash an edit
(#875)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
`ui.dialog.set` can store any JSON in the dialog's `__variables` field, and the Define and Data
Sets pages write fields into its entries (`d["name"] = …`, `set["name"] = …`), which panics when an
entry is a number or a string. The dialog now normalizes the state each frame, keeping only object
entries in `defs`, `dataSets` and each set's `values`.
---
crates/ui-egui/src/variables_ui.rs | 27 +++++++++++++++-
crates/ui-egui/tests/variables_data_sets.rs | 34 +++++++++++++++++++++
2 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/crates/ui-egui/src/variables_ui.rs b/crates/ui-egui/src/variables_ui.rs
index 81f9aa929e..a421de3915 100644
--- a/crates/ui-egui/src/variables_ui.rs
+++ b/crates/ui-egui/src/variables_ui.rs
@@ -110,7 +110,7 @@ const METHODS: &[(&str, &str)] = &[("fit", "Fit"), ("fill", "Fill"), ("conform",
pub fn body(app: &mut PhotocraftApp, ui: &mut egui::Ui, fields: &mut Map) {
let t = Tokens::get(ui.ctx());
let layers = layer_options(app);
- let mut state = fields.get("__variables").cloned().unwrap_or_else(|| json!({"defs": [], "dataSets": []}));
+ let mut state = normalize(fields.get("__variables").unwrap_or(&Value::Null));
let mut page = fields.get("__page").and_then(Value::as_str).unwrap_or("define").to_string();
ui.set_min_width(420.0);
@@ -137,6 +137,22 @@ pub fn body(app: &mut PhotocraftApp, ui: &mut egui::Ui, fields: &mut Map Value {
+ let objects =
+ |v: Option<&Value>| -> Vec { v.and_then(Value::as_array).map(|a| a.iter().filter(|e| e.is_object()).cloned().collect()).unwrap_or_default() };
+ let sets: Vec = objects(state.get("dataSets"))
+ .into_iter()
+ .map(|mut set| {
+ set["values"] = Value::Array(objects(set.get("values")));
+ set
+ })
+ .collect();
+ json!({"defs": objects(state.get("defs")), "dataSets": sets})
+}
+
fn define_page(ui: &mut egui::Ui, _t: &Tokens, layers: &[(u64, String, bool)], state: &mut Value) {
let Some(defs) = state.get_mut("defs").and_then(Value::as_array_mut) else { return };
ui.label(tl!("Variables bind a layer's visibility, text or pixels to a named data slot."));
@@ -339,6 +355,15 @@ mod tests {
assert_eq!(data_set_index(&fields, 0), 0);
}
+ #[test]
+ fn normalize_keeps_only_object_entries() {
+ let s = normalize(&json!({"defs": [1, {"name": "a"}], "dataSets": ["x", {"name": "A", "values": [true, {"variable": "a"}]}, {"values": 3}]}));
+ assert_eq!(s, json!({"defs": [{"name": "a"}], "dataSets": [{"name": "A", "values": [{"variable": "a"}]}, {"values": []}]}));
+ for bad in [Value::Null, json!(5), json!("s"), json!([1]), json!({"defs": "x", "dataSets": {}})] {
+ assert_eq!(normalize(&bad), json!({"defs": [], "dataSets": []}), "{bad}");
+ }
+ }
+
#[test]
fn owns_detects_the_field() {
let mut f = Map::new();
diff --git a/crates/ui-egui/tests/variables_data_sets.rs b/crates/ui-egui/tests/variables_data_sets.rs
index cb79eb9335..c79f1c1693 100644
--- a/crates/ui-egui/tests/variables_data_sets.rs
+++ b/crates/ui-egui/tests/variables_data_sets.rs
@@ -55,3 +55,37 @@ fn out_of_range_data_set_index_is_clamped_before_delete() {
h.get_by_label("Delete").click();
h.run_steps(2);
}
+
+/// `ui.dialog.set` can store any JSON in `__variables`; the editors write into its entries.
+fn app_with_malformed_variables(page: &str) -> PhotocraftApp {
+ let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), photocraft_ui_egui::Services::default());
+ app.run("file.new", json!({"width": 64, "height": 64})).unwrap();
+ app.run("layer.new.layer", json!({})).unwrap();
+ let mut fields = Map::new();
+ fields.insert(
+ "__variables".into(),
+ json!({"defs": [42, {"name": "v1", "layer": 0, "type": "textReplacement"}], "dataSets": ["bad", {"name": "A", "values": [7, "x"]}, {"name": "B", "values": "nope"}]}),
+ );
+ fields.insert("__page".into(), json!(page));
+ app.ui.open_dialog(DialogKind::Command, fields);
+ app
+}
+
+fn type_into_first_text_field(h: &mut Harness<'static, PhotocraftApp>) {
+ h.query_all_by_role(egui::accesskit::Role::TextInput).next().expect("a text field").click();
+ h.run_steps(2);
+ h.query_all_by_role(egui::accesskit::Role::TextInput).next().expect("a text field").type_text("z");
+ h.run_steps(2);
+}
+
+#[test]
+fn malformed_variable_entries_are_dropped_before_an_edit() {
+ for page in ["define", "dataSets"] {
+ let mut h = harness(app_with_malformed_variables(page));
+ type_into_first_text_field(&mut h);
+ let state = &h.state().ui.dialogs.last().unwrap().fields["__variables"];
+ assert_eq!(state["defs"].as_array().unwrap().len(), 1, "{page}: {state}");
+ assert_eq!(state["dataSets"].as_array().unwrap().len(), 2, "{page}: {state}");
+ assert!(state["dataSets"].as_array().unwrap().iter().all(|s| s["values"].as_array().unwrap().iter().all(|v| v.is_object())), "{page}: {state}");
+ }
+}
From 997acf5885512215de41e330778cfc8ae26637d8 Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 03:17:29 -0400
Subject: [PATCH 04/18] Layers panel: drop layers on the footer's New Layer,
New Group and Delete buttons (#736) (#965)
As in Photoshop, dragging a layer row onto New Layer duplicates it, onto New
Group groups it and onto Delete deletes it. A row that is part of the
selection carries the whole selection; any other row goes alone. The button
under the pointer is highlighted during the drag.
Co-authored-by: Claude Opus 5.5
---
crates/ui-egui/src/layer_row_ui/tests.rs | 42 ++++++++++++++++++++++
crates/ui-egui/src/panels.rs | 46 ++++++++++++++++++++++--
2 files changed, 85 insertions(+), 3 deletions(-)
diff --git a/crates/ui-egui/src/layer_row_ui/tests.rs b/crates/ui-egui/src/layer_row_ui/tests.rs
index bb2bd14971..1102a864f5 100644
--- a/crates/ui-egui/src/layer_row_ui/tests.rs
+++ b/crates/ui-egui/src/layer_row_ui/tests.rs
@@ -222,3 +222,45 @@ fn dragging_down_the_eyes_sweeps_visibility_without_reordering() {
assert!(visible(&h, rows[1].layer));
}
}
+
+/// #736: a layer row dropped on the footer's New Layer button is duplicated, on New Group it is
+/// grouped, on Delete it is deleted; a row outside the selection goes alone.
+#[test]
+fn dropping_a_row_on_the_footer_buttons_duplicates_groups_and_deletes() {
+ let mut s = photocraft_engine::Session::new();
+ s.execute("file.new", json!({"width": 64, "height": 48})).unwrap();
+ for i in 0..3 {
+ s.execute("layer.new.layer", json!({"name": format!("L{i}")})).unwrap();
+ }
+ let mut h = harness(s, 1.0, "promedium", 290.0);
+ let names = |h: &Harness<'_, PhotocraftApp>| h.state().session.active().unwrap().doc.layers.iter().map(|l| l.name.clone()).collect::>();
+ let drag_to = |h: &mut Harness<'static, PhotocraftApp>, row: usize, label: &str| {
+ let from = recorded(&h.ctx)[row].row.center();
+ let to = h.get_by_label(label).rect().center();
+ h.event(egui::Event::PointerMoved(from));
+ h.run_steps(1);
+ h.event(egui::Event::PointerButton { pos: from, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE });
+ h.run_steps(1);
+ for k in 1..=8 {
+ h.event(egui::Event::PointerMoved(from + (to - from) * (k as f32 / 8.0)));
+ h.run_steps(1);
+ }
+ h.event(egui::Event::PointerButton { pos: to, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE });
+ h.run_steps(3);
+ };
+ // Rows top to bottom: L2 (selected), L1, L0, Background. L1 isn't selected: it goes alone.
+ drag_to(&mut h, 1, "Create a new layer");
+ assert_eq!(names(&h), ["Background", "L0", "L1", "L1 copy", "L2"]);
+ let steps = h.state().session.active().unwrap().history.past_len();
+ // Rows: L2, L1 copy (now selected), L1, L0, Background.
+ drag_to(&mut h, 3, "Create a new group");
+ let doc = &h.state().session.active().unwrap().doc;
+ let group = doc.layers.iter().find(|l| l.is_group()).expect("a group");
+ let LayerContent::Group(g) = &group.content else { panic!("not a group") };
+ assert_eq!(g.children.iter().map(|l| l.name.as_str()).collect::>(), ["L0"]);
+ assert_eq!(h.state().session.active().unwrap().history.past_len(), steps + 1, "one undo step");
+ let n = h.state().session.active().unwrap().doc.layers.len();
+ drag_to(&mut h, 0, "Delete layer");
+ assert!(!names(&h).iter().any(|n| n == "L2"));
+ assert_eq!(h.state().session.active().unwrap().doc.layers.len(), n - 1);
+}
diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs
index fe8c5fc237..73967eaae4 100644
--- a/crates/ui-egui/src/panels.rs
+++ b/crates/ui-egui/src/panels.rs
@@ -1526,6 +1526,12 @@ fn layers(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
actions.push(done);
}
});
+ // A layer being dragged can also be dropped on the footer's Delete, New Layer and Group
+ // buttons (#736); read the drag before it ends.
+ let footer_drag = ctx.data(|d| d.get_temp::(egui::Id::new("layer-drag"))).map(|id| {
+ let in_selection = selection.iter().any(|s| s.0 == id);
+ (id, in_selection)
+ });
// End any layer drag after every row has had a chance to accept the drop.
if ctx.input(|i| i.pointer.any_released()) {
ctx.data_mut(|d| d.remove::(egui::Id::new("layer-drag")));
@@ -1536,15 +1542,21 @@ fn layers(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = 2.0;
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
- if icons::button(ui, "trash", 26.0, false, tl!("Delete layer")).clicked() {
+ let trash = icons::button(ui, "trash", 26.0, false, tl!("Delete layer"));
+ if trash.clicked() {
actions.push(("layer.delete".into(), json!({})));
}
- if icons::button(ui, "square-plus", 26.0, false, &crate::shortcuts::tip_label(app, "Create a new layer", "layer.new.layer")).clicked() {
+ actions.extend(footer_drop(ui, &trash, footer_drag, "layer.delete"));
+ let new_layer = icons::button(ui, "square-plus", 26.0, false, &crate::shortcuts::tip_label(app, "Create a new layer", "layer.new.layer"));
+ if new_layer.clicked() {
actions.push(("layer.new.layer".into(), json!({})));
}
- if icons::button(ui, "folder", 26.0, false, tl!("Create a new group")).clicked() {
+ actions.extend(footer_drop(ui, &new_layer, footer_drag, "layer.duplicate"));
+ let group = icons::button(ui, "folder", 26.0, false, tl!("Create a new group"));
+ if group.clicked() {
actions.push(("layer.new.group".into(), json!({})));
}
+ actions.extend(footer_drop(ui, &group, footer_drag, "layer.groupLayers"));
let adj = icons::button(ui, "contrast", 26.0, false, tl!("Create new fill or adjustment layer"));
egui::Popup::menu(&adj).show(|ui| {
ui.set_min_width(190.0);
@@ -1622,6 +1634,34 @@ fn layers(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
}
}
+/// A layer row dragged onto a Layers panel footer button, as in Photoshop: onto Delete deletes it,
+/// onto New Layer duplicates it, onto New Group groups it. A row that is part of the selection
+/// carries the whole selection; any other row goes alone. Highlights the button while over it and
+/// returns the command on release.
+fn footer_drop(ui: &egui::Ui, button: &egui::Response, drag: Option<(u64, bool)>, command: &str) -> Option<(String, Value)> {
+ // Named for screen readers (and tests) after the command a drop runs.
+ button.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, true, footer_label(command)));
+ let (layer, in_selection) = drag?;
+ let p = ui.ctx().input(|i| i.pointer.interact_pos())?;
+ if !button.rect.contains(p) {
+ return None;
+ }
+ let t = Tokens::get(ui.ctx());
+ ui.painter().rect_stroke(button.rect, t.radius_sm, Stroke::new(2.0, t.accent), StrokeKind::Inside);
+ if !ui.ctx().input(|i| i.pointer.any_released()) {
+ return None;
+ }
+ Some((command.into(), if in_selection { json!({}) } else { json!({"layer": layer}) }))
+}
+
+fn footer_label(command: &str) -> &'static str {
+ match command {
+ "layer.delete" => tl!("Delete layer"),
+ "layer.duplicate" => tl!("Create a new layer"),
+ _ => tl!("Create a new group"),
+ }
+}
+
/// Photoshop's italic "fx" footer button (no icon-font equivalent).
fn fx_button(ui: &mut egui::Ui, size: f32, tip: &str) -> egui::Response {
let t = Tokens::get(ui.ctx());
From dd963b4b44ccd561c2117da1c28b208f72269958 Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 03:17:34 -0400
Subject: [PATCH 05/18] Crop tool starts with a frame around the canvas (or the
selection), as in Photoshop (#668) (#971)
Picking the Crop tool showed nothing until a frame was drawn. It now frames the
whole canvas, or the selection's bounds when there is one, and frames again
after a crop is cancelled or committed. Like Photoshop, a drag inside the
untouched frame draws a new one, its handles resize it, and committing it
does nothing.
Co-authored-by: Claude Opus 5.5
---
crates/ui-egui/src/canvas.rs | 5 +++
crates/ui-egui/src/crop_ui.rs | 70 ++++++++++++++++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)
diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs
index 59aa27301c..260d6a41a1 100644
--- a/crates/ui-egui/src/canvas.rs
+++ b/crates/ui-egui/src/canvas.rs
@@ -1735,6 +1735,7 @@ pub fn canvas_view(app: &mut PhotocraftApp, ui: &mut egui::Ui, idx: usize, rect:
// drawn; otherwise Space is the Hand and ⌘Space / ⌘⌥Space the Zoom tool while held.
let reposition = crate::hold_keys::reposition_held(app, &ctx);
crate::crop_ui::set_space(app, reposition);
+ crate::crop_ui::ensure_frame(app);
let mut drawing = crate::crop_ui::active(app);
if let Some(d) = app.drag.as_mut().filter(|d| crate::hold_keys::repositions(d.tool)) {
d.reposition = reposition;
@@ -2853,6 +2854,10 @@ pub fn commit_polygon(app: &mut PhotocraftApp) {
/// Apply the crop tool's rectangle.
pub fn commit_crop(app: &mut PhotocraftApp) {
let Some(r) = app.ui.crop_rect.take() else { return };
+ // The untouched default frame crops nothing (Photoshop's ↵ on it does nothing).
+ if std::mem::take(&mut app.crop.default_frame) {
+ return;
+ }
let (x, y) = (r[0].round(), r[1].round());
let (w, h) = ((r[2] - r[0]).round().max(1.0), (r[3] - r[1]).round().max(1.0));
let delete = app.ui.tool_options.crop_delete;
diff --git a/crates/ui-egui/src/crop_ui.rs b/crates/ui-egui/src/crop_ui.rs
index 9d5b5b3808..6508431e7d 100644
--- a/crates/ui-egui/src/crop_ui.rs
+++ b/crates/ui-egui/src/crop_ui.rs
@@ -27,6 +27,11 @@ pub struct CropState {
pub drag: Option,
/// Space is held: drawing a new frame moves it instead of sizing it.
pub space: bool,
+ /// `UiState::crop_rect` is the untouched default frame ([`ensure_frame`]): a drag inside it
+ /// draws a new frame (as in Photoshop) instead of moving it, and committing it does nothing.
+ pub default_frame: bool,
+ /// The document (index and size) the default frame was made for.
+ frame_for: Option<(usize, u32, u32)>,
}
/// A crop gesture in progress. Rects are `[x0, y0, x1, y1]` in document coordinates.
@@ -149,6 +154,37 @@ pub fn set_space(app: &mut PhotocraftApp, down: bool) {
app.crop.space = down;
}
+/// As in Photoshop, the Crop tool always shows a frame: on picking the tool, and after a crop is
+/// cancelled or committed, it frames the selection's bounds, or the whole canvas.
+pub fn ensure_frame(app: &mut PhotocraftApp) {
+ if app.ui.tool != Tool::Crop {
+ // Leaving the tool drops an untouched default frame (a drawn one stays pending).
+ if app.crop.default_frame {
+ app.ui.crop_rect = None;
+ app.crop.default_frame = false;
+ }
+ return;
+ }
+ let key = app.session.active_index().zip(app.session.active()).map(|(i, st)| (i, st.doc.size.width, st.doc.size.height));
+ // Another document (or a resized one) gets its own default frame.
+ if app.crop.default_frame && app.crop.frame_for != key && app.crop.drag.is_none() {
+ app.ui.crop_rect = None;
+ }
+ if app.ui.crop_rect.is_some() || app.crop.drag.is_some() {
+ return;
+ }
+ let Some(st) = app.session.active() else { return };
+ let canvas = st.doc.bounds();
+ // Computed once per new frame, not per frame drawn.
+ let r = st.doc.selection.as_ref().map(|s| s.content_bounds().intersect(&canvas)).filter(|b| !b.is_empty()).unwrap_or(canvas);
+ if r.is_empty() {
+ return;
+ }
+ app.ui.crop_rect = Some([f64::from(r.x0), f64::from(r.y0), f64::from(r.x1), f64::from(r.y1)]);
+ app.crop.default_frame = true;
+ app.crop.frame_for = key;
+}
+
/// A crop gesture is in progress: Space repositions the frame rather than panning.
pub fn active(app: &PhotocraftApp) -> bool {
app.ui.tool == Tool::Crop && app.crop.drag.is_some()
@@ -175,7 +211,7 @@ pub fn pointer(app: &mut PhotocraftApp, ev: ToolEvent, mods: Modifiers) -> bool
let frame = app.ui.crop_rect.filter(|r| r.iter().all(|v| v.is_finite()));
app.crop.drag = Some(match frame.map(|r| (r, hit(r, p, tolerance(app)))) {
Some((rect, Hit::Handle(hx, hy))) => CropDrag::Resize { hx, hy, start: p, rect },
- Some((rect, Hit::Inside)) => CropDrag::Move { start: p, rect },
+ Some((rect, Hit::Inside)) if !app.crop.default_frame => CropDrag::Move { start: p, rect },
_ => CropDrag::Draw { anchor: p, cur: p, last: p, prev: app.ui.crop_rect },
});
}
@@ -184,6 +220,9 @@ pub fn pointer(app: &mut PhotocraftApp, ev: ToolEvent, mods: Modifiers) -> bool
update(app, p, mods);
let Some(drag) = app.crop.drag.take() else { return true };
let ok = app.ui.crop_rect.is_some_and(size_ok);
+ if ok {
+ app.crop.default_frame = false;
+ }
match drag {
CropDrag::Draw { prev, .. } if !ok => app.ui.crop_rect = prev,
CropDrag::Move { rect, .. } | CropDrag::Resize { rect, .. } if !ok => app.ui.crop_rect = Some(rect),
@@ -282,6 +321,35 @@ mod tests {
tool_event(app, ToolEvent::Up { x: last[0], y: last[1] }, mods);
}
+ #[test]
+ fn picking_the_tool_frames_the_canvas_or_the_selection() {
+ // #668: the Crop tool started with no frame.
+ let mut app = app(SampleType::U8);
+ ensure_frame(&mut app);
+ assert_eq!(app.ui.crop_rect, Some([0.0, 0.0, 200.0, 100.0]));
+ // Committing the untouched frame crops nothing.
+ let steps = app.session.active().unwrap().history.past_len();
+ crate::canvas::commit_crop(&mut app);
+ assert_eq!(app.session.active().unwrap().history.past_len(), steps);
+ assert_eq!(app.session.active().unwrap().doc.size, Size::new(200, 100));
+ // A drag inside the untouched frame draws a new one instead of moving it.
+ ensure_frame(&mut app);
+ drag(&mut app, &[[50.0, 20.0], [80.0, 40.0], [120.0, 70.0]], NONE);
+ assert_eq!(app.ui.crop_rect, Some([50.0, 20.0, 120.0, 70.0]));
+ // Now it's a real frame: a drag inside moves it.
+ drag(&mut app, &[[60.0, 30.0], [70.0, 30.0]], NONE);
+ assert_eq!(app.ui.crop_rect, Some([60.0, 20.0, 130.0, 70.0]));
+ // Cancelling frames the selection's bounds when there is one.
+ app.run("select.rect", json!({"x": 10, "y": 10, "width": 30, "height": 20})).unwrap();
+ app.ui.crop_rect = None;
+ ensure_frame(&mut app);
+ assert_eq!(app.ui.crop_rect, Some([10.0, 10.0, 40.0, 30.0]));
+ // Leaving the tool drops the untouched frame.
+ app.ui.tool = Tool::Brush;
+ ensure_frame(&mut app);
+ assert_eq!(app.ui.crop_rect, None);
+ }
+
#[test]
fn hit_test_finds_handles_inside_and_outside() {
let r = [10.0, 10.0, 110.0, 60.0];
From 74c798014682b5a31f7de6bb287785ee0895534a Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 03:17:39 -0400
Subject: [PATCH 06/18] Type: Cmd/Ctrl+T while typing shows or hides the
Character panel (#668) (#983)
It passed through to Edit > Free Transform, which started transforming the
layer being typed into. As in Photoshop, it now toggles the Character panel
and editing continues.
Co-authored-by: Claude Opus 5.5
---
crates/ui-egui/src/type_tool.rs | 5 +++++
crates/ui-egui/src/type_tool_tests.rs | 18 ++++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/crates/ui-egui/src/type_tool.rs b/crates/ui-egui/src/type_tool.rs
index fcc36fa5ce..bfd4f41851 100644
--- a/crates/ui-egui/src/type_tool.rs
+++ b/crates/ui-egui/src/type_tool.rs
@@ -518,6 +518,11 @@ pub fn handle_keys(app: &mut PhotocraftApp, ctx: &egui::Context) -> bool {
e.caret = n;
}
}
+ // Photoshop: while editing type, ⌘/Ctrl+T shows or hides the Character panel
+ // (Free Transform of the layer being typed into is not what it means here).
+ Key::T if m.command && !m.shift && !m.alt => {
+ let _ = crate::menus::invoke(app, ctx, "window.panel.character", json!({}));
+ }
// Other command shortcuts (⌘Z, ⌘S, …) pass through to the menus.
_ if m.command => handled[k] = false,
_ => {}
diff --git a/crates/ui-egui/src/type_tool_tests.rs b/crates/ui-egui/src/type_tool_tests.rs
index 301ea0ef3a..9c8d4c8654 100644
--- a/crates/ui-egui/src/type_tool_tests.rs
+++ b/crates/ui-egui/src/type_tool_tests.rs
@@ -434,3 +434,21 @@ fn vertical_type_tool_creates_point_and_paragraph_text_with_one_undo() {
assert!(app.session.active().unwrap().doc.layer(id).is_none());
}
}
+
+/// #668: ⌘/Ctrl+T while typing shows or hides the Character panel, as in Photoshop, instead of
+/// starting Free Transform on the layer being typed into.
+#[test]
+fn command_t_while_typing_toggles_the_character_panel() {
+ let mut app = new_app();
+ let id = LayerId(app.run("type.create", json!({"text": "HOHO", "size": 60, "x": 300, "y": 420})).unwrap()["layer"].as_u64().unwrap());
+ let mut h = harness(1.0, app);
+ let p = glyph(&mut h, id, 1, 0.5);
+ click(&mut h, p);
+ assert!(h.state().ui.text_edit.is_some(), "editing");
+ let before = crate::view_cmds::checked(h.state(), "window.panel.character");
+ h.event(egui::Event::Key { key: egui::Key::T, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::COMMAND });
+ h.run_steps(2);
+ assert!(h.state().ui.transform.is_none(), "no Free Transform while typing");
+ assert!(h.state().ui.text_edit.is_some(), "still editing");
+ assert_ne!(crate::view_cmds::checked(h.state(), "window.panel.character"), before, "the Character panel toggled");
+}
From 1ae11a4bb1c3c5f7125ab16bf7b3c1c3838266a3 Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 03:17:44 -0400
Subject: [PATCH 07/18] Shape tools: Shift and Alt pressed during the drag
constrain it, as in Photoshop (#668) (#984)
Shape drags only read the modifiers held at the press, so pressing Shift
mid-drag (the usual way) didn't square a rectangle or keep a polygon's
proportions, and Alt mid-drag didn't draw from the centre. They now follow
the modifiers held at each pointer event, like the marquees.
Co-authored-by: Claude Opus 5.5
---
crates/ui-egui/src/canvas.rs | 4 ++--
crates/ui-egui/src/vector_ui.rs | 24 ++++++++++++++++++++++++
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs
index 260d6a41a1..56e959f348 100644
--- a/crates/ui-egui/src/canvas.rs
+++ b/crates/ui-egui/src/canvas.rs
@@ -2293,7 +2293,7 @@ fn draw_drag_preview(app: &mut PhotocraftApp, painter: &egui::Painter, xf: &View
trail.feed(&d.points, app.session.tools.brush.size);
trail.draw(painter, doc_rect, xf.flip, col);
}
- t if crate::vector_ui::is_shape_tool(t) => crate::vector_ui::draw_shape_preview(app, painter, xf, t, d.start, last, d.modifiers),
+ t if crate::vector_ui::is_shape_tool(t) => crate::vector_ui::draw_shape_preview(app, painter, xf, t, d.start, last, d.live),
Tool::RectMarquee | Tool::EllipseMarquee | Tool::ObjectSelection => {
// Marching ants, visible on any pixels (#172).
let (a, b) = marquee.unwrap_or((d.start, last));
@@ -2714,7 +2714,7 @@ pub(crate) fn finish_gesture(app: &mut PhotocraftApp, d: Drag) {
}
match d.tool {
Tool::ObjectSelection => crate::retouch_ui::finish_object_selection(app, d.start, [end[0], end[1]], d.modifiers),
- t if crate::vector_ui::is_shape_tool(t) => crate::vector_ui::finish_shape(app, t, d.start, [end[0], end[1]], d.modifiers),
+ t if crate::vector_ui::is_shape_tool(t) => crate::vector_ui::finish_shape(app, t, d.start, [end[0], end[1]], d.live),
Tool::PathSelection => crate::vector_ui::path_selection_finish(app, d.start, [end[0], end[1]]),
Tool::Type | Tool::VerticalType => crate::type_tool::pointer_up(app, d.start, [end[0], end[1]]),
Tool::Brush | Tool::Pencil | Tool::Eraser => {
diff --git a/crates/ui-egui/src/vector_ui.rs b/crates/ui-egui/src/vector_ui.rs
index 619515013b..f6d258a9c9 100644
--- a/crates/ui-egui/src/vector_ui.rs
+++ b/crates/ui-egui/src/vector_ui.rs
@@ -938,6 +938,30 @@ mod tests {
assert_eq!(app.session.active().unwrap().doc.layers.len(), 4);
}
+ #[test]
+ fn shift_pressed_during_a_shape_drag_constrains_it() {
+ // #668: ⇧ only counted when held at the press; Photoshop constrains when it is pressed
+ // mid-drag (and stops when it is released).
+ use crate::canvas::{ToolEvent, tool_event};
+ for (tool, sides) in [(Tool::Polygon, 6), (Tool::Rectangle, 4), (Tool::EllipseShape, 0)] {
+ let mut app = app();
+ app.ui.tool = tool;
+ app.ui.tool_options.polygon_sides = 6;
+ let none = egui::Modifiers::NONE;
+ tool_event(&mut app, ToolEvent::Down { x: 10.0, y: 10.0, pressure: 1.0 }, none);
+ tool_event(&mut app, ToolEvent::Move { x: 40.0, y: 30.0, pressure: 1.0 }, none);
+ tool_event(&mut app, ToolEvent::Move { x: 70.0, y: 40.0, pressure: 1.0 }, egui::Modifiers::SHIFT);
+ tool_event(&mut app, ToolEvent::Up { x: 70.0, y: 40.0 }, egui::Modifiers::SHIFT);
+ let st = app.session.active().unwrap();
+ let l = st.doc.layer(st.active_layer.unwrap()).unwrap();
+ assert!(matches!(l.content, LayerContent::Shape(_)), "{tool:?} ({sides} sides): a shape layer");
+ let b = l.surface().unwrap().content_bounds();
+ // The drag is 60 × 30; constrained, the shape's box is 60 × 60 (a hexagon is narrower
+ // than its box, so the height tells).
+ assert!(b.height().abs_diff(60) <= 1 && b.width() <= 61, "{tool:?}: ⇧ mid-drag keeps proportions: {b:?}");
+ }
+ }
+
#[test]
fn shape_preview_is_the_committed_path() {
let mut app = app();
From d64f809e4d8003d4ae0e1934dad6089bc5ef2583 Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 03:17:48 -0400
Subject: [PATCH 08/18] Layer via Copy, Copy and Cut read only the selected
area: 33x faster on 24 MP (#668) (#985)
lift() converted the whole layer to a format with alpha before reading the
selection's rectangle, so on a 24 MP Background every Layer via Copy cost about
a second whatever the selection's size, and it sampled the selection mask one
pixel at a time. It now reads just that rectangle and the mask's rectangle.
6000x4000 Background, 2000x1500 selection, release: Layer via Copy 984 ms ->
30 ms. Select All then Layer via Copy: 212 ms.
Co-authored-by: Claude Opus 5.5
---
crates/engine/src/edit_cmds.rs | 52 ++++++++++++++++++++++++++++++----
1 file changed, 47 insertions(+), 5 deletions(-)
diff --git a/crates/engine/src/edit_cmds.rs b/crates/engine/src/edit_cmds.rs
index a11ee8ca83..73b47faf1d 100644
--- a/crates/engine/src/edit_cmds.rs
+++ b/crates/engine/src/edit_cmds.rs
@@ -68,13 +68,26 @@ fn lift(src: &Surface, sel: Option<&Surface>, canvas: Rect) -> Clip {
if area.is_empty() {
return Clip { surface: out, bounds: Rect::EMPTY };
}
- let conv = src.convert(with_alpha);
- let mut px = conv.read_region(area);
+ // Only the selected area is read: converting the whole layer (a 24 MP Background gaining
+ // alpha) cost about a second per Layer via Copy (#668).
let n = with_alpha.channels();
+ let mut px = if fmt.alpha {
+ src.read_region(area)
+ } else {
+ let opaque = src.read_region(area);
+ let k = fmt.channels();
+ let mut v = Vec::with_capacity(opaque.len() / k.max(1) * n);
+ for p in opaque.chunks_exact(k.max(1)) {
+ v.extend_from_slice(p);
+ v.push(1.0);
+ }
+ v
+ };
if let Some(m) = sel {
- let w = area.width() as usize;
- for (i, p) in px.chunks_exact_mut(n).enumerate() {
- p[n - 1] *= m.sample_channel(area.x0 + (i % w) as i32, area.y0 + (i / w) as i32, 0);
+ let mask = m.read_region(area);
+ let mk = m.format().channels().max(1);
+ for (p, a) in px.chunks_exact_mut(n).zip(mask.chunks_exact(mk)) {
+ p[n - 1] *= a[0];
}
}
out.write_region(area, &px);
@@ -695,6 +708,35 @@ mod tests {
assert_eq!(px(&s, 0, 8, 8)[3], 0.0);
}
+ #[test]
+ fn layer_via_copy_of_a_background_keeps_colour_and_partial_selection() {
+ // #668: lift reads only the selected area now; the result must be what converting the
+ // whole layer gave: the colour, with the selection's coverage as alpha.
+ for depth in [8, 16, 32] {
+ let mut s = Session::new();
+ s.execute("file.new", json!({"width": 40, "height": 30, "depth": depth, "background": "#336699"})).unwrap();
+ s.edit("partial selection", |doc, _| {
+ let mut m = photocraft_raster::Surface::new(PixelFormat::GRAY8);
+ m.fill_rect(Rect::new(5, 5, 15, 15), &[1.0]);
+ m.fill_rect(Rect::new(15, 5, 20, 15), &[0.5]);
+ doc.selection = Some(m);
+ Ok(())
+ })
+ .unwrap();
+ let id = s.execute("layer.new.layerViaCopy", json!({})).unwrap()["layer"].as_u64().unwrap();
+ let d = s.active().unwrap();
+ let surf = d.doc.layer(LayerId(id)).unwrap().surface().unwrap();
+ assert!(surf.format().alpha, "@{depth}");
+ let full = surf.read_region(Rect::new(6, 6, 7, 7));
+ let half = surf.read_region(Rect::new(16, 6, 17, 7));
+ for (got, want) in full.iter().zip([0.2, 0.4, 0.6, 1.0]) {
+ assert!((got - want).abs() < 0.01, "@{depth}: {full:?}");
+ }
+ assert!((half[3] - 0.5).abs() < 0.01 && (half[0] - 0.2).abs() < 0.01, "@{depth}: {half:?}");
+ assert_eq!(surf.content_bounds(), Rect::new(5, 5, 20, 15), "@{depth}");
+ }
+ }
+
#[test]
fn cut_clears_and_layer_via_copy_cut() {
let mut s = session();
From 3d003bd9d09ce9d09cc6b64fdf9b7d9c48e4a8c7 Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 04:01:33 -0400
Subject: [PATCH 09/18] Windows: selection and other crosshair tools stay
visible over grey (#737) (#954)
Windows' crosshair cursor inverts the pixels under it, so it vanishes over
mid-grey (the pasteboard, many photos). On Windows the canvas now draws a
black-and-white crosshair itself and hides the system one.
Co-authored-by: Claude Opus 5.5
---
crates/ui-egui/src/canvas.rs | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs
index 56e959f348..7e93f02b26 100644
--- a/crates/ui-egui/src/canvas.rs
+++ b/crates/ui-egui/src/canvas.rs
@@ -213,6 +213,23 @@ pub(crate) fn stroke_command(tool: Tool) -> &'static str {
if tool == Tool::Pencil { "paint.pencil" } else { "paint.stroke" }
}
+/// Windows' crosshair cursor inverts the pixels under it, so over mid-grey (the pasteboard, many
+/// photos) it vanishes (#737). There the canvas draws a black-and-white crosshair itself, like
+/// Photoshop's, and hides the system one.
+fn visible_crosshair(icon: egui::CursorIcon, painter: &egui::Painter, p: Pos2, draw: bool) -> egui::CursorIcon {
+ if !draw || icon != egui::CursorIcon::Crosshair {
+ return icon;
+ }
+ let p = pos2(p.x.round() + 0.5, p.y.round() + 0.5);
+ let (gap, len) = (2.0, 8.0);
+ for (w, c) in [(3.0, Color32::from_black_alpha(160)), (1.0, Color32::from_white_alpha(235))] {
+ for d in [vec2(1.0, 0.0), vec2(-1.0, 0.0), vec2(0.0, 1.0), vec2(0.0, -1.0)] {
+ painter.line_segment([p + d * gap, p + d * len], Stroke::new(w, c));
+ }
+ }
+ egui::CursorIcon::None
+}
+
/// The Pencil's cursor at `doc` (document pixels): the whole-pixel square its dab fills
/// (`paint::grid_square`), in screen points with its edges on physical pixels (`ppp` = pixels
/// per point), so it lines up with the pixel grid at any zoom.
@@ -2060,6 +2077,7 @@ pub fn canvas_view(app: &mut PhotocraftApp, ui: &mut egui::Ui, idx: usize, rect:
Tool::MagneticLasso => crate::magnetic_lasso_ui::cursor(app, &painter, p, view.zoom),
_ => egui::CursorIcon::Crosshair,
};
+ let icon = visible_crosshair(icon, &painter, p, cfg!(target_os = "windows"));
ui.ctx().set_cursor_icon(icon);
// Selection tools: + / − / × badge for the effective mode (#170). A gesture keeps the
// mode it started with (⇧ then constrains the marquee instead of adding).
@@ -2892,6 +2910,17 @@ fn hex(c: [f32; 4]) -> String {
#[cfg(test)]
mod tests {
+ #[test]
+ fn windows_draws_its_own_crosshair() {
+ // #737: Windows' inverting crosshair vanishes over mid-grey; the canvas draws one instead.
+ let ctx = egui::Context::default();
+ let painter = egui::Painter::new(ctx, egui::LayerId::background(), egui::Rect::EVERYTHING);
+ let p = egui::pos2(10.0, 10.0);
+ assert_eq!(super::visible_crosshair(egui::CursorIcon::Crosshair, &painter, p, true), egui::CursorIcon::None);
+ assert_eq!(super::visible_crosshair(egui::CursorIcon::Crosshair, &painter, p, false), egui::CursorIcon::Crosshair);
+ assert_eq!(super::visible_crosshair(egui::CursorIcon::Move, &painter, p, true), egui::CursorIcon::Move);
+ }
+
use super::*;
/// #569: displays 1 (sRGB) and 4 (Display P3) side by side, and a document filled with an
From 4c4c58d6e351655354164572ada5193dbd5dbb07 Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 04:01:38 -0400
Subject: [PATCH 10/18] Clone Stamp / Healing Brush: the source crosshair shows
only while painting (#668) (#969)
Setting the source with Alt-click left a + on the canvas until the next stroke.
As in Photoshop, the crosshair now shows where the stroke samples only while
the stroke is painted.
Co-authored-by: Claude Opus 5.5
---
crates/ui-egui/src/preset_panels.rs | 15 +++++++++++++++
crates/ui-egui/src/retouch_ui.rs | 25 ++++++++++++++-----------
2 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/crates/ui-egui/src/preset_panels.rs b/crates/ui-egui/src/preset_panels.rs
index 94ee84b436..15ac94f43d 100644
--- a/crates/ui-egui/src/preset_panels.rs
+++ b/crates/ui-egui/src/preset_panels.rs
@@ -1128,4 +1128,19 @@ mod tests {
app.session.presets.clone.active_mut().anchor = Some([20.0, 20.0]);
assert_eq!(clone_sample_point(&app, Some([30.0, 30.0])), Some([20.0, 20.0]));
}
+
+ #[test]
+ fn clone_marker_shows_only_while_painting() {
+ // #668: ⌥-click used to leave a "+" on the canvas until the next stroke.
+ let (mut app, _) = app();
+ app.ui.tool = Tool::CloneStamp;
+ crate::retouch_ui::set_source(&mut app, 10.0, 10.0);
+ app.hover_doc = Some([40.0, 40.0]);
+ assert_eq!(crate::retouch_ui::source_marker_point(&app), None, "hovering after ⌥-click shows nothing");
+ app.drag = Some(crate::canvas::Drag::new(Tool::CloneStamp, [40.0, 40.0], vec![[40.0, 40.0, 1.0]], egui::Modifiers::NONE, false));
+ assert!(crate::retouch_ui::source_marker_point(&app).is_some(), "painting shows where it samples");
+ app.drag = None;
+ app.ui.tool = Tool::Brush;
+ assert_eq!(crate::retouch_ui::source_marker_point(&app), None);
+ }
}
diff --git a/crates/ui-egui/src/retouch_ui.rs b/crates/ui-egui/src/retouch_ui.rs
index bd388192e4..4f22a09b1c 100644
--- a/crates/ui-egui/src/retouch_ui.rs
+++ b/crates/ui-egui/src/retouch_ui.rs
@@ -169,20 +169,23 @@ pub fn set_source(app: &mut PhotocraftApp, x: f64, y: f64) {
app.ui.status_error = false;
}
-/// Crosshair where the clone source is sampled from for the current pointer position.
-pub fn draw_source_marker(app: &PhotocraftApp, painter: &egui::Painter, xf: &ViewXform) {
+/// Where the clone source is sampled from, shown only while a Clone Stamp or Healing Brush stroke
+/// is painted, as in Photoshop: setting the source (⌥-click) leaves nothing on the canvas (#668).
+pub fn source_marker_point(app: &PhotocraftApp) -> Option<[f64; 2]> {
if !matches!(app.ui.tool, Tool::CloneStamp | Tool::Healing) {
- return;
+ return None;
}
- let at =
- app.drag.as_ref().filter(|d| matches!(d.tool, Tool::CloneStamp | Tool::Healing)).and_then(|d| d.points.last().map(|p| [p[0], p[1]])).or(app.hover_doc);
- let src = match (crate::preset_panels::clone_sample_point(app, at), app.ui.clone_offset, at, app.ui.clone_source) {
+ let at = app.drag.as_ref().filter(|d| matches!(d.tool, Tool::CloneStamp | Tool::Healing)).and_then(|d| d.points.last().map(|p| [p[0], p[1]]))?;
+ match (crate::preset_panels::clone_sample_point(app, Some(at)), app.ui.clone_offset, app.ui.clone_source) {
(Some(p), ..) => Some(p),
- (None, Some(off), Some(h), _) => Some([h[0] + off[0], h[1] + off[1]]),
- (None, None, _, Some(s)) => Some(s),
- _ => None,
- };
- let Some(s) = src else { return };
+ (None, Some(off), _) => Some([at[0] + off[0], at[1] + off[1]]),
+ (None, None, s) => s,
+ }
+}
+
+/// Crosshair at [`source_marker_point`].
+pub fn draw_source_marker(app: &PhotocraftApp, painter: &egui::Painter, xf: &ViewXform) {
+ let Some(s) = source_marker_point(app) else { return };
let c = xf.to_screen(s[0] as f32, s[1] as f32);
for (w, col) in [(3.0, Color32::from_black_alpha(160)), (1.0, Color32::WHITE)] {
painter.line_segment([c - vec2(7.0, 0.0), c + vec2(7.0, 0.0)], Stroke::new(w, col));
From 5896f0b63e6f342e0311920b4d2a0ea5a94330fc Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 04:01:43 -0400
Subject: [PATCH 11/18] Preferences: colour settings take a typed #rrggbb value
(#668 item 2) (#1001)
* Preferences: colour settings take a typed #rrggbb value (#668)
The canvas colour (and every colour preference) showed its hex value as a
label next to the swatch. It's now an editable field: a valid value sets the
colour, a partial one is kept while typing.
Co-Authored-By: Claude Opus 5.5
* rustfmt
Co-Authored-By: Claude Opus 5.5
---------
Co-authored-by: Claude Opus 5.5
---
crates/ui-egui/src/prefs_ui.rs | 46 +++++++++++++++++++++++++++++++++-
1 file changed, 45 insertions(+), 1 deletion(-)
diff --git a/crates/ui-egui/src/prefs_ui.rs b/crates/ui-egui/src/prefs_ui.rs
index 0985218a51..42c8726c56 100644
--- a/crates/ui-egui/src/prefs_ui.rs
+++ b/crates/ui-egui/src/prefs_ui.rs
@@ -788,6 +788,25 @@ fn choice_label(v: &str) -> String {
}
}
+/// An editable `#rrggbb` field beside a colour swatch (#668): typing a valid value sets the
+/// colour; while it's being typed a partial value is kept, and it shows the colour otherwise.
+fn hex_field(ui: &mut egui::Ui, key: &str, rgb: &mut [u8; 3]) {
+ let id = egui::Id::new(("pref-hex", key));
+ let shown = format!("#{:02x}{:02x}{:02x}", rgb[0], rgb[1], rgb[2]);
+ let mut text = ui.data(|d| d.get_temp::(id)).unwrap_or_else(|| shown.clone());
+ let r = ui.add(egui::TextEdit::singleline(&mut text).font(crate::theme::mono(11.5)).desired_width(72.0).char_limit(7));
+ if r.changed()
+ && let Some(c) = prefs::parse_hex(&text)
+ {
+ *rgb = c;
+ }
+ if r.has_focus() {
+ ui.data_mut(|d| d.insert_temp(id, text));
+ } else {
+ ui.data_mut(|d| d.remove::(id));
+ }
+}
+
fn color_of(s: &str) -> Color32 {
prefs::parse_hex(s).map_or(Color32::GRAY, |c| Color32::from_rgb(c[0], c[1], c[2]))
}
@@ -971,7 +990,7 @@ fn section_fields(ui: &mut egui::Ui, section: &str, obj: &mut Map
let mut rgb = c;
ui.horizontal(|ui| {
ui.color_edit_button_srgb(&mut rgb);
- ui.label(RichText::new(format!("#{:02x}{:02x}{:02x}", rgb[0], rgb[1], rgb[2])).font(crate::theme::mono(11.5)).color(t.text_dim));
+ hex_field(ui, &path, &mut rgb);
});
obj.insert(k, json!(format!("#{:02x}{:02x}{:02x}", rgb[0], rgb[1], rgb[2])));
let _ = color_of(s);
@@ -1386,6 +1405,31 @@ mod shortcut_capture_tests;
#[cfg(test)]
mod tests {
+ #[test]
+ fn colour_preferences_take_a_typed_hex_value() {
+ // #668: the canvas colour (and every colour preference) showed its hex but couldn't take one.
+ use egui::accesskit::Role;
+ use egui_kittest::kittest::Queryable;
+ let mut h = egui_kittest::Harness::new_ui_state(|ui, rgb: &mut [u8; 3]| super::hex_field(ui, "interface.canvasCustomColor", rgb), [0x28, 0x28, 0x28]);
+ h.run();
+ assert_eq!(h.get_by_role(Role::TextInput).value().as_deref(), Some("#282828"));
+ h.get_by_role(Role::TextInput).click();
+ h.run_steps(1);
+ h.key_press_modifiers(egui::Modifiers::COMMAND, egui::Key::A);
+ h.run_steps(1);
+ for ch in "#80".chars() {
+ h.event(egui::Event::Text(ch.to_string()));
+ h.run_steps(1);
+ }
+ // A partial value stays as typed and leaves the colour alone.
+ assert_eq!(h.get_by_role(Role::TextInput).value().as_deref(), Some("#80"));
+ assert_eq!(*h.state(), [0x28, 0x28, 0x28]);
+ for ch in "8080".chars() {
+ h.event(egui::Event::Text(ch.to_string()));
+ h.run_steps(1);
+ }
+ assert_eq!(*h.state(), [0x80, 0x80, 0x80]);
+ }
#[test]
fn rendering_mode_display_respects_explicit_mode_and_legacy_disable() {
From 173fc90ecb7f9f31f5dc2d7c65d670e0ab0246e4 Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 08:12:20 -0400
Subject: [PATCH 12/18] Bump version to 0.4.0 (from 0.3.0) for release
Co-Authored-By: Claude Opus 5.5
---
Cargo.lock | 56 +++++++++++++++++++++++++++---------------------------
Cargo.toml | 2 +-
2 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index a5ef97a684..6493c3734e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3421,7 +3421,7 @@ dependencies = [
[[package]]
name = "photocraft"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"arboard",
"eframe",
@@ -3454,7 +3454,7 @@ dependencies = [
[[package]]
name = "photocraft-algo"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3466,7 +3466,7 @@ dependencies = [
[[package]]
name = "photocraft-automation"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"base64",
"cap-std",
@@ -3488,7 +3488,7 @@ dependencies = [
[[package]]
name = "photocraft-cli"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"photocraft-automation",
"photocraft-codecs",
@@ -3501,7 +3501,7 @@ dependencies = [
[[package]]
name = "photocraft-cms"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"moxcms",
"rayon",
@@ -3509,7 +3509,7 @@ dependencies = [
[[package]]
name = "photocraft-codecs"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"exr",
"flate2",
@@ -3529,7 +3529,7 @@ dependencies = [
[[package]]
name = "photocraft-color"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"photocraft-cms",
"serde",
@@ -3537,7 +3537,7 @@ dependencies = [
[[package]]
name = "photocraft-compose"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"criterion",
"photocraft-color",
@@ -3552,7 +3552,7 @@ dependencies = [
[[package]]
name = "photocraft-doc"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3563,7 +3563,7 @@ dependencies = [
[[package]]
name = "photocraft-engine"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"blake3",
"flate2",
@@ -3593,7 +3593,7 @@ dependencies = [
[[package]]
name = "photocraft-format"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"blake3",
"flate2",
@@ -3611,14 +3611,14 @@ dependencies = [
[[package]]
name = "photocraft-geom"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"serde",
]
[[package]]
name = "photocraft-gpu"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"half",
"log",
@@ -3635,14 +3635,14 @@ dependencies = [
[[package]]
name = "photocraft-heif"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"heic-rs",
]
[[package]]
name = "photocraft-io"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"blake3",
"photocraft-algo",
@@ -3666,14 +3666,14 @@ dependencies = [
[[package]]
name = "photocraft-ops"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"photocraft-doc",
]
[[package]]
name = "photocraft-paint"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3684,7 +3684,7 @@ dependencies = [
[[package]]
name = "photocraft-plugins"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3699,7 +3699,7 @@ dependencies = [
[[package]]
name = "photocraft-psd"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"flate2",
"photocraft-psd",
@@ -3710,7 +3710,7 @@ dependencies = [
[[package]]
name = "photocraft-raster"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3720,7 +3720,7 @@ dependencies = [
[[package]]
name = "photocraft-raw"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"photocraft-raw",
"png 0.18.1",
@@ -3729,7 +3729,7 @@ dependencies = [
[[package]]
name = "photocraft-tablet"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"block2 0.6.2",
"objc2 0.6.4",
@@ -3741,7 +3741,7 @@ dependencies = [
[[package]]
name = "photocraft-testkit"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"memory-stats",
"photocraft-color",
@@ -3752,7 +3752,7 @@ dependencies = [
[[package]]
name = "photocraft-text"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"flate2",
"parley",
@@ -3766,7 +3766,7 @@ dependencies = [
[[package]]
name = "photocraft-ui-egui"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"base64",
"eframe",
@@ -3800,7 +3800,7 @@ dependencies = [
[[package]]
name = "photocraft-vector"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"photocraft-color",
"photocraft-doc",
@@ -3811,7 +3811,7 @@ dependencies = [
[[package]]
name = "photocraft-web"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"eframe",
"egui",
@@ -6377,7 +6377,7 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"
[[package]]
name = "xtask"
-version = "0.3.0"
+version = "0.4.0"
dependencies = [
"serde",
"serde_json",
diff --git a/Cargo.toml b/Cargo.toml
index 6b88cf5811..1b4b35de18 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,7 @@ members = ["crates/*", "apps/*", "xtask"]
default-members = ["crates/*", "apps/photocraft", "apps/photocraft-cli", "xtask"]
[workspace.package]
-version = "0.3.0"
+version = "0.4.0"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"
From c9a7d26f6a063de4c1bbd346b860d791fd3467af Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 08:48:03 -0400
Subject: [PATCH 13/18] Web build: ICU complex-script dictionaries native-only;
bump version to 0.4.1
The v0.4.0 release failed its web job: the wasm was 26,365,303 bytes, over the
24 MiB gate in packaging/web/package.sh and Cloudflare's 25 MiB per-file cap.
The largest single item was ICU4X's CJK segmentation dictionary (3.8 MB),
pulled in by parley's complex-scripts feature. Enable that feature on native
targets only; the web build falls back to the generic Unicode rules for
Japanese word boundaries and Thai/Lao/Khmer/Burmese line breaking.
wasm: 26,368,656 -> 22,578,266 bytes (21.5 MiB), measured with trunk build --release.
Co-Authored-By: Claude Opus 5.5
---
Cargo.lock | 56 +++++++++++++++++++++---------------------
Cargo.toml | 2 +-
crates/text/Cargo.toml | 10 ++++++--
3 files changed, 37 insertions(+), 31 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 6493c3734e..97e10ed421 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3421,7 +3421,7 @@ dependencies = [
[[package]]
name = "photocraft"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"arboard",
"eframe",
@@ -3454,7 +3454,7 @@ dependencies = [
[[package]]
name = "photocraft-algo"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3466,7 +3466,7 @@ dependencies = [
[[package]]
name = "photocraft-automation"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"base64",
"cap-std",
@@ -3488,7 +3488,7 @@ dependencies = [
[[package]]
name = "photocraft-cli"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"photocraft-automation",
"photocraft-codecs",
@@ -3501,7 +3501,7 @@ dependencies = [
[[package]]
name = "photocraft-cms"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"moxcms",
"rayon",
@@ -3509,7 +3509,7 @@ dependencies = [
[[package]]
name = "photocraft-codecs"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"exr",
"flate2",
@@ -3529,7 +3529,7 @@ dependencies = [
[[package]]
name = "photocraft-color"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"photocraft-cms",
"serde",
@@ -3537,7 +3537,7 @@ dependencies = [
[[package]]
name = "photocraft-compose"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"criterion",
"photocraft-color",
@@ -3552,7 +3552,7 @@ dependencies = [
[[package]]
name = "photocraft-doc"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3563,7 +3563,7 @@ dependencies = [
[[package]]
name = "photocraft-engine"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"blake3",
"flate2",
@@ -3593,7 +3593,7 @@ dependencies = [
[[package]]
name = "photocraft-format"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"blake3",
"flate2",
@@ -3611,14 +3611,14 @@ dependencies = [
[[package]]
name = "photocraft-geom"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"serde",
]
[[package]]
name = "photocraft-gpu"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"half",
"log",
@@ -3635,14 +3635,14 @@ dependencies = [
[[package]]
name = "photocraft-heif"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"heic-rs",
]
[[package]]
name = "photocraft-io"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"blake3",
"photocraft-algo",
@@ -3666,14 +3666,14 @@ dependencies = [
[[package]]
name = "photocraft-ops"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"photocraft-doc",
]
[[package]]
name = "photocraft-paint"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3684,7 +3684,7 @@ dependencies = [
[[package]]
name = "photocraft-plugins"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3699,7 +3699,7 @@ dependencies = [
[[package]]
name = "photocraft-psd"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"flate2",
"photocraft-psd",
@@ -3710,7 +3710,7 @@ dependencies = [
[[package]]
name = "photocraft-raster"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3720,7 +3720,7 @@ dependencies = [
[[package]]
name = "photocraft-raw"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"photocraft-raw",
"png 0.18.1",
@@ -3729,7 +3729,7 @@ dependencies = [
[[package]]
name = "photocraft-tablet"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"block2 0.6.2",
"objc2 0.6.4",
@@ -3741,7 +3741,7 @@ dependencies = [
[[package]]
name = "photocraft-testkit"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"memory-stats",
"photocraft-color",
@@ -3752,7 +3752,7 @@ dependencies = [
[[package]]
name = "photocraft-text"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"flate2",
"parley",
@@ -3766,7 +3766,7 @@ dependencies = [
[[package]]
name = "photocraft-ui-egui"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"base64",
"eframe",
@@ -3800,7 +3800,7 @@ dependencies = [
[[package]]
name = "photocraft-vector"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"photocraft-color",
"photocraft-doc",
@@ -3811,7 +3811,7 @@ dependencies = [
[[package]]
name = "photocraft-web"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"eframe",
"egui",
@@ -6377,7 +6377,7 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"
[[package]]
name = "xtask"
-version = "0.4.0"
+version = "0.4.1"
dependencies = [
"serde",
"serde_json",
diff --git a/Cargo.toml b/Cargo.toml
index 1b4b35de18..bec1461914 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,7 @@ members = ["crates/*", "apps/*", "xtask"]
default-members = ["crates/*", "apps/photocraft", "apps/photocraft-cli", "xtask"]
[workspace.package]
-version = "0.4.0"
+version = "0.4.1"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"
diff --git a/crates/text/Cargo.toml b/crates/text/Cargo.toml
index 84c59b0099..3d0d8ec6dc 100644
--- a/crates/text/Cargo.toml
+++ b/crates/text/Cargo.toml
@@ -17,7 +17,13 @@ photocraft-doc = { workspace = true }
photocraft-psd = { workspace = true }
# No `system` feature: fontique's system backend links fontconfig on Linux. We scan font
# directories ourselves (native) and always register the bundled fonts (native + web).
-# Include ICU dictionary data for Japanese word boundaries and complex-script line breaking.
-parley = { version = "0.11", default-features = false, features = ["std", "complex-scripts"] }
+parley = { version = "0.11", default-features = false, features = ["std"] }
skrifa = "0.44"
flate2 = { workspace = true }
+
+# ICU dictionary data for Japanese word boundaries and complex-script (Thai, Lao, Khmer, Burmese)
+# line breaking. Native only: the CJK dictionary alone is 3.8 MB of wasm, and the web build must
+# stay under Cloudflare's 25 MiB per-file cap (packaging/web/package.sh). The web build falls back
+# to the generic Unicode rules for those scripts.
+[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
+parley = { version = "0.11", default-features = false, features = ["std", "complex-scripts"] }
From b10b37c14bf94e2e293473246b6418edcf27739f Mon Sep 17 00:00:00 2001
From: Brennan Stehling <277419+brennanMKE@users.noreply.github.com>
Date: Thu, 8 Oct 2026 06:22:28 -0700
Subject: [PATCH 14/18] macOS: use the native menu bar instead of the in-window
menus (#887) (#894)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* macOS: use the native menu bar instead of the in-window menus (#887)
On macOS the menus move from the title bar to the menu bar at the top of the
screen, built with muda from the same rows as the in-window bar (menu_items).
Linux, Windows and the web keep the in-window menus, and so does macOS with
--in-window-menus or PHOTOCRAFT_IN_WINDOW_MENUS=1.
The Mac layout (native_menu.rs, platform-free and tested everywhere):
- a PhotoCraft app menu: About (from Help), Settings (Edit › Preferences),
Services, Hide, Hide Others, Show All, and Quit, which is still file.exit so
the unsaved-changes prompt runs;
- a Window menu AppKit knows (Minimize, Zoom, Bring All to Front, the window
list) and a Help menu with the system search field;
- PhotoCraft keeps Photoshop's ⌘H (Extras), ⌘M (Curves), ⌘W (Close) and
⌘, (Hide Layers): Hide and Settings have no shortcut, Minimize is ⌃⌘M.
Key equivalents are handed back to egui as the key presses they were, so
shortcuts run through shortcuts::handle exactly as before: text fields keep
⌘C/⌘V/⌘Z, dialogs and Camera Raw stay modal. A click runs the command like an
in-window click. The menu is updated only when state changes, in place, and
rebuilt only when its structure does.
On every platform:
- menu rows show the shortcut that runs them: 12 live items (Undo, Redo, Cut,
Copy, Paste, Hide Layers, …) showed none;
- Image › Mode, View › Proof Setup, Proof Colors, Gamut Warning and Isolate
Layers stay check items with no document open, so opening one doesn't
change the menu's structure.
Co-Authored-By: Claude Opus 5.5 (1M context)
* Native menu: test it against AppKit; fix the Window/Help menus and ⌘R routing
tests/mac_menu_appkit.rs (harness = false, main thread, like the tablet
crate's monitor test) installs the real muda menu and reads AppKit's menu
bar back: the PhotoCraft app menu, Quit ⌘Q, no Exit in File, the Window and
Help menus registered with NSApp, and Layer › New › Layer… enabled in place
(same NSMenu) once a document opens. It then sends a real ⌘R key-down
through -[NSMenu performKeyEquivalent:], which must reach egui as ⌘R and run
View › Rulers once, and chooses Rulers by click and by ↩ in the open menu,
which must run as clicks.
It found two bugs, fixed here:
- Window and Help were never registered: muda looks the submenus up in the
installed main menu, so set_as_*_menu_for_nsapp must come after
init_for_nsapp. The Window menu didn't list windows.
- AppKit matched ⌘R to Filter › Lens Correction (⇧⌘R), and the menu handed
egui the matched item's shortcut, so ⌘R ran Lens Correction. Key
equivalents now go back with the modifiers actually held.
Also a kittest: the title bar draws no menu titles with the Mac menu bar.
Co-Authored-By: Claude Opus 5.5 (1M context)
* Mac app menu: Language and Appearance, Hide on ⌃⌘H (aligned with VectorCraft)
App settings live in the app menu, as on a Mac and as VectorCraft does:
- Language ▸ after Settings: Auto, then each UI language in its own name,
the interface.language preference checked; choosing one runs prefs.set
(unknown codes are refused).
- Appearance ▸: the themes (now check items, in-window too) and Next Theme
move from Window › Theme to the app menu.
- Hide PhotoCraft takes ⌃⌘H when ⌘H is View › Extras, as Photoshop does
(Minimize already takes ⌃⌘M).
The other Craft apps use the same app menu, Window menu and
--in-window-menus / _IN_WINDOW_MENUS opt-out.
Co-Authored-By: Claude Opus 5.5
---------
Co-authored-by: Claude Opus 5.5 (1M context)
Co-authored-by: bflatastic
---
Cargo.lock | 40 +-
apps/photocraft/Cargo.toml | 12 +
apps/photocraft/src/mac_menu.rs | 359 +++++++++
apps/photocraft/src/main.rs | 15 +-
apps/photocraft/tests/mac_menu_appkit.rs | 171 ++++
crates/ui-egui/src/analysis_ui.rs | 3 +-
crates/ui-egui/src/lib.rs | 9 +
crates/ui-egui/src/menus.rs | 28 +-
crates/ui-egui/src/native_menu.rs | 982 +++++++++++++++++++++++
crates/ui-egui/src/panels.rs | 3 +-
10 files changed, 1614 insertions(+), 8 deletions(-)
create mode 100644 apps/photocraft/src/mac_menu.rs
create mode 100644 apps/photocraft/tests/mac_menu_appkit.rs
create mode 100644 crates/ui-egui/src/native_menu.rs
diff --git a/Cargo.lock b/Cargo.lock
index 97e10ed421..b4c13406c1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1025,6 +1025,15 @@ dependencies = [
"itertools 0.10.5",
]
+[[package]]
+name = "crossbeam-channel"
+version = "0.5.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "98b0cc327b5bc766e7fda9c9260cc0fa81b43a8e240440422dff70788e3f9ef1"
+dependencies = [
+ "crossbeam-utils",
+]
+
[[package]]
name = "crossbeam-deque"
version = "0.8.8"
@@ -2451,6 +2460,16 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "keyboard-types"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d"
+dependencies = [
+ "bitflags 2.13.2",
+ "serde",
+]
+
[[package]]
name = "khronos-egl"
version = "6.0.0"
@@ -2707,6 +2726,24 @@ dependencies = [
"pxfm",
]
+[[package]]
+name = "muda"
+version = "0.21.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a7b000cca0783af26837fe2ebd9ddf1c42279463c085b97622ee1d2f444b89e"
+dependencies = [
+ "crossbeam-channel",
+ "dpi",
+ "keyboard-types",
+ "objc2 0.6.4",
+ "objc2-app-kit 0.3.2",
+ "objc2-core-foundation",
+ "objc2-foundation 0.3.2",
+ "png 0.18.1",
+ "thiserror 2.0.21",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "naga"
version = "30.0.1"
@@ -3263,7 +3300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967"
dependencies = [
"libc",
- "windows-sys 0.52.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -3428,6 +3465,7 @@ dependencies = [
"egui",
"fmv-macos-events",
"log",
+ "muda",
"objc2 0.6.4",
"objc2-app-kit 0.3.2",
"objc2-foundation 0.3.2",
diff --git a/apps/photocraft/Cargo.toml b/apps/photocraft/Cargo.toml
index 219db34a9e..ed0d683d1d 100644
--- a/apps/photocraft/Cargo.toml
+++ b/apps/photocraft/Cargo.toml
@@ -52,6 +52,9 @@ fmv-macos-events = "=0.1.0"
objc2 = "=0.6.4"
objc2-foundation = { version = "=0.3.2", default-features = false, features = ["std", "NSArray", "NSEnumerator", "NSGeometry"] }
objc2-app-kit = { version = "=0.3.2", default-features = false, features = ["std", "NSApplication", "NSApplicationScripting", "NSEvent", "NSResponder", "NSView", "NSWindow"] }
+# The macOS menu bar (mac_menu.rs): Tauri's menu crate, AppKit menus behind a safe API (no GTK
+# with default features off). Pinned exactly: review the diff before bumping.
+muda = { version = "=0.21.1", default-features = false }
# Drop position on X11 (`cursor.rs`): pure-Rust X client, already in Cargo.lock; pinned exactly.
[target.'cfg(target_os = "linux")'.dependencies]
@@ -62,6 +65,15 @@ x11rb = { version = "=0.13.2", default-features = false }
[target.'cfg(target_os = "windows")'.dependencies]
winsafe = { version = "=0.0.29", default-features = false, features = ["user"] }
+# tests/mac_menu_appkit.rs: reads AppKit's menu bar back and sends it real key events.
+[target.'cfg(target_os = "macos")'.dev-dependencies]
+objc2-foundation = { version = "=0.3.2", default-features = false, features = ["std", "NSString"] }
+objc2-app-kit = { version = "=0.3.2", default-features = false, features = ["std", "NSApplication", "NSEvent", "NSGraphicsContext", "NSMenu", "NSMenuItem", "NSResponder"] }
+
+[[test]]
+name = "mac_menu_appkit"
+harness = false
+
[build-dependencies]
# Icon + VERSIONINFO for photocraft.exe; build.rs only uses it when targeting Windows.
winresource = "0.1"
diff --git a/apps/photocraft/src/mac_menu.rs b/apps/photocraft/src/mac_menu.rs
new file mode 100644
index 0000000000..a0f911a117
--- /dev/null
+++ b/apps/photocraft/src/mac_menu.rs
@@ -0,0 +1,359 @@
+//! The macOS menu bar, through muda (Tauri's menu crate: AppKit menus behind a safe API, no GTK on
+//! macOS). The menus themselves, their Mac layout and how their keys reach PhotoCraft are in
+//! `photocraft_ui_egui::native_menu`; this file only builds and updates the `NSMenu`s.
+//!
+//! - Item ids are command ids; a command in two menus (Keyboard Shortcuts is in Edit and Window)
+//! gets `id#2` for its second copy, as muda ids must be unique.
+//! - A structure change (a new Open Recent file, a language switch) rebuilds the menu; anything
+//! else (labels, enabled, checked) is updated in place.
+//! - A chosen item is a click or a key equivalent: AppKit's current event says which. Key
+//! equivalents go back to egui as the key press that was made (the event's modifiers, not the
+//! item's: AppKit may match ⌘R to a ⇧⌘R item), so PhotoCraft's key rules still apply.
+//! - Hide is a custom item calling `NSApplication hide:`, as the predefined one always takes ⌘H.
+
+use std::collections::HashMap;
+use std::sync::mpsc::{Receiver, channel};
+
+use muda::accelerator::{Accelerator, Code, Modifiers};
+use muda::{CheckMenuItem, Menu, MenuEvent, MenuItem, PredefinedMenuItem, Submenu};
+use objc2::MainThreadMarker;
+use objc2_app_kit::{NSApplication, NSEventModifierFlags, NSEventType};
+use photocraft_ui_egui::native_menu::{self, Backend, Chord, Event, MenuBar, MenuRole, Node, Standard};
+
+enum Handle {
+ Plain(MenuItem),
+ Check(CheckMenuItem),
+}
+
+/// One native item.
+struct Entry {
+ handle: Handle,
+ /// The command id (several entries can share one).
+ command: String,
+ chord: Option,
+ label: String,
+ enabled: bool,
+}
+
+/// How an item was chosen, read from AppKit's current event while it calls the handler.
+struct Chosen {
+ id: String,
+ /// A key press (not a mouse click), and the modifiers held: ⌘, ⌃, ⌥, ⇧.
+ key: bool,
+ mods: [bool; 4],
+}
+
+pub struct MacMenu {
+ menu: Option
@@ -312,6 +313,50 @@ PhotoCraft is tested against real files: our own Photoshop-authored oracle PSDs
sha256-verified. Fetch them with `cargo xtask corpus --all` and run the tests with
`cargo xtask test-corpus` (details in [docs/development.md](docs/development.md#test-corpora)).
+## Downloads
+
+Every [release](https://github.com/storytold/photocraft/releases/latest) ships these builds. `` is the
+version number; `SHA256SUMS.txt` lists a checksum for every file.
+
+### macOS
+
+| Build | File | Notes |
+|---|---|---|
+| App, universal (Apple silicon + Intel) | `photocraft--macos-universal.dmg` | Signed and notarized |
+| Command-line tool, universal | `photocraft-cli--macos-universal.zip` | Signed and notarized |
+
+### Windows
+
+| Build | Installer | Portable |
+|---|---|---|
+| x64 (64-bit Intel/AMD) | `photocraft--windows-x64.msi` | `photocraft--windows-x64-portable.zip` |
+| arm64 (Snapdragon and other ARM PCs) | `photocraft--windows-arm64.msi` | `photocraft--windows-arm64-portable.zip` |
+| x86 (32-bit) | `photocraft--windows-x86.msi` | `photocraft--windows-x86-portable.zip` |
+
+Installers and executables are code-signed.
+
+### Linux
+
+| Format | x86_64 | aarch64 (ARM64) | Notes |
+|---|---|---|---|
+| AppImage | `photocraft--linux-x86_64.AppImage` | `photocraft--linux-aarch64.AppImage` | Runs anywhere; updates itself with [AppImageUpdate](https://github.com/AppImageCommunity/AppImageUpdate) (`.zsync` files) |
+| Flatpak | `photocraft--linux-x86_64.flatpak` | `photocraft--linux-aarch64.flatpak` | Sandboxed; `flatpak install --user ` |
+| Debian/Ubuntu | `photocraft--linux-x86_64.deb` | `photocraft--linux-aarch64.deb` | |
+| Fedora/RHEL/openSUSE | `photocraft--linux-x86_64.rpm` | `photocraft--linux-aarch64.rpm` | |
+| Tarball | `photocraft--linux-x86_64.tar.gz` | `photocraft--linux-aarch64.tar.gz` | Unpack anywhere |
+
+### FreeBSD
+
+| Build | File |
+|---|---|
+| x86_64 | `photocraft--freebsd-x86_64.tar.gz` |
+
+### Web (WebAssembly)
+
+| Build | File | Notes |
+|---|---|---|
+| Static site | `photocraft-web-.zip` | Runs in a modern browser; host it on any static server |
+
## The Crafting Apps
PhotoCraft is one of the **Crafting Apps**: free, open-source creative tools from the
From 35f7e99965fda4aa82b37f9682dcd10ff84a8b5a Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 09:50:10 -0400
Subject: [PATCH 16/18] README Downloads: where to get it first, then builds
with Windows before macOS (#1219)
Co-authored-by: Brandon Thomas
Co-authored-by: Claude Opus 5.5
---
README.md | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 34f898454f..3bfd30e8c7 100644
--- a/README.md
+++ b/README.md
@@ -315,15 +315,9 @@ sha256-verified. Fetch them with `cargo xtask corpus --all` and run the tests wi
## Downloads
-Every [release](https://github.com/storytold/photocraft/releases/latest) ships these builds. `` is the
-version number; `SHA256SUMS.txt` lists a checksum for every file.
+**New to PhotoCraft?** Download it from the [PhotoCraft page on getartcraft.com](https://getartcraft.com/apps/photocraft). That's the easiest way to install it.
-### macOS
-
-| Build | File | Notes |
-|---|---|---|
-| App, universal (Apple silicon + Intel) | `photocraft--macos-universal.dmg` | Signed and notarized |
-| Command-line tool, universal | `photocraft-cli--macos-universal.zip` | Signed and notarized |
+**Want a specific build or format?** On GitHub, the [latest release](https://github.com/storytold/photocraft/releases/latest) has every build listed below, and [all releases](https://github.com/storytold/photocraft/releases) has earlier versions and their notes. `` in the file names is the version number, and `SHA256SUMS.txt` lists a checksum for every file.
### Windows
@@ -335,6 +329,13 @@ version number; `SHA256SUMS.txt` lists a checksum for every file.
Installers and executables are code-signed.
+### macOS
+
+| Build | File | Notes |
+|---|---|---|
+| App, universal (Apple silicon + Intel) | `photocraft--macos-universal.dmg` | Signed and notarized |
+| Command-line tool, universal | `photocraft-cli--macos-universal.zip` | Signed and notarized |
+
### Linux
| Format | x86_64 | aarch64 (ARM64) | Notes |
From bce7e54a639eb043abf344293e5d20e36238a3a2 Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 09:52:09 -0400
Subject: [PATCH 17/18] Release workflow: only signing and draft-release jobs
use the release environment (#1220)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
version, linux and web read no secrets. With environment: release they were refused on a branch,
so a branch dispatch of release.yml built nothing. Now a dry run builds every unsigned platform;
the signed jobs are still refused and the draft-release job needs them, so a branch can't create
a release. Matches craftrules release/playbook.md §2.
Co-authored-by: Brandon Thomas
Co-authored-by: Claude Opus 5.5
---
.github/workflows/release.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 67c282afdc..f2479745cf 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -39,7 +39,7 @@ jobs:
version:
name: version
runs-on: ubuntu-latest
- environment: release
+ # No `environment: release`: this job reads no secrets, so a branch dry run can run it.
outputs:
version: ${{ steps.v.outputs.version }}
date: ${{ steps.v.outputs.date }}
@@ -186,7 +186,7 @@ jobs:
# The oldest GitHub-hosted image, so the binaries only need glibc >= 2.35 (Ubuntu 22.04+,
# Debian 12+, Fedora 36+, RHEL 10). See docs/releasing.md.
runs-on: ${{ matrix.runner }}
- environment: release
+ # No `environment: release`: this job reads no secrets, so a branch dry run can run it.
strategy:
fail-fast: false
matrix:
@@ -339,7 +339,7 @@ jobs:
name: Web (wasm)
needs: version
runs-on: ubuntu-latest
- environment: release
+ # No `environment: release`: this job reads no secrets, so a branch dry run can run it.
env:
PHOTOCRAFT_VERSION: ${{ needs.version.outputs.version }}
PHOTOCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }}
From e5e3e397523b4db6a016dd19526e4c68514fcc72 Mon Sep 17 00:00:00 2001
From: Brandon Thomas
Date: Thu, 8 Oct 2026 10:01:32 -0400
Subject: [PATCH 18/18] Bump version to 0.5.0 (from 0.4.1) for release
Co-Authored-By: Claude Opus 5.5
---
Cargo.lock | 56 +++++++++++++++++++++++++++---------------------------
Cargo.toml | 2 +-
2 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index b4c13406c1..00c2e506bb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3458,7 +3458,7 @@ dependencies = [
[[package]]
name = "photocraft"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"arboard",
"eframe",
@@ -3492,7 +3492,7 @@ dependencies = [
[[package]]
name = "photocraft-algo"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3504,7 +3504,7 @@ dependencies = [
[[package]]
name = "photocraft-automation"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"base64",
"cap-std",
@@ -3526,7 +3526,7 @@ dependencies = [
[[package]]
name = "photocraft-cli"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"photocraft-automation",
"photocraft-codecs",
@@ -3539,7 +3539,7 @@ dependencies = [
[[package]]
name = "photocraft-cms"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"moxcms",
"rayon",
@@ -3547,7 +3547,7 @@ dependencies = [
[[package]]
name = "photocraft-codecs"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"exr",
"flate2",
@@ -3567,7 +3567,7 @@ dependencies = [
[[package]]
name = "photocraft-color"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"photocraft-cms",
"serde",
@@ -3575,7 +3575,7 @@ dependencies = [
[[package]]
name = "photocraft-compose"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"criterion",
"photocraft-color",
@@ -3590,7 +3590,7 @@ dependencies = [
[[package]]
name = "photocraft-doc"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3601,7 +3601,7 @@ dependencies = [
[[package]]
name = "photocraft-engine"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"blake3",
"flate2",
@@ -3631,7 +3631,7 @@ dependencies = [
[[package]]
name = "photocraft-format"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"blake3",
"flate2",
@@ -3649,14 +3649,14 @@ dependencies = [
[[package]]
name = "photocraft-geom"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"serde",
]
[[package]]
name = "photocraft-gpu"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"half",
"log",
@@ -3673,14 +3673,14 @@ dependencies = [
[[package]]
name = "photocraft-heif"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"heic-rs",
]
[[package]]
name = "photocraft-io"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"blake3",
"photocraft-algo",
@@ -3704,14 +3704,14 @@ dependencies = [
[[package]]
name = "photocraft-ops"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"photocraft-doc",
]
[[package]]
name = "photocraft-paint"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3722,7 +3722,7 @@ dependencies = [
[[package]]
name = "photocraft-plugins"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3737,7 +3737,7 @@ dependencies = [
[[package]]
name = "photocraft-psd"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"flate2",
"photocraft-psd",
@@ -3748,7 +3748,7 @@ dependencies = [
[[package]]
name = "photocraft-raster"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"photocraft-color",
"photocraft-geom",
@@ -3758,7 +3758,7 @@ dependencies = [
[[package]]
name = "photocraft-raw"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"photocraft-raw",
"png 0.18.1",
@@ -3767,7 +3767,7 @@ dependencies = [
[[package]]
name = "photocraft-tablet"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"block2 0.6.2",
"objc2 0.6.4",
@@ -3779,7 +3779,7 @@ dependencies = [
[[package]]
name = "photocraft-testkit"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"memory-stats",
"photocraft-color",
@@ -3790,7 +3790,7 @@ dependencies = [
[[package]]
name = "photocraft-text"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"flate2",
"parley",
@@ -3804,7 +3804,7 @@ dependencies = [
[[package]]
name = "photocraft-ui-egui"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"base64",
"eframe",
@@ -3838,7 +3838,7 @@ dependencies = [
[[package]]
name = "photocraft-vector"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"photocraft-color",
"photocraft-doc",
@@ -3849,7 +3849,7 @@ dependencies = [
[[package]]
name = "photocraft-web"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"eframe",
"egui",
@@ -6415,7 +6415,7 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"
[[package]]
name = "xtask"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"serde",
"serde_json",
diff --git a/Cargo.toml b/Cargo.toml
index bec1461914..24b00462ac 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,7 @@ members = ["crates/*", "apps/*", "xtask"]
default-members = ["crates/*", "apps/photocraft", "apps/photocraft-cli", "xtask"]
[workspace.package]
-version = "0.4.1"
+version = "0.5.0"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"