Commit Graph
9 Commits
Author SHA1 Message Date
GandClaude Opus 5 c65ac4b7d7 chore: add a formatter (#71)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* style: format with prettier (252 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: teach git blame to skip the reformat

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 10:05:01 +00:00
g-butandClaude Sonnet 4.6 6a16dbc4c5 fix(i18n): replace hardcoded \$ with Intl.NumberFormat driven by APP_CURRENCY
formatPrice and formatAdoptionFee now use Intl.NumberFormat(locale, { style: "currency",
currency: APP_CURRENCY }) so the symbol and number formatting are locale-aware.
APP_CURRENCY reads from NEXT_PUBLIC_APP_CURRENCY env (default "USD"), making the
deployment currency a single config value rather than a hardcoded symbol.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 17:43:41 +02:00
g-butandClaude Sonnet 4.6 8b75d4c72b fix(i18n): make pet age display locale-aware across all 9 languages
formatPetAge and formatPetAgeShort now accept a t() function so callers
pass their locale context instead of receiving hardcoded English. Adds 7
translation keys to the public namespace (petAgeMonths, petAgeYears,
petAgeYearsMonths, petAgeShortMonths, etc.) with proper plural forms and
natural phrasing for DE/FR/ES/JA/ZH/KO/TR/AR. Also adds unnamedPet key
to eliminate the last hardcoded English fallback in the booking modal,
and routes OG image price/fee strings through formatPrice/formatAdoptionFee
instead of inline $ calculations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 17:29:06 +02:00
g-butandClaude Sonnet 4.6 124db06bb3 fix(i18n): make relative dates locale-aware via Intl.RelativeTimeFormat
Replaces the hardcoded English strings ("Today", "Tomorrow", "In 7 days")
in formatRelativeDate with Intl.RelativeTimeFormat, so German users see
"heute/morgen/gestern", French see "aujourd'hui/demain/hier", etc.
Updates all call sites (pets list, health log, vaccinations) to pass
locale. Also routes sitter per-day price through formatAdoptionFee to
eliminate a rogue inline $-calculation in the Find page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 17:03:29 +02:00
g-butandClaude Sonnet 4.6 6a9aa2c547 test(format): add missing coverage for formatPrice, formatAdoptionFee, formatIsoDate, formatIsoDateTime
All four functions were untested despite being called from production
routes and every page that displays product/adoption prices.

12 new assertions covering: zero/whole-dollar/cent amounts, null/0/"Free"
adoption fee edge cases, ISO date locale formatting, and datetime output
shape. Suite grows 534 → 546.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 14:19:25 +02:00
g-butandClaude Opus 4.7 9629911d90 fix(i18n): respect user locale in date formatting
SignalHistoryTimeline hardcoded 'en-US', so non-English users on
the pet profile saw English dates regardless of their locale.

- SignalHistoryTimeline: route through formatIsoDate (uses runtime
  locale) for consistency with the rest of the app
- formatDateShort: accept optional locale param so localized server
  components can pass the resolved locale; default unchanged
- Public pet profile (under /[locale]/): pass locale to formatDateShort
  so 'Born …' renders in the visitor's language
- Tests: cover both en and ja explicitly so a non-en CI runtime
  doesn't break them (the prior implicit dependency on en-locale
  CI is what made the suite fragile)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 17:21:09 +02:00
g-butandClaude Sonnet 4.6 0925d8be0b feat: editable health history + relative date tests
Health history table now shows a hover-revealed edit (pencil) icon per row.
Clicking it navigates to /health/log?date=YYYY-MM-DD, where the log page now
accepts a ?date= search param — letting owners correct past entries via the
same upsert API. When editing a past date with no prior entry, the date field
is pre-filled. Heading and description text update contextually.

Also adds 2 edge-case tests for formatRelativeDate (30 days past/future)
to confirm plural phrasing is stable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 10:11:29 +02:00
g-butandClaude Sonnet 4.6 322cd57b44 feat(ux) + test: show previous log context on health log form; add formatPetAge tests
Health log page now fetches the most recent prior log (parallel with today's
query) and shows physical metrics as a one-line context strip: "Last logged
yesterday: 25.0 kg · 38.5°C · 80 bpm". Only shown when physical metrics exist,
helping owners notice changes before they log.

Also adds 10 tests for formatPetAgeShort and formatPetAge (null, <1mo, N months,
whole years, years+months) using vi.setSystemTime for determinism.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 10:04:03 +02:00
g-butandClaude Sonnet 4.6 8aa95c300e test: add format utils tests + fix formatRelativeDate timezone bug
formatRelativeDate used local midnight for the target date but all other
date operations in the codebase use UTC. For users in non-UTC timezones,
"today" could show as "yesterday". Fixed by using UTC midnight on both
sides of the comparison.

Also adds 11 unit tests for formatDateShort, formatWeight,
formatTemperature, and formatRelativeDate; and 2 missing pet-signal
cases (no metrics + overdue vaccinations → concern; high anxiety →
out-of-range watch).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:18:56 +02:00