Skip to content

Add a Metric / US units switch to the header - #8

Merged
ehcrea merged 1 commit into
mainfrom
claude/project-thread-muaq8j
Oct 28, 2026
Merged

ehcrea merged 1 commit into
mainfrom
claude/project-thread-muaq8j

Conversation

@ehcrea

@ehcrea ehcrea commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Requested by Eren · project thread

Summary

  • New Metric | US segmented switch in the header (shows SI | US on phones). The choice is remembered in the browser (pec:v1:units).
  • In US mode every input, result, chart axis, sketch label/caption, PDF report and the material table switch to US customary units, and current values are converted on the spot:
    mm→in, µm/nm→µin, mm²/³/⁴→in²/³/⁴, N→lbf, N/mm & N/µm→lbf/in, Nmm→lbf·in, Nm/rad→lbf·in/rad, Nm²→lbf·in², MPa→ksi, GPa→Msi, kg→lb, kg/m³→lb/in³, mm/s, m/s², m/s³→in/s, in/s², in/s³, K (ΔT)→°F, µm/m·K→µin/in·°F. Angles, time, frequency, g₀ and ratios stay as they are.
  • Values are still stored in metric, so saved calculations, JSON files and share links open correctly in either system; typing in US mode converts the entry back to metric.
  • Unit mapping lives in US_UNITS in js/core.js; PEC.run now returns result rows in the current system (value stays SI).
  • Translations for the new switch in DE/NL/TR.

Tests

  • npm test: 805 passed. New checks for conversion factors, results in US mode, and that every sketch in US mode shows no metric units.
  • Checked in headless Chromium: switching back and forth, typing in inches, German + US, material table, motion profile charts, PDF export in US units, phone header layout.

Generated by Claude Code

Every input, result, chart, sketch label, PDF and the material table can be
shown in US customary units. Values are still stored in metric units, so saved
calculations, JSON files and share links work in either system.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtSyM8KHTubyFFryCcs7s4
@ehcrea ehcrea self-assigned this Oct 28, 2026
@ehcrea
ehcrea merged commit d31bad8 into main Oct 28, 2026
2 checks passed
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.

2 participants