From 0d292ee14d0859a59d1e55f4f55f49d0582319b4 Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Fri, 25 Sep 2026 16:37:33 +0200 Subject: [PATCH] Add step name inside tab --- custom_components/cookcli/www/cookcli-recipe-strategy.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/custom_components/cookcli/www/cookcli-recipe-strategy.js b/custom_components/cookcli/www/cookcli-recipe-strategy.js index 9aa565b..4439272 100644 --- a/custom_components/cookcli/www/cookcli-recipe-strategy.js +++ b/custom_components/cookcli/www/cookcli-recipe-strategy.js @@ -403,6 +403,9 @@ class CookCliRecipeViewStrategy extends HTMLElement { static _stepTab(section, step, tabIndex, isLast, config) { const { markdown: stepMarkdown, timers } = this._renderStepMarkdown(step); + const stepLabel = section.name + ? `${section.name} ${step.number ?? ""}`.trim() + : `Étape ${tabIndex}`; const leftCards = []; const stepIngredients = (step.items || []).filter((item) => item.type === "ingredient"); @@ -448,7 +451,7 @@ class CookCliRecipeViewStrategy extends HTMLElement { const columns = this._responsiveColumns( { type: "vertical-stack", cards: leftCards }, - { type: "markdown", content: stepMarkdown } + { type: "markdown", content: `## ${stepLabel}\n\n${stepMarkdown}` } ); const cards = [columns]; @@ -481,7 +484,7 @@ class CookCliRecipeViewStrategy extends HTMLElement { } const tab = { - name: section.name ? `${section.name} ${step.number ?? ""}`.trim() : `Étape ${tabIndex}`, + name: stepLabel, card: { type: "vertical-stack", cards,