From 4ab773494ea94e2e3c58303743b8f41248cd6f98 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 08:41:27 -0800 Subject: [PATCH] Workspace: the Tools drop strip lights up where Tools docks, and the docs name the exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With no panels docked on the left and a toolbar made with New Toolbar docked there, a drop on the canvas's left edge docks Tools at the window's edge, left of the toolbar's lane. The strip that lit up during the move was the canvas's edge, right of the lane. The window's edge now lights up instead. The window.toolsBesideCanvas params text, docs/control-protocol.md, docs/target-app-parity.md and the UiState doc comment now say that a drop with no panels docked on the left, or in the column both edges share beside panels collapsed to icons, leaves Window › Toolbars › Keep Tools Beside the Canvas as it is. ROADMAP's progress log gets a line for the changed drop rule. The test of a release where the move started now presses on the title bar, moves past the drag threshold so the move starts, and releases within the travel limit over the canvas's edge; it fails without that limit. --- ROADMAP.md | 1 + crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/panel_docking/tests.rs | 21 +++++++++++++++------ crates/ui-egui/src/state.rs | 5 +++-- crates/ui-egui/src/tools_float.rs | 15 ++++++++++++--- docs/control-protocol.md | 4 +++- docs/target-app-parity.md | 2 +- 8 files changed, 37 insertions(+), 15 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 4358817b60..3f266a3dd3 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -128,6 +128,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap - 2026-11-14: Built-in Tech Circuit brush library: Circuit Trace (chamfered art with 45-degree elbows and terminal pads), Bus Lines (parallel conductor pattern) and Terminal Nodes (repeating solder pads, test points and leads), all original geometry generated in code. Ten built-in brush libraries; G5 remaining estimate 3–13 h (estimated), headline numbers unchanged. - 2026-11-05: Window › Toolbars › Keep Tools Beside the Canvas, off by default, docks the Tools panel between left-side panels and the canvas instead of at the window's left edge, and the canvas's left edge then also docks a floating Tools panel (`window.toolsBesideCanvas`, #5395). Workspaces keep the setting; workspaces saved without it keep Tools at the window's edge. An optional VectorCraft layout choice; headline numbers unchanged. +- 2026-11-17: The canvas's left edge docks a floating Tools panel whichever way Keep Tools Beside the Canvas is set: a drop there, right of panels docked on the left, turns the setting on, and a drop on the window's left edge turns it off (#7837). Headline numbers unchanged. - 2026-11-12: Stencil Bridges in the Cutting Tools add-on (Object › Plug-ins › Cutting Tools): strips of a set width are cut out of the selected art so that every island of a stencil cut from it (the inside of an O, a hole in a shape) stays attached to the sheet, by the shortest crossings first, vertical, horizontal or the shortest among 12 directions 15° apart, with up to 16 bridges per island; type is measured by its glyph outlines and stays type, and the original goes to a hidden layer or is replaced. One undo step (`addon.cutting.bridges`). A VectorCraft addition: headline numbers unchanged. - 2026-11-13: Banner Hems and Grommets in the Cutting Tools add-on (Object › Plug-ins › Cutting Tools): on the chosen sides of the selected art's bounds, or of each artboard, a hem line at a set depth inside the edge and grommet marks (a circle with a cross) at a set inset, one at each end of a side and the rest spread evenly at most a set spacing apart, stroked in a chosen swatch; a dialog with Preview, one undo step (`addon.cutting.banner`). A VectorCraft addition: headline numbers unchanged. - 2026-11-14: Nest Shapes in the Cutting Tools add-on (Object › Plug-ins › Cutting Tools): the selected objects move close together onto an artboard, a sheet of a set size or a roll of a set width, packed by their bounding boxes with a margin inside the edges and a spacing between them, optionally turning objects 90° to fit; objects that do not fit go in a column beside the sheet; a dialog with Preview, one undo step (`addon.cutting.nest`). A VectorCraft addition: headline numbers unchanged. diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 3707c3d96b..b53b9690fb 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -506,7 +506,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "window.toolsBesideCanvas", "Keep Tools Beside the Canvas", "", - "{on?: bool} dock the Tools panel between the left-side panels and the canvas (true) or at the window's left edge (false, the default), or toggle (omitted or null; any other value is an error); a floating Tools panel stays floating and docks at the chosen place when it is docked again. Dropping a floating Tools panel on the canvas's left edge turns it on, and on the window's left edge turns it off. Kept with the workspace; a workspace saved without it docks Tools at the window's edge. Returns the new state", + "{on?: bool} dock the Tools panel between the left-side panels and the canvas (true) or at the window's left edge (false, the default), or toggle (omitted or null; any other value is an error); a floating Tools panel stays floating and docks at the chosen place when it is docked again. Dropping a floating Tools panel on the canvas's left edge, right of panels docked on the left, turns it on, and on the window's left edge turns it off; with no panels docked on the left, or in the column both edges share beside panels collapsed to icons, a drop leaves it as it is. Kept with the workspace; a workspace saved without it docks Tools at the window's edge. Returns the new state", ), ( "window.floatTools", diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index a7fc209e5e..c0f5488c9c 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -507,7 +507,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "window.toolsBesideCanvas", "Keep Tools Beside the Canvas", "", - "{on?: bool} dock the Tools panel between the left-side panels and the canvas (true) or at the window's left edge (false, the default), or toggle (omitted or null; any other value is an error); a floating Tools panel stays floating and docks at the chosen place when it is docked again. Dropping a floating Tools panel on the canvas's left edge turns it on, and on the window's left edge turns it off. Kept with the workspace; a workspace saved without it docks Tools at the window's edge. Returns the new state", + "{on?: bool} dock the Tools panel between the left-side panels and the canvas (true) or at the window's left edge (false, the default), or toggle (omitted or null; any other value is an error); a floating Tools panel stays floating and docks at the chosen place when it is docked again. Dropping a floating Tools panel on the canvas's left edge, right of panels docked on the left, turns it on, and on the window's left edge turns it off; with no panels docked on the left, or in the column both edges share beside panels collapsed to icons, a drop leaves it as it is. Kept with the workspace; a workspace saved without it docks Tools at the window's edge. Returns the new state", ), ( "window.floatTools", diff --git a/crates/ui-egui/src/panel_docking/tests.rs b/crates/ui-egui/src/panel_docking/tests.rs index 2c05eb444f..6699d63f90 100644 --- a/crates/ui-egui/src/panel_docking/tests.rs +++ b/crates/ui-egui/src/panel_docking/tests.rs @@ -895,7 +895,10 @@ fn tools_dropped_beside_a_left_toolbar_lane_keep_the_setting() { settle(&mut h); let canvas_edge = h.ctx.data(|d| d.get_temp::(crate::tools_float::tools_zone_id())).expect("the canvas-edge target"); assert!(canvas_edge.left() > 30.0, "right of the toolbar lane: {canvas_edge:?}"); - h.drag(pos2(620.0, 307.0), pos2(canvas_edge.right() - 4.0, canvas_edge.center().y)); + let at = pos2(canvas_edge.right() - 4.0, canvas_edge.center().y); + let lit = crate::tools_float::drop_highlight(&h.ctx, at, beside).expect("a strip lights up"); + assert!(lit.left() < 10.0, "the window's edge, where Tools docks, lights up: {lit:?}"); + h.drag(pos2(620.0, 307.0), at); assert_eq!(h.app.ui.toolbar_pos, None, "set before: {beside}"); assert_eq!(h.app.ui.tools_beside_canvas, beside, "the setting is unchanged"); settle(&mut h); @@ -921,8 +924,8 @@ fn tools_released_as_they_float_from_the_window_edge_keep_floating() { assert!(!h.app.ui.tools_beside_canvas); } -/// A drop on the right edge, or a click on the title bar of Tools floating over the canvas's left -/// edge, leaves the setting as it is. +/// A drop on the right edge leaves the setting as it is, and so does a move of Tools floating over +/// the canvas's left edge that ends within a few points of where it started. #[test] fn tools_docked_on_the_right_or_clicked_leave_the_setting() { for beside in [false, true] { @@ -940,9 +943,15 @@ fn tools_docked_on_the_right_or_clicked_leave_the_setting() { let [x, y] = h.app.ui.toolbar_pos.unwrap(); let title = pos2(x + 12.0, y + 7.0); assert!(canvas_edge.contains(title), "the title bar is over the canvas's edge: {title:?} {canvas_edge:?}"); - h.click(title); - assert!(h.app.ui.toolbar_pos.is_some(), "a click docks nothing, set before: {beside}"); - assert_eq!(h.app.ui.tools_beside_canvas, beside, "a click leaves the setting"); + h.press_and_move(title, title + vec2(30.0, 0.0)); + let moved = h.app.ui.toolbar_pos.map(|[px, _]| px - x); + assert!(moved.is_some_and(|dx| dx > 10.0), "the move started, set before: {beside}: {moved:?}"); + let back = title + vec2(2.0, 0.0); + h.frame(vec![Event::PointerMoved(back)]); + h.frame(vec![button(back, false)]); + settle(&mut h); + assert!(h.app.ui.toolbar_pos.is_some(), "released where it started, Tools docks nowhere, set before: {beside}"); + assert_eq!(h.app.ui.tools_beside_canvas, beside, "the setting is unchanged"); } } diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 37edb59d6d..d95481dc2c 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -542,8 +542,9 @@ pub struct UiState { pub toolbar_pos: Option<[f32; 2]>, /// The docked Tools panel sits between the left-side panels and the canvas instead of at the /// window's left edge (Window › Toolbars › Keep Tools Beside the Canvas, - /// `window.toolsBesideCanvas`). Dropping Tools on the canvas's left edge turns it on, and on the - /// window's left edge turns it off. Off by default, and off in state saved without it. + /// `window.toolsBesideCanvas`). Dropping Tools on the canvas's left edge, right of panels docked + /// on the left, turns it on, and on the window's left edge turns it off; with no panels docked on + /// the left, a drop leaves it as it is. Off by default, and off in state saved without it. #[serde(default)] pub tools_beside_canvas: bool, /// The docked Tools panel stands on the right, between the canvas and the panels, instead of on diff --git a/crates/ui-egui/src/tools_float.rs b/crates/ui-egui/src/tools_float.rs index 2dd62af1cb..1511958ff1 100644 --- a/crates/ui-egui/src/tools_float.rs +++ b/crates/ui-egui/src/tools_float.rs @@ -168,7 +168,8 @@ enum Dock { /// panels docked on the left, both left strips put Tools in the same place, and a drop on either /// docks it where `beside_canvas` puts it; with panels collapsed narrower than the window's strip, /// so does a drop in the column the two strips share. The canvas's strip lights up where both are -/// under `at` and `beside_canvas` is on. Without `canvas_laid_out`, the canvas's strip is skipped. +/// under `at` and `beside_canvas` is on; with no panels docked on the left, the window's strip lights +/// up, where Tools docks. Without `canvas_laid_out`, the canvas's strip is skipped. fn drop_zone(ctx: &egui::Context, at: Pos2, beside_canvas: bool, canvas_laid_out: bool) -> Option<(Rect, Dock)> { let (canvas, window, right, area_left) = ctx.data(|d| { let canvas = d.get_temp::(tools_zone_id()).filter(|_| canvas_laid_out); @@ -177,9 +178,11 @@ fn drop_zone(ctx: &egui::Context, at: Pos2, beside_canvas: bool, canvas_laid_out let panels_left = matches!((canvas, area_left), (Some(c), Some(left)) if c.left() > left + 0.5); let shared = !panels_left || matches!((canvas, window), (Some(c), Some(w)) if c.x_range().contains(at.x) && w.x_range().contains(at.x)); let follow = |beside: bool| Dock::Left((!shared).then_some(beside)); + // With no panels docked on the left, Tools docks at the window's edge either way. + let shown = |hit: Rect| if panels_left { hit } else { window.unwrap_or(hit) }; match (canvas.filter(|r| r.contains(at)), window.filter(|r| r.contains(at))) { - (Some(c), Some(w)) => return Some((if beside_canvas { c } else { w }, follow(beside_canvas))), - (Some(c), None) => return Some((c, follow(true))), + (Some(c), Some(w)) => return Some((shown(if beside_canvas { c } else { w }), follow(beside_canvas))), + (Some(c), None) => return Some((shown(c), follow(true))), (None, Some(w)) => return Some((w, follow(false))), (None, None) => {} } @@ -189,6 +192,12 @@ fn drop_zone(ctx: &egui::Context, at: Pos2, beside_canvas: bool, canvas_laid_out (r.contains(at) || at_edge).then_some((r, Dock::Right)) } +/// The strip that lights up with the pointer at `at` during a move. +#[cfg(test)] +pub(crate) fn drop_highlight(ctx: &egui::Context, at: Pos2, beside_canvas: bool) -> Option { + drop_zone(ctx, at, beside_canvas, true).map(|(zone, _)| zone) +} + fn highlight(ctx: &egui::Context, zone: Rect) { let t = Tokens::get(ctx); let painter = ctx.layer_painter(egui::LayerId::new(egui::Order::Foreground, Id::unique("tools-float-drop"))); diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 3ddc49aeaa..816edba221 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -497,7 +497,9 @@ window. `ui.toolbar_pos` in `ui.inspect` is the Tools panel's corner (null: dock `window.panel.dock` with `panel: "tools"` float it at `x`, `y` or dock it on the window's left edge. With `window.toolsBesideCanvas {on?}` (Window › Toolbars › Keep Tools Beside the Canvas, off by default; `ui.tools_beside_canvas`) the docked Tools panel sits between left-side panels and the canvas, and `window.panel.dock` docks it there. Dropping -a floating Tools panel on the canvas's left edge turns the setting on, and on the window's left edge turns it off. +a floating Tools panel on the canvas's left edge, right of panels docked on the left, turns the setting on, and on the +window's left edge turns it off; with no panels docked on the left, a drop leaves the setting as it is +(`docs/mcp.md` › Tools panel placement). Flatten Transparency: `ui.flattenTransparencyDialog` opens the `flattenTransparency` dialog for the selection (fields `preset`: a preset name, setting it loads that preset's options; the option keys of diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index d735501037..f6623bf63d 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -994,7 +994,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Window › Toolbars › Manage Toolbars… and Manage Toolbars… in the All Tools drawer's menu open a dialog that lists the toolbars made with New Toolbar: a new name typed for the selected toolbar renames it, + copies it with its tools (with none selected, + makes a blank toolbar), and the trash can deletes it. Each change shows under Window › Toolbars and stays in the workspace (; `window.toolbar.manage`, `window.toolbar.rename`, `window.toolbar.duplicate`, `window.toolbar.delete`; `manage_toolbars_renames_duplicates_and_deletes`). - A toolbar made with New Toolbar docks in a lane along the window's left or right edge when its title bar is dropped on that edge, or with Dock to Left and Dock to Right in the title bar's context menu. Toolbars docked at one edge stack from the top, each with its share of the lane's height, and the lane is as wide as its widest toolbar; a lane too short for its stack wraps it into more columns, up to half the window's width, and past that the toolbars show only their title bars, which the mouse wheel scrolls through when even they do not fit. Dragging the title bar out of the lane, or Float Toolbar, floats it again, and Escape during the drag puts it back. Hiding and renaming keep its place, and the workspace keeps it. New toolbars still start floating. The lanes and the stacking are VectorCraft's own rules (#1759; `window.toolbar.dock`, `window.toolbar.float`; `toolbars_dock_and_float_by_their_commands`, `docked_toolbars_stack_in_lanes_along_the_window_edges`, `a_title_bar_dropped_on_an_edge_docks_the_toolbar`). - The status bar shows the errors of the toolbars made with New Toolbar (a missing, empty, too long or taken name, the 64-toolbar limit, a `side` or `order` that `window.toolbar.dock` does not take, and New Toolbar's dialog and Manage Toolbars) in every language that translates every message, with the toolbar's name, the parameter key and the value given kept as they are; the error the command returns stays English (`custom_toolbar_command_errors_are_translated`). - - Window › Toolbars › Keep Tools Beside the Canvas, a VectorCraft layout option that is off by default, docks the Tools panel between left-side panels and the canvas instead of at the window's left edge, and workspaces keep the setting. A floating Tools panel dropped on the canvas's left edge docks there and turns the setting on, and one dropped on the window's left edge docks there and turns it off (#7837). Scores are unchanged (`window.toolsBesideCanvas`; `docked_tools_keep_the_window_edge_unless_kept_beside_the_canvas`, `tools_dropped_on_a_left_edge_dock_there_and_the_setting_follows`, `tools_dropped_where_the_left_edges_overlap_keep_the_setting`, `tools_dropped_beside_a_collapsed_left_dock_follow_the_strip_dropped_on`). + - Window › Toolbars › Keep Tools Beside the Canvas, a VectorCraft layout option that is off by default, docks the Tools panel between left-side panels and the canvas instead of at the window's left edge, and workspaces keep the setting. A floating Tools panel dropped on the canvas's left edge, right of panels docked on the left, docks there and turns the setting on, and one dropped on the window's left edge docks there and turns it off; with no panels docked on the left, a drop leaves the setting as it is (#7837). Scores are unchanged (`window.toolsBesideCanvas`; `docked_tools_keep_the_window_edge_unless_kept_beside_the_canvas`, `tools_dropped_on_a_left_edge_dock_there_and_the_setting_follows`, `tools_dropped_where_the_left_edges_overlap_keep_the_setting`, `tools_dropped_beside_a_collapsed_left_dock_follow_the_strip_dropped_on`). - Hindi (2026-11-06): Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged. [Terminology and limitations](localization-hi.md). - Gujarati (2026-11-14, #6613): `gu` has 4,673 catalog rows, zero/one singular plurals, installed desktop font fallback and support for optional `Gujr` craft-font faces. The original 4,286 rows remain unchanged; all 387 additions are contributor-reviewed and approved, with 11 wording corrections. Status/error messages remain partial; the pinned fonts and web startup list have no Gujarati face, so web selection remains unavailable until one is bundled. Current-head validation is recorded in the PR; scores and estimates unchanged. - Hindi wording (2026-11-13): rows outside the plug-in messages keep their English's meaning, quantities and clauses, and use the catalog's save, swatch, crop, resolution, path and type terms; a test checks those terms and the point unit in every row; native review remains; scores and estimates unchanged.