Skip to content

[Maintainer] Fix node dragging and refine pillars, elevators, and roofs - #1247

Merged
Aymericr merged 19 commits into
mainfrom
cursor/node-interactions-refinements-11c1
Nov 10, 2026
Merged

Aymericr merged 19 commits into
mainfrom
cursor/node-interactions-refinements-11c1

Conversation

@Aymericr

@Aymericr Aymericr commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

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 a Co-authored-by trailer.

From #1112, unchanged in intent:

  • Node interactions: handle previews stay in live overrides, and moving, snapping and selection cleanup for hosted openings and accessories are fixed.
  • Pillars: lower-polygon geometry, consistent bounds and plan drawing, paint coverage, property previews, and a single preset gallery with white as the default for new pillars.
  • Elevators: moves go through the generic mover. movable.resolvePosition recomputes 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.
  • Roofs: surface queries and accessory cache invalidation are corrected, and editing limits aligned. Trim editing is a transient interaction scope. A failed geometry rebuild keeps the previous mesh and offers a retry. There's a four-column roof menu, and ghosts for all nine forms.

Maintainer changes on top:

  • Merges with main:
  • Lean-to managed posts can't be moved from the editor. The column's movable.override returns { axes: [], gridSnap: false }; null means "use the base config". A new core isMoveLocked check sits in setMovingNode, 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.
  • Lean-to posts can't be duplicated. A new optional duplicable.allow({ node }) opt-out is checked by isNodeDuplicable. Duplicate, copy and cut skip managed posts in the floating, 2D and mobile menus, duplicateNodeAndPickUp and the clipboard.
  • Saved scenes keep their column finish (E-003). The slot fallback stays concrete plaster and steel. New columns get explicit white slots from defaults(), the pillar tool and the material reset.
  • Elevator landing: the resolver takes the nodes it's given instead of reading the global store.
  • Elevator runtime (Bugbot finding): an idle cab on a landing that becomes disabled is sent to the nearest available landing instead of staying shut there (cb4b4821).
  • Placement selection (Bugbot finding): selectPlacedNode adopts 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).
  • Cleanup: the resolvePosition docs moved next to the other movable fields in plugin-authoring.md. Unreferenced roof-type WebP files and thumbnail-prompt JSON files are removed.

How to test

  1. Run bun dev and 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.
  2. Open an existing scene with unpainted columns: they still render concrete. A newly placed pillar is white.
  3. Place an elevator across levels and move it over a raised slab: the landing height follows during the drag and on drop. One undo restores the move. After placing, the floor stays selected.
  4. With an elevator idle on a floor, disable that floor in its panel: the cab moves to the nearest enabled floor.
  5. Draw each roof type: the ghost matches the form and all nine thumbnails show. In roof trim mode, Escape in a number field cancels the field only; Escape over the canvas exits trim.
  6. Focused tests: 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 menu and thumbnails

Roof inspector thumbnails
Roof inspector thumbnails

Barrel roof
Barrel roof

Pillar preset gallery
Pillar preset gallery

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Local bun run ci passed on bd1c3eca (exit 0). Independent read-only reviews approved 0ecb2817, both merge heads (eeb4de1a, 0b06f914), and bd1c3eca with the two Bugbot fixes. Follow-ups, including the three Codex P2s:

  • Group moves don't call resolvePosition, so an elevator in a group keeps its old landing height (Codex).
  • Erasing paint on a new white column falls back to concrete (Codex).
  • Column and elevator preset images load from host-relative /icons/ paths that aren't in the published @pascal-app/nodes package (Codex).
  • The agent move_node doesn't check isMoveLocked, so an agent can still move a managed post.
  • Document duplicable.allow in plugin-authoring.md.
  • Have the agent duplicate_node use isNodeDuplicable.
  • selectPlacedNode can clear an active zone when selection.buildingId was null, and doesn't fall back to scanning a building's children for older scenes.
  • The panelled-pedestal base sizes depth with baseWidthScale in both the renderer and the bounds (Bugbot, low).

Supersedes #1112. Credit: @sudhir9297.

Co-authored-by: sudhir sudhir9297@gmail.com

Open in Web Open in Cursor 

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.

sudhir9297 and others added 15 commits October 19, 2026 14:25
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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T23:02:17.965847Z 0ecb281 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Aymericr Aymericr added the bot:maintainer label Nov 9, 2026 — with Cursor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +210 to +214
resolvePosition: ({ node, position, nodes }) => [
position[0],
resolveElevatorNodeSupportY(node as ElevatorNodeType, position, nodes),
position[2],
],

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 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 👍 / 👎.

Comment on lines +15 to +19
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',

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 👍 / 👎.

Comment on lines +161 to +164
<img
alt=""
src={`/icons/column-presets/${id}.webp`}
width={256}

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 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 👍 / 👎.

cursoragent and others added 2 commits November 9, 2026 23:24
…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>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

export default function ElevatorTool() {
const { activeLevelId: levelId, selectNode } = useRegistryToolContext()
const buildingId = useViewer((state) => state.selection.buildingId)
const onPlaced = useMemo(() => (id: AnyNodeId) => selectNode(id), [selectNode])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0b06f91. Configure here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

cursoragent and others added 2 commits November 10, 2026 00:19
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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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).

Fix All in Cursor

❌ 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bd1c3ec. Configure here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@Aymericr
Aymericr merged commit 85d7f4c into main Nov 10, 2026
5 checks passed
@Aymericr
Aymericr deleted the cursor/node-interactions-refinements-11c1 branch November 10, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants