Skip to content

fix(editor): area readouts + generated names follow the unit toggle; bump lingo to 0.2.0#477

Merged
Aymericr merged 2 commits into
mainfrom
fix/unit-labels-lingo-0.2
Jul 8, 2026
Merged

fix(editor): area readouts + generated names follow the unit toggle; bump lingo to 0.2.0#477
Aymericr merged 2 commits into
mainfrom
fix/unit-labels-lingo-0.2

Conversation

@Aymericr

@Aymericr Aymericr commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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 :

  • Load-build import dialog — the "Floor area" stat (formatFloorArea) now converts value + label to the active unit.
  • Auto-generated default names for zones, slabs, and ceilings (e.g. 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 / formatAreaLabel helpers to lib/measurements (with tests), and routes the existing site-panel Area readout through them (replacing an inline 10.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/lingo 0.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/mcp typecheck ✅
  • All 31 measurement tests pass, including the AMBIGUOUS_NUMBER → error escalate 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 , building on length-input work from #472.

New helpers in lib/measurementssquareMetersToAreaUnit, getAreaUnitLabel, and formatAreaLabel (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 read useViewer’s unit, so values and labels update when the toggle changes.

Also bumps @pascal-app/lingo from 0.1.0 to 0.2.0 in packages/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.

Aymericr and others added 2 commits July 8, 2026 22:34
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>
@Aymericr Aymericr merged commit a477c4a into main Jul 8, 2026
3 checks passed
@Aymericr Aymericr deleted the fix/unit-labels-lingo-0.2 branch July 8, 2026 20:51
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