Skip to content

feat(health): imperial/metric units setting - #42

Merged
ralyodio merged 1 commit into
masterfrom
feat/health-units
Nov 8, 2026
Merged

ralyodio merged 1 commit into
masterfrom
feat/health-units

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Adds a measurement-units preference to accounts and uses it in the /health tracker.

  • users.units (migration 0012): imperial | metric | null (= automatic)
  • Automatic follows the browser locale: imperial for US (en-US, es-US, bare en), Liberia, Myanmar; metric otherwise
  • GET /api/v1/me returns user.units; PATCH /api/v1/me accepts units and now only updates fields that are sent (saving units no longer blanks the name)
  • Tracker: units picker next to Lock; weight/temperature readings store their unit; older readings (no unit, entered as kg/°C) are converted for display
  • /app/account: Units card
  • Glucose stays mg/dL; BP/HR/SpO2 unaffected

Tests: 152 pass on a fresh Postgres 16.

🤖 Generated with Claude Code

Accounts get a units preference (imperial, metric, or automatic). Automatic
follows the browser locale: imperial for the US, Liberia and Myanmar, metric
everywhere else. The tracker saves each weight/temperature reading with its
unit and converts saved readings for display, so old kg/°C entries show in
lb/°F for imperial users. Picker on the tracker and on /app/account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 10b7dd4 into master Nov 8, 2026
3 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.

1 participant