Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Zoom tool menu: Zoom In and Zoom Out last, as in Photoshop (#6005)

wstocke51f48d0e8c7
diff --git a/crates/ui-egui/src/canvas_tool_menu.rs b/crates/ui-egui/src/canvas_tool_menu.rs
index 43418d5ff..6f555af96 100644
--- a/crates/ui-egui/src/canvas_tool_menu.rs
+++ b/crates/ui-egui/src/canvas_tool_menu.rs
@@ -210,18 +210,17 @@ pub fn cycle_canvas_color(app: &mut PhotocraftApp, backward: bool) -> Result<(),
app.run("prefs.set", json!({"values": {"interface.canvasColor": name}})).map(|_| ())
}
-/// The Zoom and Hand tools' context menu: the zoom steps and fixed zooms of the View menu, plus
-/// the Hand tool's Fill Screen.
+/// The Zoom and Hand tools' context menu: the fixed zooms of the View menu (plus the Hand tool's
+/// Fill Screen), then the zoom steps last, in Photoshop's order (#6005).
pub const VIEW_MENU: &[Row] = &[
- Some(("Zoom In", "view.zoomIn")),
- Some(("Zoom Out", "view.zoomOut")),
- None,
Some(("Fit on Screen", "view.fitOnScreen")),
Some(("Fill Screen", FILL_SCREEN)),
- None,
Some(("100%", "view.actualPixels")),
Some(("200%", "view.twoHundredPercent")),
Some(("Print Size", "view.printSize")),
+ None,
+ Some(("Zoom In", "view.zoomIn")),
+ Some(("Zoom Out", "view.zoomOut")),
];
/// The view menu's Fill Screen row. Photoshop has no View menu command for it, so the menu sets
@@ -1483,11 +1482,13 @@ mod tests {
assert_eq!(app.session.journal.len(), before);
}
+ /// Photoshop's Zoom tool menu is Fit on Screen, 100%, 200%, Print Size, then Zoom In and Zoom
+ /// Out after a separator (#6005); Fill Screen (the Hand tool's) keeps its place by Fit on Screen.
#[test]
fn view_menu_follows_photoshop_order() {
assert_eq!(
labels(VIEW_MENU),
- vec![Some("Zoom In"), Some("Zoom Out"), None, Some("Fit on Screen"), Some("Fill Screen"), None, Some("100%"), Some("200%"), Some("Print Size")]
+ vec![Some("Fit on Screen"), Some("Fill Screen"), Some("100%"), Some("200%"), Some("Print Size"), None, Some("Zoom In"), Some("Zoom Out")]
);
// Every row but Fill Screen (the Hand tool's options-bar button) is a View menu command.
let app = app();
diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs
index 581925f83..5d9146767 100644
--- a/crates/ui-egui/src/control.rs
+++ b/crates/ui-egui/src/control.rs
@@ -1863,7 +1863,7 @@ mod tests {
let ids: Vec<_> = entries.iter().filter_map(|row| row.get("id").and_then(Value::as_str)).collect();
assert_eq!(
ids,
- ["view.zoomIn", "view.zoomOut", "view.fitOnScreen", "view.fillScreen", "view.actualPixels", "view.twoHundredPercent", "view.printSize"]
+ ["view.fitOnScreen", "view.fillScreen", "view.actualPixels", "view.twoHundredPercent", "view.printSize", "view.zoomIn", "view.zoomOut"]
);
assert_eq!(call(&mut app, &ctx, "ui.context.choose", json!({"id":"select.all"}))["ok"], false);
assert_eq!(call(&mut app, &ctx, "ui.context.choose", json!({"id":"view.twoHundredPercent"}))["ok"], true);
diff --git a/docs/context-menu-parity.md b/docs/context-menu-parity.md
index 53b6d99bd..76066f346 100644
--- a/docs/context-menu-parity.md
+++ b/docs/context-menu-parity.md
@@ -1,6 +1,6 @@
# Context-menu parity contract
-> **Last reviewed:** 2026-10-18 · **Last updated:** 2026-10-18 · **Change:** minor (Type tool menu over committed type, #7324) · **Target:** Adobe Photoshop 2026
+> **Last reviewed:** 2026-10-20 · **Last updated:** 2026-10-20 · **Change:** trivial (Zoom tool menu order, #6005) · **Target:** Adobe Photoshop 2026
Status: implementation contract, updated 2026-10-09. Scope: canvas, document tabs, and panels. “Right-click” means a secondary pointer click; macOS Control-click should also open the same menu where the platform sends a context-menu gesture. Photoshop changes a context menu with the active tool, selection, and panel item. Adobe documents that principle but does not publish a complete current menu catalog. **Documented** means an Adobe source explicitly names the gesture or action. **Inferred** means a PhotoCraft design target or an item known from a main menu whose presence in a Photoshop context menu still needs a current-product capture. Do not present inferred rows as exact Photoshop menus. [Adobe: panels and menus](https://helpx.adobe.com/photoshop/using/panels-menus.html), [Adobe: shortcuts and context menus](https://helpx.adobe.com/sa_en/photoshop/using/customizing-keyboard-shortcuts.html).
@@ -28,7 +28,7 @@ The “PhotoCraft at branch point” column records behavior before this PR. Pic
| Brush, Pencil, Eraser, Background Eraser, Spot Healing, Healing, Clone Stamp, History Brush, Blur, Sharpen, Smudge, Dodge, Burn, Sponge | Brush preset, size and hardness where applicable | Picker | P0; [Adobe Brush Settings](https://helpx.adobe.com/photoshop/desktop/apply-painting-techniques/brushes-presets/create-brush-set-painting-options.html). Alt+secondary-drag on Windows and Control+Option-drag on macOS adjust size/hardness ([Adobe cursor shortcuts](https://helpx.adobe.com/in/photoshop/desktop/get-started/settings-and-preferences/change-tool-pointers.html)) |
| Gradient, Paint Bucket | Gradient preset/type/mode or fill source/tolerance **(inferred context placement)** | No tool menu | P1 |
| Type | In text: cut/copy/paste, spelling suggestions, text formatting; outside text: type-layer action **(inferred context placement)** | While editing text (canvas_tool_menu.rs `TYPE_EDIT_MENU`): Undo, Cut, Copy, Paste, Select All (on the text), Check Spelling…, Find and Replace Text…, Faux Bold/Italic (checked), Rasterize Type, Create Work Path, Convert to Shape, Horizontal/Vertical and the anti-alias modes (checked), Convert to Paragraph/Point Text, Warp Text…; Esc closes only the menu. Over a misspelled word the menu starts with up to 3 spelling suggestions (replace the word) and Add to Dictionary (#4370). Over committed type (no edit running, `TYPE_LAYER_MENU`, #7324): the same rows without Undo, Cut, Copy, Paste, Select All and Faux Bold/Italic; the clicked type becomes the active layer first (a layer multiselection stays). The Type Mask tools get no menu. Ignore / Ignore All remain open | P1; editing and nonediting states are separate; [Adobe type editing](https://helpx.adobe.com/photoshop/desktop/text-typography/get-started-with-text/edit-text.html) |
-| Hand, Zoom | Fit on Screen, 100%, 200%, Print Size; zoom step choices **(inferred context placement)** | View menu (#3242): Zoom In, Zoom Out, Fit on Screen, Fill Screen, 100%, 200%, Print Size. Zoom In/Out step about the right-clicked point (Preferences › Tools › Zoom Clicked Point to Center centres it). Outside the image the pasteboard menu still wins. | P1; view actions stay out of document history; row order still needs a dated Photoshop capture |
+| Hand, Zoom | Fit on Screen, 100%, 200%, Print Size; zoom step choices **(inferred context placement)** | View menu (#3242, #6005): Fit on Screen, Fill Screen, 100%, 200%, Print Size, then Zoom In and Zoom Out after a separator. Zoom In/Out step about the right-clicked point (Preferences › Tools › Zoom Clicked Point to Center centres it). Outside the image the pasteboard menu still wins. | P1; view actions stay out of document history; row order still needs a dated Photoshop capture |
| Pen, Path Selection | Path/point actions, Make Selection, Fill/Stroke Path, Free Transform Path **(inferred context placement)** | Pen canvas right-click follows the user-provided 20-row Photoshop capture below. Paths rows offer Make Selection, Fill and Stroke. The Path Selection and Direct Selection tools open the same path menu for the selected path (#1056, 2026-10-15); node- and segment-specific rows remain open. | P1; distinguish node, segment, path, and blank canvas |
| Rectangle, Ellipse Shape, Triangle, Polygon, Line, Custom Shape | Shape/path operations, fill/stroke settings, transform **(inferred context placement)** | No tool menu | P2 |
| Slice, Slice Select | Slice properties, duplicate/delete, divide, guides **(inferred context placement)** | No tool menu | P2 |
@@ -100,6 +100,7 @@ Each slice needs pure model tests (including every item dispatching a known comm
| Date | Change | Summary |
|---|---|---|
+| 2026-10-20 | trivial | Zoom tool menu order (#6005) |
| 2026-10-18 | minor | Type tool menu over committed type (#7324) |
| 2026-10-13 | minor | Layer-mask thumbnail menu (#4575) |
| 2026-10-10 | trivial | Status line, revision history |