Skip to content

editor: complete floorplan construction documentation#531

Merged
wass08 merged 96 commits into
pascalorg:mainfrom
sudhir9297:floorplan-update
Jul 22, 2026
Merged

editor: complete floorplan construction documentation#531
wass08 merged 96 commits into
pascalorg:mainfrom
sudhir9297:floorplan-update

Conversation

@sudhir9297

@sudhir9297 sudhir9297 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Completes the floor-plan construction-document workflow with associative dimension strings, curved and circular dimensions, drawing-type coordination, wall assembly datums, room/stair/opening documentation, structural grids, schedules, and completeness advisories.
  • Adds persistent drawing sheets with fixed-scale PDF output, paper-space annotation profiles, visibility controls, collision layout, preflight diagnostics, general/keyed notes, document markers, and title-block metadata.
  • Finishes the registry architecture pass by injecting floor-plan tool host APIs, keeping structural-grid coordination in the nodes package, making snapping mode-driven, and preserving nested drawing-sheet references during clone and migration flows.

How to test

  1. Run bun run check, bun run check-types, and bun run build; all workspace checks and production builds should pass.
  2. Run bun dev, open the editor, create a level with straight and curved walls, openings, rooms, columns, stairs, and structural grids, then switch to floor-plan view and confirm the documented geometry and schedules update with scene edits.
  3. Create linear, continuous, radius, diameter, arc-length, angular, and coordinate construction dimensions; drag witnesses and baselines under Grid, Magnetic, Both, and Off snapping modes and confirm semantic references and previews remain stable.
  4. Configure a drawing sheet with placed views, annotation profile, notes, keyed notes, markers, schedules, and title-block data, export the PDF, and confirm fixed scale, paper-space annotation sizing, visibility rules, and preflight findings.
  5. Duplicate or fork a scene containing drawing sheets and associative dimensions, then confirm level/view, keyed-note, marker, measurement, and controlling-dimension references point to the cloned identities.

Screenshots / screen recording

To be added — this PR includes visual and interactive floor-plan, annotation, and PDF-export changes.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

High Risk
Large cross-package feature (new persistent node types, associative references, PDF pipeline swap) with broad editor and export surface area; regressions in clone, dimensions, or PDF output are plausible despite heavy test coverage.

Overview
Delivers floor-plan construction documentation end-to-end by introducing persistent scene nodes and editor wiring so dimensions, sheets, and advisories stay associative with the model.

Core schema and registry gain construction-dimension, drawing-sheet, and structural-grid kinds (with clone/migration remapping for dimensions, measurements, and sheet-local IDs). Walls can carry assembly layers and datum references; doors/windows gain construction marks and optional opening dimensions. Floorplan geometry adds dimension-string, dimension terminators/text placement, and optional GeometryContext.extensions. Event bus and subtree clone paths are extended for the new types.

Standalone editor app mounts a headless FloorplanConstructionPreflight that debounces scene nodes and pushes dimension completeness, clearance, and module advisories into editor preflight state. The Build tab builds its structure palette from nodeRegistry (plus getFloorplanNodeExtension preferred view) instead of a fixed tool-kind union. The viewer toolbar adds coordinated drawing type selection, floor-plan annotation and wall dimension reference submenus, and a units submenu (meters / millimeters / imperial).

Dependencies: @pascal-app/editor replaces jspdf/svg2pdf with pdfkit (+ blob-stream); workspace packages bump to 0.9.2 / nodes 0.1.1. Minor Next env path tweak in ifc-converter; design-qa.md documents internal-dimension baseline fixes (mostly validated in tests; local 2D preview was blocked in QA).

Reviewed by Cursor Bugbot for commit fe92336. Bugbot is set up for automated code reviews on this repo. Configure here.

sudhir9297 and others added 30 commits May 19, 2026 02:59
Items (e.g. solar panels) can now be placed on sloped roof surfaces.
The placement system computes euler rotation from the roof surface
normal so items sit flush on the slope instead of going inside.

- Add roofStrategy to placement-strategies with enter/move/click/leave
- Wire roof:enter/move/click/leave events in the placement coordinator
- Add calculateRoofRotation in placement-math using surface normals
- Support full 3D cursor rotation for sloped surfaces
- Items on roofs are parented to the level with world-space rotation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
useEffect(() => {
setAuditIssues(issues)
return () => setAuditIssues([])
}, [issues, setAuditIssues])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Audit cleared between refreshes

Medium Severity

The useEffect for audit issues clears them in its cleanup function. This cleanup runs on every issues change, not just on unmount. This briefly wipes audit advisories from the store, causing issues like dimension-completeness to flicker away before new results are displayed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6b6ee8f. Configure here.

Comment thread design-qa.md

- Reassess internal line contrast only after the corrected geometry can be seen in the target scene.

final result: blocked

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local QA doc committed

Medium Severity

The design-qa.md file introduces temporary, machine-specific QA notes and paths. This content isn't reproducible for other contributors and isn't suitable as permanent project documentation.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6b6ee8f. Configure here.

if (pending) clearTimeout(pending)
unsubscribe()
}
}, [])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timer updates after unmount

Medium Severity

The debounced scene subscription clears its timeout on unmount but never guards setNodes. A callback scheduled before teardown can still run afterward and update React state on an unmounted hook instance.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6b6ee8f. Configure here.

...dimension,
anchors: remapMeasurementAnchors(dimension.anchors, idMap),
controllingDimensionId,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clone keeps old controller id

Medium Severity

When remapping construction dimensions, controllingDimensionId falls back to the original id if the controller is absent from the clone id map. Partial duplicates can keep pointing at a dimension that was not copied.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6b6ee8f. Configure here.

const mode = useEditor((s) => s.mode)
const follow = useLiquidLineToolOptions((s) => s.follow)
const toggleFollow = useLiquidLineToolOptions((s) => s.toggleFollow)
const buildTypes = useMemo(collectBuildTypes, [])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build palette never refreshes

Low Severity

buildTypes is computed once via useMemo(collectBuildTypes, []), so structure tools discovered after the first mount—such as asynchronously loaded registry plugins—never appear in the Build tab until a full remount.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6b6ee8f. Configure here.

# Conflicts:
#	packages/core/src/store/use-scene.ts
#	packages/core/src/utils/clone-scene-graph.test.ts
#	packages/core/src/utils/clone-scene-graph.ts
#	packages/editor/src/index.tsx
#	packages/nodes/src/shared/opening-placement-dimensions.ts
#	packages/nodes/src/wall/measurement.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

There are 7 total unresolved issues (including 5 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fe92336. Configure here.

message: issue.message,
}))
const clearance = clearanceChecksEnabled
? buildClearanceAdvisories(nodes, { includeDisabled: true }).map((issue) => ({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearance audit ignores profile toggles

Medium Severity

When clearance checks are turned on, advisories are built with includeDisabled: true, so disabled clearance profiles still run. That inverts the usual meaning of enabling checks and can surface advisories users explicitly turned off in profile settings.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fe92336. Configure here.

.default([
[0, 0, 0],
[1, 0, 0],
]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arc modes allow two anchors

Medium Severity

ConstructionDimensionNode always requires at least two anchors, but constructionDimensionRequiredAnchorCount expects three for arc-length and angular modes. Data created outside the floor-plan tool (import, MCP, hand-edited JSON) can validate yet violate what rendering and the tool assume.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fe92336. Configure here.

@wass08
wass08 merged commit 7744286 into pascalorg:main Jul 22, 2026
3 checks passed
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.

2 participants