feat(editor): unify placement/move facing triangle into one editor-side renderer

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>
This commit is contained in:
Wassim SAMAD
2026-06-26 21:48:58 -04:00
co-authored by Claude Opus 4.8
parent 76089d85ea
commit 68e5c6ca67
47 changed files with 1285 additions and 505 deletions
+1
View File
@@ -30,6 +30,7 @@ export {
nodeRegistry,
type PluginDiscovery,
registerNode,
resolveFacingIndicator,
setPluginDiscovery,
} from './registry'
export {
+12
View File
@@ -178,6 +178,18 @@ export function isPresettableKind(kind: string): boolean {
return def ? isPresettable(def) : false
}
/**
* Resolve a kind's facing-triangle config, or `null` when it has none.
* `{ reversed }` says whether the triangle points along the node's local -Z
* (its front) instead of +Z. One reader (the editor-side `<FacingPoseIndicator>`
* publishers) so placement and move stay consistent.
*/
export function resolveFacingIndicator(kind: string): { reversed: boolean } | null {
const facing = nodeRegistry.get(kind)?.facingIndicator
if (!facing) return null
return { reversed: facing === true ? false : (facing.reversed ?? false) }
}
/**
* Names of schema fields on `def` that are host references (`wallId`,
* `wallT`, etc.). Read by host apps at preset-save time to strip these
+8
View File
@@ -732,6 +732,14 @@ export type NodeDefinition<S extends ZodObject<any>> = {
schema: S
category: NodeCategory
surfaceRole?: SurfaceRole
/**
* Show a floor direction-triangle while placing/moving — the kind has a
* meaningful front. `true` points along the node's local +Z (forward).
* `{ reversed: true }` points along local -Z, for kinds whose front is the
* -Z side (a stair faces *out* of its run: you approach from the low end,
* which sits on the -Z side of the footprint).
*/
facingIndicator?: boolean | { reversed?: boolean }
/**
* Role this kind plays in a distribution system (HVAC duct / DWV pipe /
* refrigerant lineset). Lets the system-graph summary classify a