Repository navigation
[Maintainer] Fix node dragging and refine pillars, elevators, and roofs - #1247
Conversation
Resolve conflicts against main's i18n panels and tools, MEP connected editing and move-tool changes, keeping main's structure and re-applying the PR's intent: - duct-fitting and refrigerant-line selection: rebuilt on main's gesture owner (claimHandleDrag, Alt free-slide, paused history, inputDragging) with drag previews published as live node overrides through a small shared createLivePreview helper; the PR's use-node-handle-drag hook is dropped as superseded. Pipe-fitting keeps main's scene writes. Tests read the effective node mid-drag and the Escape case cancels through cancelActiveTool. - column, elevator and roof-segment panels, preset gallery, slider control and roof geometry notice: the PR's rewritten copy moved to i18n descriptors. Column option labels use one descriptor map; elevator sections reset by a stable section key rather than the translated title, and the cab/door dimension line is one message. New es/fr/ja/zh-CN entries are AI drafts marked fuzzy and Review: required. - roof-segment panel: main's version plus the PR's trim scope (interaction scope instead of metadata.showTrimPlanes), the shared MIN_ROOF_SEGMENT_DIMENSION / MAX_ROOF_PITCH limits, uncapped sliders (E-008) and roof-type thumbnails. - roof tool: the PR's retained menu shape on remount with main's ridge-mode reset; both test sets kept. - roof system: the PR's geometry-failure guard around main's framing-aware geometry calls. - move-registry-node tool: the PR's resolvePosition before main's connectivity preview. Door move tool keeps main's transom handling and also clears the PR's roof-face preview fields. - build tab: main's i18n labels plus the PR's barrel roof and thumbnails. nodes package.json takes main's version and keeps the bench:elevator script.
The column's movable.override returned null for managed posts, which
resolveMovable reads as "use the base config", so managed posts stayed
movable. It now returns { axes: [], gridSnap: false }, the cabinet
convention.
That alone only covers isMovable readers (3D direct drag). The other
paths only know the kind, so a new core isMoveLocked(node) predicate
(a per-node override that leaves no axes) gates them:
- registryMoveDisabled: the floorplanMoveTarget exemption no longer
re-enables Move/Duplicate pick-up for a locked node, so the 2D and 3D
action menus disable Move.
- MoveTool: refuses a locked moving node instead of mounting the
generic MoveRegistryNodeTool, which wrote position without
columnEditPatch.
- Group pick-up/rotate: classifyParticipant leaves locked nodes out,
since the group commit writes positions directly.
The column's 2D floorplanMoveTarget was already a no-op for managed
posts, and keyboard nudge only moves walls.
Co-authored-by: sudhir <sudhir9297@gmail.com>
Changing the column slot defaults to white also changed the render fallback, so every saved column without slots turned white (E-003). The slot defaults go back to concrete plaster (steel frame) and a new NEW_COLUMN_SLOTS is written as explicit slots by the column's defaults(), the pillar tool's placement seed and Reset materials. Applying a shape preset still keeps the column's materials. Co-authored-by: sudhir <sudhir9297@gmail.com>
A lean-to generates its posts from its own post count and indexes them, so a copy of one is either a stacked managed orphan or, stripped of its metadata, a free column parented inside the lean-to frame. Neither is a post the lean-to owns, so managed posts are not duplicable: a new per-node duplicable.allow hook (column rejects managed posts) and a core isNodeDuplicable() gate Duplicate in the floating, 2D and mobile menus, duplicateNodeAndPickUp (inspector buttons), and copy/paste and group duplicate through the clipboard root filter. Duplicating the whole lean-to still copies its posts. isMoveLocked is now checked once in setMovingNode, the single entry for moving nodes (engageMove, engageMoveDrag and the 2D Ctrl-drag included), which also clears the drag-mode flag engageMoveDrag set; the MoveTool guard it replaces is gone. The mobile selection bar hides Move and Duplicate when the node refuses them. Co-authored-by: sudhir <sudhir9297@gmail.com>
The cases are parsed without slots, which now resolve to the saved-column fallback; give them the new-column slots the white expectation is about. Co-authored-by: sudhir <sudhir9297@gmail.com>
movable.resolvePosition receives the scene nodes, but the elevator read the global store; the support helpers now take an optional nodes map and the definition passes its own. The landing test resolves against an empty store to pin it. Co-authored-by: sudhir <sudhir9297@gmail.com>
Co-authored-by: sudhir <sudhir9297@gmail.com>
Roof-type thumbnails render as components; nothing loads these images, and no script reads the prompt files. Co-authored-by: sudhir <sudhir9297@gmail.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ecb28179a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| resolvePosition: ({ node, position, nodes }) => [ | ||
| position[0], | ||
| resolveElevatorNodeSupportY(node as ElevatorNodeType, position, nodes), | ||
| position[2], | ||
| ], |
There was a problem hiding this comment.
Resolve elevator support heights in group moves
When an elevator is part of a multi-selection, the 2D and 3D group paths use translateGroupPatches, which preserves s.position[1] in group-transform-shared.ts and never invokes this hook. Dragging or rotating a group across a raised or lowered slab therefore commits the elevator's old landing height, unlike either single-node mover; apply resolvePosition to group preview and commit patches as well.
Useful? React with 👍 / 👎.
| 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', |
There was a problem hiding this comment.
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 👍 / 👎.
| <img | ||
| alt="" | ||
| src={`/icons/column-presets/${id}.webp`} | ||
| width={256} |
There was a problem hiding this comment.
Bundle preset thumbnails with the nodes package
In any npm consumer of @pascal-app/nodes other than apps/editor, these absolute URLs resolve against the host, but the new column and elevator WebPs exist only under apps/editor/public and are not included in the nodes package's published files. Consequently both preset galleries show broken images in external hosts; bundle/import the images with the package, as the roof thumbnails do, or expose a host-provided asset base.
AGENTS.md reference: AGENTS.md:L3-L3
Useful? React with 👍 / 👎.
…ions-refinements
Conflicts:
- packages/editor/src/i18n/locales/{en,en-XA}/messages.ts: compiled
catalogs conflicted on both branches' new messages. Regenerated with
`bun run i18n:extract` rather than hand-merged; this also normalised
comment order in the es/fr/ja/zh-CN PO drafts, which keep their
`fuzzy` + `Review: required` markers. `bun run i18n:check` passes.
Auto-merged files touched by both sides (reviewed, no edits needed):
- packages/editor/src/index.tsx: keeps this branch's
`RegistryToolContextValue` export and #1249's PlacementCoordinateInput,
wall typed-entry and usePlacementTyping exports.
- packages/nodes/src/cabinet/tool.tsx and wall/tool.tsx changed only on
main since the merge base, so #1249's typed coordinates land unchanged
next to this branch's cabinet move-lock/selection-proxy changes.
Co-authored-by: sudhir <sudhir9297@gmail.com>
…ments
Conflicts:
- packages/editor/src/i18n/locales/{en,en-XA}/messages.ts: compiled
catalogs conflicted on both branches' new messages; regenerated with
`bun run i18n:extract` rather than hand-merged. `bun run i18n:check`
passes.
Everything else auto-merged; `bun run ci` covers the files both sides
touched (core/index.ts, floating-action-menu.tsx, en/messages.po).
Co-authored-by: sudhir <sudhir9297@gmail.com>
| export default function ElevatorTool() { | ||
| const { activeLevelId: levelId, selectNode } = useRegistryToolContext() | ||
| const buildingId = useViewer((state) => state.selection.buildingId) | ||
| const onPlaced = useMemo(() => (id: AnyNodeId) => selectNode(id), [selectNode]) |
There was a problem hiding this comment.
Elevator place drops floor selection
Medium Severity
Placing an elevator no longer keeps the active floor. The dedicated selection handoff that passed buildingId and the current levelId was removed, and selectPlacedNode cannot find a level ancestor because elevators are parented to the building, so the floor plan can deselect on drop.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0b06f91. Configure here.
There was a problem hiding this comment.
Fixed in bd1c3ec. levelId itself survived placement, because the viewer's hierarchy guard keeps it. The regression was that main's elevator handoff also set buildingId, and placement no longer did. selectPlacedNode now looks up the placed node's building. If that building isn't the one already selected, it becomes the selected building, and the current floor is kept when it belongs to that building. This works for any kind, so the editor has no elevator-specific check. The regression test is in level-selection.test.ts.
The idle early-return treated a disabled current landing as valid and nothing queued a move, so the cab stayed shut on an out-of-service floor (door-open is rejected there). Queue the nearest available landing instead. Co-authored-by: sudhir <sudhir9297@gmail.com>
An elevator is parented to the building, so it has no level ancestor and selectPlacedNode only set selectedIds. Main's dedicated elevator handoff also wrote the elevator's building into the selection; when the selection had a level but no building (level picked from the tree or keyboard), placement now left buildingId null. Resolve the building ancestor generically and keep the floor in view when it belongs to that building. Co-authored-by: sudhir <sudhir9297@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bd1c3ec. Configure here.
| } else if (n.baseStyle === 'panelled-pedestal') { | ||
| const x = n.width * n.baseWidthScale, | ||
| z = n.depth * n.baseWidthScale | ||
| include(x * 0.51 + n.basePanelInset / 2, z * 0.51 + n.basePanelInset / 2) |
There was a problem hiding this comment.
Pedestal bounds ignore depth scale
Low Severity
The panelled-pedestal envelope scales depth by baseWidthScale instead of baseDepthScale. Neighboring base styles use the separate width and depth scales. On a rectangular pillar those values can differ, so plan drawing, collision, and handles undershoot the real pedestal along Z.
Reviewed by Cursor Bugbot for commit bd1c3ec. Configure here.
There was a problem hiding this comment.
The bounds match the drawn geometry, so there's no undershoot. The panelled-pedestal renderer (packages/nodes/src/column/renderer.tsx, baseStyle === 'panelled-pedestal') also sizes the block's depth and the Z-side panel offsets with widthScale, so the envelope in bounds.ts follows what's drawn. Switching only the bounds to baseDepthScale would make them disagree with the mesh. Whether this style should honour baseDepthScale at all is a geometry choice that came with #1112. It's tracked as a follow-up, with the bounds and the renderer to change together, rather than changed in this port.


What does this PR do?
Maintainer port of #1112 by @sudhir9297, merged with current
main, with the post-review fixes landed. Sudhir's seven commits keep their authorship. The follow-up commits carry aCo-authored-bytrailer.From #1112, unchanged in intent:
movable.resolvePositionrecomputes the landing height on every frame and again at commit, in 3D and in the plan. Doors are recessed behind the entrance surround, and stops and openings stay in sync.Maintainer changes on top:
main:i18n:extract.movable.overridereturns{ axes: [], gridSnap: false };nullmeans "use the base config". A new coreisMoveLockedcheck sits insetMovingNode, which every editor move entry goes through (3D drag, 2D Ctrl-drag, action-menu Move, move tool, group pick-up). The Move button is hidden for these posts.duplicable.allow({ node })opt-out is checked byisNodeDuplicable. Duplicate, copy and cut skip managed posts in the floating, 2D and mobile menus,duplicateNodeAndPickUpand the clipboard.defaults(), the pillar tool and the material reset.nodesit's given instead of reading the global store.cb4b4821).selectPlacedNodeadopts the building of a building-parented node, such as an elevator, and keeps the current floor when it belongs to that building. Main's dedicated elevator handoff did this before (bd1c3eca).resolvePositiondocs moved next to the othermovablefields inplugin-authoring.md. Unreferenced roof-type WebP files and thumbnail-prompt JSON files are removed.How to test
bun devand add a lean-to extension. Try to drag a post in 3D, Ctrl-drag it in 2D, and use Move and Duplicate from the action menu. Nothing moves or duplicates. Duplicating the whole lean-to still copies its posts.bun test packages/nodes/src/column packages/nodes/src/elevator packages/core/src/systems/elevator packages/editor/src/lib/node-action-movement.test.tsx packages/editor/src/lib/level-selection.test.ts.Screenshots / screen recording
Captures from @sudhir9297's branch, unchanged by the port. The visuals for roofs, pillars and elevators are the same, and the follow-ups change no UI except hiding Move and Duplicate for lean-to posts.
Four-column roof menu and thumbnails

Roof inspector thumbnails

Barrel roof

Pillar preset gallery

Checklist
bun devbun checkto verify)mainbranchLocal
bun run cipassed onbd1c3eca(exit 0). Independent read-only reviews approved0ecb2817, both merge heads (eeb4de1a,0b06f914), andbd1c3ecawith the two Bugbot fixes. Follow-ups, including the three Codex P2s:resolvePosition, so an elevator in a group keeps its old landing height (Codex)./icons/paths that aren't in the published@pascal-app/nodespackage (Codex).move_nodedoesn't checkisMoveLocked, so an agent can still move a managed post.duplicable.allowinplugin-authoring.md.duplicate_nodeuseisNodeDuplicable.selectPlacedNodecan clear an active zone whenselection.buildingIdwas null, and doesn't fall back to scanning a building's children for older scenes.baseWidthScalein both the renderer and the bounds (Bugbot, low).Supersedes #1112. Credit: @sudhir9297.
Co-authored-by: sudhir sudhir9297@gmail.com
Note
Medium Risk
Touches core movement, elevator runtime/opening sync, and roof surface math across editor and scene graph paths; behavior is broad but heavily tested and gated by new capability predicates.
Reviewed by Cursor Bugbot for commit bd1c3ec. Bugbot is set up for automated code reviews on this repo. Configure here.