Skip to content

fix(editor): honor millimeter notation across measurement panels - #823

Open
FenjuFu wants to merge 2 commits into
pascalorg:mainfrom
FenjuFu:fix/measurement-control-millimeters
Open

fix(editor): honor millimeter notation across measurement panels#823
FenjuFu wants to merge 2 commits into
pascalorg:mainfrom
FenjuFu:fix/measurement-control-millimeters

Conversation

@FenjuFu

@FenjuFu FenjuFu commented Sep 10, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes #374. Measurement property controls now read both unit and metricNotation, so millimeter mode displays and accepts millimeters while scene values remain in meters. Input hints, precision, and keyboard/drag increments use the displayed unit.

The panel audit also found 178 meter-value props rounded before reaching the controls. Removing that repeated display rounding lets the controls format the original values: entering 2501 mm now stores 2.501 m and still displays 2501 mm after the panel rerenders.

The shared controls cover the door, window, roof, column, slab, fence, and descriptor-driven inspectors. The mechanical migration spans 26 panel files; its AST checks verified that callbacks, bounds, steps, precision props, and non-meter controls were preserved. Per-control migration evidence.

How to test

  1. Set metric notation to millimeters and edit a roof's X position to 2501. Verify the scene node stores 2.501 and the panel continues to show 2501 mm.
  2. Switch to imperial and back; verify the node position is unchanged. Exercise bare numbers, explicit units, bounds, and keyboard/drag increments in both shared controls.
  3. Run bun test ./packages/editor/src/lib/linear-display.test.ts.

Validation completed: 5 unit tests with 72 assertions; 22 browser interaction checks; and an actual RoofPanel/SliderControl/useScene regression confirming the 2501 mm → 2.501 m → 2501 mm round trip. Rendering the original panel against the same stored node reproduced 2500 mm. The component browser setup isolates unrelated action/presentation wrappers; it is not a full editor E2E run. Configured Biome and whitespace checks passed; the two normally excluded UI-control files were formatted separately.

Level-height badges also use the shared display precision: nine direct production-path checks passed for integer millimeters and the existing meter/foot readouts. Full fork CI for the current head passed the Linux quality pipeline (lint, skill checks, typecheck, full test suite and builds) and the macOS packed CLI/runtime smoke test. The validation workflow entry is isolated from this PR.

Screenshots / screen recording

Actual RoofPanel component regression: original panel · fixed panel.

Both screenshots use the same stored X position of 2.501 m.

Checklist

  • I've tested this locally with bun dev (tested the actual components in Chromium; full application validation passed in CI)
  • My code follows the existing code style
  • I've updated relevant documentation (not applicable)
  • This PR targets the main branch

Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
@pascal

pascal Bot commented Sep 10, 2026

Copy link
Copy Markdown

I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…).

Please try again, rephrase, or reach out if it keeps failing.

Error id: 09f18cf8-e5fe-4abf-a092-eb18f6599a93

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

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 41212e9. Configure here.

Comment thread packages/editor/src/components/ui/floating-level-selector.tsx
Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
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.

Track imperial unit support for remaining measurement panels

1 participant