From f123782f4cb95a6a84bf5d74b3939b6f24c6bb99 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 10 Nov 2026 09:48:23 -0500 Subject: [PATCH] Confirmed and fixed in $H. With the Work Path selected in the Paths panel, \`hit_active\` now searches only the Work Path, as it does for a selected saved path and as Path Selection does. A miss no longer falls through to the active shape. New test \`with_the_work_path_selected_a_click_on_the_active_shape_does_nothing\`: the shape is active and the Work Path selected, and a Delete Anchor Point click on the shape's corner (650,250) leaves it unchanged with no history step. It fails on the previous head, where the corner knot was deleted. Anchor and direct_select tests: 107 passed; clippy \`-D warnings\` and fmt clean. EOF2 cd C:/Users/thetr/.claude-personal-2/jobs/5c930f10/tmp && python cr_reply_resolve.py storytold/photocraft 12815 4525641135 $S/reply-12815-work-path.md 2>&1 | tail -2 Anchor tools: a selected Work Path is the only target too (#12762, #12705) Review item on #12815: with the Work Path selected in the Paths panel, a miss on it fell through to the active shape. Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 drove and wrote (review fix, no brief) --- .../delete_anchor_targeted_path_tests.rs | 13 +++++++++++++ crates/ui-egui/src/tools/direct_select.rs | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tools/anchor_tools/delete_anchor_targeted_path_tests.rs b/crates/ui-egui/src/tools/anchor_tools/delete_anchor_targeted_path_tests.rs index dbe47aeeff..5a48b6756f 100644 --- a/crates/ui-egui/src/tools/anchor_tools/delete_anchor_targeted_path_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/delete_anchor_targeted_path_tests.rs @@ -93,3 +93,16 @@ fn with_a_saved_path_selected_a_click_on_the_active_shape_does_nothing() { assert_eq!(shape_path(&mut app, shape), before); assert_eq!(steps(&app), n); } + +#[test] +fn with_the_work_path_selected_a_click_on_the_active_shape_does_nothing() { + let (mut app, shape) = setup(Tool::DeleteAnchorPoint); + select_layer(&mut app, shape); + let path = json!({"subpaths": [{"closed": true, "knots": [[50, 450], [150, 450], [150, 550], [50, 550]]}]}); + app.run("path.set", json!({"path": path})).unwrap(); + app.ui.selected_path = Some("work".into()); + let (before, n) = (shape_path(&mut app, shape), steps(&app)); + click(&mut app, [650.0, 250.0]); + assert_eq!(shape_path(&mut app, shape), before); + assert_eq!(steps(&app), n); +} diff --git a/crates/ui-egui/src/tools/direct_select.rs b/crates/ui-egui/src/tools/direct_select.rs index 1e834c51cd..0ece93cf6f 100644 --- a/crates/ui-egui/src/tools/direct_select.rs +++ b/crates/ui-egui/src/tools/direct_select.rs @@ -353,11 +353,13 @@ pub(crate) fn hit_target(app: &PhotocraftApp, p: [f64; 2], handles: bool) -> Opt pub(crate) fn hit_active(app: &PhotocraftApp, p: [f64; 2]) -> Option<(PathRef, Path, Hit)> { let tol = 6.0 / f64::from(app.point_zoom().max(0.01)); let st = app.session.active()?; - // A path selected in the Paths panel is the only target; otherwise the Pen draft first (as + // A path selected in the Paths panel (saved or Work Path) is the only target; otherwise the Pen draft first (as // `candidates` builds it), then the active paths. The draft's destination is private to // `vector_ui`, so it is not filtered here. let targets: Vec<(PathRef, Path)> = match crate::vector_ui::selected_saved_path_index(app) { Some((i, path)) => Some((PathRef::Saved(i), path)).filter(|(r, _)| writable(app, r)).into_iter().collect(), + // The Work Path selected in the Paths panel is the only target too, as for Path Selection. + None if app.ui.selected_path.as_deref() == Some("work") => active_paths(app).into_iter().filter(|(r, _)| *r == PathRef::Work).collect(), None => { let pen = app .ui