feat(blocks): implement Block Definition dialog (BLOCK/BMAKE) with on-screen sequencing

Implement the complete Block Definition dialog window launched via BLOCK
and BMAKE commands, featuring standard CAD layout, workflows, and entity
creation pipelines.

- Dialog UI & Layout:
  - 2-column compact CAD grid with synchronized vertical heights (580 × 390px).
  - Editable combobox with existing block names, invalid character validation,
    and inline redefinition badge.
  - Multi-line text editor widget for block descriptions (replacing single-line input).
  - Quick Select (QSELECT) button integration restoring dialog state upon completion.
  - Confirmation guard when attempting to redefine an existing block definition.
  - Centered radio buttons, clean coordinate inputs, and accessible keyboard shortcuts.

- Base Point & On-Screen Workflow:
  - BlockOnScreenCommand strictly enforces prompt sequencing: Base point is
    prompted before object selection.
  - Dynamically recalculates world_to_block and block_to_world affine transforms
    when base point is specified on-screen, preventing stale (0,0,0) normalization.
  - Supports Retain, Convert to block (INSERT placement), and Delete modes.

- Explode Enforcement:
  - Guarded EXPLODE command to prevent decomposing blocks flagged as non-explodable.

- Dynamic Themed Icons:
  - Added pick_point.svg, select_objects.svg, quick_select.svg, and warning_triangle.svg.
  - Routed all icons through the semantic theming engine so line work (#B4B6B9)
    and accents (#6DB7ED) adapt automatically to the active theme.

- Tests:
  - Added unit tests for retain/convert/delete modes, redefinition, explodable flag,
    on-screen base point transform recalculation, and command sequencing.
This commit is contained in:
Karim Jerbi committed 2026-09-22 17:05:15 +01:00
1 parent 889a19c362
commit 652f4d6bbc
19 files changed
+2316 -318

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-label="Pick point">
<line x1="7" y1="2" x2="7" y2="12" stroke="#6DB7ED" stroke-width="1.75" stroke-linecap="round"/>
<line x1="2" y1="7" x2="12" y2="7" stroke="#6DB7ED" stroke-width="1.75" stroke-linecap="round"/>
<circle cx="7" cy="7" r="2" fill="#6DB7ED" stroke="none"/>
<path d="M 8.5 8.5 L 8.5 20.5 L 12.2 16.8 L 15.5 21.5 L 18 20 L 14.8 15.2 L 20.5 15.2 Z" fill="#1A1A1A" stroke="#B4B6B9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 553 B

+8
View File
@@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-label="Quick Select">
<rect x="12" y="7" width="9.5" height="13.5" rx="1.5" stroke="#B4B6B9" stroke-width="1.5" fill="none"/>
<line x1="14.5" y1="10.5" x2="19" y2="10.5" stroke="#B4B6B9" stroke-width="1.2" stroke-linecap="round"/>
<line x1="14.5" y1="13.5" x2="19" y2="13.5" stroke="#B4B6B9" stroke-width="1.2" stroke-linecap="round"/>
<line x1="14.5" y1="16.5" x2="17.5" y2="16.5" stroke="#B4B6B9" stroke-width="1.2" stroke-linecap="round"/>
<polygon points="10.5,2 5.5,9.5 9.5,9.5 8.5,15.5 14.5,8 10.5,8" fill="#6DB7ED" stroke="#1A1A1A" stroke-width="0.8" stroke-linejoin="round"/>
<path d="M 2.5 7 L 2.5 17.5 L 5.5 14.5 L 8 18.5 L 10 17.5 L 7.5 13.5 L 11 13.5 Z" fill="#1A1A1A" stroke="#B4B6B9" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 861 B

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-label="Select objects">
<rect x="3" y="3" width="12" height="12" rx="1.5" stroke="#6DB7ED" stroke-width="1.6" stroke-dasharray="2.5 2" fill="#6DB7ED" fill-opacity="0.15"/>
<path d="M 9.5 9.5 L 9.5 21 L 13 17.5 L 16 22 L 18.5 20.5 L 15.5 16 L 21 16 Z" fill="#1A1A1A" stroke="#B4B6B9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 438 B

+5
View File
@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path d="M12 2.5 L22.5 20.5 H1.5 Z" fill="#F0C040" stroke="#F9A825" stroke-width="1.5" stroke-linejoin="round"/>
<line x1="12" y1="8.5" x2="12" y2="14" stroke="#1A1A1A" stroke-width="2.2" stroke-linecap="round"/>
<circle cx="12" cy="17.5" r="1.2" fill="#1A1A1A"/>
</svg>

After

Width:  |  Height:  |  Size: 350 B