Skip to content

feat: add exact wall-length input during drafting - #602

Draft
aryansk wants to merge 1 commit into
pascalorg:mainfrom
aryansk:codex/issue-308-wall-length-input
Draft

feat: add exact wall-length input during drafting#602
aryansk wants to merge 1 commit into
pascalorg:mainfrom
aryansk:codex/issue-308-wall-length-input

Conversation

@aryansk

@aryansk aryansk commented Aug 5, 2026

Copy link
Copy Markdown

Summary

  • Add an exact-length input during wall drafting in both the 2D and 3D flows.
  • Parse the entered measurement with the existing unit-aware wall measurement behavior.
  • Keep the live wall measurement and unit toggle behavior aligned with the entered value.

Validation

  • 596 editor tests
  • Editor typecheck
  • Nodes, core, and viewer builds
  • Biome
  • git diff --check

Closes #308

Signed-off-by: Aryan Singh K. <70511529+aryansk@users.noreply.github.com>
@Aymericr

Copy link
Copy Markdown
Contributor

Sorry for the silence on this — it's a draft so it fell off my radar, and it shouldn't have. This is the feature #308 has been waiting for and the foundations are right: heading from the pointer, distance from the input is the correct split, you reused parseMeasurement with bareUnit following the unit toggle instead of re-deriving the conversion, and you landed it in both the 2D floorplan-panel and the 3D wall/tool.tsx in one PR, which most attempts at this miss. constrainWallDraftLength([0,0],[3,4],2) → [1.2,1.6] with a test is exactly the shape I wanted.

Four things on the interaction before it can land — all above the geometry, none of it a rewrite:

  1. Don't mount the input unconditionally. Right now a focusable text field with pointerEvents: 'auto' and stopImmediatePropagation on pointerdown sits at the segment midpoint — on top of the wall being drawn. A click meant to place the endpoint can land in the field instead. Keep DraftMeasurementLabel as the default and have a digit keypress swap it for the input; that's also the pattern people arrive from other CAD tools expecting, since you type rather than aim.
  2. Give it Enter and Escape. onKeyDown={(e) => e.stopPropagation()} is unconditional, so with focus in the field there's no way to commit the length and no way to cancel the tool. Enter should place the segment; Escape should clear the field on first press and fall through to the tool on second.
  3. Decide what happens to snapping, and show it. Forcing useWallSnapIndicator to null whenever a length is set means corner and T-junction snapping silently stop, with nothing on screen saying so. I'd rather the length constrain the distance and leave the angle snap live, so typing 3m along a snapped axis still snaps the axis. If you'd rather keep the current rule, the HUD needs to indicate that the endpoint is length-locked.
  4. DraftMeasurementLabel is now unused for walls but still drives fence and roof, so the wall HUD diverges from its siblings. Either keep walls on the label with the input as an overlay, or note the divergence deliberately.

One practical warning: floorplan-panel.tsx has moved a lot since you branched (2D viewer modes in #672#675, hidden-wall pointer fixes in #683/#689/#697), so expect a real rebase around your handleWallPlacementPoint and pointer-move hunks rather than a clean one. Happy to review as soon as it's out of draft — and thanks for reading #308 and #321 before starting, it shows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unit toggle only affects the display of dimensions, not the input

2 participants