* feat(editor): dev-only window hook for deterministic camera poses
Exposes a getter for the CameraControls impl in development so
screenshot/automation tooling can set exact camera poses.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer): rendering pass — sun-dominant lighting, grade, gradient-sky IBL, albedo clamp, SSGI tune
- Shadow intensity clamp 0.55 → 0.9 (sun no longer leaks into shadow),
2048 shadow maps, PCFSoft filtering
- Scene-referred contrast/saturation grade before ACES output
(GRADE_PARAMS in post-processing)
- Procedural gradient-sky IBL (cool zenith / warm horizon / ground
bounce) replaces the venice_sunset HDR fetch; env-only, background
unchanged
- Near-white albedos clamped to ~0.83 linear (defaults, white palette,
catalog preset-white/softwhite, schema presets)
- SSGI: 2 slices / 6 steps, radius 1.6, aoIntensity 1.7, giIntensity 2
(bounce on); studio hemi 0.6→0.45, fill 0.75→0.6
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer): shadow-caster-only cutaway, glass fresnel, ground fade, specular-map unwiring
- SHADOW_ONLY_LAYER (4) + lib/shadow-only.ts: hidden roofs/levels in
level-solo (editor) and dollhouse (GLB viewer) stay in the shadow map,
so interiors keep sun shadows + window light patches; only the sun's
shadow camera enables the layer
- Glass: fresnel-driven opacity + envMapIntensity on transparent
standard materials (catalog glass, scene glass, window default)
- Site ground: radial fade into the theme background at the lot
boundary (TSL colorNode); dead ground-occluder.tsx removed
- Catalog: 22 bogus *specular*→metalnessMap wirings removed (specular
level maps are not metalness; they darkened/metallized dielectrics)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer): PCSS contact-hardening sun shadows via LightShadow.filterNode
Custom TSL filter: Vogel-disk blocker search (textureLoad — the sampled
path would inherit the comparison sampler, which WGSL rejects) →
receiver-blocker penumbra estimate → variable-radius rotated PCF.
shadow.radius scales max penumbra (now 4).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer): dark-theme recalibration for the new lighting pipeline
Night/twilight: lifted ambient/hemi beds (the 0.9 shadow intensity
crushed them), brightened theme grounds to a lit mid-tone, and dimmed
the daylight gradient-sky IBL to 0.2 for dark appearances.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer): rendering-pass follow-ups — GI denoise, lighter interactive SSGI, sky gradients, scoped solo shadows
- Denoise the SSGI GI bounce (it composited raw — the visible grain) and
drop giIntensity to 1
- Interactive SSGI back to 1 slice (×6 steps); SSGI_BAKE_PARAMS (2×6)
for the thumbnail/bake pipeline
- Per-theme backgroundSky: vertical zenith→horizon backdrop gradient in
the post pipeline; makes the lot-edge ground fade read in every theme
- Level solo: only levels above the soloed floor stay shadow-caster-only;
below-levels plain-hide (they can't block the sun)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer): kill SSGI grain, real horizon — infinite ground disc fading into the sky
- SSGI back to 2 slices × 6 steps: three's own minimum preset without
temporal filtering — 1×6 was below the floor and the grain showed on
flat walls; denoise radius 5 on both AO and GI, aoIntensity 1.5;
bake preset raised to 3×8 (single-frame renders)
- Site renderer: presentation horizon disc (8× lot radius, min 400 m)
under the lot in the theme ground colour, fading radially into the
theme background; lot fill back to plain ground colour (the disc
carries the fade); never pickable (noop raycast)
- Backdrop sky gradient compressed to the upper half of the screen so
it meets the disc's far fade at exactly the horizon colour — no seam
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer): laptop-budget SSGI + seamless world-space horizon
- SSGI interactive: 1 slice × 6 steps, GI bounce OFF (denoised AO only)
— 2 slices was a thermal problem on laptops; the bounce moves to
SSGI_BAKE_PARAMS (3×8, gi 1) for one-shot renders
- Horizon disc dissolve: albedo fades to black while emissive fades to
the background colour, so the far end IS the backdrop (no lit-vs-flat
seam); backdrop gradient graded with the same transform as the scene
- Sky gradient is now world-space: per-pixel view ray reconstructed from
the scene camera matrices, sky above the true horizon (dir.y 0→0.35),
pure background below — aligns with the disc at any camera angle
- Studio theme: ground #e9e7e2 / horizon #fbfbfa / sky #dde7ef so the
fade is actually visible against the white void
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(viewer): kill shadow grain (PCSS opt-in only) and the inked horizon line
- The eye-level ground grain was measured (high-pass σ on a flat patch:
2.95 baseline → 1.52 shadows-off → 2.49 ao-off): PCSS's per-pixel IGN
dither was the dominant source, and it can't be fixed within a laptop
budget without TAA. Interactive shadows revert to the renderer's
PCFSoft (clean, cheap); PCSS stays wired behind ?enable=pcss for
experiments and future bake-time use
- The horizon 'line' was the ink pass edge-detecting the ground disc's
depth silhouette against the backdrop. Ink now fades with raw depth
(full below ~150 m, gone past ~350 m) — near silhouettes keep their
SketchUp line, the horizon dissolves cleanly
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer): soft blue skies for light presets, slab coplanarity epsilon
- backgroundSky retuned: studio/paper/blueprint/verdant get a soft blue
zenith (overcast keeps a bluish gray — it's overcast; mediterranean/
sunset were already blue; dark themes untouched)
- Slabs duplicated at the exact same position z-fight and no camera
near/far tuning can separate identical depths; each slab mesh now gets
a deterministic sub-3mm lift hashed from its node id. Render-only —
node data, snapping and measurements untouched. (Long-term fix is
reversedDepthBuffer; parked in plans with the depth-consumer audit.)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(viewer): walk back perf-costly rendering-pass pieces, soften dark-theme ink
Review feedback on the rendering pass:
- SSGI back to main's params (1 slice / 4 steps / r1, AO-only) everywhere,
including thumbnails — SSGI_BAKE_PARAMS removed. Kills the added AO grain
and the extra per-frame cost; bake workers also stop paying for heavier GI.
- Shadows stay visible via plain knobs only (intensity 0.9, radius 4): the
custom TSL PCSS filter is gone, shadow map back to 1024, filter back to PCF
(r184's Vogel-disk PCF respects radius, so edges stay soft).
- Night/twilight ink edges: colour now derived from the theme background
(lifted toward white) instead of a near-white constant, and dark scenes run
the ink at 70% alpha — no more glowing wireframe on dark backdrops.
- Snapshots: the `transparent` capture flag is now honored — preset/item
captures keep their alpha, while studio renders and project thumbnails
composite the theme background + sky gradient (same world-ray math as the
viewport backdrop, uniform-driven so the cached pipeline serves both).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer,nodes): ground the scene — contact vignette + horizon haze, shadow tune
Follow-ups from review:
- Shadow intensity 0.9 → 0.75 (read too heavy) and PCF radius 4 → 2: the
filter's per-pixel dither spreads with radius, which showed as dots across
wide penumbras. Both are free knobs.
- New shared backdrop formula (viewer lib/backdrop.ts): background below,
theme-derived haze band hugging the horizon (background lifted toward
white — faint glow on dark themes), sky above. Used by the post pipeline,
the thumbnail pipeline, and the site horizon disc, whose far-field
dissolve now evaluates the same gradient per fragment view direction —
ground and backdrop converge to identical colours, so no horizon seam
from any camera pose.
- Contact vignette on the horizon disc: a soft albedo darkening hugging the
lot (15%, fading out by ~2.6 lot radii) so the parcel sits on the field
instead of floating on it. Albedo-only — never tints the dissolve.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(nodes): make the contact vignette read on bright themes
A fixed 15% albedo cut disappears into the tone mapper's shoulder on themes
with strong key lights (studio runs intensity 4), and the dissolve's bright
emissive diluted what was left. Scale the vignette with the theme's strongest
light (0.13×, clamped at 0.45) and apply the halo to the in-band emissive as
well — it zeroes out by 2.6R while the dissolve completes at 5R, so the far
field stays the pure backdrop and the horizon seam guarantee holds.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(viewer): no more horizon line, sky gradient reaches the horizon
Two things drew a visible line where the infinite ground met the sky:
- SSGI AO grows a band along the geometry↔sky depth cliff (same disease the
ink pass had). Fade AO to 1 with raw depth over the ink's ≈150→350 m
window, in both the viewport and thumbnail pipelines — AO is a near-field
cue, it has no business shading the horizon.
- The backdrop's flat haze plateau sat between two ramps, which the eye
amplifies into Mach lines. The gradient is now one smooth background→sky
ramp crossing the horizon, with the haze applied as an exponential glow
peaking exactly at dir.y = 0 — C¹-smooth on both sides, edge-free.
The sky ramp also starts at the horizon instead of ~11° up, so the theme's
backgroundSky blue actually reads at eye level instead of hiding at the top
of the frame.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer): three-stop sky — derived deep zenith, warm horizon haze
The single pale backgroundSky stop read as a white void with blue hiding at
the top of the frame. The backdrop is now three derived stops, inZOI-style:
- pale theme sky arrives fast (full by ≈8° elevation),
- then deepens toward a zenith colour derived per theme in HSL (saturate
×1.5, darken ×0.72 — hue stays the theme's own: blue studio, lavender
sunset, near-black night),
- horizon haze now lifts toward a warm white (#fff4de) instead of pure
white, giving the junction the slight yellow of sun-scattered atmosphere.
All derived from the existing backgroundSky/background fields — no theme
data changes, and the shared-formula seam guarantee (viewport = captures =
horizon disc) carries over.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(viewer): horizon haze derives from the sky, hugs the horizon tighter
White-based haze read as a tall white stripe between ground and sky. Aerial
perspective is sky-coloured light with a little sun scatter, so the haze now
pulls the theme's backgroundSky toward the warm sun tint (50% light themes,
25% dark) and the glow decay tightens (exp −7→−11, weight 0.9→0.8) — the
merge band is skyish, sunish, and half the height, so blue starts right
above the ground line.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Two readiness fixes surfaced by the first successful headless bake of a
heavy scene (which exported with 33 items missing):
- The 180-FRAME give-up cap silently assumed display-rate frames. The
bake page's timer-driven loop (?disable=draw) runs those frames in
~3.6s — shorter than a cold item-model download — so the cap fired
and the export raced ahead of real content. New `sceneReadyMaxWaitMs`
Viewer prop replaces the frame cap with a wall-clock one on hosts
whose frame cadence is decoupled from time; default frame behavior
unchanged for interactive surfaces.
- hasPendingSceneBuildWork now skips UNREACHABLE dirty nodes: orphans
whose parent doesn't list them in `children` (or parentless non-roots)
never render — every renderer enumerates the parent's children array —
so no system ever builds them or clears their mark. Observed in prod
scene data (two dangling windows parented to a level that doesn't list
them): they held every bake of that scene to the full readiness cap.
Validated: the 200+-item office scene with ?disable=draw settles
organically in ~2s and exports the complete artifact; a one-shot 504'd
item is now WAITED for through its retry instead of racing the cap.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
With no real frames submitted, Chromium's no-damage scheduler throttles
requestAnimationFrame to 1Hz on Linux — measured in the headless bake
worker: every useFrame system ticked once per second, so a heavy scene
needed 300+ seconds of wall time just to run ~300 frames of build work
(and exceeded the capture deadline on the worker's slower cores). The
empty-scene clear from #482 avoids this on macOS but not on Linux.
When `draw` is disabled, drive advance() with setInterval instead of
rAF — plain timers are never throttled on a visible page, so the loop
pacing is deterministic (fps prop) regardless of compositor heuristics.
Normal rendering paths are untouched.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
The headless bake worker renders on SwiftShader (CPU), where per-frame
vertex/draw cost dominates the whole capture — but a bake only reads the
built scene graph; the pixels are thrown away. `?disable=draw` (same
diagnostic-param family as postFx) renders an EMPTY scene each frame
instead of the real one: useFrame systems and scene-ready keep ticking,
per-frame cost collapses to a 64x64 clear.
Rendering nothing at all does NOT work: with zero submitted frames
Chromium's no-damage scheduler throttles rAF to exactly 1Hz (measured),
starving the very systems the bake needs — hence the empty-scene draw.
Measured on the office scene (200+ items) with a real GPU: capture
45.0s -> 8.4s (settle 37.6s -> 4.5s); output equivalent to a normal
render (structural GLB diff clean; the ±13-accessor variance exists
between normal runs too). CPU-only (worker) numbers via the prod-image
container against a preview deploy.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): group R/T — keyboard rotate for multi-selections
Extract the rigid rotate/translate math from the group gizmos into
group-transform-shared (rotateGroupPatches / translateGroupPatches) and
add a keyboard group-rotate path: R/T on a multi-selection steps the
whole group ±45° around its bbox center, welded junctions and
connected-component expansion included, committed as one updateNodes
batch (one undo step). Single-selection R/T arms (reference, door/window
flip, registry keyboardActions) are untouched.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): polygon participant kind — slabs/ceilings/zones join group transforms
classifyParticipant learns a 'polygon' kind ([x,z] vertex arrays + optional
hole rings): slab/ceiling/zone now ride along in group move and rotate —
the two 3D gizmos and the keyboard group R/T all flow through the shared
rotateGroupPatches/translateGroupPatches, so the wiring is the classifier
plus the rotate gizmo's spread sampling. Zone's 3D renderer merges its live
polygon override so it previews during the drag (slab/ceiling already
rebuild via getEffectiveNode in their systems). Classifier + patch unit
tests included.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): 2D floorplan group drag — Photoshop-style multi-selection move
Plain pointer-down on a transformable member of a multi-selection now
slides the whole selection rigidly in the floor plan (the 2D parity fill
for the 3D GroupMoveHandle), instead of collapsing the selection to the
pressed node. A plain click (no drag) still collapses on release; modified
clicks, Cmd-drag direct move, and reshape affordances keep their paths.
The move-handle dot routes through the same group session when its node
is part of the multi-selection.
The session shares group-transform-shared verbatim: welded LinkedNeighbor
endpoints, connected-component expansion, live previews via
useLiveNodeOverrides.setMany, grid snapping on the delta plus Figma
alignment through applyFloorplanAlignment (guides in every mode except
off, magnetic pull in lines mode), interaction scope handle-drag with the
shared group-move label, and a single batched updateNodes (one undo).
A dashed group bbox overlay shows what rides along and tracks the live
delta. clientToPlan moves to lib/floorplan/plan-coords for reuse.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): group manipulation polish — helper text + shortcuts dialog
Multi-selection select-mode HUD now advertises the group gestures (drag
any member to move the whole selection, R/T to step-rotate), and the
keyboard-shortcuts dialog documents both under Selection.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): restore zone renderer useLiveNodeOverrides import
Formatter stripped it between the import and usage edits; nodes'
tsc --build catches it where the cached turbo typecheck did not.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): tag the 2D group selection box for drivability
data-group-selection-box on the overlay <g> so smoke drivers and devtools
can assert the multi-selection chrome.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): multi-selection shows highlight only — hide per-node edit chrome
While 2+ nodes are selected the group is manipulated as one rigid piece,
so per-member edit affordances hide in both views: the 2D overlay pass
strips handle/dimension chrome centrally (stripHandleChrome — body
highlight, hit targets, and zone name text stay), and in 3D the slab /
ceiling boundary editors and slab hole click-to-edit outlines mount only
for a sole selection (the arrow-handle rig, wall side arrows, selection
affordances, and floating menu were already single-gated). Transformable
members show a move cursor in the floor plan.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): 3D body-drag group move replaces the move gizmo cross
Pressing any transformable member of a multi-selection in 3D and dragging
past the threshold now slides the whole selection on the ground plane
(group-move-3d.ts, armed from the selection manager's pointer-down choke
point) — same participant snapshot, welded junctions, grid + alignment
snapping, live overrides, and single-undo commit as the 2D session; the
2D dashed bbox rides the same delta in split view. A plain click still
collapses the selection to the pressed node. The purple GroupMoveHandle
cross is deleted, and the hover cursor advertises the gesture: 'move'
over any transformable member in both views (3D selection-manager cursor
+ 2D entry cursor).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): group action menu — move / duplicate / delete the whole selection
Multi-selections get a floating Move / Duplicate / Delete pill in BOTH
views (GroupFloatingActionMenu anchored above the 3D group bbox,
FloorplanGroupActionMenu anchored above the 2D dashed group box); the
single-node menus are now sole-selection only. All three actions target
the whole selection via shared group-actions:
- Move starts a group pick-up: the selection rides the cursor
(delta-relative, grid + alignment snapped) across BOTH surfaces —
floorplan via the scene CTM, 3D via a ground-plane raycast through a
three-context bridge published by the selection manager — until a
click places it as one undo step; Escape / right-click cancels.
- Duplicate clones the selection through the clipboard pipeline
(subtrees + id remap, without touching the user's clipboard — new
duplicateNodesToLevel), selects the clones, and picks them up;
cancelling deletes the clones again. The pick-up scopes to the
selection (no component expansion / welded links) because the clones
sit exactly on the originals, and falls back to participant-data
bounds because the clones' meshes haven't mounted yet.
- Delete removes everything selected with the keyboard arm's
bulk-confirm semantics.
Verified end-to-end with the scripted smoke (16/16): chrome hiding,
2D/3D/split group drags, R/T round-trip, one-step undo, menu move /
duplicate / delete, 3D move cursor. (Headless runs of the suite can
deadlock in SwiftShader's GL readback on the split-view resize —
environment-only; run headed.)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): group transforms no longer re-create auto rooms
Every group commit (2D/3D body drags, pick-up, rotate gizmo, keyboard
R/T) now wraps its single updateNodes in pauseSpaceDetection /
resumeSpaceDetection: the wall-driven room auto-detection rolls its
baseline forward instead of treating rigidly-moved walls as a new room
and duplicating its floors/ceilings. Room creation stays where it
belongs — building and editing walls.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): polygon hosts carry their attached items in group transforms
Ceiling-mounted items are children of the ceiling, but polygon hosts
(slab/ceiling) move by rewriting vertices — no group transform — so,
unlike wall children which ride the wall mesh, their children were left
behind by group moves/rotates. collectParticipants now snapshots a
polygon participant's positioned children (level-frame coords, since the
host group sits at the origin) so they ride every group path. Unit test
included.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): click picks up the group; the 2D dashed box is the drag handle
Clicking a selected member of a multi-selection (no drag) now enters the
group pick-up — the same click-to-move the sole-selection has — instead
of collapsing the selection, in 2D and 3D alike; clicking outside still
deselects. The 2D dashed selection box is itself the group's handle:
move cursor across its whole area, press-drag anywhere inside slides the
group, a plain click picks it up, and holding Cmd/Ctrl/Shift lets clicks
pass through to the entries so membership toggling keeps working. HUD
hint + shortcuts dialog updated.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): 3D dashed group selection box doubles as the drag handle
The multi-selection now shows a dashed wireframe box in 3D (sibling of
the 2D dashed rect): move cursor across its whole volume, press-drag
anywhere on it slides the group, a plain click picks it up, and holding
a selection modifier passes the press through so members inside can
still be toggled. Rides the shared live-drag delta so it tracks the
group mid-gesture in both panes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): mid-move R/T, 2D corner rotate, realtime opening symbols, box cursor + Esc hint
- R/T while carrying a group (body drag or pick-up) now rotates the
carried snapshots around the rest pivot — identical to the idle
keyboard rotate — instead of leaking into the store mid-session; the
session keydown owns the keys in capture phase and the group-move HUD
advertises them.
- The 2D dashed box grows corner rotate handles: drag a corner to spin
the group in 15° steps, Shift for free rotation — the floor-plan
sibling of the 3D rotate gizmo, sharing its scope, HUD hints, and
single-undo + space-detection-paused commit.
- Door / window floor-plan symbols now track wall drags in realtime:
their defs merge the walls' live overrides (wallFloorplanSiblingOverrides)
so ctx.parent is the effective wall instead of the stale store one.
- The 3D selection box asserts the move cursor across its whole volume
on pointer move (the old ''-guard lost to app default cursors).
- Multi-select HUD + shortcuts dialog mention Esc / click-outside to
clear, and the mid-move rotate.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): rotate cursor + spinning box on 2D corner rotate; Delete ends a carry
- The 2D corner handles show a proper curved-arrow rotate cursor (inline
SVG data URI, black glyph with white halo, grab fallback).
- The dashed selection box spins live with the group during a corner
rotate: the rotate session publishes pivot+angle through the shared
drag store and the box applies the SVG rotate transform.
- Delete / Backspace during any group session (drag, rotate, pick-up)
reverts the session first and then lets the global Delete arm remove
the selection — no more dangling carry after deleting mid-move; the
duplicate flow's cancel still discards the clones instead.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): per-node direct manipulation stands down for multi-selections
Cmd is both the selection-toggle key and the single-node direct-move /
direct-rotate trigger, so a Cmd+click that wobbled past the drag
threshold over a selected member (slab or any kind) armed the legacy
single-node move and yanked that one member out of the group. All four
per-node direct-manipulation entry points — the 3D Cmd-drag move and
Cmd+right-drag rotate in the selection manager, and their 2D siblings in
the registry layer — now require the pressed node to be the SOLE
selection; with a multi-selection the gesture is simply not registered
(the group sessions own plain drags, Cmd+click keeps toggling). The
shortcuts dialog notes the single-selection scope.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): group gestures own their ending pointerup — no synthesized click leak
use-node-events synthesizes a selection click on EVERY canvas pointerup
(deliberately more forgiving than R3F's onClick). Body drags were safe
only because inputDragging suppresses it, but the pick-up flows leaked
it as a race: the release that started a pick-up could collapse the
multi-selection to the pressed node first (then only that node was
carried), and the placement press re-selected whatever sat under the
cursor after commit.
The group sessions now claim their gesture-ending pointer events in the
CAPTURE phase and stop propagation, so the canvas never sees them and no
click is synthesized: the pick-up claims the placement press on
pointerdown and commits on its pointerup; the 3D and 2D drag/rotate
sessions stop their ending pointerup (split view: a 2D-started release
over the 3D canvas had the same hole).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): screen-rect marquee tests projected oriented bounds, not double-inflated AABBs
The 3D screen-rect box select intersected the marquee with each node's
world AABB re-boxed in screen space — two nested axis-aligned inflations.
Any oblique camera padded every node's claim, and rotated geometry (now
common: group rotation) made it flagrant — a diagonal wall's world AABB
spans a full square, so marquees selected objects visually far from the
cursor.
Membership now tests the marquee against the convex hull of the node's
ORIENTED (local-frame) bounding box projected to screen — tight under any
rotation and camera, uniform for every kind. Pure helpers
(convexHull2D / rectIntersectsHull) live in marquee-geometry.ts with unit
tests covering the diagonal-wall regression, containment both ways, and
edge-only crossings. The plane marquee variant was already precise and is
untouched.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): keep box select alive after group gestures
The capture-phase stopPropagation the sessions used to silence the
canvas's synthesized selection click also killed the window bubble
listeners that clear the box-select pointer suppression — and the mouse
pointerId is constant, so one group gesture left the marquee dead until
blur. The sessions now use the designed suppression instead: they hold
inputDragging raised through the release event's dispatch (lowered on a
0ms timer) so use-node-events suppresses the click itself, and every
other pointerup listener runs normally.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): marquee membership by plan footprint; 2D item highlight; site line steps back
- The 3D screen-rect marquee now projects itself onto the active level's
floor plane and tests the DATA kinds exactly there — walls/fences by
their segment, slabs/ceilings/zones by their polygon — matching the
plane-marquee tool's semantics. This kills the two remaining
imprecision sources the hull pass couldn't: vertex-baked rotation
(polygon/fence geometry lives in level coords, so after a group
rotation even the local bbox is an inflated axis-aligned square) and
ceiling parallax (an elevated plane projects to a screen quad offset
from its room, selecting 'from far'). Mesh-transform kinds (items,
columns) keep the projected oriented-bbox hull test; plan-space
segment/polygon intersection helpers join marquee-geometry.ts with
unit tests.
- Selected items finally read as selected in the floor plan: palette
stroke + heavier weight on the footprint, plus a selection ring drawn
above the thumbnail (the move dot used to be the only cue, and it
hides in multi-selections).
- The site's dashed property line drops to 20% opacity while a multi or
in-flight marquee selection exists so it stops fighting the dashed
group selection box.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): 2D marquee plan-footprint membership; item marquee preview; overlays re-measure after undo
- The 2D screen marquee intersected each entry's getBoundingClientRect —
an axis-aligned DOM box, inflated for rotated polygons and diagonal
walls (the same double-inflation class as the 3D bug). It now maps the
marquee through the scene CTM into a plan quad (rotated views included)
and tests the data kinds exactly — walls/fences by segment,
slab/ceiling/zone by polygon — reusing the shared marquee-geometry
helpers; other kinds keep the DOM-rect fallback.
- Items now show the marquee preview tint in 2D (highlighted viewState =
the same palette stroke + thumbnail ring the selection shows, slightly
lighter), instead of giving zero feedback until the drop.
- Everything that measures the selection's meshes (2D/3D dashed boxes,
the 3D group menu anchor, the rotate gizmo pivot) re-measures once the
meshes settle after a scene change via useMeshSettleEpoch — an undo
after a move no longer leaves the box at the pre-undo position
(computeGroupBox reads mesh world bounds, which lag the store commit by
a frame or two).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): dim the actual site boundary line during multi-selections
The earlier dimming targeted registry-layer site entries, but the site
lives at the scene root — outside the level DFS and the building-scoped
sweep — so no entry ever matched and the dashed property line kept full
opacity next to the dashed group selection box. Move the dimming to
FloorplanSiteLayer (the component that actually draws the line) and
drop the dead registry plumbing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* fix(items): retry failed model loads, settle skipped items, keep exports clean
A transient storage failure (observed: Supabase 504s under the bake page's
~200-concurrent-request burst) permanently broke an item for the whole
session: drei's useGLTF caches the rejected load by URL, the per-item
ErrorBoundary swallowed it, and the red debug-box fallback was BAKED into
the exported GLB (observed in a prod artifact). Meanwhile ItemSystem
cleared the dirty mark at group registration — before the model resolved —
so scene-ready could fire while GLBs were still loading, risking exported
placeholder geometry.
- ModelWithRetry: bounded retries (1s/3s) that clear the useGLTF cache
entry and re-mount via the boundary's new resetKey. The timer is owned
by an effect keyed on the failure count, so StrictMode's synthetic
unmount/remount re-arms it instead of silently discarding it (the
naive onError-scheduled timer died exactly that way in dev).
- Exhausted retries settle the item as SKIPPED: the debug box renders
nothing during exports, and the failure lands in
useViewer.itemLoadFailures (nodeId -> url) so a bake host can persist
which items are missing from the artifact.
- ItemSystem holds the dirty mark until the item settles (model mounted,
terminally failed, or never expected) — scene-ready now genuinely waits
for item content; loading placeholders also hide during exports.
- ErrorBoundary: onError + resetKey props.
Verified against a 200+-item prod scene locally: permanent 504 -> exactly
3 fetch attempts, bake completes without the item and without debug
boxes; 504-once -> retry heals, artifact byte-equivalent to the intact
run; no-failure runs unchanged (demo_1 byte-identical).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(items): reset retry budget + settled flag when the asset URL changes
Bugbot: after a terminal load failure, swapping the item's model kept the
stale failures/epoch state and the settled flag — the new URL never even
attempted to load. ModelWithRetry is now keyed by asset src (clean retry
budget per URL) and un-settles the item on mount so the replacement load
is awaited by ItemSystem/scene-ready too.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Instanced plant kinds (trees/grass/flowers) never cleared their dirty
marks: FloorElevationSystem deliberately leaves the mark for kinds with
a def.system, expecting that system to clear it after its own work, but
InstancedKindSystem never participated in the dirty protocol. The marks
lived forever, hasPendingSceneBuildWork() never went false, and the
Viewer's scene-ready signal stalled at SCENE_READY_MAX_WAIT_FRAMES on
every plant-containing scene — measured on the headless bake worker as
~190s (180 frames x ~1s SwiftShader frames) of pure cap-wait per bake.
Clear the marks in a priority-2 useFrame pass: after the priority-1
floor-elevation lift in the same frame, and only for nodes whose proxy
is registered (instances rebuild synchronously from the store, so a
rendered node is already built). Validated by baking Wawa House
locally: settle 22.5s -> 11.6s (the remainder is genuine asset
loading), exported GLB byte-identical with and without the fix.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Fix pass over 2D reference-image (guide) handling plus two adjacent repairs:
- North is now world −Z (FLOORPLAN_VIEW_ROTATION_DEG 90 → 0, mirrored in
world-grid-snap + mcp README; floorplan-panel de-dupes its local copy).
A rotation-0 north-up scan reads upright when the compass says aligned,
and "align north" maps to camera azimuth 0 instead of a 90° jump.
- Guide resize cursor: custom double-arrow cursor aimed at the dragged
corner in screen space — accounts for image aspect (was atan2(±1,±1),
square-only), the guide's own rotation, and the floorplan view rotation
the overlay group renders inside (was ignored entirely).
- R/T rotate a selected reference (guide/scan) in ±45° steps; references
live in selectedReferenceId, not the viewer selection, so both arms get
the reference-first branch the Delete arm already had. Locked guides skip.
- 2D-only mode hides the Top View button (drives the display:none 3D
camera); orbit stays — it spins the synced floorplan view.
- Set Scale UX: locked guides stay clickable (calibration auto-lock made
them unselectable until reload); starting the flow from 3D switches to
2D; the length input pre-fills the drawn length in the pre-selected unit
(imperial pre-filled meters labeled feet); Set Scale flips into Cancel
while the flow runs (mirrored via referenceScaleActiveGuideId); Hide/
Clear Scale only render once calibrated; Escape cancels (global arm +
dialog); Clear Scale and Replace Image drop the calibration auto-lock;
discoverability: corner-hint row + panel nudge for uncalibrated guides.
- healSceneNodes: strip child refs whose child's parentId names another
parent (stale reparent leftovers rendered a window twice — duplicate
React keys in 2D, doubled hosted geometry in 3D) and same-array dupes.
- Editor accepts onLoaderChange so hosts can measure open-to-interactive
time (community wires it to a PostHog timing event).
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* fix(core): apply window schema defaults on scene load
Windows saved before a schema field existed (columnRatios/rowRatios/
frameThickness/…) loaded with those fields missing; the window mesh
builder reads them unconditionally and threw every frame, crashing the
viewer on legacy scenes. Zod-parse windows on load like doors so the
schema defaults land.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): mount plant geometry during client GLB/STL/OBJ export
The client export never set isExporting, so instanced kinds (trees/
flowers/grass) kept their colorWrite:false raycast collider mounted and
exported it as an opaque white box, while the real geometry (which only
mounts while exporting) was never captured. Reuse BakeExporter's
flag + frame-wait dance in ExportManager, and harden isRenderableMesh
to drop colorWrite:false materials from exports entirely.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): route zone drawing through the shared surface snap
The zone tool quantized later vertices by distance along a free ray
instead of snapping to the grid, and never joined the magnetic
wall-corner/midpoint/crossing + alignment-guide pipeline that walls,
slabs and ceilings use. Give zone the slab treatment in the 3D tool and
both 2D floorplan branches (move + click + double-click commit).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(viewer): self-host the scene environment HDR
drei's preset="sunset" fetches venice_sunset_1k.hdr from
raw.githack.com, which intermittently fails ("Could not load
venice_sunset_1k.hdr: Failed to fetch"). Point Environment at
/hdri/venice_sunset_1k.hdr and ship the file in the app's public/ —
same mirroring convention as /audios/sfx; consuming apps must carry
the file too.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): unmount zones entirely outside the zones layer
Zone labels showed in every editing mode (visual noise), and each zone
kept a drei <Html> mounted at opacity 0 — an <Html> costs per-frame
matrix work and live DOM even when invisible. A new viewer presentation
flag (showZones, default true) lets the editor unmount zone meshes and
labels whenever the structure layer isn't 'zones' (and during snapshot
capture); the registered group stays so zones keep their scene identity
for selection and GLB export. Preview / first-person / viewer surfaces
are untouched. Raycast-disable moved from a one-shot group flag to
per-frame on the meshes, which now remount on layer toggles.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): keep snapshot pitch out of preset thumbnail capture
The capture overlay's snapshot hint and 'Take snapshot' shutter label
rendered in every capture variant, clashing with the save-as-preset
flow's own 'Frame your item — click Capture' banner. Gate them on the
existing isPreset discriminator and label the shutter 'Capture' there.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(viewer): renderPaused flag suspends the frame loop
Hosts that fully cover the canvas (e.g. the studio gallery overlay) can
set renderPaused to stop FrameLimiter's RAF loop — a heavy animated
scene otherwise keeps starving the GPU behind the overlay and makes it
stutter.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): drop the crop/format HUD in preset capture
The pills crowded the save-as-preset banner and repeat what the fixed
square frame already shows.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): no contextual shortcut hints in the studio workspace
Holding Shift surfaced select-mode/snapping hints over the studio
compose panel and gallery, where there is no scene selection or tool to
act on.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
WebGPU rejects block-compressed textures whose base dimensions aren't
multiples of 4; three's KTX2Loader only warns and transcodes anyway, so a
baked GLB carrying one odd-sized user-item texture (e.g. 299x399) poisoned
every render pass — endless 'Invalid BindGroup … Invalid CommandBuffer'
spam. Route such payloads through a fallback transcode to uncompressed
RGBA32 and repackage the pixels as a plain DataTexture (three's WebGPU
upload path crashes on a CompressedTexture holding rgba8 data).
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
- roof-system: replace BoxGeometry placeholders (initial swap + empty-roof
merged shell) with a group-less degenerate geometry — a Box's 6 groups
against the roof's 4-material array crashed GLTFExporter on every scene
with a segment-less roof node (prod: 'reading isShaderMaterial'), and
count-0 groups crash MeshBVH's packed-tree build.
- glb-export: sanitizeMaterialGroups pass repairs any mesh whose geometry
groups don't line up with its material array before GLTFExporter runs.
- export-manager: give neutralised (attribute-less) meshes an empty position
attribute before STL/OBJ export — both exporters read position.count
unconditionally.
- bake-exporter: log the full error stack so the bake worker's console relay
captures it in the job's error trail.
- viewer: host-controlled disablePostFx prop (Viewer → PostProcessing) that
skips building the SSGI/denoise pipeline entirely; the ?disable=postFx URL
flag previously only bypassed it per-frame while still allocating it.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): stage overlay slot, preselectable snapshot crop, pro capture overlay
- Editor/EditorLayoutV2 gain a stageOverlay slot rendered over the canvas
but under the viewer toolbar (z-10 < z-20), so hosts can swap in a
full-stage surface (e.g. studio gallery) without unmounting the WebGL
canvas; FloatingLevelSelector hides while a stage overlay is active
- CaptureMode 'standard' accepts an optional crop preselection
(SnapshotCropMode, exported) so hosts can enter capture with
standard/viewport/area already chosen
- SnapshotCaptureOverlay restyle: letterboxed 16:9 frame with corner
accents + rule-of-thirds for standard mode, thirds grid in viewport
and area modes, top-center crop/format HUD chips, shutter button with
capture/saved states — all existing crop, drag, resize and preset
behaviors preserved
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): standard-capture aspect presets, capture scrim, caption fix
- Standard crop gains aspect presets (16:9, 9:16, 4:3, 3:4, 1:1) — clicking
the active Standard chip opens the picker; the letterbox frame, HUD and
output resolution follow the choice
- ThumbnailGenerateEvent carries standardSize; ThumbnailGenerator
center-crops to it (default stays 1920×1080)
- Subtle bottom scrim keeps shutter/caption readable on bright scenes
- Fix missing space in the snapshot caption
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): standard-capture aspect preselect via CaptureMode
Hosts (the studio capbar) can now pass standardAspect alongside crop when
entering capture mode; the overlay initializes its aspect picker from it.
SnapshotStandardAspect exported.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* fix(snapping): show alignment lines in all modes, snap only in lines; north export; R/T hint; grid default
- Alignment guides display in every snapping mode (grid/lines/angles/off);
magnetic pull applies only in 'lines'. New isAlignmentGuideActive() predicate
decouples guide display from the snap delta across all placement/move/draw
producers (item, wall, fence, slab/ceiling/roof, column/shelf/spawn, door/
window, MEP, 2D floorplan drafting, surface snap).
- Floorplan PDF export now rotates to north-up (FLOORPLAN_VIEW_ROTATION_DEG -
building rotation), matching the on-screen aligned-to-north view.
- Item placement rotate hint collapsed to a single 'R / T Rotate' row.
- Default item snapping mode changed lines -> grid.
* feat(walls): detect rooms across shared walls + tight connect-snap in all modes
Room detection: planarize the wall graph before face-finding — split straight
walls at T-junctions where another wall ends mid-span, so a room closed against
the middle of an existing wall is detected, not just isolated 4-wall rooms.
Auto-close: wire the wall builder's "Room (auto-close)" to the same room graph
via wallClosesRoom(), so drafting stops when a segment seals a room against the
existing structure — not only when the chain returns to its own start.
Connectivity snap: add a tight wall-connect snap (WALL_CONNECT_SNAP_RADIUS 0.05)
that also runs in grid/off/angles — within range of a wall (body or corner,
uniform radius) the endpoint sticks onto it and the beacon shows, so rooms close
in every mode. Lines keeps its wider magnetic radii. Gate alignment guides in
non-magnetic modes to the same connect distance so a corner dot no longer
magnetises the cursor from far.
Tests: cover T-junction detection + wallClosesRoom; update the item-default and
wall-split tests for the mode-driven behaviour.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(surfaces): gate alignment guides to connect distance in non-magnetic modes
Port the wall drafting/endpoint gating to the shared slab/ceiling/roof snap
(resolveSurfacePlanPointSnap): in grid/off/angles, only anchors within the
connect distance are fed to the alignment resolver, so guides form to nearby
points and far corner dots stop lighting up from across the plan. Filtering the
candidates (local-frame, like the cursor) rather than the resolved guides avoids
the floor-plan view rotation baked into the guide coords. Lines mode keeps the
full-range guides; the surface wall connect-snap is unaffected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(slabs): deterministic wall-slab overlap via clipped overlap length
Wall elevation used ray-cast point samples that landed exactly on the
slab boundary for perpendicular walls, so whether a butting wall
followed the slab's elevation depended on which side of the slab it
touched. Clip the wall centerline and face lines against the polygon
and require >=5cm of on/inside length instead: walls along the slab
edge follow it on every side, point contact never does.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(grid): lift lattice 1mm off slab tops; wall-align on wall-item move start
The horizontal snap lattice sat exactly at the followed surface Y, so it
z-fought elevated slab tops while moving items. The visual mesh now rides
1mm above; the grid event plane keeps the true height.
Moving a wall-hosted item showed a horizontal grid until the first
pointer move published a wall surface — the mesh fallback assumed UP.
Derive the host wall normal from the item mesh's world orientation
(local +Z faces out of the wall) so the lattice is wall-aligned from
the first frame.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(editor): unify selection shortcuts + truthful select-mode hints
Shift+click now toggles selection membership in 3D like Cmd/Ctrl (and
appends on box-select release), matching the 2D floorplan. The HUD rows
describe what actually works in both views: move is plain left-drag (the
grip/dot), the two vague selection rows collapse into one Cmd/Shift
or-group, and the modifier-held variants (freely / with guides / bypass
snaps) are gone — guides follow the snapping mode now. Key pills join
with + for combos and / for alternatives; Shift renders as the shift
icon.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): group gizmos — reliable rotate grabs, mutual hide, snapping-mode integration
The group-rotate gizmo never received pointer events through the shared
invisible hit-area path (EDITOR_LAYER + custom raycast) in its portalled
context; its handlers now live on the visible arrow plus a plain
default-layer invisible torus, so hover and drag work with a fat target.
Group drags begin a handle-drag scope: each gizmo hides while its
sibling drags (the frozen corner goes stale), idle hints leave the HUD,
and the drag gets contextual hints — Shift free-rotation for rotate, the
snapping chips for move.
Group move joins the snapping-mode system via the 'item' context: Shift
cycles the mode, Ctrl the grid step (both read live mid-drag), and
'lines' runs the same Figma-style alignment as single-node moves against
the group's bbox anchors. Chip clicks now tick like the keyboard cycles.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(editor): group-move ticks in every snapping mode
Mirror the single-node move's sfx: emit per delta change rather than
only on grid crossings, so lines/off get the same rate-limited texture.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(items): keep host transfers glued to the cursor
Moving between hosts used to diverge from the pointer and mangle state:
- Grab offsets: every surface anchor (wall / ceiling / shelf / item
surface / floor) preserved the grab offset by re-seeding from the
item's carried-over position on each new host, landing it far from
the cursor. The grab offset now survives only on the original host
and only until the item anchors anywhere else — after that every
host (the original included) centers the item under the cursor.
Applied uniformly to the placement coordinator and the window/door
move tools.
- Rotation: detaching from a rotated shelf/table back to the floor kept
the HOST-local yaw as the level yaw, visibly spinning the item. The
detach now re-expresses the item's world yaw in the level frame.
- Elevation: the same detach wrote the level parentId to the store but
not the draft ref, so the floor-elevation resolver bailed on its
parent-must-be-a-level guard — the snap grid and the item stopped
following slab elevations for the rest of the drag.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(items): latch grab-offset forgetting across every host kind
Review follow-up (PR #458): unify the per-surface grab-forget rule into
one grabForgotten latch. A wall/ceiling item could not actually reach a
shelf or the floor (item-surface enter rejects attachTo assets), but a
wall item CAN anchor on a roof face — and returning to its original
wall then restored the stale grab offset. Roof-wall transitions (and
floor landings after a host visit) now trip the latch in the
coordinator and the window/door move tools alike.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(plugins): trees tracer-bullet plugin + minimal host panel surface
Ship one real first-party plugin and only the host surface it forces
into existence, proving the plugin contribution paths every future
plugin (mint.gg generator, Home Assistant, environments, room volume)
will reuse.
Host surface (core + editor):
- core: Plugin.panels + observable panelRegistry; loadPlugin routes
panels (namespaced by plugin id, dup-throws like nodes).
- editor: AppSidebar merges panelRegistry into the icon rail via
useSyncExternalStore; each plugin panel lazy-loaded behind an error
boundary; host extraPanels keep precedence.
- editor: widen Tool to `KnownTool | (string & {})` so plugin tool ids
(e.g. 'trees:tree') typecheck; dispatch already registry-first.
Trees plugin (packages/plugin-trees), structurally a third-party pack
(peer-deps on @pascal-app/*):
- trees:tree node — procedural low-poly geometry (oak/pine/birch/palm),
free parametric inspector (preset/height/seed + Randomize), placement
tool + ghost preview built from public primitives only.
- presets rail panel — panel -> plugin store -> def.tool -> SceneApi ->
scene -> reactive read-back ("N planted").
Loading + docs:
- apps/editor: setPluginDiscovery([treesPlugin]) in bootstrap;
transpilePackages + dep.
- wiki/architecture/plugin-authoring.md: panels field, error-boundary
contract, styling, tool-from-panel note.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(plugins): merge plugin panels into the v2 sidebar layout too
The community shell renders <Editor layoutVersion="v2" sidebarTabs={...}>,
a separate rail from AppSidebar. Merge registry panels into the v2
tabMap + tab bar (and thus mobile) so plugin panels show up there as
well, not only in the v1 AppSidebar.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(plugin-trees): ez-tree geometry + instanced rendering + snapping
Replace the placeholder low-poly geometry with dgreenheck/ez-tree
(self-contained — bark/leaf textures inlined as base64, no assets to
host) and render the forest with true GPU instancing.
Rendering:
- def.system (system.tsx): one collective renderer that groups every
trees:tree node by (preset, seed) variant and draws each variant as
one InstancedMesh per ez-tree sub-mesh, composing the parent level's
world matrix into per-instance matrices. ~1 draw call per variant.
- def.renderer (proxy-renderer.tsx): an invisible, raycastable per-node
proxy so the host's existing selection / outline / zone machinery
keeps working — no instanceId bookkeeping. (Outline highlights the
proxy bbox; documented.)
- geometry per variant generated once by ez-tree and cached; seeds drawn
from a bounded pool so trees actually share variants.
Presets remapped to ez-tree built-ins (oak/pine/aspen/ash/bush).
Placement now respects the active snap mode — isGridSnapActive() +
gridSnapStep + snapPointToGrid, like the built-in item/shelf tools.
transpilePackages += @dgreenheck/ez-tree in the editor app.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(plugin-trees): true-silhouette hover/select + richer presets panel
Selection/hover now outlines the real tree shape, not the bbox. The
proxy splits into an outer group (stable invisible box collider +
pointer handlers, the raycast target) and an inner registered group that
mounts the real ez-tree geometry (invisible, non-raycasting) only while
the node is hovered or selected. The host outline pass reads the
registered inner group, so it traces the true silhouette; picking stays
on the steady box. Geometry for the highlight reuses the cached variant.
Panel: redesigned cards with gradient swatches + selected state, a
"planted" count chip, and a height slider that seeds the next tree's
height (a per-instance scale — never touches placed trees or instancing).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(plugin-trees): curated tree params + procedural flowers (sibling kind)
Tree params: expose foliageDensity, trunkThickness, and a leafless toggle
in the inspector and the panel brush. Each is folded into the instancing
variant key and mapped onto ez-tree options (radius scale, leaf count),
so editing one tree only re-buckets that tree — instancing degrades
gracefully, never worse than per-node.
Flowers: add a `trees:flower` sibling kind — simple procedural geometry
(stem + petals + center, merged per material), presets daisy / tulip /
lavender, instanced + selectable exactly like trees.
Refactor: extract the instanced renderer + selection proxy into a generic
`instanced.tsx` (InstancedKindSystem + KindProxy) and the snap/level/grid
placement wiring into `placement.tsx` (usePlacement). Trees and flowers
are now thin bindings — the template for future plant kinds.
Panel: a Trees / Flowers toggle, gradient preset cards, per-kind planted
count, and brush sliders.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(plugin-trees): native inspector controls in panel + preset thumbnails + ez-tree credit
- swap the panel's custom slider/checkbox/toggle for the host's exported
SliderControl/ToggleControl/SegmentedControl so the brush matches the
right-hand inspector pixel-for-pixel
- replaceable preset thumbnails (inline SVG data URIs, no asset hosting) render
as <img> cards instead of gradient swatches
- credit footer linking @dgreenheck/ez-tree (Daniel Greenheck, MIT)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(plugin-trees): all ez-tree presets + type + leaf/branch colours, flower petal colour, grass kind
- tree presets now cover all of ez-tree's built-ins via species × size
(Small/Medium/Large + Bush 1/2/3 + Trellis), plus a Deciduous/Evergreen type
- edit-only leaf & branch colour tints (leaves.tint / bark.tint), all folded
into the instancing variant key
- flowers gain a per-flower petal colour (baked from preset at placement)
- new trees:grass instanced kind — procedural blade tufts (meadow/fescue/reed)
with a per-tuft blade colour, reusing the generic instanced + placement core
- panel: Trees/Flowers/Grass segmented switch, size + type controls, native
host controls throughout; credit links Daniel Greenheck's X
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(plugin-trees): tolerate nodes persisted before new fields existed
treeSpecOf/flowerPetalColor now default every geometry field, and hexToInt
guards undefined — trees/flowers placed before size/type/colour fields were
added load with neutral defaults instead of crashing the instanced renderer.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(plugin-trees): shared always-on wind + pin credits to panel bottom
- wind.ts injects a sway into each material's begin_vertex driven by one shared
uTime uniform (advanced per frame in the instanced system); USE_INSTANCING
guards keep the same material valid for the non-instanced placement ghost.
Applied to tree, flower, and grass materials — a whole scene sways like ez-tree.
- credits footer is now sticky to the bottom of the panel.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(plugin-trees): rename rail panel Trees -> Nature (covers trees/flowers/grass)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(plugin-trees): rename panel header Plant -> Nature to match the rail
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat: bake-exportable instanced plants + renderer-agnostic wind
Bake (GLB export): add a transient useViewer.isExporting flag. BakeExporter
flips it, waits for the commit, then exports. KindProxy watches it and, during
export, emits each plant's REAL visible geometry under scene-renderer (which the
exporter clones) instead of the invisible collider — so instanced kinds
(def.system) that live outside that subtree are captured. The collider box is
dropped during export so it doesn't bake as a phantom solid.
Wind: the previous onBeforeCompile wind was a no-op under the editor's WebGPU
renderer (WebGL-only hook). Replace it with a renderer-agnostic per-instance
base-pivot tilt animated in useFrame (which FrameLimiter drives continuously).
Reads as wind under any renderer; removes the dead wind.ts + applyWind calls.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(plugin-trees): TSL vertex-bend wind (WebGPU), replacing CPU tilt
wind-node.ts adds a TSL positionNode that bends each plant proportional to
height above its base, phased per-instance (instanceIndex) and per-vertex, so
tips sway and roots stay planted — animated on the GPU via the renderer's time
node. ez-tree is untouched: its materials are copied into MeshStandardNodeMaterial
(toWindMaterial); flowers/grass build node materials directly (windStandardMaterial).
Instance matrices go back to static.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(plugin-trees): tree materials render black under wind (Phong not Standard)
ez-tree's bark/leaves are MeshPhongMaterial; copying them into a
MeshStandardNodeMaterial swapped the shading model (specular/shininess ->
roughness/metalness) and rendered black. Convert into the matching node
material type (Phong->Phong, Lambert->Lambert, else Standard) so map/color/
alphaTest/side are preserved.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(plugin-trees): trees still black — build node material from map/color explicitly
Material.copy() doesn't transfer a classic material's map/color onto a node
material, so textured trees rendered black (flowers/grass were fine — they carry
no map). Re-create the ez-tree materials as MeshStandardNodeMaterial with map,
alphaMap, color, side, alphaTest passed explicitly in the constructor — the same
proven path the flower/grass materials use.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(plugin-trees): tree wind — per-leaf flutter (ez-tree style), static trunk
The whole-tree height-based bend was a rigid rotation about the base ('rotating
in place'). Replicate ez-tree's actual approach: scale sway by the leaf card's
uv.y and apply it ONLY to the 'leaves' material (multi-frequency wave, phased per
instance + per leaf) so leaves flutter from their attachment while bark/branches
stay static. Flowers/grass keep the gentle whole-plant stem bend.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(plugins): Plugin.onSceneLoad hook + viewer application; trees wind via it
Adds a broad, plugin-declared post-load scene hook so effects survive GLB export:
- core: Plugin.onSceneLoad (lazy, three-free) + observable sceneHookRegistry + loadPlugin routing.
- viewer: applyPluginSceneHooks util; PluginSceneHooksSystem re-runs it on the live
scene as nodes change; GlbScene runs it on each loaded baked GLB.
- plugin-trees: declare onSceneLoad; wind is no longer welded into the materials —
the hook re-attaches LEAF_FLUTTER/STEM_BEND by material name (leaves / flower-* /
grass-*), so it now animates in the baked /viewer too, not just live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(plugin-trees): scale-invariant leaf wind (÷ modelScale) so baked GLB matches editor
The bake's quantiser renormalises each plant mesh to [-1,1] and moves real size
into a large node scale (~3 on trees). LEAF_FLUTTER added a constant local offset,
so in the baked GLB it was multiplied by that scale → ~3x over-swing. Divide the
sway by modelScale.x to keep a constant world-space amplitude; editor (scale 1)
is unchanged, baked now matches.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* revert: onSceneLoad wind approach → back to wind-in-materials
Reverts the Plugin.onSceneLoad hook + viewer application + modelScale compensation
(commits 893ca839, 6c9ee003). Superseded by the bake-policy 'replace' model
(plans/editor-plugin-trees-example.md Part D): trees render live in the viewer via
their own path, so wind is a plain positionNode on the material again — no hook,
no baked-geometry decoration, no coordinate-space fights.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(bake): per-kind bake policy (static/strip/replace)
Adds NodeDefinition.bake ('static' default | 'strip' | 'replace') + registry
helpers bakePolicyOf/kindsWithBakePolicy in core. Generalises the previously
hardcoded scan/guide handling:
- glb-export strips kinds with bake==='strip' from the artifact (was a
scan/guide type check); 'replace' kinds stay baked (portable static snapshot).
- glb-reference-nodes selects rebuild candidates by policy instead of type.
- scan/guide declare bake:'strip'; trees/flower/grass declare bake:'replace'.
Viewer-side 'replace' swap (strip baked meshes + live-rebuild) is the next slice.
Part of plans/editor-plugin-trees-example.md Part D.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(bake): viewer 'replace' swap — hide baked meshes, re-render live
Adds NodeDefinition.bakeReplaceRenderer (falls back to renderer). The baked
/viewer now, for kinds with bake:'replace' and a loaded plugin:
- hides the static baked meshes (bakePolicyOf(kind)==='replace') in GlbScene's
identity pass — capability-gated, so with no plugin the meshes stay;
- re-renders each node live via buildGlbReplaceNodes + the shared portal-into-
baked-level path (GlbReferenceNode now prefers bakeReplaceRenderer), so trees
ride level stacking automatically and wind runs in real coordinate space.
plugin-trees ships a hookless KindStatic (real geometry + wind materials, no
collider/selection) and per-kind static-renderer binds; tree/flower/grass point
bakeReplaceRenderer at them. Completes plans/editor-plugin-trees-example.md Part D.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* perf(viewer): memoize GlbReferenceNode(s) — skip forest re-render on camera move
GlbScene re-renders per frame during camera movement (hover raycast / walkthrough
HUD). The rebuilt nodes reconciled every frame — fine for 1-2 scans/guides, but a
bake:'replace' forest puts dozens of nodes here (profiler: KindStatic x56 6ms,
GlbReferenceNode x57 4ms per frame). memo at the node boundary skips the whole
subtree (incl. the plugin renderer) when (node, anchor) are unchanged; both props
are stable refs, so it short-circuits cleanly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* perf(plugin-trees): NO_RAYCAST on KindStatic meshes — cheap hover over a forest
The baked scene's <primitive> has pointer handlers, so R3F recursively raycasts
every descendant on each pointer move (incl. orbit drags). The live replace trees
had fully-raycastable dense ez-tree geometry, so hover cost ~400ms/frame over a
forest (profiler: 'JavaScript' 413ms during camera move). They carry no pascalId
(a hit resolves to the level, not the tree), so they're scenery, not pick targets
— mirror KindProxy, which already NO_RAYCASTs its real geometry.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor(bake): viewer 'replace' renders instanced per level (was per-node)
Replaces the per-node KindStatic viewer path with a collective instanced one,
mirroring the editor's system instead of diverging from it:
- extract InstancedNodes from InstancedKindSystem (shared by both) with a
localSpace flag: editor folds parent world matrix (root instances); viewer uses
level-local matrices + NO_RAYCAST, portaled into the baked level.
- bakeReplaceRenderer is now a collective renderer (BakeReplaceRenderer<N>,
receives {nodes}); GlbReplaceInstances groups replace nodes by (level, kind) and
portals each kind's instanced renderer into that baked level. GlbReferenceNode
reverts to per-node renderer (strip kinds only).
Fixes: forest hover cost (100+ tree meshes → a few instanced draws, R3F walks far
fewer objects) and per-tree wind phase (instanceIndex varies again; per-node
KindStatic gave every tree phase 0 → unison sway). Trees still ride level stacking
(portaled) and stay static in a plain glTF viewer.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* perf(viewer): BVH the baked scene — accelerate hover/pick raycasts
The baked /viewer runs with useBvh={false}, so GlbScene's hover/pick raycasts
against the baked building were brute-force triangle intersection (profiler:
_computeIntersections + intersectTriangle ~30%). The parametric viewer wraps its
scene in <SceneBvh>; the baked one never did. SceneBvh's effect is one-shot on
mount and can't catch the async-loaded GLB, so compute a per-mesh BVH inside
GlbScene keyed on gltf.scene instead. 'replace' instances are NO_RAYCAST, so the
raycast===Mesh.prototype.raycast guard skips them (mirrors SceneBvh).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(plugin-trees): inherit ez-tree preset by default (seed/type/tints)
Our node defaults (seed:1, treeType:deciduous, colors:#ffffff) were applied as
*overrides* on top of loadPreset, discarding each preset's tuned seed, growth
model, and tints — so our trees looked nothing like eztree.dev (pine grew
deciduous, foliage washed white, every silhouette off).
Mirror the flower petalColor pattern: seed/treeType/leafColor/branchColor are now
optional; generateTree only overrides an ez-tree option when the node set it,
otherwise loadPreset's value stands. Placement stores none of them (fresh tree =
pure preset; all same-preset trees share one instancing variant); the deciduous/
evergreen brush toggle is gone (growth model comes from the preset). The inspector
keeps them as per-tree overrides, and Randomize still varies the seed.
Verified against ez-tree: fresh Oak Medium → seed 35729 + preset tints; Pine
Medium → evergreen + seed 13977; overrides apply when set.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(plugin-trees): bundle real preset artwork (webp, in-package)
Replaces the placeholder SVG thumbnails + lucide panel icon with the real nature
art. 13 webp (~126KB total, 256px cards / 128px icon) live in src/assets and are
imported via art.ts — both consumers are Next, so transpilePackages runs them
through the image pipeline (hashed, cached /_next/static/media URLs). No CDN, no
per-app public/ mirroring; the assets travel with the package.
- art.ts: central webp imports → TREE_ART / FLOWER_ART / GRASS_ART / NATURE_ICON
- presets/flower-presets/grass-presets: thumbnail ← bundled art (was *Thumbnail())
- index.ts: Nature panel icon ← NATURE_ICON (was lucide:leaf)
- assets.d.ts: ambient *.webp decl (no next type dep)
- remove thumbnails.ts (placeholder generators, now dead)
Verified on the running dev server: webp emitted + served (HTTP 200, image/webp).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(plugin-trees): square preset cards on light-gray flattened thumbnails
Regenerate the 12 thumbnails with the transparency flattened onto gray-100
(#f3f4f6) and render the card square (aspect-square, was h-16 crop). The
nature-icon keeps its transparency for the icon rail.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(plugin-trees): correct move-drag + outline behavior for instanced plants
Two selection defects, one root cause each:
1. Outline moved mirror-wise during a move drag. The host move tool drives the
registered Object3D imperatively with absolute level-local positions (and
mirrors them via useLiveTransforms) — the contract ParametricNodeRenderer
satisfies by putting position + registration on the same group. KindProxy
registered a child nested inside the transform-carrying group, so drag
positions landed in the node's rotated frame (placement gives every plant a
random Y rotation → deltas rotated up to 180°). Restructure: the registered
group now carries position/rotation (live-transform aware); the box collider
is a positioned sibling, staying out of the outline mask.
2. Outline froze while the mesh swayed. The outline mask pass renders with a
shared override material, so it can never follow the material positionNode
wind. Instead, while hovered/selected the collective system skips the node
and the proxy mounts the real geometry with static twins of the wind
materials (toStaticMaterial — explicit property transfer; node-material
clone() drops map/color). Outlined mesh == visible mesh, both still.
Bonus from the same restructure: a move drag now animates the actual plant in
realtime (the proxy is what the tool drives), not just the drag box.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(plugin-trees): 2D plan symbols + trunk-sized footprint
- def.floorplan for the three kinds — the registry floor-plan layer renders any
kind that provides one, so this is all plugin nodes need to appear in 2D.
Tree: dashed canopy ring (dashed = overhead element) in the preset swatch +
solid trunk dot; ring is pointer-events:stroke so the large disc doesn't
steal clicks from what's under the canopy. Flower/grass: small colour dots.
Selected → palette stroke + move-handle; hovered → hover stroke.
- Tree floorPlaced.footprint is trunk-sized (treeTrunkRadius) instead of
canopy-sized, so the move/placement drag box hugs where the tree actually
plants instead of spanning the crown. The invisible hover collider keeps its
larger radius — only the displayed box shrinks.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(plugin-trees): trunk-sized drag box, 45°-aligned rotation, rotate gizmo
- The move drag box ignored floorPlaced.footprint: with collides:false the tool
auto-measures the rendered mesh — which, since the selection swap-out, is the
whole canopy. Declare capabilities.dragBounds (trunk-sized, node-local) so the
box hugs the trunk and rotates with the node instead of wrapping the crown as
a world AABB.
- Placement wrote a fully random Y rotation, so the box/gizmo never sat on a 45°
step. Snap the random rotation to 45° increments (variety preserved, alignment
restored) and widen rotatable.snapAngles to 8×45° on all three kinds.
- Add the standard rotate gizmo (def.handles, shelf-style arc handle): ring
around the trunk near the ground — not the canopy, which would put the handle
meters out on a large oak.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(plugin-trees): live rotate preview + ground-level rotate ring
- KindProxy now folds useLiveNodeOverrides into its transform (mirrors
ParametricNodeRenderer) — the rotate/resize gizmos publish mid-drag patches
there, so the plant turns in realtime instead of snapping on commit. The
snap-on-commit (with the arc delta wrapping to ±180°) is also what made long
drags land 'the wrong way'; with live feedback the direction reads correctly
and matches the item gizmo pipeline exactly.
- Rotate ring drops from mid-trunk to 0.25m — a floor affordance like the item
gizmo, not a waist-height hoop.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(registry): panelForKind — 'find in catalog' opens a plugin kind's panel
loadPlugin now associates every node kind with its plugin's first (namespaced)
panel id; panelRegistry.panelForKind(kind) exposes it. A host's find-node
handler can open the right panel for any plugin kind with zero per-plugin
knowledge.
plugin-trees uses it end-to-end: a module-level selection:find-node listener
(find-sync.ts, imported by the manifest so it's live from plugin load) points
the panel store at the found node's section + preset — panel section state
moved from panel-local useState into the store to make it addressable.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(registry): plugin panels declare their workspaces (default edit-only)
Plugin panels rode into the studio rail: the host swaps its own sidebar tabs by
workspaceMode, but usePluginPanels appended registry panels unconditionally.
PluginPanel gains workspaces?: readonly ('edit'|'studio')[] — manifest metadata,
default ['edit'] (an authoring panel has no business in the clean render
workspace; a plugin shipping studio tooling opts in explicitly). usePluginPanels
filters by the current workspaceMode, covering both the v1 AppSidebar and v2 tab
bar paths. Nature declares nothing and disappears from studio via the default;
the v2 layout's existing active-tab fallback handles a panel vanishing mid-use.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs: link plugin-authoring guide from README + CONTRIBUTING, fix stale wiki path
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(plugin-trees): keep ez-tree off the eager SSR path
ez-tree loads its inlined textures at module scope (needs document), so any
eager import chain reaching geometry.ts crashed Next prerender
(ReferenceError: document is not defined on /_not-found). Move the pure
helpers (mulberry32, naturalHeight) to variant-utils.ts so the
flower/grass builders and floorplan no longer pull ez-tree, and drop the
generateTree re-export from the package barrel (no external consumers).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Walk 4→2 m/s, run 5.5→5 m/s, jump 6→5 (~1.27 m peak). Applied to both
the GLB walkthrough controller (viewer) and the editor first-person
controls so the two surfaces stay consistent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Polish pass on the placement/interaction overhaul. Five fixes:
- Item-on-item rotation box: the cursor box held the host-local yaw instead of
world yaw, so it diverged from the item by the host's rotation when stacked on
another item (fine on the floor). The box now derives world yaw from the
mesh/host quaternion in both the R/T handler and the move-start sync.
- 2D floorplan move now respects the snapping mode (parity with 3D): grid
quantization only in grid mode, alignment guides only in lines/magnetic mode;
Shift/Alt no longer hard-bypass. Item move also plays the move "tick" SFX on
any resolved-position change, like the 3D move.
- Wall-side item footprint side: the 2D footprint depth offset extended toward the
wall (centerLocalZ -depth/2) instead of into the room, mirroring the item across
the wall; flipped to +depth/2. Aligned the undefined-side anchor to the 3D
convention (front +1 / else -1).
- 3D placement preview side: the wall-side preview bounds + base plane used a -Z
(into-wall) convention; flipped to +Z (into-room) to match the body and the
fixed 2D footprint. The 2D live preview during a 3D wall placement now publishes
the plan rotation (wall angle + item yaw) instead of the world cursor yaw, which
was pi off on a wall face and flipped the footprint to the far side.
- Cmd/Ctrl+R no longer rotates/flips the selected node (it reaches the browser
reload); guard added to the global selected-node handler and the 2D move overlay.
Verified: core/editor/nodes tsc, biome, editor 162/0 + nodes 292/0 tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a Floorplan group to the settings Export panel alongside the 3D
model exports, with "Full floorplan" and "Structure only" buttons.
Export re-runs the live registry-driven floorplan pipeline
(def.floorplan -> FloorplanGeometryRenderer) headlessly with a neutral
viewState, fits each level to its own page, and titles each page with
the level label. Every level of the active building becomes a page in
one landscape A4 PDF. "Structure only" keeps category === 'structure'
nodes; "Full" keeps every visible node with a floorplan builder.
- new lib/floorplan/floorplan-export.tsx; jsPDF + svg2pdf dynamically
imported so they only load on export
- export five pure helpers from floorplan-registry-layer for reuse
(buildContext, getFloorplanLevelData, floorplanLayerRank,
splitFloorplanOverlay, isFloorplanNodeVisible) — no behaviour change
- bake vector-effect:non-scaling-stroke widths into real units before
svg2pdf (which ignores the hint and would otherwise draw door/window/
stair linework as metre-wide strokes)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes the lone biome organizeImports error so the quality gate passes on the
post-#448 base. Type-check (9/9), biome, and all suites green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two zone fixes.
helper-manager: the contextual HUD only rendered for tools with `def.toolHints`,
so zone (none) showed no HUD and no snapping chip even though it resolves a snap
context. Render the generic RegisteredToolHelper whenever the tool has hints OR a
snap/continuation context; hoist the legacy `roof` RoofHelper above it so the new
fallback doesn't capture it. Any snappable hint-less draft tool now advertises
Shift = cycle.
zone-tool: a not-yet-migrated legacy tool — it used Shift as a snap bypass and
applied `gridSnapStep` unconditionally, so Off mode still snapped to grid.
Migrated to the mode-driven exclusive-modes convention (zone resolves to the
'wall' context): grid quantize gated on isGridSnapActive(), 15° ray gated on
isAngleSnapActive(), Off/Lines leave the raw cursor. Dropped the Shift-bypass and
its key listeners — Shift now cycles the mode globally. Recorded as migrated in
the review skill's known-legacy list.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Capture the durable patterns from the placement-interaction overhaul so reviews
and new devs don't regress them:
- tools.md: new "Data-driven live drag" section — kinds whose geometry is
recomputed from fields (wall/opening/endpoint) preview via useLiveNodeOverrides
(merged by getEffectiveWall/getEffectiveNode), store written once on commit;
per-tick useScene.updateNodes is the documented anti-pattern (churns the nodes
ref → app-wide re-render flood). Plus "Floorplan registry: per-node
subscriptions" — each entry subscribes to its own live slice, memo'd with
stable props, sibling-epoch invalidation; widening to the whole Map / dropping
memo is a regression. Plus a note that the HUD snapping chip renders for any
snap-context tool, not only those with def.toolHints.
- review SKILL.md: matching blockers in §C (data-driven drag / no per-tick store
write) and §D (per-node list subscriptions).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The grid only appeared while a ghost was in flight (moving node / placing scope /
armed GLB item), so a merely-armed draft tool (wall / slab / fence / ceiling /
zone / column / MEP) showed no lattice. Gate visibility on isGridSnapActive()
alone — it already derives the snap context from the interaction scope OR the
armed build tool and is true only when that context resolves to grid (false for
select / idle / paint / lines / off), so it is exactly the right condition.
Draft tools publish no surface; the grid's horizontal branch already falls back
to the active level floor, with the reveal patch following the cursor.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The footprint polygon uses `rotateVec` (R(-angle)) but the sprite was drawn via
SVG `rotate(+angle)`, so image and box counter-rotated and diverged by 2x the
item's rotation in the 2D floorplan. Negate the image rotation so the sprite
tracks its box (and the 3D orientation). Scoped to items — the only emitter of
the `image` floorplan geometry kind.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In split view, dragging any node re-rendered ALL ~150 per-node
InteractiveGeometry instances every tick (profiler: InteractiveGeometry ×3192),
because FloorplanRegistryLayer subscribed to the whole useLiveTransforms /
useLiveNodeOverrides maps and the per-node component wasn't memoized.
Extract a memoized FloorplanRegistryEntry that subscribes to ONLY its own slice
(useLiveTransforms(s => s.transforms.get(id)) / overrides.get(id)). The live
stores write a fresh value object for the changed node only, so unchanged nodes
keep identity and don't re-render. The parent now watches just the stable
node-id list; sibling invalidation (wall miters / opening cuts) moves to a
store-subscribe that bumps only affected siblings' epoch. InteractiveGeometry is
also memoized. Geometry cache, affected-sibling epochs, the base/overlay
two-pass, hit-testing, and selection/hover are all preserved verbatim.
An item move now re-renders only its own entry; a wall drag only the moving wall
plus its linked-corner siblings.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two fixes to the wall-endpoint reshape interaction.
selection-manager: a node:click is synthesized on R3F pointer-up, so an endpoint
handle that sits on the wall body lets the wall mesh (raycast-hit behind it from
a 3D angle) emit its own click on the same release — selecting the wall and
arming its move tool on top of the endpoint move. Ignore the body click while an
`endpoint` reshape owns the pointer. Scoped to `endpoint` so hole-edit (which
relies on node clicks to exit) is unaffected.
move-endpoint-tool: a press-drag committed on release but a tap dismissed, and
whether the tap's release ran at all raced the window pointer-up listener
mounting a tick after the handle's pointerdown ("works once, then needs a long
press"). Unify on one rule: commit only when the endpoint actually moved,
otherwise stay armed. A tap now grabs the endpoint (it follows the cursor; the
next click after a move commits) exactly like a press-drag — both engage
identically. Drops the now-dead hasDraggedRef.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two changes from the split-view / wall-endpoint perf + UX pass.
floorplan-panel: render the heavy 2D <svg> scene only when the panel is visible
(`isFloorplanOpen`, i.e. viewMode !== '3d'). The panel stays mounted in 3D
(display:none) to keep the portalled compass + viewport state warm, but the
registry layer / per-node InteractiveGeometry / handle layers no longer
reconcile on every scene change while invisible. Renders fully in 2D and split;
viewport pan/zoom is preserved across the toggle.
wall move-endpoint-tool: preview via `useLiveNodeOverrides` instead of writing
`useScene.updateNodes` every grid:move tick. The per-tick store write handed a
fresh `nodes` ref to every `useScene(s => s.nodes)` subscriber (WallPanel, the
contextual HUD, tooltips, floor plan), rebuilding them all each frame. Overrides
are merged by the wall system, wall panel, and 2D floor plan, so the preview
still tracks live with no store churn; the store is written once on commit, and
one Ctrl-Z reverts to the original endpoint. Also swallow the click that follows
every endpoint-tool release so it can't fall through to the wall body and arm
the wall move tool (no-drag tap or post-commit).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Camera-zoom hitch: the FloorplanPanel stays mounted (display:none in 3D mode),
so its navigation-pose subscriber fired every camera onUpdate. During zoom the
view-width changes continuously, so the epsilon guard never short-circuited and
`syncFloorplanViewportToNavigationPose` ran each frame → setViewport/
setFloorplanUserRotationDeg → a full re-render of the ~10k-line floorplan SVG,
even though nothing is visible (React reconciles display:none subtrees).
Gate the viewport sync on `isFloorplanOpen` via a ref the per-frame subscriber
reads, and re-run the mount catch-up effect when the panel reopens so the
viewport snaps to the current camera. The compass is unaffected — it's portaled
to the always-visible viewer area and still receives the pose; only the panel's
own viewport sync is skipped while hidden.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
BUG 1 — wall-attached furniture facing. The coordinator drew its own inline
facing triangle and published the wall grid normal from the cursor ghost's own
yaw, which is the symmetric-wireframe yaw — π off the item's true facing for a
wall (and a different frame for a roof-segment face). The triangle pointed into
the wall and the grid normal was sign-flipped while the box still looked right.
Fold the coordinator into the unified `useFacingPose` overlay (drop the inline
triangle, geometry/material/constants). The per-frame surface publisher now
derives the true outward facing from the draft mesh's world orientation (its
local +Z faces out of the host surface) for wall/roof-wall and feeds that single
yaw to BOTH the grid normal and the facing triangle. Floor/ceiling/item-surface/
shelf paths are unchanged behaviourally — same cursor yaw and Y, just routed
through the overlay.
Right-click cancel vs camera orbit. The right button also orbits the camera, so
the old unconditional `contextmenu → onCancel` cancelled placement on every
right-drag. Gate the cancel on pointerup: only when the right press moved ≤4px
within ≤200ms (a quick stationary click); a longer/further press is an orbit and
is left alone. contextmenu now only suppresses the OS menu.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Validated live by Wassim. The click-to-move branch set `clickHandledRef = true`
then returned early, skipping the 50ms reset the normal select path runs at the
end. The flag stayed true, so `onGridClick`'s guard silently blocked every
empty-click deselect until the next normal select cleared it. Schedule the reset
right after the flag is set so EVERY branch (incl. the early return) clears it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Validated live by Wassim.
- Wall grid is anchored to the wall PLANE (its foot), not the moving ghost, so
sliding a door/window only moves the reveal patch — the lattice stays a fixed
snap reference instead of "following" the opening.
- DoubleSide so the lattice renders when an opening is handled from the far side.
- depthTest is conditional: ON for the floor (the ground occludes a sub-floor
lattice) and OFF on a wall (visible through the wall from the opposite side).
- Resolution change is a uniform write only — `cellSize` no longer rebuilds the
uniform + material (which recompiled the shader and stalled on every step).
- Y follow snaps instantly (was a lerp); `gridY` state only updates on change.
- Reveal radius 5 → 12.
- Door/window publish the wall surface on mount (+ claim the pointer for the
wall) so the grid is vertical from the FIRST frame — no horizontal flash.
- Export the active-placement-surface module so the opening tools can publish.
- Drop the editor-side "Show Grid" setting: the 3D grid is now purely a
placement aid (shown only while placing/moving in grid-snap mode).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Door and window are placed via preset and moved with a bespoke wall-bound
`move-tool` (affordanceTools.move), not the draw tool — so the previous inline
triangle never showed for the paths actually used. Migrate both:
- move-tool (move + preset, the community path): publish the on-wall ghost pose
to `useFacingPose` in the same building-local frame the ghost renders in,
dropped to the floor under the wall (the ghost Y is the opening centre); clear
on every off-wall / hide / reveal / unmount path
- draw tool (standalone from-scratch path): publish the on-host pose, clear on
fallback/hide; frame depth read via a ref to keep the setup effect deps clean
Removes the now-dead `FacingIndicator` public export (the editor-side overlay is
its only consumer, via relative import). The unified overlay now covers every
placement/move path: items, column/shelf, stair, and door/window.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Every placement and move path now publishes its ghost pose to a single
`useFacingPose` store, drawn by one editor-side `<FacingPoseIndicator>` overlay,
instead of each path drawing its own triangle (which left the nodes-package and
PlacementBox paths invisible):
- column/shelf presets + all moves (PlacementBox via move-registry, and
DragBoundingBox) now publish the pose, so the triangle finally shows
- stair create + move use a declarative `facingIndicator: { reversed: true }`
(new registry resolver) so the triangle sits before the entry pointing out —
resolved in one place, so create and move match automatically
- stair placement defaults to single and respects the shared `point`
continuation (C) toggle, like the other placement tools
Checkpoint on the placement-interaction epic: also carries the in-flight
continuation-profile extraction (lib/continuation), grid surface (item #8), and
HUD work. Door/window still render their own legacy inline triangle and are
migrated to the overlay next.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The walkthrough rode the default 50° orbit camera, which feels cramped on
foot. Both walkthrough controllers (baked GlbWalkthroughController and the
parametric WalkthroughControls fallback) now set a shared WALKTHROUGH_FOV = 60
on enter and restore the prior FOV on exit, leaving orbit framing untouched.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The bundled ceiling-fan model.glb was stale (no animation clip, two slots).
Replace it with the variant matching production storage: an `On` animation
clip and a third `slot_base` paint slot. Same dimensions/offset, so no catalog
metadata change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`poseDoorMovingParts` assigned a single euler axis (`group.rotation.y` /
`.x`). The live system was fine because the group's euler stays a clean
(0, y, 0). But the GLB exporter clones the door and decomposes its matrix,
which re-derives a gimbal-flipped euler (x=z=π) for any rotation beyond
±90° — folding panels reach ~158°. The reset to t=0 then only zeroed `.y`,
leaving the π residue on x/z and baking a 180°-flipped rest pose (panels
folded out toward a wrong position even when closed).
Set the full euler triple via `.set()` in every pose branch so the other
two axes are always zeroed, clearing any decomposed residue. Add a
regression test that exports an open folding door and asserts an identity
rest pose for all panels.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
interaction-scope.md + review-architecture skill: the sanctioned Alt-as-toggle
(wall/fence chain mode, the one place Alt-as-force is meaningless), and a second
known-legacy pattern — `event.altKey` alignment-bypass in the roof/polygon/slab
previews + ceiling/slab snap paths (migrate-on-touch; wall+fence already done).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the legacy held-Alt mechanism on wall and fence drafting with a
mode toggle, mirroring the snapping-mode chip:
- Wall: `wallChainMode` room (auto-close on loop) / single. Room mode
finishes automatically when the new endpoint lands within the join-snap
radius of the chain's first vertex; single commits one wall per click.
- Fence: `fenceChainMode` continuous (chain until double-click/Esc) /
single. Fences are linear barriers, so continuous has no auto-close.
- Both: Alt-tap cycles the active drafting tool's chain mode (clean-tap,
scoped to wall/fence drafting); a clickable HUD chip shows the mode.
Persisted + migrated in `useEditor`.
Migrate wall and fence off held-Alt-bypass-alignment to the unified
convention: alignment now follows the magnetic snap mode, which frees Alt
for the toggle. 2D floorplan parity kept in sync with the 3D tools.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two issues surfaced testing the baked viewer:
- Folding door folded toward +z (into the room) — the joint rotation sign
was inverted, so the accordion opened the wrong way ("weird position").
Flip to `(prevDirection - direction) * foldAngle` so leaves fold toward
−z, matching the original inline rig. Verified panel-for-panel against the
original formula at every operationState.
- Openable clips were named by display name (`<name>: open`), but the baked
viewer drives playback by clip name (`useAnimations` maps name → action).
Several windows share the name "Window 1", so their clips collapsed to one
action and triggering any one opened the first. Key the clip name by node
id (`<id>: open`) — unique, matching the item-loop convention; the
human-readable name still lives in `extras.label`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Only swing doors (hinged/double/french) baked an open clip into the GLB —
they carry a `pascalSwingLeaf` marker the exporter reads. Every operation
door type (sliding, pocket, barn, folding, garage-sectional/rollup/tiltup)
baked its `operationState` straight into mesh vertex positions at build
time, so the exporter had no re-poseable node to sample and the artifact
never flagged them `openable`.
Give operation doors the same build-once + pose-at-t split windows already
use. Each builder now emits its moving parts in a named group at the CLOSED
pose, and `poseDoorMovingParts` (the single source of truth, shared by the
live system and the GLB exporter) drives the open motion:
- sliding/pocket/barn: rigid leaf translation
- garage-tiltup: rigid hinge about the lintel
- folding: hinged accordion chain (nested groups, per-joint fold)
- garage-sectional: per-panel groups posed along the overhead curve
- garage-rollup: the one type whose live geometry changes (slats roll onto
a drum, which a glTF clip can't express) keeps its full-detail live
rebuild; the curtain is wrapped in a top-pivoted group the exporter
scales up into the lintel as the baked approximation.
The exporter samples each operation door's motion into keyframe tracks
(16 segments) so the non-linear rigs (curve, accordion) stay faithful, and
stamps `extras.openable` + `extras.clips` so any glTF consumer can play it.
Tests: per-type kinematics (groups build, rest closed, open) +
sliding/roll-up clip baking (sampled position/scale tracks).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The floor grab-offset comment claimed floorStrategy.move reads localPosition
"under Alt (free place)"; it reads event.position with mode-governed snapToGrid
and has no Alt branch (Alt is force-place-only). Describe the real reason both
frames carry the offset: it's computed local-space but the strategy consumes the
world point.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The snapping model (Shift = cycle mode, Alt = force/free, mode-driven reads via
isGridSnapActive/isMagneticSnapActive/isAngleSnapActive, snapProfile-declared
context) lived only in code and the plan; tools.md still preached the legacy
"Shift = bypass snapping". Close the drift so the architecture review refuses
tool changes that revert to the old pattern:
- tools.md: replace the held-Shift-bypass manipulation policy with the unified
mode-driven model + the single snap read path.
- interaction-scope.md: new "Snapping mode & modifiers" section (contexts, read
path, modifiers, the chip-needs-a-scope rule) + a Rules bullet + the
known-legacy MEP movers (migrate-on-touch) incl. the dual-path constraint
(a bespoke mover must not open a `moving` scope — it re-mounts the generic
mover via useMovingNode).
- review-architecture skill: add interaction-scope.md to the reads and a new
"F. Interaction scope, snapping & modifiers" checklist — new shiftKey-bypass,
ungated grid step, missing snapProfile, a new useEditor interaction flag, or a
bespoke mover opening a moving scope are blockers; touching the legacy MEP
movers forces migration.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The MEP run/fitting/terminal tools anchored their cursor readout pill at
~+0.35m above the placement point, so with the tall CursorSphere line
(badge at +2.7m) the pill sat right on the cursor and overlapped it,
especially when zoomed in. Editor main (#438) already raised the duct
pill to +1.45m; this long-lived branch predates that merge. Bring every
MEP tool that uses the tall cursor onto the same +1.45m anchor:
duct/pipe/liquid/lineset runs, duct/pipe fittings, and duct-terminal.
hvac-equipment (height-aware anchor) and pipe-trap (no cursor line) are
left as-is — their HUDs already clear the ghost.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Baking some projects failed with "Cannot read properties of undefined (reading
'isShaderMaterial')". GLTFExporter reads material.isShaderMaterial unconditionally,
so a renderable (Mesh / Line / Points) with no material crashes the export — and a
non-Mesh renderable slips past both the isMesh prune check and material conversion.
Guard it in pruneNonRenderableMeshes: a material-less renderable is dropped if it's
a leaf, or neutralised (empty geometry + a hidden placeholder material) if it has
children so its subtree survives. Post-FX disable now lets these scenes reach the
exporter, which is why it surfaced.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The last two hot per-pointer-move 2D states still lived in FloorplanPanel's
useState, re-rendering the ~10k-line panel on every move:
- marquee (box-select): the whole drag struct moves to a dedicated
use-floorplan-marquee store; down/move/up/cancel read+write it via
getState() (panel holds nothing), and a FloorplanMarqueeOverlay leaf
subscribes to the moving corner and renders the rect alone. Drops the 3
bounds memos + the useState.
- reference-scale: the rubber-band's moving end was always equal to the
shared cursorPoint (written every move anyway), so drop the `cursor` field
from the draft and read it from useFloorplanDraftPreview in a new
FloorplanReferenceScaleDraftLine leaf. The draft now carries only the
per-click guide + start anchor, so it no longer re-renders the panel.
Closes out the 2D edition perf pass — every build/edit/select hot path now
writes a store, not panel state.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Roof-segment edit/move ignored the active snap mode and showed no chip:
- add snapProfile:'structural' so a body-move resolves the no-angle polygon
context (grid/lines/off) like every other structural move;
- resize uses getSegmentGridStep() (0 outside grid mode = the "smooth" resize
that used to need a held Shift), dropping the captured gridSnapStep + Shift;
- move drops its Shift bypass;
- the affordance dispatcher opens a boundary reshape scope for the resize so
the snapping chip shows and the context resolves.
2D rotation handles now match the 3D gizmo across all six rotate affordances
(column / elevator / roof-segment / shelf / spawn / stair): a shared
rotateAffordanceDelta snaps to the 15° step unless Shift (free), the
dispatcher opens the same ROTATE_HANDLE_DRAG_LABEL handle-drag scope the 3D
gizmo uses so the contextual HUD shows the "Shift = rotate freely" hint, and
the live degree readout snaps to match the committed rotation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wall and fence endpoint-move affordances hard-snapped to the grid via a
hardcoded WALL_GRID_STEP and always ran Figma line-alignment, ignoring the
active snapping mode. Now:
- grid step follows getSegmentGridStep() (0 outside grid mode), so lines /
angles / off no longer force a grid snap the mode chip says is inactive;
- Figma alignment is gated on isMagneticSnapActive() (the lines mode);
- angles mode angle-locks the endpoint off the fixed corner (free length),
mirroring the draft tool;
- fence drops its legacy Shift-bypass to match the wall's unified model
(Alt stays as linked-segment detach).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The 2D affordance dispatcher (`startAffordanceDrag`) now begins the matching
reshaping interaction scope (boundary / hole / curve / endpoint) on pointer-down
and tears it down on release/cancel, matched by node id. This makes the
contextual snapping HUD show the right chip during polygon vertex/edge and wall
endpoint/curve edits, and lets `getActiveSnapContext()` resolve the correct
per-context snapping mode the affordance snap math already reads.
Wall creation is owned by the 3D `WallTool`, which is dead in 2D-only view
(canvas `display:none`). Mirror the slab/ceiling 2D-only committers: commit
locally via `createWallOnCurrentLevel`, gated on `viewMode === '2d'`, chaining
the next segment from the committed wall's resolved end. Split/3D keep their
single-owner tool commit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Same fix as slab: ceiling is committed by its 3D registry tool, dead in 2D-only
view. Commit it from the panel on both close paths, gated to viewMode==='2d'.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Slab is committed by its 3D registry tool, which accumulates the grid:click
vertices the 2D panel emits and commits on close. That path is dead in 2D-only
view — the 3D canvas is display:none, so the tool never commits and the slab is
never created (split/3D work because the 3D side is live). Mirror the zone
pattern: the panel commits the slab itself on both close paths (double-click +
click-first-vertex), gated to viewMode==='2d' so split/3D keep their single-owner
tool commit (no double-create).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The shared polygon-vertex affordance snapped via snapPointToGrid(rawPoint), whose
default step is the hardcoded WALL_GRID_STEP (0.5m) — so slab/zone/ceiling vertex,
edge, and add-vertex edits always quantized to half-meters regardless of the
active mode OR the user's grid-step setting (plan open bugs #1-2). Use the
mode-aware getSegmentGridStep() (0 in non-grid modes) so grid quantizes to the
live step, lines/off pass through to the wall-snap/alignment resolver. Drop the
legacy shiftKey bypass from the slab/ceiling magnetic resolvers (they already
gate on isMagneticSnapActive).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Perf: move the per-move wall/fence/roof draft END points into
useFloorplanDraftPreview; a new FloorplanLinearDraftLayer leaf owns the live
draft polygon + fence segment + wall measurement, subscribing to the store. The
shared FloorplanDraftLayer keeps only the per-click anchors. Wall/fence/roof
drafts now have zero per-move panel setState — buttery smooth like slab/zone.
Parity: migrate the remaining legacy Shift=bypass paths to the unified
mode-driven model. roof (move + click) honored only always-grid + bypassSnap —
now grid/lines/off (footprint → no angle). wall + fence click-commit still used
the legacy bypass while their move-preview didn't — now consistent. Wall Alt
stays 'commit single wall' (open product decision, untouched).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The polygon-draft snap path used the legacy model: bypassSnap = shiftPressed and
angleSnap = pointCount > 0 && !bypassSnap, so the 15deg angle lock engaged after
the first vertex regardless of mode — hijacking grid/lines/off into angle-snap
even though the HUD chip showed the right mode.
Migrate all three placement paths (move preview, single-click vertex, double-
click close) to the unified model: angleSnap = isAngleSnapActive(); grid flows
through snapToHalf (step 0 in non-grid modes); wall-snap/alignment already gates
on isMagneticSnapActive(). Behavior now matches the chip — grid quantizes,
angles locks 15deg rays, lines snaps to walls/alignment, off is free. Drop the
now-dead bypassSnap param from snapPolygonDraftPoint.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The 2D build/edit tools republish the snapped cursor point AND the screen-space
coordinate-badge position on every pointer move. Both lived in FloorplanPanel
useState, so each move re-rendered the whole ~310ms panel (the badge fires on
every pointermove while any build tool is active — the dominant culprit).
Move both into a useFloorplanDraftPreview store written via getState() (no panel
re-render); render the crosshair + live polygon-draft edge from a
FloorplanDraftCursorLayer leaf and the coordinate badge from a
FloorplanCursorIndicator leaf, each subscribing to the store. Same store+leaf
pattern as the stair build preview. Slab/zone/ceiling drafts now have zero
per-move panel setState. Wall/fence/roof draftEnd are follow-up slices.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The stair tool held its 2D build preview in FloorplanPanel useState, so every
grid:move re-rendered the whole ~120-220ms panel. Move the preview into a
dedicated useStairBuildPreview store written via getState() (no panel re-render)
and render it from a FloorplanStairBuildPreviewLayer leaf that subscribes to the
store directly — the same pattern that keeps column/elevator placement smooth.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Main's biome config flags a callback returning a value; the ternary in the
zone-shape forEach implicitly returned moveTo/lineTo. Use a block body.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Migrate roof/stair/elevator draft tools + the 2D floorplan move overlay off the
legacy Shift/Alt=bypass model onto mode-driven snapping (isGridSnapActive /
isMagneticSnapActive); Alt dropped (no validity gate). stair/elevator now use the
live grid step.
These three are placed as footprints, not directional draws, so the angle-lock
mode was meaningless: add NodeDefinition.snapDraftDirectional (default true; false
for roof/stair/elevator) so their draft resolves to the no-angle 'polygon' context
(grid / lines / off). snapContextOf takes an injected draftDirectionalOf, like
profileOf. Add toolHints to stair/elevator so they route through the contextual
HUD and show the snapping chip. Fix one stale Alt-bypass comment in the item
placement coordinator (#9: already force-only). +snapping-mode test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The 5 bespoke MEP movers (duct/pipe-segment, liquid-line, lineset, duct-fitting)
now read the active snapping mode (isGridSnapActive / isMagneticSnapActive)
instead of shiftKey=bypass. The moving scope already carries the node
(setMovingNode → begin('moving')), so the per-kind context resolves with no
extra wiring. Grid and alignment are now independent reads.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Migrate all 9 MEP kinds' placement tools onto the unified snapping model:
declare snapProfile ('item' for point-placed hvac-equipment / duct-terminal /
duct-fitting / pipe-fitting / pipe-trap; 'structural' for directional runs
duct-segment / pipe-segment / liquid-line / lineset), and replace the legacy
shiftKey-bypass reads with mode-driven isGridSnapActive / isMagneticSnapActive /
isAngleSnapActive. For runs the 45° lock becomes the cyclable 'angles' mode;
Alt stays the vertical-riser modifier (run drafting has no validity gate to
force). Port mating gated on "mode != off". Dropped stale "⇧ smooth/free" hints.
The bespoke MEP move-tool/selection (endpoint) tools stay on the legacy model —
they use setMovingNode(null) so no moving-scope context resolves yet; migrating
them needs scope-wiring first (follow-up).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The 3D MoveDoor/MoveWindow tools wrote useScene every frame during a move
(freeFollowAt + applyPreview alternating): the wall:move (R3F) / grid:move
(DOM) de-dup compared event.timeStamp across two event systems with different
clocks, so it never matched and the floor free-follow ran during on-wall
slides too, ping-ponging the host and churning the nodes ref → framerate
collapse in both 2D and 3D. Replace it with a single-clock wall-ownership
window (performance.now, ~4 frames): the floor follow stands down while a
wall/roof hit is fresh. On-wall slides now write no scene per frame (mesh +
useLiveTransforms only). Lower the live wall-cutout throttle 120→60ms now that
the per-frame churn is gone.
Also completes the door/window modifier-model migration (#10): Shift=cycle /
Alt=force-place, fully mode-driven snap, snapProfile:'item'; exclude
ground-line candidates from along-wall opening alignment; emit the move SFX
once per snapped step.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Scans (LiDAR meshes) and guides (floorplan images) are heavy reference assets
stored elsewhere, not part of the compiled building — and baking them into a
public static GLB would also bypass the per-project show_*_public flags. Strip
both from the export entirely (previously they leaked in as empty identity
nodes, timing-dependent).
The GLB viewer re-adds them at runtime from the scene graph, like lights:
GlbReferenceNodes resolves each scan/guide's registry renderer (no static nodes
import — same nodeRegistry path the viewer already uses) and portals it into its
parent level's baked node, so the node's level-local transform resolves to the
right world pose and rides level stacking. Uses the same GuideRenderer/
ScanRenderer + asset resolver as the parametric viewer, so http-backed assets
show for everyone and local asset:// ones for the owner — exact parity.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Toggling pointLight.visible changes the active-light count, which makes the
WebGPU renderer rebuild every material's lighting node + pipeline — a multi-
hundred-ms stall. The pool reassigns on every camera move, so zooming churned
visibility and tanked FPS. Keep all 12 pool lights permanently visible and
animate only intensity (an idle light lerps to 0); the light-set never changes,
so no recompiles. Also make reassignment O(n) (score lookup map, not find).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Match the parametric ItemLightSystem instead of mounting a light per item:
a fixed pool of point lights is assigned to the nearest/most-visible lit
items each tick (camera-proximity scored, hysteresis, level factor), snapped
to each item's world position + offset, and faded on reassignment — so a large
house doesn't blow the renderer's light budget. The controls overlay already
mounts its <Html> only while the item sits in the focused zone (not hide/show);
add stopPropagation on the overlay so toggling a control no longer bubbles to
the canvas and deselects the zone.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A catalog GLB ships its own animation clips (a ceiling fan's spin), but those
clips aren't in the editor scene graph, so the bake couldn't see them. Add an
`itemClipRegistry` (core, type-only three) that the item renderer fills with the
resolved clip per node while the scene is live; the GLB export reads it and
re-emits each item's clip onto the baked subtree, rebinding tracks to the cloned
spinning node's uuid. Catalog node names repeat across instances and the glTF
roundtrip rebinds by name, so the targeted node is uniquified per item
(`<id>__lamp_018`) — every fan animates independently.
The baked viewer plays these as looping ambient motion: `<id>: loop` clips are
set to LoopRepeat (not the door/window LoopOnce) and GlbItemAnimation drives
them off each item's toggle (lit/spinning by default).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a GLB interactive layer (`GlbInteractive`) that re-creates the item
interactivity the parametric viewer has — point lights and the controls
overlay — on top of a baked artifact. Effects + controls come from the
DB scene graph (joined to baked nodes by `pascalId`, no sidecar); world
transforms come from the baked Object3Ds. Lights are portaled into their
item node so they ride level stacking, and intensity tracks the shared
`useInteractive` store so overlay dimming works. Baked scenes load "lit"
(toggles default on) for a showcase viewer feel.
Extract `ControlWidget` into its own module so the parametric
`InteractiveSystem` and the GLB overlay render identical controls.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Items mounted on a ceiling (lamps, fans, recessed lights) are child nodes of
the ceiling, so hiding the whole occluder node hid them too. Hide only the
ceiling/roof's own meshes (stop descending at nested identity nodes) so hosted
items stay visible when a floor is opened up.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Migrate the remaining floor-placed kinds onto the unified snapping/modifier
model and generalize floor collision so any solid floor kind blocks any other.
- shelf/column/spawn declare `snapProfile: 'item'` → contextual snapping chip,
Shift=cycle, Ctrl=grid step during placement; their tools read the active
mode (grid/lines/off) instead of legacy Shift/Alt bypass; spawn fresh
placement now respects alignment ("lines") like its move.
- Resize/radial handles claim the handle-drag scope (new RESIZE_HANDLE_DRAG_LABEL)
so the HUD shows no select-mode shortcuts mid-resize.
- Column move migrated to the generic MoveRegistryNodeTool (declare `movable`,
drop the bespoke move-tool) — gains mode-driven snapping, alignment, R/T,
slab lift, grid SFX, and the collision box for free. 2D move still routes
through `floorplanMoveTarget`.
- Cross-kind floor collision: new declarative `FloorPlacedConfig.collides`
(item/shelf/column opt in; spawn/MEP/stair stay off). `canPlaceOnFloor` now
treats every colliding floor kind as an obstacle (was item-only), reading the
declarative footprint; the generic move tool's red/green placement box gates
on `collides`. Column footprint uses the visible `columnFootprintHalf` extent
so the box/slab-lift/collision track the real (round/square) column size.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move the first-person walkthrough into @pascal-app/viewer (BVHEcctrl +
GlbWalkthroughController) and round out the GLB-consuming viewer:
- Walkthrough: fallback ground only on level 0 (upper floors rely on baked
slabs), hidden spawn marker, auto pointer-lock on enter, single-Esc exit via
pointerlockchange, force perspective on enter / restore on exit.
- GlbScene: monochrome strips baked textures and recolours meshes by surface
role using the active theme's clay tints; spawn node hidden from render.
- glb-export: camera/label/spawn identity extras for the viewer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Generify the snapping/modifier HUD off the FSM scope and node declarations
instead of wall-creation-shaped, leaking pills.
- Per-context snapping (`snappingModeByContext`, persisted): wall / item /
polygon mode-sets with exclusive modes (grid | lines | angles | off), each
doing exactly what its chip says. Context is node-declared via the new
`NodeDefinition.snapProfile` ('item' | 'structural'); the resolver maps
(profile × action) → context with no per-kind switch.
- Scope-driven HUD: helper-manager reads the interaction scope; reshaping
(endpoint/curve/boundary) and item move get their own chip, no select-hint
leak. Rotate R/T rounds to 45°; Alt = force-place only (hidden for
structural kinds); Shift = cycle everywhere.
- Slab/ceiling drafting: Shift=cycle, mode-aware grid/angle, Enter finishes
(minDraftVertices); polygon boundary vertex/edge drag begins a reshaping
scope. Fix grid/angle being ignored on boundary edit + slab creation:
make resolveSurfacePlanPointSnap exclusive (alignment gated on magnetic) so
grid/angles keep the snapped fallback instead of the raw cursor.
- Painter application scope: node-derived (single/object/matching/room) from
the hovered node, cyclable via Shift, single-source HUD chip.
- Remove the redundant GridSnapControl from view-toggles (grid step lives in
the contextual HUD now).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 7th and last of the legacy interaction flags. The node being placed/moved
now lives inside the interaction scope's `placing`/`moving` variant (carried
inline, since fresh-placement/duplicate drafts aren't in the scene yet), read via
`useMovingNode()` / `getMovingNode()` / `movingNodeOf(scope)`.
- scope.ts: `placing`/`moving` carry `node: AnyNode`; add `movingNodeOf`.
- use-interaction-scope.ts: `useMovingNode` (hook) + `getMovingNode` (imperative);
no useRef snapshot needed — the node is set once at `begin`, stable for the gesture.
- use-editor.tsx: drop the `movingNode` field + the `set({ movingNode })` writes.
`setMovingNode` still drives the scope and still sets `movingNodeOrigin` /
`placementDragMode`, so cross-store subscribers keep firing. Param + ~90 call
sites unchanged.
- migrate ~17 reader sites to `useMovingNode()` / `getMovingNode()`; drop
`movingNode` from lib/scene.ts; export `movingNodeOf`.
Every interaction flag is now derived from the single authoritative scope; only
`movingNodeOrigin` + `placementDragMode` intentionally remain as useEditor flags
(they outlive the scope / gate companion behavior).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A door/window only carries extras.openable + extras.clips when an open
animation actually bakes. Cased openings (no leaf) and fixed windows (no
operable sash) are no longer mislabelled openable, so the GLB never claims
a part opens when nothing moves. /viewer is unaffected (it already required
openable && clips). Adds a regression test for the no-clip case.
(Export barrels reordered by the formatter.)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two fixes for the split-view FPS cliff when moving a wall or opening:
- wall/move-tool: publish the live preview to useLiveNodeOverrides instead of
writing useScene.updateNodes every frame. The store's `nodes` ref no longer
churns per frame (which had re-rendered every useScene(s => s.nodes) subscriber
app-wide). Matches the existing 2D wall drag + 3D wall-system override pattern;
the final plan still commits atomically as one undoable change.
- floorplan-registry-layer: replace the single global siblingEpoch with a
per-node epoch bumped only for the nodes affected by the live drag (dragged
wall -> walls at its old + new junctions + child openings; door/window -> host
wall; gutter -> roof-peer gutters), unioned with the previous frame's live set
so a cancelled drag reverts. Dragging one wall/opening now rebuilds a handful
of geometries instead of all the level's walls + openings.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
exportSceneToGlb now calls snapLevelsToTruePositions() (the same clean stacked
presentation thumbnail capture uses) before snapshotting the scene, so the GLB
always reflects the stacked building regardless of the live levelMode
(exploded/solo) or an unsettled level lerp. Fixes baked GLBs where a level was
captured at a stray offset (e.g. ~ -100k Y), which inflated the bounding box and
made the model unframable / invisible in third-party glTF viewers.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reverts the LOD switching (0469b256). Rendering lod1/lod2 on zoom-out produced
WebGPU validation errors (invalid bindGroup_object) on real-GPU browsers — not
caught earlier because headless Chromium falls back to the WebGL2 backend, so
the WebGPU path was never exercised. The viewer returns to loading the baked
KTX2 lod0 (still the 22MB->12MB win). LOD switching to revisit with a real-GPU
test loop and on-demand loading instead of preload-all.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GlbScene accepts an optional lodUrls list and swaps rendered detail by camera
distance to the building's world-space center: lod0 (interactive — identity,
selection, zones, clips all bind here) for normal + building-view distances,
simpler visual-only levels only past ~2.5R / ~8R. Single-URL callers are
unchanged. useGLTFKTX2 now accepts a URL array.
Manual visibility toggling rather than THREE.LOD: THREE.LOD measures distance
to its own origin (0,0,0), which mis-selected levels (blanking the scene) when
the baked geometry is offset from the origin.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Migrate `curvingWall`, `curvingFence`, `movingWallEndpoint`, `movingFenceEndpoint`
(and their setters) off `useEditor` onto the authoritative interaction scope.
The `reshaping` scope variant gains an `endpoint` discriminator; existence
checks read `useIsCurveReshape()` / `useEndpointReshape()`, and the few sites
that need the node (affordance-tool mounts, wall-vs-fence type checks) read it
from `useReshapingNode()` — a frozen drag-start snapshot, mirroring the old
flags so the tools' own per-frame writes don't feed back. `MovingWallEndpoint`
/ `MovingFenceEndpoint` move to the kind-owned tools that consume them.
`editor-api` is simpler: endpoint engagement is kind-agnostic, and the
`engageMove` reshape clears are gone (the scope is single-owner).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Migrate the two pure-mirror interaction flags off `useEditor` onto the
authoritative `useInteractionScope`. Both carried payloads byte-identical to
the scope union, so this is a zero-behaviour-change refactor: readers use the
reference-stable `useEditingHole()` / `useActiveHandleDrag()` hooks (or the
`getEditingHole()` imperative read), and producers drive the scope directly
with guarded `endIf` so clearing one interaction never stomps an unrelated
scope. Adds the `holeEditScope` builder + a no-leaked-flag invariant test.
Closes the first slice of the legacy-flag deletion; the rich-payload flags
(movingNode, curving*, *Endpoint, placementDragMode) remain.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract the GLB build (prepare + GLTFExporter + WebGPUTextureUtils) out of
ExportManager into exportSceneToGlb so it can run outside the editor download
flow. Add a BakeExporter R3F component that fires the export once a host viewer
signals scene-ready and hands back the ArrayBuffer. Both exported for the
headless bake route (baked-glb-export phase 3, headless de-risk).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add `GlbScene` — the viewer that renders a baked GLB artifact with no
parametric scene graph, and finish the phase-1 export contract it consumes.
Viewer (packages/viewer):
- GlbScene: loads the artifact, drives a building → level → zone → node drill
hierarchy on useViewer.selection. Room/zone picking resolves from the floor
plane (ray ∩ floor + point-in-polygon), node picking uses a footprint test,
so walls/ceilings/zone-helpers never skew or block selection. Level modes
(stacked/exploded/solo), dollhouse (hide a focused floor's ceilings + roof so
rooms are visible and pickable), reconstructed zone floor fills + gradient
edge borders + room labels (faded, hover-brightened), baked door/window
open clips, click-outside / empty-space deselect, and the shared outline
post-FX. Exported as GlbScene/GlbLevel/GlbIdentity/GlbHover.
- post-processing: composite the zone-pass tint into the base scene so rooms
show whether or not SSGI is enabled (previously only added in the SSGI branch).
Export contract (packages/editor/src/lib/glb-export.ts):
- Convert WebGPU NodeMaterials to classic glTF-standard materials; decompress
KTX2 maps via WebGPUTextureUtils so GLTFExporter can embed them.
- Stamp name + extras identity (pascalId/kind/label/openable/clips), bake
door/window open clips (loop:false), strip editor overlays (off-layer +
invisible-material hitboxes) so cutouts aren't plugged.
- Fix opaque-but-flagged-transparent materials (no spurious alphaMode=BLEND)
and BackSide → FrontSide + winding flip (glTF has no back-face-only).
- Force levels + zones visible and stamp level display names + zone polygons so
every floor bakes and /viewer can reconstruct rooms and label the breadcrumb.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Implements plans/editor-placement-interaction-overhaul.md: an authoritative
interaction-scope state machine plus the catalogued placement/interaction
fixes, and split-view floor-plan performance.
- Interaction-scope spine (lib/interaction/* + store/use-interaction-scope),
driven from central useEditor setters; overlay scoping (zone labels,
context badges, floating action menu) reads resolveOverlayPolicy.
- Bug tracks A/B/D/E/F/G/H: handle/cutout raycast, footprint validity,
auto-slab loop, ceiling hosting, B-key tool desync, 2D drop offset,
per-frame jank.
- Snapping modes (grid/lines/angles/off) + contextual HUD chips; modifier
model (Shift=cycle, Alt=free place, Ctrl=grid step).
- Item move now tracks the cursor 1:1 (was a laggy per-frame lerp); handle
rig hides during a whole-node move; rotate gizmo advertises Shift=free
rotation in the HUD and hides the move cross while rotating.
- Floor-plan perf: pause live reactivity while in 3D-only view; per-node
geometry cache so only changed nodes rebuild on a drag; hoist wall miters
to a once-per-pass ctx.levelData (O(N^2) -> O(N) on wall/opening drags).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Promote the client GLB export into the baked-artifact format from
plans/editor-baked-glb-export.md (phases 0 and 1).
- NodeMaterial -> classic MeshStandardMaterial conversion at export. The
viewer's MeshStandard/LambertNodeMaterial set isNodeMaterial, not
isMeshStandardMaterial, so GLTFExporter would otherwise drop every
surface to a blank default. KTX2 (compressed) maps are decompressed via
WebGPUTextureUtils so the exporter can embed them (PNG for now; KTX2
re-encode is deferred to the phase-3 bake worker).
- Identity stamping from sceneRegistry: node.name = pascalId and
extras = { pascalId, kind, label?, openable?, clips? }; all other
userData stripped so editor/runtime ephemera never reach glTF extras.
- Door/window open clips baked from the build-once + pose-at-t primitives
(door pascalSwingLeaf marker, window poseWindowMovingParts). Clips named
by label ("Door 1: open"), carry extras.loop = false (consumers play
once and hold; dumb glTF players still loop).
- Cutout fix: door/window selection hitboxes hide via material.visible,
which onlyVisible misses, so the hitbox box plugged the wall opening.
Non-renderable container meshes now keep their node but lose geometry;
childless ones are removed.
- Editor-overlay stripping mirrors the thumbnail capture: emit
thumbnail:before/after-capture so scene-layer affordances (handles,
ceiling/site brackets) self-hide, and drop anything off SCENE_LAYER
(gizmos, grid, zone fills).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Register a `resize` sound effect (three round-robin variations with
pitch/pan jitter and an 80ms gap) and emit it from the linear/radial
resize drag handler whenever the snapped+clamped value steps, so width /
length / depth / radius / height drags tick as the size changes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Selecting a textured wall/slab/item replaced its surface with a flat
purple wash. Root cause: the selection highlight clones the material and
tints it, but `NodeMaterial.clone()` on the WebGPU backend drops the
texture-map node assignments, so the clone rendered flat — and a strong
albedo blend + emissive washed whatever was left.
Fix: re-attach the maps from the source material after cloning (shared by
reference) and drop the albedo tint, keeping only a gentle indigo emissive
so the real material/texture stays readable with a soft "selected" glow.
Applied to both highlight paths:
- generic editor highlight (slabs/items) in selection-manager
- wall path (walls are excluded from the generic one), built lazily +
cached/self-healing so it survives the wall finish's async texture load
Removes the now-dead eager wall `highlightedVisible`/`selection` profile.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a Section B rule to the review-architecture skill: a new node kind or
geometry change that exposes paintable parts must carry overrides in a
schema `slots` record resolved via def.capabilities.paint (and thread it
through clone/duplicate/preset paths), and texturable def.geometry must
emit UVs in metres (1 unit = 1 m) so catalog finishes tile. Surfaced in the
skill description too.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a `horizontal` fence style that builds composite-cladding panels —
horizontal boards stacked between square intermediate posts — instead of
the vertical pickets that slat/rail/privacy all produce today.
- New `style: 'horizontal'` (core schema + inspector Style control).
- Posts march along the whole span at `postSpacing`, each with a cap.
- New `postCap` control (none/flat/pyramid, default pyramid); pyramid
caps render as a 4-sided cone fence part.
- New `slatGap` control for the board reveal — 0 collapses to one flush
panel so the stacked-board seams don't read as lines.
- `postCap` + `slatGap` are horizontal-only (visibleIf); postCap uses a
labelled dropdown so its options aren't a context-free switch.
- Lower the `postSpacing` inspector minimum from 0.2 to 0.05 m.
- 2D floor plan reuses the solid-panel marker for horizontal.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>