Bring the day surfaces into one language

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.
This commit is contained in:
Marc-André Bombeck committed 2026-10-08 19:14:22 +02:00
1 parent e9a5614733
commit 28458448c2
12 files changed
+80 -38

No files matched your search

+4 -3
View File
@@ -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",
+4 -3
View File
@@ -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",
+4 -3
View File
@@ -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",
+4 -3
View File
@@ -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",
+4 -3
View File
@@ -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",
+4 -3
View File
@@ -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": "타임라인",
+4 -3
View File
@@ -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",
+31 -4
View File
@@ -161,6 +161,31 @@ const RUNNING_COLOR: Record<DayRunningKind, string> = {
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[] }) {
/>
<span className="min-w-0 flex-1">
<span className="block truncate text-sm font-medium">
{item.title}
{dayTitle(item.title, t)}
</span>
<span className="text-muted-foreground block truncate text-xs">
{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)}
</Link>
) : (
<p className="text-sm leading-5 font-medium">{event.title}</p>
<p className="text-sm leading-5 font-medium">
{dayTitle(event.title, t)}
</p>
)}
{event.meta ? (
<p className="text-muted-foreground mt-0.5 text-xs">
{event.meta}
{dayMeta(event.kind, event.meta, t)}
</p>
) : null}
{event.note ? (
+1 -1
View File
@@ -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
@@ -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 (
<div
data-slot="intraday-pulse-chart"
// `.metric-accent` — the tension layer's identity edge on the CARD
// shell only (`--tile-stress`, the wellness vocabulary's autonomic
// hue, per the plan's §3.6 hue-family call); the chart inside stays
// untouched. The same hue marks the `tension_window` rail card, so
// the two S11 surfaces read as one family.
className="bg-card metric-accent space-y-1.5 rounded-xl border p-4 md:p-6"
style={{ "--tile-hue": "var(--tile-stress)" } as React.CSSProperties}
// A plain card, like every other chart card and the day view it
// opens into. The coloured identity edge it used to carry read as a
// warning stripe beside a workout.
className="bg-card space-y-1.5 rounded-xl border p-4 md:p-6"
>
<TileHeader
icon={Activity}
@@ -258,7 +258,10 @@ export function IntradayPulseChart({
onRetry={() => 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.
<div className="text-muted-foreground flex h-44 items-center justify-center rounded-lg border border-dashed text-sm">
{t("insights.intradayPulse.empty")}
</div>
+3 -1
View File
@@ -137,7 +137,9 @@ export function WorkoutList({
/>
) : null}
</span>
<span className="text-muted-foreground truncate text-xs">
{/* Wraps rather than truncates, so the day it opens
stays readable beside the stats column. */}
<span className="text-muted-foreground text-xs">
<DayLinkAt at={workout.startedAt} className="z-10">
{formatDate(workout.startedAt, locale, timeFormat)}
</DayLinkAt>
@@ -1435,7 +1435,7 @@ export function MeasurementList({
className="bg-card border-border data-[state=selected]:border-primary/60 data-[state=selected]:bg-primary/5"
>
<div className="flex items-center justify-between">
<div className="flex items-center gap-2 overflow-hidden">
<div className="flex min-w-0 flex-1 items-center gap-2">
{/* 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({
<Icon className="h-4 w-4" />
</button>
)}
<div className="min-w-0">
<div className="min-w-0 flex-1">
{/* 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({
</span>
)
)}
<p className="text-muted-foreground truncate text-xs">
{/* The meta line wraps rather than truncates:
cut to "vor 9 Stunden…" it hid the day it
opens and the source beside it. */}
<p className="text-muted-foreground text-xs">
{/*
v1.4.43 QoL (L8) — see desktop
counterpart at the same `measuredAt`