Design: every sketch tool has an address in the offer, not just its family

Mirror of snaporca 0c83f59f13 (DesignPanel.cpp applied as a patch, not copied, so this
fork's 30 permitted divergent lines survive; parity re-checked at 30/16 with the shared
files byte-identical).

The sketch dropdown never registered "fly:<family>#<row>" addresses the way
feat_dropdown does for model verbs, so the offer could name a family but only ever arm
its first tool — Rectangle always gave a corner rectangle. Adds the registration, 14
atlas verbs (including the entire array family, which was absent, and rotate/scale), an
action for the sk_move row that previously did nothing when picked, and a second submenu
level so variants nest under their family instead of flattening 19 create tools.

Built green and verified on the rig: Oblique rectangle arms oblique, not corner.

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-08-01 08:20:47 +02:00
co-authored by Claude Opus 5
parent fd1bc092d8
commit d1d61ce997
4 changed files with 424 additions and 74 deletions
+8 -2
View File
@@ -87,6 +87,11 @@ def main():
" int need_sketches;",
" bool need_sheet;",
" bool sketch_mode; // belongs to the sketch-mode vocabulary, not the model one",
" // Second level INSIDE a row, for tools that come in variants: \"Rectangle\" holds corner,",
" // centre, oblique and rounded. nullptr = sits directly in the row. Keeps the row's own",
" // address fixed (L4.1) while the variants hang one level below it, mirroring the toolbar's",
" // grouping instead of flattening 19 create tools into one wall.",
" const char* family;",
"};",
"",
"// Row labels, in ratified order.",
@@ -106,12 +111,13 @@ def main():
mask |= 1 << sels.index(a)
n = v.get("needs") or {}
lines.append(
" {%s, %s, %d, %s, %s, %s, 0x%08xu, %d, %d, %s, %s}," % (
" {%s, %s, %d, %s, %s, %s, 0x%08xu, %d, %d, %s, %s, %s}," % (
cstr(v["id"]), cstr(v["name"]), slots.index(v["slot"]),
cstr(v.get("key")), cstr(v.get("action")), cstr(v.get("refusal")),
mask, n.get("bodies", 0), n.get("sketches", 0),
"true" if n.get("sheet") else "false",
"true" if v.get("mode") == "sketch" else "false"))
"true" if v.get("mode") == "sketch" else "false",
cstr(v.get("family"))))
lines += [
"};",
f"static const int kOfferVerbCount = {len(A['verbs'])};",
+305 -10
View File
@@ -954,11 +954,33 @@
"needs": {},
"refusal": null,
"gui": true,
"action": "key:L"
"action": "key:L",
"family": "Line"
},
{
"id": "sk_polyline",
"name": "Polyline",
"slot": "create",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_line#1",
"mode": "sketch",
"family": "Line"
},
{
"id": "sk_rect",
"name": "Rectangle",
"name": "Corner rectangle",
"slot": "create",
"key": "R",
"feature": "Sketch",
@@ -974,11 +996,75 @@
"needs": {},
"refusal": null,
"gui": true,
"action": "key:R"
"action": "key:R",
"family": "Rectangle"
},
{
"id": "sk_rect_center",
"name": "Centre rectangle",
"slot": "create",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_rect#1",
"mode": "sketch",
"family": "Rectangle"
},
{
"id": "sk_rect_oblique",
"name": "Oblique rectangle",
"slot": "create",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_rect#2",
"mode": "sketch",
"family": "Rectangle"
},
{
"id": "sk_rect_rounded",
"name": "Rounded rectangle",
"slot": "create",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_rect#3",
"mode": "sketch",
"family": "Rectangle"
},
{
"id": "sk_circle",
"name": "Circle",
"name": "Centre circle",
"slot": "create",
"key": "C",
"feature": "Sketch",
@@ -994,11 +1080,54 @@
"needs": {},
"refusal": null,
"gui": true,
"action": "key:C"
"action": "key:C",
"family": "Circle"
},
{
"id": "sk_circle_2pt",
"name": "2-point circle",
"slot": "create",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_circle#1",
"mode": "sketch",
"family": "Circle"
},
{
"id": "sk_circle_3pt",
"name": "3-point circle",
"slot": "create",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_circle#2",
"mode": "sketch",
"family": "Circle"
},
{
"id": "sk_arc_t",
"name": "Arc",
"name": "3-point arc",
"slot": "create",
"key": "A",
"feature": "Sketch",
@@ -1014,7 +1143,50 @@
"needs": {},
"refusal": null,
"gui": true,
"action": "key:A"
"action": "key:A",
"family": "Arc"
},
{
"id": "sk_arc_tangent",
"name": "Tangent arc",
"slot": "create",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_arc3pt#1",
"mode": "sketch",
"family": "Arc"
},
{
"id": "sk_arc_center",
"name": "Centre-point arc",
"slot": "create",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_arc3pt#2",
"mode": "sketch",
"family": "Arc"
},
{
"id": "sk_slot",
@@ -1034,7 +1206,29 @@
"needs": {},
"refusal": null,
"gui": true,
"action": "key:S"
"action": "key:S",
"family": "Slot"
},
{
"id": "sk_slot_arc",
"name": "Arc slot",
"slot": "create",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_slot#1",
"mode": "sketch",
"family": "Slot"
},
{
"id": "sk_ellipse",
@@ -1054,7 +1248,29 @@
"needs": {},
"refusal": null,
"gui": true,
"action": "key:E"
"action": "key:E",
"family": "Ellipse"
},
{
"id": "sk_ellipse_arc",
"name": "Elliptical arc",
"slot": "create",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_ellipse#1",
"mode": "sketch",
"family": "Ellipse"
},
{
"id": "sk_spline",
@@ -1186,6 +1402,44 @@
"gui": true,
"action": "key:H"
},
{
"id": "sk_array",
"name": "Linear array",
"slot": "repeat",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_array#0",
"mode": "sketch",
"family": "Array"
},
{
"id": "sk_array_polar",
"name": "Polar array",
"slot": "repeat",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_array#1",
"mode": "sketch",
"family": "Array"
},
{
"id": "sk_mirror",
"name": "Mirror",
@@ -1221,7 +1475,48 @@
"needs": {},
"refusal": null,
"gui": true,
"action": null
"action": "fly:design_move#0",
"family": "Move"
},
{
"id": "sk_rotate",
"name": "Rotate",
"slot": "transform",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_line",
"sk_arc",
"sk_point",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_move#1",
"mode": "sketch",
"family": "Move"
},
{
"id": "sk_scale",
"name": "Scale",
"slot": "transform",
"key": null,
"feature": "Sketch",
"mcp": null,
"accepts": [
"sk_line",
"sk_arc",
"sk_point",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_move#2",
"mode": "sketch",
"family": "Move"
},
{
"id": "sk_dimension",