From 9524e4df541febce17c6a1882778254db71bf9b1 Mon Sep 17 00:00:00 2001 From: Piotr Oleszczyk Date: Sun, 1 Mar 2026 01:04:28 +0100 Subject: [PATCH] fix(frontend): fix routine step numbering and product name display Steps were numbered from 2 due to off-by-one (order_index + 1). Product steps showed "Unknown step" because the template checked step.product (never returned by API) instead of looking up by step.product_id in the already-loaded products list. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/routes/routines/[id]/+page.svelte | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/routes/routines/[id]/+page.svelte b/frontend/src/routes/routines/[id]/+page.svelte index 155fecc..7ddb326 100644 --- a/frontend/src/routes/routines/[id]/+page.svelte +++ b/frontend/src/routes/routines/[id]/+page.svelte @@ -93,11 +93,12 @@ {#each routine.steps.toSorted((a, b) => a.order_index - b.order_index) as step (step.id)}
- {step.order_index + 1} + {step.order_index}
- {#if step.product} -

{step.product.name}

-

{step.product.brand}

+ {#if step.product_id} + {@const product = products.find((p) => p.id === step.product_id)} +

{product?.name ?? step.product_id}

+ {#if product?.brand}

{product.brand}

{/if} {:else if step.action_type}

{step.action_type.replace(/_/g, ' ')}

{:else}