Skip to content

fix: zone grid snapping, shelf position panel, deselect on item placement#394

Merged
wass08 merged 2 commits into
mainfrom
fix/zone-snap-shelf-position-deselect
Jun 10, 2026
Merged

fix: zone grid snapping, shelf position panel, deselect on item placement#394
wass08 merged 2 commits into
mainfrom
fix/zone-snap-shelf-position-deselect

Conversation

@wass08

@wass08 wass08 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Four small editor fixes:

  • Zone tool respects grid snapping — zone drawing snapped to a hardcoded 0.5 step for both cursor move and click; it now reads the editor's gridSnapStep setting (0.5 / 0.25 / 0.1 / 0.05) live, like the wall/column/shelf tools.
  • Shelf inspector gets an X/Y/Z position panel — adds a Position group with a vec3 field to shelfParametrics, rendered by the parametric inspector as three X/Y/Z sliders (same renderer the spawn node uses), matching the item panel.
  • Item catalog deselects before placement — clicking a catalog item to place it now clears the viewer selection first, so shortcuts (rotate & co) no longer act on both the placement ghost and the previously selected node.
  • Level display naming moves to @pascal-app/coregetDefaultLevelName / getLevelDisplayName ("Ground Floor" / "Floor N" / "Basement N") were internal to packages/editor, so viewer-only surfaces couldn't reach them and hand-rolled "Level N" labels instead. Pure domain logic → moved to core and exported from its barrel; the editor package's seven call sites import from there now.

How to test

  1. bun dev, open the editor.
  2. Zone snap: set the grid snap step to 0.1 in the view toggles, activate the zone tool, and draw — the cursor and committed points should snap at 0.1 m increments (previously always 0.5 m).
  3. Shelf panel: place a shelf, select it — the inspector now shows a Position section with X/Y/Z sliders; dragging them moves the shelf.
  4. Deselect on placement: select any placed node, then click an item in the catalog and press R while placing — only the ghost rotates, and the previous selection's panel is closed.
  5. Level naming: no behavior change inside the editor — level lists still read "Ground Floor / Floor 1 / …". bun run build confirms the import move compiles across core/editor/nodes.

Screenshots / screen recording

N/A — small interactive fixes; behavior is covered by the test steps above.

Checklist

  • I've tested this locally with bun dev (verified via typecheck + bun run build; needs a manual pass of the steps above)
  • 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

…ment

- Zone tool reads the editor's gridSnapStep (0.5/0.25/0.1/0.05) instead
  of a hardcoded 0.5 for both cursor move and click snapping.
- Shelf inspector gains a Position group (vec3 X/Y/Z sliders), matching
  the item panel.
- Item catalog clears the viewer selection before arming placement so
  shortcuts (rotate & co) don't hit both the ghost and the selected node.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
pascal 🔴 Failed Jun 10, 2026, 4:41 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

getDefaultLevelName / getLevelDisplayName ("Ground Floor" / "Floor N" /
"Basement N") lived in packages/editor's internal lib, so viewer-only
surfaces couldn't reach them and fell back to hand-rolled "Level N"
labels. The helpers are pure domain logic, so they move to core and
export from its barrel; the editor package's seven call sites now import
them from there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wass08 wass08 merged commit d36e8fc into main Jun 10, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant