Skip to content

Add Unit Converter tool - #10

Merged
02karthik merged 1 commit into
mainfrom
claude/stoic-pascal-dqfbq8
Aug 1, 2026
Merged

Add Unit Converter tool#10
02karthik merged 1 commit into
mainfrom
claude/stoic-pascal-dqfbq8

Conversation

@02karthik

Copy link
Copy Markdown
Collaborator

What is this tool?

Unit Converter — a single-file, fully offline converter for the everyday quantities people actually reach for: length, weight, temperature, volume, area, speed, time, and digital storage. Pick a category, type in either field, and the other side updates live. It's for anyone in a note or draft who needs "how many km is 5 miles?" without leaving the workspace or opening a browser tab.

Highlights:

  • Two-way, live conversion — edit the From or the To value and the other recomputes instantly; a swap control flips the units.
  • Equation echo + quick reference — a one-line "1 mile = 1.609344 km" readout, plus a list showing the value expressed in every unit of the category.
  • Correct by construction — linear categories use base-unit factors; temperature uses explicit °C/°F/K offset formulas. Results are trimmed to sensible significant figures.
  • Remembers your last category and units in localStorage under unit-converter:v1.
  • On-brand — azure primary #4d63ff, cool-mist canvas, Manrope 900 display, 24px card radius, per the Hillnote design system.

Checklist

  • It's a single file: unit-converter/index.html with all CSS + JS inline.
  • It is fully self-contained / offline — no remote fonts, scripts, styles, images, fetch, or import. All math is done in-browser.
  • No analytics, trackers, or phone-home behavior.
  • Added a screenshot at screenshots/unit-converter.webp (via npm run screenshot unit-converter).
  • Registered the tool in tools.json (dir = unit-converter, matches the folder).
  • Bumped the top-level catalogVersion (20 → 21).
  • New tool → version: 1.
  • npm run validate passes locally (✓ catalog valid — 27 tool(s), catalogVersion 21).

Notes for reviewers

  • Temperature is the only non-linear category; it's converted via to-Celsius / from-Celsius helpers rather than a single factor.
  • Number formatting uses toPrecision(8) (stripping trailing zeros) and falls back to exponential notation for very small/large magnitudes, so results stay readable across, e.g., milligrams and tonnes.
  • All output inserted into the equation echo is HTML-escaped; the quick-reference list is built with textContent.
  • This branch was already sitting on the pending Metronome commit (not yet in main), so the branch-level diff includes it too. My commit Add Unit Converter tool is self-contained to the new tool — the Metronome change drops out of this diff once its own PR lands in main.

Generated by Claude Code

A single-file, fully offline unit converter covering the everyday
categories people actually convert: length, weight, temperature,
volume, area, speed, time, and digital storage.

- Live two-way conversion (edit either field), a swap control, an
  equation echo, and a quick-reference list of the value in every unit.
- Pure in-browser arithmetic (no network, no libraries); temperature
  handled with explicit offset formulas. Last category/units persist in
  localStorage under `unit-converter:v1`.
- Styled to the Hillnote design system: azure primary, cool-mist canvas,
  Manrope 900 display, 24px card radius.
- Registered in tools.json (version 1) and catalogVersion bumped to 21;
  screenshots/unit-converter.webp added. `npm run validate` passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112G97ct4QHnyU8Ldb7zEjr
@02karthik
02karthik merged commit 8dd3032 into main Aug 1, 2026
1 check 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