fix(editor): area readouts + generated names follow the unit toggle; bump lingo to 0.2.0#477
Merged
Merged
Conversation
The metric/imperial preference was already honored by every length input, but two area surfaces were still hardcoded to m²: - the "Load build" import dialog's Floor area stat - the auto-generated default names for zones, slabs, and ceilings (e.g. "Zone (12.3m²)"), which are live display fallbacks Both now convert value + label to the active unit. Adds shared squareMetersToAreaUnit / getAreaUnitLabel / formatAreaLabel helpers to lib/measurements (with tests) and routes the site-panel Area readout through them, replacing an inline 10.7639 magic constant. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0.2.0 is API-compatible with our usage (parseQuantity, quantity, Kind); it adds i18n/locale entrypoints and does not change the symbols we import. Verified: @pascal-app/editor and @pascal-app/mcp typecheck, and all 31 measurement tests pass, including the AMBIGUOUS_NUMBER escalate guard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Follow-up to #472. Two small, targeted changes.
1. Unit-label consistency (fix)
#472 made every length input honor the metric/imperial preference. This closes the two remaining area surfaces that were still hardcoded to
m²:formatFloorArea) now converts value + label to the active unit.Zone (12.3m²)). These are live display fallbacks ({name || defaultName}, recomputed each render), so they now live-update on toggle —Zone (129.2ft²)in imperial.Adds shared
squareMetersToAreaUnit/getAreaUnitLabel/formatAreaLabelhelpers tolib/measurements(with tests), and routes the existing site-panel Area readout through them (replacing an inline10.7639…magic constant).Audited the full UI: all other length/area readouts (site-panel perimeter + vertices, floorplan 2D area + linear dimension labels) were already unit-aware.
2. Bump
@pascal-app/lingo0.1.0 → 0.2.0 (chore)API-compatible with our usage (
parseQuantity,quantity,Kind). 0.2.0 only adds i18n/locale entrypoints; no imported symbols changed.Verification
@pascal-app/editor+@pascal-app/mcptypecheck ✅AMBIGUOUS_NUMBER → errorescalate guard ✅🤖 Generated with Claude Code
Note
Low Risk
Display-only formatting and a minor dependency bump; no auth, persistence, or geometry logic changes.
Overview
Extends the metric/imperial preference to area surfaces that were still fixed to
m², building on length-input work from #472.New helpers in
lib/measurements—squareMetersToAreaUnit,getAreaUnitLabel, andformatAreaLabel(with tests) — centralize conversion and labeling. The load-build dialog’s floor-area stat, the site panel property-line area readout (replacing an inline conversion constant), and auto-generated default names for zones, slabs, and ceilings now readuseViewer’sunit, so values and labels update when the toggle changes.Also bumps
@pascal-app/lingofrom0.1.0to0.2.0inpackages/editor,packages/mcp, and the lockfile.Reviewed by Cursor Bugbot for commit 8476a99. Bugbot is set up for automated code reviews on this repo. Configure here.