fix(wall): typed exact length during drafting follows unit toggle - #884
Frank-zhu0404 wants to merge 13 commits into
Conversation
…scalorg#308) Keep the normal wall measurement label until a digit starts editing, then parse bare values with the active unit (ft / m / mm) while explicit suffixes still win. Enter commits the typed length along the current heading; Escape clears the buffer first and cancels on the second press. Shared across the 2D floor-plan draft and the 3D wall tool. Closes pascalorg#308
|
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: 4d2683ef-f5b2-46f8-9e42-68db0e331135 |
Bugbot: 2D typed-length keys only prevented default, so Escape/digits/unit letters still hit the global tool listener. Also pull store wallDraftStart back into panel draftStart so split-view Enter (3D capture → grid:click) advances the 2D rubber-band chain start.
… store null (pascalorg#308) Bugbot on PR pascalorg#884: 2D Enter was calling a first-click closure, typing keys lost to bubble use-keyboard, and split Enter left the 2D rubber band open. - Assign wallPlacementPointRef after handleWallPlacementPoint so Enter commits when draftStart is set. - Register the 2D keydown listener in the capture phase (add/remove with the same flag); skip keys 3D already preventDefaulted. - Sync-clear local draftStart/end/cursor when the store start is null. Self-test: - bun test packages/editor/src/components/tools/wall/wall-drafting.test.ts packages/editor/src/store/use-wall-draft-typing.test.ts → 43 pass, 0 fail - bunx biome check on the three touched files → clean
Bugbot follow-up (
|
Bugbot round 2 — Muse PASSFixed both new Mediums on
Self-test: focused |
Bugbot round-3 fixes (Medium ×3) + Muse PASSHead: Fixes
Prior Self-test
Muse
|
Bugbot r4 (604682f)Fixed both new Medium threads on top of a4dbcec:
Self-test: Bun wall-draft-typing + wall-drafting tests; biome on touched files. |
Bugbot r5 — Muse PASSHead: Bugbot High (16aa0c3c): Typed Enter in 2D-only emitted Fix:
Muse ( Note: Bugbot has since filed 2 new Highs on this head (null store wipe / typed Enter skip-create) — fixing next. |
|
Bugbot r5 (
Muse on |
|
Bugbot r6 — both Highs fixed @
Self-test: bun wall-drafting + use-wall-draft-typing → 80 pass. Muse: VERDICT=PASS. Unresolved actionable Bugbot: 0. |
|
Bugbot r6 (final) @
Self-test: 86 pass. Muse: VERDICT=PASS. |
|
Bugbot r6b — Muse PASS @ Third High (post-r6): skip 2D twin Self-test: |
…Enter (pascalorg#308) Pointer clicks with a live typing buffer now adopt the 2D published start instead of begin()-clearing it. Failed Enter keeps the buffer and stops propagation so global shortcuts cannot fire.
|
Bugbot r7 (
Self-test: wall-drafting + use-wall-draft-typing → 88 pass / 0 fail |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 39dd625. Configure here.
|
Bugbot r8 ( Fixed both new Medium threads after r7:
Self-test: |
Bugbot r8 follow-up (Cline Muse PASS)Head Addresses the two Mediums after r7:
Self-test: |

Summary
3m,180cm,2500in mm notation,10'6", or a bare number in the active unit) locks the draft to that length along the current heading — the pointer keeps steering direction only.DraftMeasurementLabeluntil typing begins (no always-mounted input over the segment).useWallDraftTyping, withparseWallDraftLength/constrainWallDraftLengthas the shared parse+project helpers (bare units follow the unit toggle + metric mm notation, matching inspectorparseUnit).Testing
packages/editor—use-wall-draft-typing.test.ts+wall-drafting.test.ts(incl. new length-input cases): 39 passCloses #308
Note
Medium Risk
Touches core wall drafting, keyboard capture, and 2D/3D commit ownership; regressions could duplicate walls or desync the draft rubber band.
Overview
Adds typed exact length while drawing walls in the two-click flow, matching 3D behavior on the 2D floor plan. Users can enter lengths (bare numbers in the active unit,
180cm,10'6", etc.); the draft endpoint stays on that distance along the current heading while the pointer still sets direction. Enter commits, Escape clears the buffer first then cancels drafting, and the on-segment label shows the raw buffer while typing.A shared
useWallDraftTypingstore plusparseWallDraftLength/constrainWallDraftLength(and related commit helpers) wire the floor plan panel andWallTooltogether. Capture-phase keyboard handling on the floor plan avoids shortcut conflicts (including Space as a length separator when mid-entry). Enter arms a one-shotpendingCommitMetersand emitsgrid:clicksoWallToolowns creation when mounted, with guards so 2D-only does not double-create walls or leave a stale rubber band after split-view / typed commits.Reviewed by Cursor Bugbot for commit 3404b18. Bugbot is set up for automated code reviews on this repo. Configure here.