Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
80ca1c3
Improve node interactions and pillar editing experience
sudhir9297 Oct 19, 2026
07f0f89
Improve elevators, pillar presets, and inspector layout
sudhir9297 Oct 20, 2026
2e841df
Recess elevator doors behind stationary entrance surrounds
sudhir9297 Oct 20, 2026
d93a579
Improve roof geometry, previews, and thumbnail menus
sudhir9297 Oct 20, 2026
266171d
Fix roof architecture review findings
sudhir9297 Oct 20, 2026
c4e7bcf
Isolate registry tests and verify capped history through undo
sudhir9297 Oct 20, 2026
c3edd17
Resolve elevator landing height during moves and add review screenshots
sudhir9297 Oct 21, 2026
092a2bb
Merge branch 'main' into fix/node-tool-interactions
cursoragent Nov 9, 2026
f3f7b36
Lock lean-to managed posts against every move path
cursoragent Nov 9, 2026
0319a8b
Keep saved columns' finish; write white slots on new columns
cursoragent Nov 9, 2026
bb89df9
Keep lean-to posts out of Duplicate and the moving-node entry
cursoragent Nov 9, 2026
6f0ae1d
Paint-slot coverage renders columns as newly placed
cursoragent Nov 9, 2026
1f210da
Thread nodes through the elevator landing resolver
cursoragent Nov 9, 2026
5157097
Document movable.resolvePosition beside the other movable fields
cursoragent Nov 9, 2026
0ecb281
Drop unreferenced roof-type images and thumbnail prompt files
cursoragent Nov 9, 2026
eeb4de1
Merge origin/main (typed wall/cabinet entry #1249) into node-interact…
cursoragent Nov 9, 2026
0b06f91
Merge origin/main (#1251, #1248, #1244) into node-interactions-refine…
cursoragent Nov 10, 2026
cb4b482
elevator: send an idle cab away from a landing that becomes disabled
cursoragent Nov 10, 2026
bd1c3ec
editor: selectPlacedNode adopts the building of a building-parented node
cursoragent Nov 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions apps/editor/components/build-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import {
useWallDrawVariant,
withToolShortcut,
} from '@pascal-app/editor'
import { framingPostToolChoices, useLiquidLineToolOptions } from '@pascal-app/nodes'
import {
framingPostToolChoices,
RoofTypeThumbnail,
useLiquidLineToolOptions,
} from '@pascal-app/nodes'
import { useViewer } from '@pascal-app/viewer'
import Image from 'next/image'
import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react'
Expand Down Expand Up @@ -307,14 +311,14 @@ export function BuildTab() {
<div className="px-0.5 pt-1 font-medium text-muted-foreground text-xs">
{i18n._({ id: 'app.buildTab.roofType', message: 'Roof type' })}
</div>
<div className="grid grid-cols-2 gap-1.5">
<div className="grid grid-cols-4 gap-1.5">
{ROOF_TYPE_OPTIONS.map((roofType) => {
const active = activeTool === 'roof' && activeRoofType === roofType.value
return (
<button
aria-pressed={active}
className={cn(
'rounded-lg px-2.5 py-2 text-left font-medium text-xs transition-colors',
'flex flex-col items-center gap-1 rounded-lg px-2.5 py-2 text-center font-medium text-xs transition-colors',
active
? 'bg-primary/10 text-primary ring-1 ring-primary/50'
: 'bg-muted/40 text-muted-foreground hover:bg-muted hover:text-foreground',
Expand All @@ -327,6 +331,7 @@ export function BuildTab() {
onMouseEnter={() => triggerSFX('sfx:menu-hover')}
type="button"
>
<RoofTypeThumbnail type={roofType.value} />
{i18n._(roofType.label)}
</button>
)
Expand Down
1 change: 1 addition & 0 deletions apps/editor/lib/build-tab-state.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ test('roof creation exposes every supported roof type', () => {
'dutch',
'mansard',
'conical',
'barrel',
])
})
4 changes: 4 additions & 0 deletions apps/editor/lib/build-tab-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export const ROOF_TYPE_OPTIONS: ReadonlyArray<{ label: MessageDescriptor; value:
label: /* i18n */ { id: 'app.lib.buildTabState.conical', message: 'Conical' },
value: 'conical',
},
{
label: /* i18n */ { id: 'app.lib.buildTabState.barrel', message: 'Barrel' },
value: 'barrel',
},
]

export function getActiveRoofFeatureId(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/ifc-converter/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- BEGIN:nextjs-agent-rules -->

# This is NOT the Next.js you know
## This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.

Expand Down
3 changes: 0 additions & 3 deletions i18n/literal-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,6 @@
"part",
"parts"
],
"packages/editor/src/components/ui/controls/slider-control.tsx": [
"Mixed"
],
"packages/editor/src/components/ui/controls/terrain-sculpt-panel.tsx": [
"Clear terrain",
"Click the ground to pick its height as the target.",
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/contracts/reference-inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,6 @@ export const METADATA_NON_REFERENCES: readonly { path: string; reason: string }[
'porch',
'renderPass',
'role',
'showTrimPlanes',
'storyShell',
'suppressedDimensionSegmentIndexes',
]),
Expand Down
13 changes: 12 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,13 @@ export { useRegistryVersion } from './registry/use-registry-version'
export * from './schema'
export * from './schema/nodes/stair-defaults'
export * from './services'
export { isMovable, movePlanToward, moveToward, resolveMovable } from './services/movement'
export {
isMovable,
isMoveLocked,
movePlanToward,
moveToward,
resolveMovable,
} from './services/movement'
export * from './services/project-file-sink'
export {
collectionIdsOf,
Expand Down Expand Up @@ -948,6 +954,9 @@ export {
} from './store/use-scene'
export { resolveElevatorDispatchTarget } from './systems/elevator/elevator-dispatch'
export {
ELEVATOR_MIN_CAB_DIMENSION,
ELEVATOR_MIN_CAB_HEIGHT,
ELEVATOR_MIN_WALL_THICKNESS,
type ElevatorDoorSide,
getElevatorCabCenterZ,
getElevatorCabDepth,
Expand All @@ -961,6 +970,8 @@ export {
getResolvedElevatorDoorPanelStyle,
getResolvedElevatorDoorStyle,
getResolvedElevatorShaftStyle,
normalizeElevatorDimensions,
resolveElevatorDimensions,
} from './systems/elevator/elevator-geometry'
export { syncAutoElevatorOpenings } from './systems/elevator/elevator-opening-sync'
export { ElevatorOpeningSystem } from './systems/elevator/elevator-opening-system'
Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/node-slots/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ export const COLUMN_BASE_DEFAULT = 'library:concrete-plaster'
export const COLUMN_CAPITAL_DEFAULT = 'library:concrete-plaster'
export const COLUMN_FRAME_DEFAULT = 'library:metal-steel'

/**
* Written onto newly created columns. The slot defaults above stay the render
* fallback, so saved columns that never had `slots` keep their look (E-003).
*/
export const NEW_COLUMN_SLOTS: Readonly<Record<ColumnSlotId, string>> = {
shaft: 'library:preset-white',
base: 'library:preset-white',
capital: 'library:preset-white',
frame: 'library:preset-white',
Comment on lines +15 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve white defaults when erasing column paint

New columns now persist white in slots, but after painting one of those slots, the shared eraser deletes that slot key and the column falls back to the concrete or steel declarations in columnSlots. Thus painting and then erasing a newly placed white column unexpectedly changes its original finish; restore the new-column white baseline on erase without changing the slot-less fallback needed by existing scenes.

AGENTS.md reference: AGENTS.md:L38-L38

Useful? React with 👍 / 👎.

}

export function columnSlots(node: ColumnNode): SlotDeclaration[] {
if (node.source)
return node.source.manifest.slots.map((slot) => ({
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export {
hasRegistry3DMoveTool,
isDrawnViaTool,
isDrawnViaToolKind,
isNodeDuplicable,
isNodeKindEnabled,
isPresettable,
isPresettableKind,
Expand Down
10 changes: 10 additions & 0 deletions packages/core/src/registry/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,16 @@ export function isRegistryMovable(kind: string): boolean {
return false
}

/**
* Whether Duplicate, copy and paste may clone this node: its kind is not
* `duplicable: false` and its `duplicable.allow` (if any) accepts it.
*/
export function isNodeDuplicable(node: AnyNode): boolean {
const duplicable = nodeRegistry.get(node.type)?.capabilities.duplicable
if (duplicable === false) return false
return typeof duplicable === 'object' && duplicable.allow ? duplicable.allow({ node }) : true
}

/**
* Whether the kind has a move tool that MOUNTS in the 3D viewport — the
* generic `capabilities.movable` mover or a bespoke `affordanceTools.move`.
Expand Down
8 changes: 8 additions & 0 deletions packages/core/src/registry/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,8 @@ export type DuplicableConfig = {
/** 'with-children' preserves the root-only draft lifecycle for childless nodes. */
subtree?: boolean | 'with-children'
prepareSubtreeClone?: (args: DuplicateSubtreeCloneArgs) => DuplicateSubtreeCloneResult
/** Per-node opt-out, e.g. a post its lean-to generates and counts itself. */
allow?: (args: { node: AnyNode }) => boolean
}

// ─── Capabilities ────────────────────────────────────────────────────
Expand Down Expand Up @@ -2277,6 +2279,12 @@ export type CapabilityCtx = { node: AnyNode }
export type CutsContext = { nodes: Readonly<Record<AnyNodeId, AnyNode>> }

export type MovableConfig = {
/** Resolve the stored pose after snapping, during preview and again on commit. */
resolvePosition?: (args: {
node: AnyNode
position: [number, number, number]
nodes: Readonly<Record<string, AnyNode>>
}) => [number, number, number]
axes: ReadonlyArray<'x' | 'y' | 'z'>
gridSnap?: boolean
/** Keep an existing floor-placed node on its current level and visual elevation while dragging. */
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ export {
getSegmentSlopeFrame,
hasSegmentMaterialOverride,
isBandedShedSegment,
MAX_ROOF_PITCH,
MIN_ROOF_SEGMENT_DIMENSION,
MIN_ROOF_SEGMENT_TRIM_SPAN,
normalizeRoofSegmentTrim,
ROOF_SHAPE_DEFAULTS,
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/schema/nodes/roof-segment-resize.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
getActiveRoofHeight,
getPitchFromActiveRoofHeight,
MAX_ROOF_PITCH,
type RoofSegmentNode,
} from './roof-segment'

Expand All @@ -25,5 +26,5 @@ export function getRoofSegmentResizePatch(
if (node.roofType === 'barrel')
return { depth: dimension, barrelRise: Math.min(dimension / 2, rise), position }
const pitch = getPitchFromActiveRoofHeight({ ...node, depth: dimension, roofHeight: rise })
return { depth: dimension, pitch: Math.max(0, Math.min(85, pitch)), position }
return { depth: dimension, pitch: Math.max(0, Math.min(MAX_ROOF_PITCH, pitch)), position }
}
46 changes: 45 additions & 1 deletion packages/core/src/schema/nodes/roof-segment-surface.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { describe, expect, test } from 'bun:test'
import { getRoofSegmentSurfaceY, ROOF_SHAPE_DEFAULTS, RoofSegmentNode } from './roof-segment'
import {
getActiveRoofHeight,
getRoofSegmentSurfaceY,
ROOF_SHAPE_DEFAULTS,
RoofSegmentNode,
} from '@pascal-app/core'

describe('getRoofSegmentSurfaceY', () => {
test('falls linearly from a conical apex in every radial direction', () => {
Expand Down Expand Up @@ -79,3 +84,42 @@ describe('getRoofSegmentSurfaceY', () => {
expect(getRoofSegmentSurfaceY(segment, localX, localZ)).toBeCloseTo(expected, 6)
})
})

test('gambrel surface follows its lower and upper slopes across the kink', () => {
const node = RoofSegmentNode.parse({
roofType: 'gambrel',
width: 10,
depth: 8,
wallHeight: 0,
pitch: 45,
})
const peak = getActiveRoofHeight(node)
expect(getRoofSegmentSurfaceY(node, 0, 3)).toBeCloseTo(1, 6)
expect(getRoofSegmentSurfaceY(node, 0, 2)).toBeCloseTo(2, 6)
expect(getRoofSegmentSurfaceY(node, 0, 1)).toBeCloseTo((peak + 2) / 2, 6)
})

test('mansard surface includes the shoulder and a ridge on rectangular footprints', () => {
const node = RoofSegmentNode.parse({
roofType: 'mansard',
width: 12,
depth: 8,
wallHeight: 0,
pitch: 45,
})
const peak = getActiveRoofHeight(node)
expect(getRoofSegmentSurfaceY(node, 0, 3.4)).toBeCloseTo(0.6, 6)
expect(getRoofSegmentSurfaceY(node, 0, 2.8)).toBeCloseTo(1.2, 6)
expect(getRoofSegmentSurfaceY(node, 1, 0)).toBeCloseTo(peak, 6)
expect(getRoofSegmentSurfaceY(node, 5.4, 0)).toBeCloseTo(0.6, 6)
})

test('rectangular hip surface stays at crown height along the ridge in either orientation', () => {
for (const [width, depth, x, z] of [
[10, 6, 1, 0],
[6, 10, 0, 1],
]) {
const node = RoofSegmentNode.parse({ roofType: 'hip', width, depth, wallHeight: 0, pitch: 45 })
expect(getRoofSegmentSurfaceY(node, x!, z!)).toBeCloseTo(3, 6)
}
})
40 changes: 38 additions & 2 deletions packages/core/src/schema/nodes/roof-segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import type { MaterialSchema as MaterialSchemaType } from '../material'
import { MaterialSchema } from '../material'
import { getBarrelRoofProfile } from './barrel-roof'
import { RoofGlazing, RoofSystemType } from './roof-glazing'
import { getRoofModuleFaces, getRoofShapeRatios } from './roof-segment-shape'
import { RoofEaveCut, RoofType } from './roof-types'

export { RoofEaveCut, RoofType } from './roof-types'
export const MIN_ROOF_SEGMENT_TRIM_SPAN = 0.1
export const MIN_ROOF_SEGMENT_DIMENSION = 0.5
export const MAX_ROOF_PITCH = 85
const DEFAULT_ROOF_SEGMENT_WIDTH = 8
const DEFAULT_ROOF_SEGMENT_DEPTH = 6

Expand Down Expand Up @@ -134,7 +137,7 @@ export const RoofSegmentNode = BaseNode.extend({
// For gable/hip/shed this is the only slope; for gambrel/mansard/dutch
// it is the steep (lower) slope. The overall peak height is derived
// from pitch + footprint + roofType via getActiveRoofHeight().
pitch: z.number().min(0).max(85).default(40),
pitch: z.number().min(0).max(MAX_ROOF_PITCH).default(40),
// Structure thicknesses
wallThickness: z.number().default(0.1),
deckThickness: z.number().default(0.1),
Expand Down Expand Up @@ -787,7 +790,40 @@ export function getRoofSegmentSurfaceY(
const peakY = node.wallHeight + activeRh
if (activeRh === 0) return node.wallHeight

if (node.roofType === 'gable' || node.roofType === 'gambrel' || node.roofType === 'mansard') {
if (node.roofType === 'gambrel' || node.roofType === 'mansard' || node.roofType === 'hip') {
const faces = getRoofModuleFaces({
type: node.roofType,
w: node.width,
d: node.depth,
wh: node.wallHeight,
rh: activeRh,
baseY: node.wallHeight - 1,
baseW: node.width,
baseD: node.depth,
tanTheta: slopeFrame.tanTheta,
insets: {},
shapeRatios: getRoofShapeRatios(node),
})
let top: number | undefined
for (const face of faces) {
const a = face[0]
if (!a) continue
for (let i = 1; i + 1 < face.length; i++) {
const b = face[i]!,
c = face[i + 1]!
const determinant = (b.z - c.z) * (a.x - c.x) + (c.x - b.x) * (a.z - c.z)
if (Math.abs(determinant) < 1e-10) continue
const u = ((b.z - c.z) * (localX - c.x) + (c.x - b.x) * (localZ - c.z)) / determinant
const v = ((c.z - a.z) * (localX - c.x) + (a.x - c.x) * (localZ - c.z)) / determinant
if (u < -1e-8 || v < -1e-8 || u + v > 1 + 1e-8) continue
const y = u * a.y + v * b.y + (1 - u - v) * c.y
top = top === undefined ? y : Math.max(top, y)
}
}
if (top !== undefined) return top
}

if (node.roofType === 'gable') {
const t = node.depth > 0 ? Math.abs(localZ) / (node.depth / 2) : 0
return peakY - t * activeRh
}
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/services/drag-session.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { beforeEach, describe, expect, mock, test } from 'bun:test'
import { afterEach, beforeEach, describe, expect, mock, test } from 'bun:test'
import { z } from 'zod'
import { nodeRegistry, registerNode } from '../registry/registry'
import type { AnyNodeDefinition, DragAction, Relations, SceneApi } from '../registry/types'
Expand Down Expand Up @@ -81,9 +81,12 @@ function makeAction(): DragAction<{ id: AnyNodeId }, { x: number }> {
}

describe('createDragSession', () => {
let restoreRegistry = () => {}
beforeEach(() => {
restoreRegistry = nodeRegistry._snapshot()
nodeRegistry._reset()
})
afterEach(() => restoreRegistry())

test('start pauses history; commit resumes', () => {
const scene = makeSpyScene()
Expand Down
13 changes: 13 additions & 0 deletions packages/core/src/services/movement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,16 @@ export function isMovable(node: AnyNode): boolean {
const config = resolveMovable(node)
return config != null && config.axes.length > 0
}

/**
* True when the node's `movable.override` locks this particular node (a lean-to
* post, a cabinet run behind its selection proxy). The lock outranks the kind's
* other movers — `floorplanMoveTarget`, `affordanceTools.move`, group pick-up —
* which only know the kind, not the node.
*/
export function isMoveLocked(node: AnyNode): boolean {
const base = nodeRegistry.get(node.type)?.capabilities.movable
if (!base?.override) return false
const config = resolveMovable(node)
return config !== base && config !== null && config.axes.length === 0
}
Loading
Loading