Skip to content

feat: add imperial unit support for measurements in UI controls and t…#310

Open
PRAVEEN7230 wants to merge 2 commits into
pascalorg:mainfrom
PRAVEEN7230:main
Open

feat: add imperial unit support for measurements in UI controls and t…#310
PRAVEEN7230 wants to merge 2 commits into
pascalorg:mainfrom
PRAVEEN7230:main

Conversation

@PRAVEEN7230
Copy link
Copy Markdown

What does this PR do?

This PR fixes the bug where toggling the unit only affected the display of dimensions and not the input itself, specifically in the object editing panels. It also adds keyboard-based dimensional input to the Wall tool during drafting.

Fixes #308

Specific changes:

  • Centralized Measurement Parsing: Added a new measurements.ts utility to handle parsing and formatting between metric and imperial values (e.g., converting 10'6" to meters).
  • Unit Respect in SliderControl: Updated SliderControl (used in the Properties panels) to fetch the active unit state. It now properly formats values and parses imperial strings so that dimensions update correctly instead of silently reverting to metric.
  • Keyboard Dimension Input for Walls: Added direct drafting input to WallTool. While drawing a wall, users can now type dimensions (e.g., 10') and press Enter to snap the wall length in the current pointer direction exactly.

How to test

  1. Verify Unit Toggle in Properties Panel: Select an existing wall and change your global unit to Imperial. Select the wall again, and try changing the length via the properties panel using a string like 15'2". Ensure the wall length updates accurately.
  2. Verify Wall Drafting Input: Select the Wall tool and click to start drawing. Before completing the wall, type 10' (a text input overlay should appear near your cursor). Press Enter and verify the wall is created at exactly 10' length in the direction of the cursor.
  3. Verify Escape/Cancel Flow: While typing a dimension in the Wall tool, press Escape to ensure it clears the text input without prematurely canceling the wall drawing itself.

Screenshots / screen recording

Screenshot 2026-05-15 at 11 09 34 PM Screenshot 2026-05-15 at 11 10 20 PM

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

boboidvtw pushed a commit to boboidvtw/editor that referenced this pull request May 17, 2026
…ss (pascalorg#284)

Backport from monorepo PR pascalorg#310 (fix/april-pass):

1. WebGPU renderer race on Canvas remount
   Cache the in-flight WebGPURenderer promise per canvas element so
   concurrent configure() calls from R3F's useLayoutEffect await the
   same init() instead of creating duplicate renderers. Fixes
   intermittent 'resolve target size does not match' errors when
   navigating between projects and home.

2. Duplicate item loses its scale
   Add scale to the field set in useDraftNode.commit() so duplicated
   items preserve their original scale instead of falling back to
   [1,1,1].

Co-authored-by: Pascal <open@pascal.app>
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.

unit toggle only affects the display of dimensions, not the input

1 participant