Add step name inside tab

This commit is contained in:
TheThomaas 2026-09-25 16:37:33 +02:00
parent bcfb62ccc4
commit 0d292ee14d

View file

@ -403,6 +403,9 @@ class CookCliRecipeViewStrategy extends HTMLElement {
static _stepTab(section, step, tabIndex, isLast, config) { static _stepTab(section, step, tabIndex, isLast, config) {
const { markdown: stepMarkdown, timers } = this._renderStepMarkdown(step); const { markdown: stepMarkdown, timers } = this._renderStepMarkdown(step);
const stepLabel = section.name
? `${section.name} ${step.number ?? ""}`.trim()
: `Étape ${tabIndex}`;
const leftCards = []; const leftCards = [];
const stepIngredients = (step.items || []).filter((item) => item.type === "ingredient"); const stepIngredients = (step.items || []).filter((item) => item.type === "ingredient");
@ -448,7 +451,7 @@ class CookCliRecipeViewStrategy extends HTMLElement {
const columns = this._responsiveColumns( const columns = this._responsiveColumns(
{ type: "vertical-stack", cards: leftCards }, { type: "vertical-stack", cards: leftCards },
{ type: "markdown", content: stepMarkdown } { type: "markdown", content: `## ${stepLabel}\n\n${stepMarkdown}` }
); );
const cards = [columns]; const cards = [columns];
@ -481,7 +484,7 @@ class CookCliRecipeViewStrategy extends HTMLElement {
} }
const tab = { const tab = {
name: section.name ? `${section.name} ${step.number ?? ""}`.trim() : `Étape ${tabIndex}`, name: stepLabel,
card: { card: {
type: "vertical-stack", type: "vertical-stack",
cards, cards,