Skip to content

feat(editor): make wall drafting and attachments curve-aware - #897

Closed
sudhir9297 wants to merge 13 commits into
pascalorg:mainfrom
sudhir9297:t3code/improve-project-items
Closed

sudhir9297 wants to merge 13 commits into
pascalorg:mainfrom
sudhir9297:t3code/improve-project-items

Conversation

@sudhir9297

@sudhir9297 sudhir9297 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Curve-aware wall geometry and attachments

    • Issue: Fixed curve sampling and straight-line remapping could make curved wall outlines, junctions, and hosted openings or items drift during topology changes.
    • Fixed: Wall geometry now uses exact arc-length and projection helpers with adaptive centerline sampling, while split and merge operations remap supported wall attachments along the resulting centerline.
  • Strict, migration-safe wall data

    • Issue: Invalid dimensions, partial material migrations, and one-sided child ownership could leave saved walls in an inconsistent state.
    • Fixed: Wall dimensions and points are validated, legacy geometry and material fields are normalized on load, and bidirectional wall-child ownership accepts plugin-defined child kinds.
  • Exact wall drafting and shared drawing controls

    • Issue: Wall lengths could only be set by pointer placement, and drawing tools implemented keyboard behavior independently.
    • Fixed: Wall drafts accept an exact typed length in 2D, 3D, and split views, and registered drawing tools share Enter, Backspace, and Escape behavior without duplicate commits.
  • Stable placement previews

    • Issue: Ceiling elevation and door or opening previews could use stale geometry or write transient pointer state into the scene.
    • Fixed: Ceiling drafts resolve their level-aware height, while doors and opening affordances preview through live overrides and commit scene changes only once.
  • Plugin-owned editor extensions

    • Issue: Core editor UI needed built-in knowledge of tool-specific overlays and drawing tools.
    • Fixed: Registered tools can provide drawing controls and overlays, and wall rendering accepts registered plugin children without adding plugin node kinds to core.
  • Provenance-safe PR descriptions

    • Issue: Merge-imported or reverted work could be attributed to the feature branch when generating a PR description.
    • Fixed: OpenPR2 now audits first-parent commits, patch-equivalent commits, merge-only files, overlapping files, unexplained files, and reverted eligible files before writing PR metadata.
  • Editor integration maintenance

    • Issue: Local package resolution and the environment plugin pin were out of sync with the current workspace.
    • Fixed: Turbopack aliases resolve from the monorepo root, the environment plugin pin is updated, and failed Next.js cache output is ignored.

How to test

  1. Draw walls in 2D, 3D, and split view; type a length and press Enter, then exercise Backspace and Escape.

    • The committed segment should keep the entered length, commit once, and preserve or cancel the active draft as indicated.
  2. Create a curved wall with a hosted door, window, or wall item, then split or merge the wall.

    • The wall geometry should remain smooth and the supported attachment should remain mapped to the resulting wall centerline.
  3. Place a ceiling and preview or resize a door/opening.

    • The ceiling should use the resolved level height, and preview movement should not mutate scene data until commit.
  4. Run the focused provenance, wall, drawing, ceiling, door, opening, and slab tests:

    • bun test ./.agents/skills/open-pr2/scripts/provenance-audit.test.ts packages/core/src/schema/nodes/wall.test.ts packages/core/src/store/use-scene-wall-slot-migration.test.ts packages/core/src/systems/wall/wall-curve.test.ts packages/core/src/systems/wall/wall-mitering.test.ts packages/editor/src/components/tools/wall/wall-draft-length.test.ts packages/editor/src/lib/drawing-controls.test.ts packages/nodes/src/ceiling/draft-elevation.test.ts packages/nodes/src/door/renderer.test.tsx packages/nodes/src/shared/opening-width-affordances.test.ts packages/nodes/src/slab/placement-ownership.test.ts
    • All 76 tests should pass.
  5. Run bun run checks and bun run build.

    • Formatting, type checks, and all build tasks should pass.

Screenshots / screen recording

Not added yet.

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

Medium Risk
Touches core wall topology, scene migrations, and shared keyboard/drafting paths; regressions could affect saved scenes and wall-hosted attachments, though the added tests cover the main geometry and control flows.

Overview
This PR extends wall geometry and topology so curved centerlines use exact arc length, adaptive sampling, and projection helpers; split/merge and miter/junction logic remaps hosted doors, windows, and wall items along those curves instead of straight chords. Wall schema and load paths tighten finite dimensions, normalize legacy geometry and material presets into slots, and validate bidirectional wall–child ownership (including plugin child IDs via generic children).

