From 5403a06348ac386c54934521c6b6b9cd12e5224b Mon Sep 17 00:00:00 2001 From: Arnaud Date: Sun, 19 Jul 2026 18:29:18 +0200 Subject: [PATCH] fix: stray "0" shown for steps with no timer (v0.52.1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `{step.timerSeconds && (...)}` renders the literal 0 when timerSeconds is the number 0 rather than null/undefined — only false/null/undefined skip rendering in JSX, a bare falsy number doesn't. Some steps ended up with timerSeconds stored as 0 instead of null (e.g. AI generation filling in a "default" value for an optional field rather than omitting it), which this guard then rendered as a bare "0" instead of hiding the timer. Fixed at all 4 render sites (recipe page, cook mode, both print views) by coercing to a real boolean (`!!step.timerSeconds`) — makes a stored 0 behave identically to null everywhere it's displayed. Co-Authored-By: Claude Sonnet 5 --- CHANGELOG.md | 5 +++++ apps/web/app/(app)/recipes/[id]/page.tsx | 2 +- apps/web/app/print/[id]/page.tsx | 2 +- apps/web/app/print/collection/[id]/page.tsx | 2 +- apps/web/components/cooking-mode/cooking-mode.tsx | 2 +- apps/web/lib/changelog.ts | 9 ++++++++- apps/web/package.json | 2 +- package.json | 2 +- 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f877ab..474a8f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to Epicure are documented here. This file is mirrored in-app at `/changelog` (and in the admin dashboard) via `apps/web/lib/changelog.ts` — update both together. +## 0.52.1 — 2026-07-19 14:10 + +### Fixed +- Steps with no timer sometimes showed a stray "0" on the recipe page, cook mode, and print views — a step whose timer happened to be stored as 0 (rather than empty) hit a JS truthiness quirk where `0 && ...` renders the literal 0 instead of nothing. + ## 0.52.0 — 2026-07-19 13:55 ### Added diff --git a/apps/web/app/(app)/recipes/[id]/page.tsx b/apps/web/app/(app)/recipes/[id]/page.tsx index 53af3ae..bdc8479 100644 --- a/apps/web/app/(app)/recipes/[id]/page.tsx +++ b/apps/web/app/(app)/recipes/[id]/page.tsx @@ -427,7 +427,7 @@ export default async function RecipePage({ params }: Params) {

{step.instruction}

- {step.timerSeconds && ( + {!!step.timerSeconds && (

{step.timerSeconds >= 60 diff --git a/apps/web/app/print/[id]/page.tsx b/apps/web/app/print/[id]/page.tsx index dfc19cc..96fa36d 100644 --- a/apps/web/app/print/[id]/page.tsx +++ b/apps/web/app/print/[id]/page.tsx @@ -171,7 +171,7 @@ export default async function RecipePrintPage({ params }: Params) { {recipe.steps.map((step) => (

  • {step.instruction} - {step.timerSeconds && ( + {!!step.timerSeconds && ( ⏱ {Math.floor(step.timerSeconds / 60)} min )}
  • diff --git a/apps/web/app/print/collection/[id]/page.tsx b/apps/web/app/print/collection/[id]/page.tsx index 1bea56b..db24d7d 100644 --- a/apps/web/app/print/collection/[id]/page.tsx +++ b/apps/web/app/print/collection/[id]/page.tsx @@ -131,7 +131,7 @@ export default async function CollectionPrintPage({ params }: Params) { {recipe.steps.map((step) => (
  • {step.instruction} - {step.timerSeconds && ( + {!!step.timerSeconds && ( ⏱ {Math.floor(step.timerSeconds / 60)} min )}
  • diff --git a/apps/web/components/cooking-mode/cooking-mode.tsx b/apps/web/components/cooking-mode/cooking-mode.tsx index 47988f3..66c065c 100644 --- a/apps/web/components/cooking-mode/cooking-mode.tsx +++ b/apps/web/components/cooking-mode/cooking-mode.tsx @@ -300,7 +300,7 @@ export function CookingMode({

    {/* Timer for current step */} - {step.timerSeconds && ( + {!!step.timerSeconds && (