From 28458448c2691adc3f88385a61ed59499ab8c544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 8 Oct 2026 19:14:22 +0200 Subject: [PATCH] Bring the day surfaces into one language MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cycle and travel rows of a day read their server sentinels ('cycle', 'travel', a raw flow level) instead of words, so a day said 'cycle · Tag 8'. They are worded in the reader's language now. The date in the phone measurement row and the workout row wrapped to 'vor 9 Stunden…' because the text column shrank to its value; it takes the row's width and wraps instead of truncating. The intraday pulse card drops its coloured identity edge, takes a title that says what it shows, and says there is not enough for a course instead of drawing one dot across 24 hours. The day body's top inset moves from the banned pt-5 to pt-4. --- messages/de.json | 7 ++-- messages/en.json | 7 ++-- messages/es.json | 7 ++-- messages/fr.json | 7 ++-- messages/it.json | 7 ++-- messages/ko.json | 7 ++-- messages/pl.json | 7 ++-- src/components/day/day-sections.tsx | 35 ++++++++++++++++--- src/components/day/day-view.tsx | 2 +- .../insights/intraday-pulse-chart.tsx | 19 +++++----- src/components/insights/workout-list.tsx | 4 ++- .../measurements/measurement-list.tsx | 9 +++-- 12 files changed, 80 insertions(+), 38 deletions(-) diff --git a/messages/de.json b/messages/de.json index 4677ce5c4..3b6b8a461 100644 --- a/messages/de.json +++ b/messages/de.json @@ -4726,8 +4726,8 @@ "emptyCta": "Gerät verbinden" }, "intradayPulse": { - "title": "Der Verlauf deines Tages", - "caption": "Dein Puls über den Tag, gemittelt in 10-Minuten-Schritten.", + "title": "Puls über den Tag", + "caption": "Gemittelt in 10-Minuten-Schritten.", "hourlyNote": "Stündlicher Durchschnitt für diesen Tag — aktuelle Tage zeigen das volle 10-Minuten-Detail.", "empty": "Für diesen Tag noch nicht genug Pulswerte, um den Tagesverlauf zu zeigen.", "coverageOne": "Basierend auf 1 Messung über {hours}h.", @@ -12265,7 +12265,8 @@ "fewer": "Weniger anzeigen", "note": "Zusammengestellt aus deinen Einträgen, ohne Bewertung. Jedes Datum öffnet den ganzen Tag.", "report": "Arztbericht {date} bis heute" - } + }, + "travel": "Unterwegs" }, "timeline": { "title": "Zeitleiste", diff --git a/messages/en.json b/messages/en.json index 491e58a87..7d80357c5 100644 --- a/messages/en.json +++ b/messages/en.json @@ -4726,8 +4726,8 @@ "emptyCta": "Connect a device" }, "intradayPulse": { - "title": "Your day's shape", - "caption": "Your heart rate through the day, averaged in 10-minute steps.", + "title": "Pulse through the day", + "caption": "Averaged in 10-minute steps.", "hourlyNote": "Showing this day's hourly average — recent days show the full 10-minute detail.", "empty": "Not enough heart-rate readings for this day to show its shape yet.", "coverageOne": "Based on 1 reading across {hours}h.", @@ -12265,7 +12265,8 @@ "fewer": "Show fewer", "note": "Compiled from your entries, without judgement. Every date opens the whole day.", "report": "Doctor report from {date} to today" - } + }, + "travel": "Away" }, "timeline": { "title": "Timeline", diff --git a/messages/es.json b/messages/es.json index c248b9bca..95ebf5cc3 100644 --- a/messages/es.json +++ b/messages/es.json @@ -4726,8 +4726,8 @@ "emptyCta": "Conectar un dispositivo" }, "intradayPulse": { - "title": "La forma de tu día", - "caption": "Tu frecuencia cardíaca a lo largo del día, promediada en tramos de 10 minutos.", + "title": "Pulso a lo largo del día", + "caption": "Promediado en intervalos de 10 minutos.", "hourlyNote": "Mostrando el promedio por hora de este día — los días recientes muestran el detalle completo de 10 minutos.", "empty": "Aún no hay suficientes lecturas para este día para mostrar su forma.", "coverageOne": "Basado en 1 lectura a lo largo de {hours}h.", @@ -12265,7 +12265,8 @@ "fewer": "Mostrar menos", "note": "Reunido a partir de tus entradas, sin valoración. Cada fecha abre el día completo.", "report": "Informe médico del {date} hasta hoy" - } + }, + "travel": "De viaje" }, "timeline": { "title": "Cronología", diff --git a/messages/fr.json b/messages/fr.json index 8e3250f06..9f6a7f002 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -4726,8 +4726,8 @@ "emptyCta": "Connecter un appareil" }, "intradayPulse": { - "title": "Le rythme de votre journée", - "caption": "Votre fréquence cardiaque au fil de la journée, moyennée par tranches de 10 minutes.", + "title": "Pouls au fil de la journée", + "caption": "Moyenné par tranches de 10 minutes.", "hourlyNote": "Moyenne horaire affichée pour cette journée — les jours récents affichent le détail complet par tranches de 10 minutes.", "empty": "Pas encore assez de mesures pour cette journée pour en afficher le rythme.", "coverageOne": "Basé sur 1 mesure sur {hours}h.", @@ -12265,7 +12265,8 @@ "fewer": "Afficher moins", "note": "Établi à partir de vos entrées, sans évaluation. Chaque date ouvre la journée entière.", "report": "Rapport médical du {date} à aujourd’hui" - } + }, + "travel": "En déplacement" }, "timeline": { "title": "Chronologie", diff --git a/messages/it.json b/messages/it.json index f2a5173f1..bb050da28 100644 --- a/messages/it.json +++ b/messages/it.json @@ -4726,8 +4726,8 @@ "emptyCta": "Collega un dispositivo" }, "intradayPulse": { - "title": "L'andamento della tua giornata", - "caption": "La tua frequenza cardiaca durante il giorno, mediata in intervalli di 10 minuti.", + "title": "Battito nel corso della giornata", + "caption": "Media su intervalli di 10 minuti.", "hourlyNote": "Media oraria per questo giorno — i giorni recenti mostrano il dettaglio completo a 10 minuti.", "empty": "Non ci sono ancora abbastanza misurazioni per questo giorno per mostrarne l'andamento.", "coverageOne": "Basato su 1 misurazione in {hours}h.", @@ -12265,7 +12265,8 @@ "fewer": "Mostra meno", "note": "Raccolto dalle tue voci, senza valutazioni. Ogni data apre l’intera giornata.", "report": "Referto medico dal {date} a oggi" - } + }, + "travel": "In viaggio" }, "timeline": { "title": "Cronologia", diff --git a/messages/ko.json b/messages/ko.json index a4d2e79ab..12d9c8af9 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -4726,8 +4726,8 @@ "emptyCta": "기기 연결" }, "intradayPulse": { - "title": "하루의 흐름", - "caption": "10분 단위로 평균 낸 하루 동안의 심박수예요.", + "title": "하루 동안의 맥박", + "caption": "10분 단위로 평균했어요.", "hourlyNote": "이 날짜는 시간별 평균으로 보여줘요 — 최근 며칠은 10분 단위까지 자세히 볼 수 있어요.", "empty": "이 날짜는 심박수 측정값이 적어서 아직 흐름을 보여줄 수 없어요.", "coverageOne": "{hours}h 동안 모은 측정값 1개를 기준으로 했어요.", @@ -12265,7 +12265,8 @@ "fewer": "줄여 보기", "note": "평가 없이 기록에서 모았어요. 날짜를 누르면 그날 전체가 열려요.", "report": "{date}부터 오늘까지 진료 보고서" - } + }, + "travel": "여행 중" }, "timeline": { "title": "타임라인", diff --git a/messages/pl.json b/messages/pl.json index b55cc6159..554000b27 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -4726,8 +4726,8 @@ "emptyCta": "Połącz urządzenie" }, "intradayPulse": { - "title": "Przebieg Twojego dnia", - "caption": "Twoje tętno w ciągu dnia, uśrednione w 10-minutowych odcinkach.", + "title": "Tętno w ciągu dnia", + "caption": "Uśrednione w krokach co 10 minut.", "hourlyNote": "Pokazano średnią godzinową dla tego dnia — ostatnie dni pokazują pełny, 10-minutowy szczegół.", "empty": "Za mało pomiarów z tego dnia, aby pokazać jego przebieg.", "coverageOne": "Na podstawie 1 pomiaru w ciągu {hours}h.", @@ -12265,7 +12265,8 @@ "fewer": "Pokaż mniej", "note": "Zestawione z Twoich wpisów, bez oceny. Każda data otwiera cały dzień.", "report": "Raport lekarski od {date} do dziś" - } + }, + "travel": "W podróży" }, "timeline": { "title": "Oś czasu", diff --git a/src/components/day/day-sections.tsx b/src/components/day/day-sections.tsx index 767ab2414..6de9b09b9 100644 --- a/src/components/day/day-sections.tsx +++ b/src/components/day/day-sections.tsx @@ -161,6 +161,31 @@ const RUNNING_COLOR: Record = { lifeEvent: "var(--chart-2)", }; +/** + * The server names a few records by a sentinel rather than by text it would + * have to translate: a cycle is titled "cycle", a trip "travel", a cycle + * day carries its flow level. They are worded here, in the reader's + * language; every other title is the record's own text. + */ +function dayTitle(title: string, t: (key: string) => string): string { + if (title === "cycle") return t("nav.cycle"); + if (title === "travel") return t("day.travel"); + return title; +} + +const FLOW_LEVELS = new Set(["NONE", "SPOTTING", "LIGHT", "MEDIUM", "HEAVY"]); + +function dayMeta( + kind: string, + meta: string, + t: (key: string) => string, +): string { + if (kind === "cycleDayLog" && FLOW_LEVELS.has(meta)) { + return `${t("cycle.flow.label")}: ${t(`cycle.flow.${meta}`)}`; + } + return meta; +} + export function DayRunning({ items }: { items: readonly DayRunningItem[] }) { const { t } = useTranslations(); const fmt = useFormatters(); @@ -192,7 +217,7 @@ export function DayRunning({ items }: { items: readonly DayRunningItem[] }) { /> - {item.title} + {dayTitle(item.title, t)} {parts.join(" · ")} @@ -431,14 +456,16 @@ export function DayEvents({ events }: { events: readonly DayEvent[] }) { data-slot="day-event-link" className="focus-visible:ring-ring/50 block text-sm leading-5 font-medium after:absolute after:inset-0 after:rounded-md after:content-[''] focus-visible:outline-none focus-visible:after:ring-[3px] focus-visible:after:ring-inherit" > - {event.title} + {dayTitle(event.title, t)} ) : ( -

