Conversation
|
I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…). Please try again, rephrase, or reach out if it keeps failing. Error id: 5d855979-f1f0-4e3f-8558-79abd46c6a3f |
- Strip insertionPreview/insertionFailure in applyTypedPlacement so Enter commits the typed wall position instead of re-entering the pointer path's run-insertion branch (Bugbot: stale insertion, high). - Drop the trailing setProjectedPosition(snap) in beginTypedPlacement that pinned the HUD to the pre-typing snap instead of the first digit's projection. - Clear typedWallHitRef/typedCoordinateDefaultsRef on every typing exit (becameInactive), covering Escape typed inside the HUD input whose window handler skips INPUT targets. - Render the coordinate HUD from exactly one surface: 2D pane in 2d/split, 3D Html in 3d-only — split view mounts both panes, so both instances fought over caret/focus.
|
Addressed all 4 Bugbot findings in 27101de:
Verification: |
- Neutralize altKey on the reused pointer event for typed commits so a stale force-place modifier cannot override the typed pose (Bugbot: stale Alt click). - onClick now reports whether a cabinet was committed; a rejected typed commit (e.g. collision) keeps the typing session so values survive and can be adjusted instead of being silently wiped. - 2D typed-entry HUD sizes its foreignObject from CSS px × unitsPerPixel and counter-rotates by -sceneRotationDeg (mirrors the measurement extrusion control), so inputs render screen-upright at a usable size at any zoom/rotation.
|
Round 2 in 4ec9ae8 — addressed the 3 new findings:
Verification: |
- Continuous-mode typed Enter now seeds the stretch preview at the typed position (zero-length span) via a rawOverride on resolveStretchedPlacement, instead of growing toward the stale cursor position carried by the reused pointer event (Bugbot: high). - A canvas click while typed entry is active ends the typing session before committing, so a newly started stretch can follow the pointer instead of being frozen until Escape (Bugbot: medium).
|
Round 3 in 2074553:
(The third comment on 4ec9ae8 was a re-anchor of the already-fixed Enter-clears-typing finding.) Verification: tsgo clean, biome clean, cabinet suite 937 pass / 0 fail. |
findClosestCabinetWallInPlan now accepts maxDistance; beginTypedPlacement passes Infinity since the placement already knows its wallId and only needs the projection onto it. A typed perpendicular offset (or deep cabinet) can push the center beyond WALL_SNAP_DISTANCE_M, which made the next session fail to start and let digits fall through to global phase shortcuts.
|
Round 4 in 9eabd0a: Typed entry blocked after offset — Verification: tsgo clean, biome clean, cabinet suite 937 pass / 0 fail. |
- Restore the pre-typing pose when a typing session ends uncommitted (Escape/tool cancel): placementRef kept the typed pose, so a click right after Escape committed the cancelled coordinates (Bugbot: high). - Ending the session on island toggle: island has no wall snapping, so the session would be orphaned (frozen pointer, vanished HUD) until Escape. - resolveCabinetTypedPlacementPosition clamps distance instead of rejecting when the cabinet is wider than the wall, matching the coordinate getter's clamp so the pose stays committable (Bugbot: medium).
|
Round 5 in e709e8d:
Verification: tsgo clean, biome clean, cabinet suite 937 pass / 0 fail. |
- A canvas click during typed entry now commits the typed preview pose (suppress the pre-typing restore; keep placementRef) instead of the restored original snap (Bugbot: high). - Strip 'node' from the synthetic typed-commit event so stopPlacementCommitPropagation does not install its 300ms window click swallow, which could eat the user's next real click (Bugbot: medium). - resolveCabinetTypedPlacementPosition samples the mitered face offset at the destination station (hit.localX = typed distance + width/2) instead of the frozen pre-typing snap (Bugbot: medium).
|
Round 6 in 7c7851a:
Verification: tsgo clean, biome clean, cabinet suite 937 pass / 0 fail. |
- HIGH-2: recompute wallSurfaceNormal from updated resolved.yaw in applyTypedPlacement - HIGH-3: re-resolve and publish placement from lastPlacementEventRef when typing ends without commit - QUICKWIN-2: allow '/' and ',' in isPlacementTypingKey and advance field on comma in PlacementCoordinateInput Note: HIGH-1 and QUICKWIN-1 were already addressed in commit 7c7851a.
|
Post-review hardening in bb8ea5e (+7c7851af earlier in this push):
Verified: 57 targeted tests pass, full suite 7,990 tests — only pre-existing unrelated |
…les field - A canvas click during typed entry now ends the session only when the commit succeeds (onClick wrapper defers clear() past onClickInner). An invalid typed pose keeps the session alive so values stay editable (Bugbot: invalid click ends typed entry, high). - The capture-phase window keydown handler now treats ',' as a field toggle like the focused HUD input does, so comma advances to the offset field even when the HUD is unfocused (Bugbot: medium).
|
Round 7 in 7eb477c (on top of bb8ea5e):
Verification: tsgo clean (nodes+editor), biome clean, cabinet suite 937 pass, editor store suite 79 pass. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7eb477c. Configure here.
Wall snap centers an oversized cabinet on the wall (empty span → midpoint), but typed entry mapped default distance 0 to localX = width / 2, sliding the cabinet off the wall center — possibly past the wall end — the moment coordinate entry started or the default was committed. resolveCabinetTypedPlacementPosition now resolves the centered pose (wallLength / 2) when the cabinet is wider than the wall, matching getCabinetPlacementCoordinates and resolveCabinetWallSnapPlacement. Adds a regression test: wall 4m, cabinet 5m wide → distance 0 resolves to wallLocalX 2 (wall center), not 2.5.
|
Round 8 in 51953c0: Wide cabinet jumps off wall center (medium) — Regression test added (wall 4 m, cabinet 5 m wide → typed distance 0 resolves to Verification: tsgo clean (nodes+editor), biome clean, cabinet suite 938 pass / 0 fail. |

Closes #885
Interaction design
Tabtoggles the active field; live preview updates while either field changes;Enterplaces; firstEscapeclears the typed fields, second cancels the tool.parseMeasurement.Parity (2D ↔ 3D)
Html.foreignObject.usePlacementTypingZustand store (buffers, active-field, projection, commit revisions, clear/reset) — reusable for future placement tools.Files
packages/editor/src/store/use-placement-typing.ts(+ test)packages/editor/src/components/tools/shared/placement-coordinate-input.tsxpackages/editor/src/components/editor-2d/renderers/floorplan-placement-preview-layer.tsxpackages/editor/src/index.tsxpackages/nodes/src/cabinet/placement-dimensions.ts(+ test)packages/nodes/src/cabinet/tool.tsxVerification
tsgo --noEmit: clean inpackages/editorandpackages/nodesbun test: 7,988 passed; sole failure is the pre-existing unrelatedsafeFetchtest on mainRisks / follow-ups
foreignObjectsizing/focus across zoom levels recommended.Note
Medium Risk
Substantial changes to cabinet placement commit paths, keyboard handling, and wall projection math; incorrect edge cases could mis-place cabinets or fight focus between 2D/3D HUDs.
Overview
Adds AutoCAD-style typed coordinate entry for wall-snapped cabinet placement: users type distance (wall start → near edge) and offset (perpendicular from the wall face), with live preview and Enter / click to commit.
A shared
usePlacementTypingstore andPlacementCoordinateInputHUD back both views—3D viaHtml, 2D floorplan via SVGforeignObject(gated byviewModeso only one surface owns focus). Pointer moves are ignored while typing; cancel restores the last pointer pose unless a commit succeeds.Cabinet math gains
getCabinetPlacementCoordinates/resolveCabinetTypedPlacementPosition(curved walls, miter face offset at destination, oversized cabinets stay centered).findClosestCabinetWallInPlanaccepts optionalmaxDistance: Infinitywhen the wall is already known. The cabinet tool wires keyboard/HUD input throughparseMeasurement, strips run-insertion preview on typed commits, and seeds continuous stretch at the typed pose.Reviewed by Cursor Bugbot for commit 51953c0. Bugbot is set up for automated code reviews on this repo. Configure here.