Canvas: make double-click-to-plant work on desktop #135

Merged
steve merged 3 commits from fix/double-click-focus into main 2026-08-23 07:26:50 +00:00
3 Commits
Author SHA1 Message Date
steveandClaude Fable 5 b5e97d4144 Address #135 review: ref with the refs, primary button only, reset on ground
Build image / build-and-push (push) Successful in 12s
lastPress sits with the component's other refs and its thresholds at module
scope with the other tuning constants; only a primary-button (or finger)
press counts, like a native dblclick; a press on empty ground clears the
pending half, so bed → ground → bed within 400 ms is not a double-click.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-23 03:25:54 -04:00
steveandClaude Fable 5 a19fc2e7fc CLAUDE.md: the pointer-capture / dblclick gotcha
Build image / build-and-push (push) Successful in 9s
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-23 03:13:35 -04:00
steveandClaude Fable 5 916b2989f5 Canvas: make double-click-to-plant work on desktop
Build image / build-and-push (push) Successful in 19s
Gadfly review (reusable) / review (pull_request) Successful in 8m43s
Adversarial Review (Gadfly) / review (pull_request) Successful in 8m43s
"Double-click a bed to plant it" has done nothing since the Organic rebuild:
track() captures the pointer on the SVG root, and pointer capture retargets
the compatibility click/dblclick events to the root, so the onDoubleClick
handler on each object's <g> never fired. A double-click only selected.

The double press is now detected in objDown itself — two presses on the
same object within 400 ms and 12 px — which capture cannot retarget. The
second press focuses the bed and starts no drag, so its pointerup has
nothing to select into Plot; a plop in an unfocused bed already delegates
to objDown, so double-clicking a plant focuses its bed too.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-23 03:12:13 -04:00