fix: the corner handle wins on small furniture, guides exclude the real drag (#400)

(1) Corner and edge handles carry the same hit radius (1.8 % of the
view), so on furniture narrower than 4·hr — a 40 cm cabinet — the two
circles overlap and whichever is painted last takes the tap. Edges were
painted last. Corners are now, because a side handle scales one axis
while a corner scales both, and the object is small exactly when
proportional resize matters most. The visible beads are unchanged.

The audit called this 'proportional resize becomes unavailable'; the
measurement says otherwise and the spec records the correction: the
corner centre lies outside the edge circle, so the corner was reachable
— its area was halved, not lost. A polish, not a bug, and worth fixing
because it is one line of ordering.

(2) Alignment guides in the devices mode excluded the dragged marker by
_drag, which has been null there since #74 moved device dragging into
_deviceDrag. So the marker being moved was among its own candidates.
Nothing looked wrong because a point always matches itself within
tolerance — the guide was drawn from the marker to itself, visually
identical to an honest one, and the smoke asserted only guides() >= 1.
The smoke now compares the candidate lists with and without the drag and
demands exactly one removed entry.

(3) The 38 settings-help strings stay in the initial chunk, and that is
now a recorded decision rather than an oversight: measured 2 654 B gzip,
0.9 % of the ceiling, against splitting a synchronous dictionary in two,
a second request on first hint, and a second source for the key type
derived from en.json (#391). docs/ARCHITECTURE.md says so, with the
number that would justify revisiting it.

Both mutants run by hand: reverting the paint order reddens the 40 cm
probe while the 160 cm one stays green; restoring _drag reddens the
guides smoke.

User-Visible: yes
Issue: #400
This commit is contained in:
Codex
2026-08-31 07:56:27 +03:00
parent 532743b01c
commit fe3b85c06b
8 changed files with 160 additions and 6 deletions
+24
View File
@@ -746,6 +746,30 @@ const MUTANT_DEFINITIONS = [
replace: " this._persistDecorStyle();\n }, 0);",
}],
},
{
id: 'furniture-edge-handles-steal-the-corner',
guard: 'node demo/smoke_furniture_polish.mjs',
because: 'both handles share one hit radius, so on furniture narrower than '
+ '4·hr whichever is painted last takes the corner — and the corner is '
+ 'the one that cannot be reached any other way (#400 AC1)',
patches: [{
file: 'src/houseplan-card.ts',
find: ' ${/* #400: corners LAST.',
replace: ' ${/* mutant: corners no longer last.',
}],
},
{
id: 'align-guides-exclude-dead-source',
guard: 'node demo/smoke_align_guides.mjs',
because: 'device dragging lives in _deviceDrag since #74; excluding by '
+ '_drag excludes nothing, and a guide drawn from a marker to itself '
+ 'looks exactly like an honest one (#400 AC4/AC5)',
patches: [{
file: 'src/houseplan-editor-runtime.ts',
find: ' const draggedId = this.host._deviceDrag?.id ?? this.host._drag?.id;',
replace: ' const draggedId = this.host._drag?.id;',
}],
},
{
id: 'workflow-scan-hardcodes-the-list',
guard: 'node --test test/validate-workflow.test.mjs',