179 Commits

Author SHA1 Message Date
Sudhir Yadav
9ff657419c
Merge branch 'main' into feat/upgrade-and-bug-fix 2026-04-29 10:49:11 +05:30
sudhir
e688792c34 Refactor first-person and spawn selection handling 2026-04-29 10:35:34 +05:30
Aymeric Rabot
aa43bb6a43
feat: backport monorepo PRs #297, #302, #306 — floorplan thumbnails + mobile editor UI
Port floorplan item thumbnails, full mobile editor UI, and
mobile polish from the private monorepo into the public editor.

Monorepo PR #297 (feat/item-admin-advanced):
- Add optional floorPlanUrl to item asset schema (core)
- Render 2D floor-plan images inside item footprints on floorplan
- Improve slider drag with modifier key re-anchoring

Monorepo PR #302 (feat/mobile-ui):
- Mobile editor layout with draggable bottom sheet
- Mobile tab bar, selection bar, and panel sheet
- Mobile-aware panel manager and panel wrapper
- useIsMobile rewrite (useSyncExternalStore, SSR-safe)
- Camera actions hideOrbit prop
- GridSnapControl and SecondaryToggles exports
- Action menu hides on mobile contextual tabs
- SidebarTab extended with mobileDefaultSnap/mobileIcon

Monorepo PR #306 (feat/mobile-ui-polish):
- Touch gesture mapping for camera controls (one/two/three finger)
- Snap ratio constants for bottom sheet
- Thumbnail generator WebGL2 fallback (bottom-up row flip)
- ErrorBoundary scope logging, viewer scene wrap
- GPUDeviceWatcher enhanced logging and uncaptured error handler
- WebGPURenderer init error handling and diagnostics
- Post-processing log improvements
- MergedOutlineNode WebGL2 FBO corruption fix