{event.title}

+

+ {dayTitle(event.title, t)} +

)} {event.meta ? (

- {event.meta} + {dayMeta(event.kind, event.meta, t)}

) : null} {event.note ? ( diff --git a/src/components/day/day-view.tsx b/src/components/day/day-view.tsx index 55e317a23..14ee0b7ac 100644 --- a/src/components/day/day-view.tsx +++ b/src/components/day/day-view.tsx @@ -276,7 +276,7 @@ export function DayView({ data-slot="day-body" className={cn( "flex min-h-0 flex-1 flex-col overflow-x-clip overflow-y-auto overscroll-contain", - compact ? "gap-6 px-4 pt-0.5 pb-4" : "gap-6 px-6 pt-5 pb-6", + compact ? "gap-6 px-4 pt-0.5 pb-4" : "gap-6 px-6 pt-4 pb-6", )} > {/* What the day holds, as meta under the header. The line keeps its diff --git a/src/components/insights/intraday-pulse-chart.tsx b/src/components/insights/intraday-pulse-chart.tsx index 42b7c0523..18726cc1f 100644 --- a/src/components/insights/intraday-pulse-chart.tsx +++ b/src/components/insights/intraday-pulse-chart.tsx @@ -86,6 +86,9 @@ const AXIS_TICKS = [0, 360, 720, 1080, 1440]; * navigator still works from there, so "the day before" stays one tap away. * Absent, the view opens on today and keeps tracking it. */ +/** Fewest present buckets that make a course worth drawing across 24 h. */ +const MIN_BUCKETS_FOR_COURSE = 3; + export function IntradayPulseChart({ userTimezone, initialDateKey, @@ -194,13 +197,10 @@ export function IntradayPulseChart({ return (
refetch()} className="border-0 bg-transparent shadow-none" /> - ) : chartData.length === 0 ? ( + ) : (data?.series?.length ?? 0) < MIN_BUCKETS_FOR_COURSE ? ( + // A lone reading or two on a 24-hour axis drew a dot in an empty + // field and called it the course of the day. Below a handful of + // buckets the card says there is not enough for a course.
{t("insights.intradayPulse.empty")}
diff --git a/src/components/insights/workout-list.tsx b/src/components/insights/workout-list.tsx index 4d0523d45..913a19846 100644 --- a/src/components/insights/workout-list.tsx +++ b/src/components/insights/workout-list.tsx @@ -137,7 +137,9 @@ export function WorkoutList({ /> ) : null} - + {/* Wraps rather than truncates, so the day it opens + stays readable beside the stats column. */} + {formatDate(workout.startedAt, locale, timeFormat)} diff --git a/src/components/measurements/measurement-list.tsx b/src/components/measurements/measurement-list.tsx index 72f48cc4e..286f0bbb0 100644 --- a/src/components/measurements/measurement-list.tsx +++ b/src/components/measurements/measurement-list.tsx @@ -1435,7 +1435,7 @@ export function MeasurementList({ className="bg-card border-border data-[state=selected]:border-primary/60 data-[state=selected]:bg-primary/5" >
-
+
{/* v1.15.13 — multi-select checkbox in a 44px tap target; absent for synthetic grouped rows. */} {!isGrouped && canManage && ( @@ -1472,7 +1472,7 @@ export function MeasurementList({ )} -
+
{/* v1.22 — metadata badges sit on the scale token `text-xs` (12 px, the mobile legibility baseline) instead of an arbitrary per-site @@ -1520,7 +1520,10 @@ export function MeasurementList({ ) )} -

+ {/* The meta line wraps rather than truncates: + cut to "vor 9 Stunden…" it hid the day it + opens and the source beside it. */} +

{/* v1.4.43 QoL (L8) — see desktop counterpart at the same `measuredAt`