From 2b11586efea2cbdcd25410b8f77327f4f8147702 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 19 Jul 2026 15:36:34 +0000 Subject: [PATCH 1/3] feat: show step counts on workshop entry path and scenario cards - Precompute step counts per entry path (using default scenario) at build time and show them in the route badge on entry path cards - Precompute step counts for all journey+scenario combinations at build time and embed in the manifest JSON - Add a `data-workshop-step-count` route badge to scenario cards - In the client-side render() loop, populate scenario card step counts dynamically based on the currently selected journey, so users see the exact step count for each scenario before they select it Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../workshop/WorkshopExperience.astro | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/src/components/workshop/WorkshopExperience.astro b/docs/src/components/workshop/WorkshopExperience.astro index dda8248b150..d0701822fe4 100644 --- a/docs/src/components/workshop/WorkshopExperience.astro +++ b/docs/src/components/workshop/WorkshopExperience.astro @@ -362,6 +362,27 @@ const workshopSteps: WorkshopStep[] = await Promise.all(workshopEntries.map(asyn const initialFlow = buildWorkshopFlow(workshopDefaults.journeyId, workshopDefaults.scenarioId); const initialStepKey = initialFlow[0] ?? workshopSteps[0]?.key ?? ''; const initialStep = workshopSteps.find((item) => item.key === initialStepKey) ?? workshopSteps[0]; + +// Precompute step counts for entry path cards using the default scenario (estimate shown before scenario is selected). +const entryPathStepCounts: Record = Object.fromEntries( + workshopEntryPaths.map((path) => [ + path.id, + buildWorkshopFlow(path.journeyId, workshopDefaults.scenarioId).length, + ]), +); + +// Precompute step counts for every journey + scenario combination for the scenario picker. +const scenarioStepCountsByJourney: Record> = Object.fromEntries( + workshopJourneys.map((journey) => [ + journey.id, + Object.fromEntries( + workshopScenarios.map((scenario) => [ + scenario.id, + buildWorkshopFlow(journey.id, scenario.id).length, + ]), + ), + ]), +); ---
item.key === initialStepKey) ?? > {path.kicker} - {journey.label} + {entryPathStepCounts[path.id]} steps {path.label} {path.summary} {path.fit} @@ -416,6 +437,7 @@ const initialStep = workshopSteps.find((item) => item.key === initialStepKey) ?? > {scenario.kicker} + {scenario.label} {firstSentence(scenario.summary)} @@ -508,6 +530,7 @@ const initialStep = workshopSteps.find((item) => item.key === initialStepKey) ?? journeys: workshopJourneys, scenarios: workshopScenarios, scenarioAdventures: workshopScenarioAdventures, + scenarioStepCountsByJourney, })} />