The editor gains a shared typed wall draft length (2D/3D/split), a drawing-controls registry for Enter/Backspace finish and back across tools, optional tool overlays from node extensions, and ceiling drafts that resolve level-aware height. Door previews apply live overrides without mutating scene data until commit.

OpenPR2 is rewritten around a provenance audit (provenance-audit.ts) that classifies eligible commits, merge-imported files, overlaps, and reverted work before PR titles and bodies are written; the audit is wired into skills:validate.

Smaller maintenance: Turbopack resolves monorepo packages from the repo root, the environment plugin pin and lockfile update, .next-failed-cache/ ignored, and minor editor typing for wall child IDs in trees/scene data.

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

- Add immersive WebXR editor integration and wand bindings
- Improve floorplan drawing controls, placement, and wall-height editing
- Update node tools, viewer integration, and bundled dependencies
- Deleted multiple obsolete WebXR plugin binaries to streamline the vendor directory and reduce clutter.
- Removed the outdated WebXR plugin files from the vendor directory to streamline the project.
- Updated the WebXR plugin path in the editor configuration for local development.
- Refactored the editor components to utilize the new WebXR feature gate for improved integration.
- Deleted the WebXR plugin files and references from the editor components to streamline the project.
- Updated the configuration and component files to remove obsolete WebXR integration.
- Added a new entry to the .gitignore for the failed cache directory.
- Document architectural modeling capabilities and Pascal gaps
- Stabilize pre-slice host-child migration coverage
@pascal

pascal Bot commented Sep 21, 2026

Copy link
Copy Markdown

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: 8f826581-0222-443d-b789-b0fec8e67a80

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/editor/src/store/use-floorplan-draft-preview.ts Outdated
Comment thread packages/editor/src/lib/drawing-controls.ts
Comment thread packages/editor/src/components/editor/handles/use-handle-drag.ts Outdated
Comment thread apps/editor/lib/bootstrap.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.

Stale Bugbot comment from a previous run.

Comment thread packages/editor/src/components/editor/floorplan-panel.tsx
- Consolidate spatial and wall-handle drag logic
- Remove unused React Three XR dependencies and toolbar plumbing
- Add provenance auditing to the open-pr2 workflow
- Generalize wall ownership for plugin-defined child nodes
- Register drawing controls and tool overlays through extensions
- Preserve exact wall draft lengths across views
@sudhir9297 sudhir9297 changed the title feat(editor): improve project item hosting and editing feat(editor): make wall drafting and attachments curve-aware Sep 21, 2026

@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.

Stale Bugbot comment from a previous run.

wallId: wall.id,
position: [clampedX, node.position[1], node.position[2]],
...(node.type === 'item' ? { wallT: nextLength > 1e-6 ? clampedX / nextLength : 0 } : {}),
} as Partial<AnyNode>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wall topology drops generic hosted children

High Severity

Walls now accept any child id and validateWallRelations requires a matching parentId, but getWallAttachmentSpan and remapWallAttachment still only handle doors, windows, and wall-mounted items. A split aborts when any other hosted child is present, and a merge can list children it never remaps, so the following commit fails validation or leaves those children attached to a deleted wall.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 73e607f. Configure here.

Comment thread packages/nodes/src/ceiling/tool.tsx
Comment thread packages/nodes/src/ceiling/tool.tsx
…t-items

# Conflicts:
#	packages/core/src/store/actions/node-actions.ts
#	packages/core/src/systems/wall/wall-topology.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 3 total unresolved issues (including 1 from previous review).

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 1aa647d. Configure here.

const primary = views.get(owner)
const secondary = views.get(owner === '2d' ? '3d' : '2d')
if (!primary?.finish?.()) return false
secondary?.afterFinish?.()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Split ceiling Enter drops 2D draft

High Severity

In split view, runDrawingControl always invokes the 3D ceiling finish when that function exists and treats a false return as a hard failure. A polygon authored on the 2D pane lives in ceilingDraftPoints, not the 3D tool's points, so Enter does not commit and never falls back to the 2D handler.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1aa647d. Configure here.

for (const attachment of wallAttachments(wall, nodes)) {
const span = attachmentSpan(attachment)
for (const attachment of getWallAttachments(wall, nodes)) {
const span = getWallAttachmentSpan(attachment)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Plugin wall children block splits

Medium Severity

WallNode.children now accepts any plugin id, and getWallAttachments includes those hosted nodes, but getWallAttachmentSpan only understands doors, windows, and wall items. splitWall returns null on the first unknown attachment, so a wall that hosts a plugin child cannot be split and the attachment is not remapped.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1aa647d. Configure here.

@wass08 wass08 closed this Sep 22, 2026
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