Design: double-click a sketch stroke to edit it — the gesture belongs on the geometry

Selecting a committed sketch line lit the right tree row and then told the user
to go and press Edit in the panel. That is the side-panel dependency this tab
exists to remove, and it made "selectable" true while "editable from the
geometry" stayed false.

on_edit_feature already does the whole job — re-open the entities in the sketch
UI with handles and live quotes — and was only ever reachable from a tree row.
A double-click on a committed stroke now calls it for that feature. Double-click
on empty space still fits the view, so nothing is taken away.

The stroke hit test is now one hit_display_sketch() shared by the click and the
double-click. Two copies of "what is under the pointer" drift, and a double-click
acting on a different entity than the click before it is a miserable thing to
chase. It also reports the entity index, which the tracer prints, so a pick that
lands on the wrong stroke can be seen rather than inferred.

Verified on :11 end to end: draw an open line, commit, double-click it. The
tracer prints "double-click -> edit sketch feature 0 (entity 0)", the panel
reads "Editing sketch — drag a handle or click a quote to edit", and a click
inside the session selects the line with endpoint handles, live quotes and
"1 selected — Delete removes them".

NOT delivered by this commit, found while verifying it: typing a new value into
a length quote is accepted and displayed but the geometry does not move and the
solver drops to "Conflicting constraints". Filed separately — it lives in the
constraint layer, not in selection, and nothing here touches it.

Refs snaporca-e1p.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LyRwbuq6fjn3VV9U9UvhBM
This commit is contained in:
Tommaso Bianchi
2026-07-31 21:10:08 +02:00
co-authored by Claude Opus 5
parent c5404507c7
commit a1fdb9f217
5 changed files with 84 additions and 28 deletions
+5
View File
@@ -494,6 +494,11 @@ void DesignCanvas::set_on_display_sketch_selected(std::function<void(int, int)>
m_sketch_tool.on_display_sketch_selected = std::move(cb);
}
void DesignCanvas::set_on_display_sketch_activated(std::function<void(int)> cb)
{
m_sketch_tool.on_display_sketch_activated = std::move(cb);
}
std::vector<SketchEntity> DesignCanvas::selected_loop_entities() const
{
return m_sketch_tool.selected_loop_entities();