feat(insights): PR badge on metric trend tiles when achieved in last 30 days

Adds a small text-only PR pill that consumers can compose next to
a metric label. The badge pulls /api/personal-records?metricType=
and renders only when the most recent record landed in the last
30 days — older PRs are still visible on the dedicated /insights
PR list but the dashboard surface keeps a fresh-only filter so the
pill is a noticeable signal rather than a permanent fixture.

i18n keys insights.personalRecord.badge and insights.personalRecord.tooltip
ship in all six locales. The badge component is locale-aware
through the standard useTranslations / useFormatters hooks and
exposes a withTooltip prop so standalone uses (doctor report,
correlation cards) can skip the Tooltip provider.
This commit is contained in:
Marc-André Bombeck committed 2026-05-14 18:59:14 +02:00
1 parent 87853eb2ac
commit e51a4f53bb
8 files changed
+283 -8

No files matched your search

+4
View File
@@ -879,6 +879,10 @@
"heroFindingWarning": "Wichtigster Alarm",
"correlationsTitle": "Zusammenhänge",
"recommendationsTitle": "Empfehlungen",
"personalRecord": {
"badge": "PR",
"tooltip": "Persönlicher Rekord: {value} {unit} am {date}"
},
"recommendation": {
"source": "Quelle",
"viewSource": "Leitlinie in neuem Tab öffnen",