Repository navigation
Conversation
kruschdev
force-pushed
the
feat/item-panel-editable-dimensions
branch
from
November 25, 2026 22:38
4079063 to
5aa3f84
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 81bf49d. Configure here.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
Fixes #1307
Previously, the Dimensions readout under Scale in the shared item panel (
packages/nodes/src/item/panel.tsx) was read-only, so resizing an item to an exact physical measurement required computing scale factors by hand.I replaced the read-only Info row with an editable Dimensions section in the shared
ItemPanelso both hosted and standalone editors support direct physical dimension entry:packages/nodes/src/item/dimensions.ts): AddedcomputeScaleForDimensionandeditableDimensionAxes. Editing axisisetsscale[i] = requested / asset.dimensions[i](clamped at>= 0.01, preserving mirrored signs). When the aspect-ratio lock is on, all three axes scale by the same factor so the item keeps its aspect ratio (uniform items set all three axes torequested / asset.dimensions[i]); when off, only the edited axis changes. Missing, zero, negative, or non-finiteasset.dimensionsare guarded and fall back to the existing Scale controls.packages/nodes/src/item/panel.tsx): Added Width, Height, and DepthSliderControlrows (unit="m",precision={2},step={0.01}) with a Lock Aspect Ratio toggle synced with the panel's uniform-scale state. Direct typed edits (respecting metric/imperial settings and unit suffixes such as1 m,90 cm,36 in) and slider drags each record a single undo step viauseScene.temporal, skip no-op writes, and cancel cleanly on Escape.node.item.panel.width,node.item.panel.height,node.item.panel.depth, andnode.item.panel.lockAspectRatioacrossen,es,fr,ja, andzh-CN(bun run i18n:checkpasses with 0 missing strings).packages/nodes/src/item/panel.test.tsx): Added unit tests covering unlocked and aspect-locked scale math, mirrored signs, minimum scale clamping, missing/zero/partial-zero dimension guards, unit-awareItemPanelcontrols, single-step Undo on typed edits and drags, no-op write suppression, and drag cancel rollback.How to test
bunx biome check packages/nodes/src/item/dimensions.ts packages/nodes/src/item/panel.tsx packages/nodes/src/item/panel.test.tsx.bun test packages/nodes/src/item/panel.test.tsx(7 pass, 0 fail).bun run i18n:checkandbunx turbo run check-types --filter=@pascal-app/nodes --filter=@pascal-app/editor.1 minto Width with Lock Aspect Ratio on (confirming 3D, 2D plan, and Scale all update proportionally), pressCtrl+Z/Cmd+Z(restores in one step), then toggle Lock Aspect Ratio off and edit Width independently.Screenshots / screen recording
Split 2D/3D view: typing
1 minto Width (parsed in imperial mode to3.28 ft,XYZ scale: 0.50), pressingCtrl+Zto undo in one step, then toggling Lock Aspect Ratio off and typing1.2 m(X scale: 0.60,Y/Z scale: 1.00):Checklist
bun devbun checkto verify)mainbranchNote
Medium Risk
Touches scene
scaleupdates and undo/temporal pause/resume semantics in a shared control used beyond the item panel, though changes are guarded and heavily tested.Overview
Replaces the item panel’s read-only dimension readout with an editable Dimensions section: unit-aware Width / Height / Depth sliders (meters, with locale/unit parsing) when
asset.dimensionsare valid, plus a Lock Aspect Ratio toggle tied to the existing uniform-scale behavior. Scale updates go through newdimensions.tshelpers (computeScaleForDimension,editableDimensionAxes) with guards for missing/zero axes, mirroring, minimum scale, and uniform vs per-axis edits.SliderControl is extended with optional
onDragStart, dirty-input tracking so click-and-blur without typing does not commit, and stricter wheel/arrow/drag behavior when scene undo tracking is paused—supporting single-step undo for drags, no-op suppression, and cancel rollback from the panel’s dimension drag state.Adds i18n strings and broad
panel.test.tsxcoverage for the math and inspector/undo behavior; assets without usable dimensions still use the Scale section only.Reviewed by Cursor Bugbot for commit 4345aed. Bugbot is set up for automated code reviews on this repo. Configure here.