feat: convert inputs when switching units

This commit is contained in:
w33ble
2026-01-11 19:47:03 -07:00
parent 7c512f5adb
commit 56c6ac47eb
4 changed files with 52 additions and 3 deletions

View File

@@ -7,6 +7,8 @@
## Recent Changes
- Created `memory-bank/projectBrief.md`.
- Created `memory-bank/productContext.md`.
- Implemented unit conversion on toggle in `src/main.ts`.
- Extracted `convertUnits` utility and added tests.
## Current Focus
- Completing Memory Bank initialization.
@@ -18,3 +20,4 @@
- Using **Vanilla TypeScript** to avoid framework overhead.
- Using **Vitest** for unit testing calculation logic.
- Target: A single-page application that can be built into a self-contained output.
- **Unit Toggle Behavior**: Switching units now automatically converts existing input values using a factor of 25.4. MM values are rounded to 1 decimal, Inches to 2 decimals.