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
+13 -2
View File
@@ -3125,11 +3125,22 @@ DesignPanel::DesignPanel(wxWindow* parent)
set_tree_selection(feat);
m_status->SetForegroundColour(wxNullColour);
m_status->SetLabel(region >= 0
? _L("Loop selected — Extrude it, or Edit / Delete the sketch")
: _L("Sketch selected — Extrude it, or Edit / Delete from the tree"));
? _L("Loop selected — Extrude it, or double-click to edit")
: _L("Sketch selected — Extrude it, or double-click to edit"));
m_status->Refresh();
});
// Double-click a committed sketch stroke: open THAT sketch for editing, where its entities
// are individually selectable and their quotes editable. on_edit_feature already does the
// whole job — it was only ever reachable from the tree, which is precisely the side-panel
// dependency being retired. The pick has already lit the right tree row by the time the
// double-click arrives, but set it again so the path does not depend on that ordering.
m_viewport->set_on_display_sketch_activated([this](int feat) {
if (feat < 0 || feat >= int(m_doc.features.size())) return;
set_tree_selection(feat);
on_edit_feature();
});
// F key (Prepare's Place on Face): the tool forwards it here when the Design viewport
// has focus; we lay the selected body face on the bed. Returns false when no face is
// selected so the key can fall through to the default handler.