From 14b221a627e6054ab5f700e493036a39d8488fd1 Mon Sep 17 00:00:00 2001 From: Lucas Winther Date: Thu, 27 Aug 2026 15:43:33 +0200 Subject: [PATCH] Give the cadence line the gap its siblings have MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every other paragraph in that stack carries an mt-*; this one did not, so "every 2 weeks" sat flush against the bottom of the window table with no gap. Static-markup tests assert on content, not spacing, so nothing caught it — the Task 10 review did, by reading the surrounding rhythm. Reading cadenceLabel once into a local rather than calling it at both the guard and the render also drops the non-null assertion the second call needed. Co-Authored-By: Claude Opus 5 (1M context) --- src/client/components/EventDetail.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/components/EventDetail.tsx b/src/client/components/EventDetail.tsx index 3886aa5..3c53703 100644 --- a/src/client/components/EventDetail.tsx +++ b/src/client/components/EventDetail.tsx @@ -86,6 +86,9 @@ export function EventDetail({ const game = gameMeta(event.game); const heat = URGENCY_COLOR[clock.urgency]; const risk = status === "done" ? "fine" : pressure(effort, clock.msRemaining); + // Read once rather than at both the guard and the render: calling it twice + // was what forced the non-null assertion below it. + const cadence = cadenceLabel(own?.record.repeat ?? null); useEffect(() => { const onKey = (e: KeyboardEvent) => { @@ -160,8 +163,8 @@ export function EventDetail({ {event.type} - {cadenceLabel(own?.record.repeat ?? null) !== null && ( -

{cadenceLabel(own!.record.repeat)}

+ {cadence !== null && ( +

{cadence}

)} {risk !== "fine" && effort !== undefined && clock.msRemaining !== null && (