feat(nodes): draft axis guides at the moving endpoint + 2d parity#534
Merged
Conversation
Wall/fence drafting already drew an X/Z axis cross at the segment start. Now the moving endpoint gets a single long guide line perpendicular to the draft segment (a second cross would collide with the start cross on axis-aligned segments), fences gain the same guides they lacked entirely, and the 2D floor plan renders the equivalent SVG guides (cross at start, perpendicular line at end) fed by the floorplan draft preview store. The guide components are extracted from wall/tool.tsx into nodes/shared/draft-axis-guides.tsx so both tools (and the fence's formerly duplicated arc/label helpers) share one implementation.
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 879bf6e. Configure here.
| y1: end[1] - ny * DRAFT_AXIS_GUIDE_EXTENT, | ||
| x2: end[0] + nx * DRAFT_AXIS_GUIDE_EXTENT, | ||
| y2: end[1] + ny * DRAFT_AXIS_GUIDE_EXTENT, | ||
| }) |
There was a problem hiding this comment.
2D endpoint guide length mismatch
Medium Severity
The 2D draft axis guide draws its endpoint perpendicular line for segments as short as 1e-6 m. This is inconsistent with 3D DraftAxisGuides and wall previews, which require segments of at least 0.01 m, leading to a misleading 2D guide for very short drafts without a corresponding 3D visual.
Reviewed by Cursor Bugbot for commit 879bf6e. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What
While drafting a wall or fence segment (click start → move endpoint):
useFloorplanDraftPreview, for both wall and fence drafts.How
wall/tool.tsxintopackages/nodes/src/shared/draft-axis-guides.tsx;DraftAxisGuideStategainsendOrigin.fence/tool.tsxdrops its duplicatedDraftAngleArc/DraftMeasurementLabelcopies in favor of the shared module and wires up the newaxisGuidestate.FloorplanLinearDraftLayer(the leaf layer that already re-renders per move) as solid lines with stroke width budgeted viaunitsPerPixel, matching the alignment-guide layer — dashed 2000 m lines were too expensive.Verification
check-types9/9,@pascal-app/nodestests 874 pass, biome clean.Note
Low Risk
Editor-only drafting visuals and a refactor of duplicated UI helpers; no persistence, auth, or core geometry commit paths changed.
Overview
Adds draft axis guides while drawing wall and fence segments: an axis cross at the start point and a perpendicular guide through the moving endpoint (no second full cross at the end, to avoid overlap on axis-aligned segments).
3D: Wall and fence tools share a new
packages/nodes/src/shared/draft-axis-guides.tsxmodule (DraftAxisGuides,getNearestAxisAngleLabel, measurement/arc UI).DraftAxisGuideStatenow includesendOriginso the end perpendicular line renders during drag. Fence tool wires up the sameaxisGuideflow it lacked before; duplicated localDraftAngleArc/DraftMeasurementLabelcode is removed.2D: The floor plan panel draws matching SVG guides for active wall and fence drafts from
useFloorplanDraftPreview, using long solid lines andunitsPerPixelstroke width for performance.Reviewed by Cursor Bugbot for commit 879bf6e. Bugbot is set up for automated code reviews on this repo. Configure here.