Excluded: apps/community/*, apps/editor/*, packages/community-*,
.cursor/*, .env.example (monorepo-only files)

Co-authored-by: Pascal <open@pascal.app>
2026-04-28 06:36:08 -07:00
Wassim SAMAD
010c874963
Merge pull request #277 from sudhir9297/feat/2d-editor
Feat/2d editor
2026-04-28 07:36:05 -04:00
sudhir
15daeaace6 Standardize stair controls on slider inputs 2026-04-28 14:50:51 +05:30
Sudhir Yadav
1c2746f538
Merge branch 'main' into feat/upgrade-and-bug-fix 2026-04-28 14:37:10 +05:30
sudhir
bead8796d2 Add spawn node support and refine stair and door cutouts 2026-04-28 14:26:24 +05:30
sudhir
a64d6b86cc Fix floorplan preview update loop 2026-04-28 09:52:10 +05:30
Aymeric Rabot
0711cad660 Merge remote-tracking branch 'origin/main' into feat/mcp-server 2026-04-27 17:22:14 -04:00
Aymeric Rabot
3d5c87a651 feat(mcp): add guided construction workflows 2026-04-27 14:31:04 -04:00
Sudhir Yadav
bc93f09304
Merge branch 'main' into feat/2d-editor 2026-04-27 18:07:28 +05:30
sudhir
e4f42e0ee5 Use bbox anchors for item dimension measurements 2026-04-27 10:49:20 +05:30
sudhir
59779c5bf2 Use mesh bounds for item placement and floorplan 2026-04-27 09:57:05 +05:30
sudhir
45f0867a74 Extract floorplan render logic into editor 2D modules 2026-04-26 23:02:03 +05:30
sudhir
275a42cc7f Simplify paint material compatibility logic 2026-04-25 00:15:29 +05:30
sudhir
2876f39876 Refactor paint materials to use category-based compatibility 2026-04-23 12:48:50 +05:30
Sudhir Yadav
8fde99e7c9
Merge branch 'main' into feat/color-picker-tool 2026-04-22 17:57:26 +05:30
sudhir
1492e5bd0c Add roof drag controls to the 2D floorplan 2026-04-22 17:24:58 +05:30
sudhir
a69591670d Refactor floorplan wall visuals and shared plan helpers 2026-04-22 15:34:22 +05:30
sudhir
87dfdf1b38 Add paint hover previews to viewer 2026-04-22 10:52:35 +05:30
sudhir
8ae217502c Add curved fence support 2026-04-21 11:26:49 +05:30
sudhir
ffa78f1344 Fix realtime undo updates for wall and fence moves 2026-04-21 11:12:04 +05:30
sudhir
8cf2df1483 Unify material target selection across wall stair and roof 2026-04-20 22:45:56 +05:30
sudhir
b715e96038 Fix fence UV generation before geometry merge 2026-04-20 13:12:20 +05:30
sudhir
bbc351d3a4 Add roof material targets and UV mapping 2026-04-20 12:57:06 +05:30
sudhir
4f9b822e54 Add click-targeted stair materials and UV mapping 2026-04-20 12:01:23 +05:30
sudhir
71ddb7052b Add two-sided wall material targeting 2026-04-20 11:18:20 +05:30
Adrian Perez
e8d0b13ff5 feat(mcp,editor): Option A+B storage + 10 agent deliverables (Phase 7)
Ships the combined filesystem/Supabase storage adapter + MCP scene
lifecycle tools + Next.js API routes + editor /scene/[id] route, so
an MCP save is directly openable at /scene/<id> without any
injection hack. End-to-end verified: 10/10 e2e steps pass.

Storage (A1/A2/A3):
- SceneStore interface + error classes + slug helpers
- FilesystemSceneStore at $PASCAL_DATA_DIR (defaults XDG/~/.pascal)
  with atomic writes, .index sidecar, optimistic locking
- SupabaseSceneStore with scenes + scene_revisions tables, RLS
  migration SQL, mock-backed unit tests
- createSceneStore(env) auto-selects based on SUPABASE_URL +
  SUPABASE_SERVICE_ROLE_KEY

MCP tools (A4, A8, A9, A10):
- save_scene / load_scene / list_scenes / delete_scene / rename_scene
- list_templates / create_from_template (3 seed templates:
  empty-studio, two-bedroom, garden-house)
- generate_variants (7 mutation kinds, seeded RNG, save=true|false)
- photo_to_scene (vision sampling → scene graph → save)

Editor (A5, A6):
- /api/scenes + /api/scenes/[id] with RFC 7232 If-Match locking
- /scene/[id] and /scenes route pages with save button, SceneLoader
- Removed the window.__pascalScene dev injection hack

Security + UX edges (A7, A8):
- AssetUrl Zod validator: asset:// blob: data:image/ /path https:
  (http://localhost for dev) + PASCAL_ALLOWED_ASSET_ORIGINS env
  allowlist. Hardens scan.url, guide.url, item.asset.src,
  material.texture.url, MaterialMaps.*Map
- Auto-frame camera on empty→non-empty scene transition
  (camera-controls:fit-scene emitter event)

Shared utilities:
- rehydrateSiteChildren() extracted to packages/mcp/src/lib/ and
  used by both create-from-template and generate-variants to work
  around the SiteNode.children-as-objects vs. ids inconsistency
  (CROSS_CUTTING §2)
- Storage + MCP subpath exports added to packages/mcp/package.json
  (CROSS_CUTTING §4)

Tests: 293 pass / 0 fail across 40 files (was 142 pre-Phase-7).
Biome: clean.

Phase-7 e2e script at packages/mcp/test-reports/phase7-e2e.ts:
MCP HTTP + editor Next.js both point at $PASCAL_DATA_DIR =
/tmp/pascal-e2e, save_scene from MCP, GET /api/scenes/<id> from
editor server, /scenes list page renders all saved scenes, scene
page renders SceneLoader, delete_scene works.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 19:29:28 +02:00
Pascal
5c16aa4225
feat: improve thumbnails, placement, and editor responsiveness (#258)
* wip: backport monorepo PRs 278 280 281 283 284

* refactor(editor): align floorplan panel with monorepo split version
2026-04-17 15:14:40 -04:00
sudhir
7b6d295cd8 Harden stair reload and spiral post-processing 2026-04-17 13:58:54 +05:30
sudhir
49836360ca Add stair openings to ceilings 2026-04-17 13:19:42 +05:30
sudhir
7ca94ce375 Refine stair slab opening placement 2026-04-17 13:18:04 +05:30
sudhir
b314a8fbf8 Implement stair-driven slab hole cutouts 2026-04-17 13:13:02 +05:30
sudhir
4edf45f7c9 Add auto ceilings and simplify ceiling selection affordances 2026-04-16 17:56:54 +05:30
sudhir
b1d8180f62 Fix opening remounts after merged wall reparenting 2026-04-16 13:22:33 +05:30
sudhir
ecb97aba8c Merge split wall segments when deleting dividers 2026-04-16 13:03:31 +05:30
sudhir
ae68d69f77 Simplify auto slab polygons for curved wall rooms 2026-04-16 12:39:52 +05:30
sudhir
dee086545d Fix sharp edges on auto slabs for curved walls 2026-04-16 11:30:43 +05:30
sudhir
5c92d071f7 Fix slab updates for curved wall changes 2026-04-16 11:21:28 +05:30
sudhir
95f4c4e610 Merge branch 'main' of github.com:sudhir9297/editor into feat/wall-room-creation 2026-04-15 22:59:36 +05:30
Sudhir Yadav
b1709de44a
feat: curved wall and fixes (#236)
* feat: add polygon movement support to editor and implement dedicated move tools for walls, slabs, and ceilings

* feat: add uv2 attribute to ceiling and slab geometries for lightmap support

* Fix curved wall miters and align roof position sliders

* Fix wall measurement label and extension anchors

* Fix WebGPU renderer initialization order

* fix(editor): scope wall movement to the selected level

---------

Co-authored-by: Pascal <open@pascal.app>
2026-04-15 12:41:16 -04:00
Sudhir Yadav
57df224948
feat: Add catalog-based material presets across structural nodes (#231)
* Add catalog-based material presets across structural nodes

* Fix material picker fallback and wall visible highlights

* Preserve wall materials in selection highlights
2026-04-15 12:16:35 -04:00
sudhir
d1bef22701 Handle wall split attachment migration and child ids 2026-04-15 14:49:58 +05:30
sudhir
6190ba4bdc feat: implement automatic wall-splitting and slab generation from closed wall loops 2026-04-15 14:18:09 +05:30
Sudhir Yadav
a205e4f778
Feat/stairs fence update (#226)
* feat: railing on the straight stairs and new fence

* feat: added spiral and curved stairs with bug fix for fence

* feat:fence are linked to each other ... so moving one move the other sharing the same coordinate

* fix: update stair railing logic to include front-side attachments for terminal landings

* Integrate fence rendering into the fence system

* fix: pass nodeId instead of undefined node to WallTreeNode and FenceTreeNode

TreeNode was passing `node` (undefined variable) instead of `nodeId` to
WallTreeNode and FenceTreeNode, causing a runtime ReferenceError.
Updated FenceTreeNode to accept nodeId and look up the node from the
scene store internally, consistent with all other tree node components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: update fence icon with new isometric design

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Aymeric Rabot <aymeric@pascal.app>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 23:31:57 -04:00
Pascal
00b8f42899
feat: move/rotate building + relative positioning for all tools (#220)
Sync monorepo PRs #243 and #248 to the open-source editor.

Move/Rotate Building:
- New move-building-tool with grid snapping, R/T rotation, and Esc cancel
- Floating building action menu with move button
- Building helper with keyboard shortcut hints
- BuildingRenderer now applies position and rotation from node data

Building-Relative Coordinate System:
- GridEvent gains localPosition (building-local coords)
- use-grid-events computes building-local intersection from building mesh
- ToolManager wraps building-relative tools in a building-local <group>
- All tools (wall, slab, ceiling, stair, roof, zone, polygon-editor,
  placement coordinator) updated to use event.localPosition
- Placement coordinator adds worldToBuildingLocal helper for cursor
  position conversion

2D Floorplan Fix:
- SVG layers wrapped in <g transform=rotate(...)> for building rotation
- Pointer-to-plan conversion un-rotates when building is rotated
- Grid events from 2D include localPosition

Store Changes:
- useEditor movingNode union includes BuildingNode
- NodeActionMenu onDelete is now optional (buildings can move but not delete)
2026-04-09 14:36:34 -04:00
Pascal
0a46a9deb4
sync: comprehensive monorepo → editor parity (2D/3D decoupling, UX polish, crash fixes)
Squash merge of 3 commits:
1. useLiveTransforms store for 2D/3D decoupling + floorplan overhaul + Sentry crash fixes
2. Comprehensive 59-file sync bringing editor to full monorepo parity (selection highlights, delete tool, furnish/zone modes, keyboard shortcuts, all panels)
3. Missing files fix (materials.ts, merged-outline-node.ts, type fix)

75 files changed, ~6K additions.
2026-04-07 19:21:10 -04:00
Pascal
d9965f487c
fix: sync stair elevations with floor slabs (#216)
Mark stair nodes as dirty when slabs change so stairs properly stack on
top of floor slabs. StairSystem now computes slab-driven elevation by
sampling segment centers against the spatial grid.

Changes:
- spatial-grid-sync: mark stair nodes dirty on slab changes (same level)
- stair-system: syncStairGroupElevation + getStairSlabElevation compute
  Y offset from slab data; rotateXZ helper for world-space transforms
- stair-renderer: use position-x/position-z so the system controls Y
2026-04-06 12:02:57 -04:00
geopenta
ed6ed3f018
fix(editor): release scene singletons on Editor unmount (#214)
The spatial-grid manager, scene-store subscriptions, and the viewer
outliner's Object3D arrays are module-level singletons that previously
lived for the whole page lifetime. When an app unmounted the Editor
(e.g. navigating away from the 3D editor and back in an SPA host) they
retained references to the disposed Three.js scene graph, which caused
the app to freeze on re-entry as the stale data was replayed against a
fresh scene.

- initSpatialGridSync now returns the unsubscribe handle from its
  scene-store subscription so callers can detach it.
- initializeEditorRuntime becomes reversible: it wires up the spatial
  grid, space detection and SFX bus on mount and returns a teardown
  closure that detaches both store subscriptions, clears the spatial
  grid manager, and truncates the viewer outliner's selected/hovered
  arrays in place.
- The Editor component's runtime-init effect now returns that teardown,
  so the singletons are reset cleanly every time the Editor unmounts.
- initSFXBus is now idempotent via an internal guard so repeated
  Editor mounts do not stack duplicate mitt listeners.

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-05 23:37:30 -04:00
Pascal
0bd0cab533
feat: stair system, scene graph utilities, read-only mode, viewer state improvements (#210)
Stair system (full stack):
- New StairNode + StairSegmentNode schemas with flights, landings, L/U-shapes
- StairSystem: geometry generation with throttled per-frame updates
- Stair tool, edit system, panels, tree node, and renderers
- Event bus types, scene registry, and command palette entries

Scene graph utilities:
- cloneLevelSubtree: deep-clone a level with remapped IDs
- forkSceneGraph: clone + strip scan/guide nodes for project forking

Core improvements:
- Read-only mode on scene store (blocks create/update/delete when locked)
- readOnly guards on node-actions and collection actions
- Upload store for scan/guide file upload handling

Viewer state:
- previewSelectedIds for box-select live preview
- hoverHighlightMode (default/delete) for delete-mode hover outline
2026-04-05 01:20:43 -04:00