From f1e07b92736fe1696921e05f46ccf57840220b86 Mon Sep 17 00:00:00 2001 From: Phil Helm Date: Mon, 23 Nov 2026 11:04:03 +0000 Subject: [PATCH] Make the life of an event a timeline you scroll through The stepper hid all but one step, its height jumped between steps so the controls moved, and autoplay ran at a fixed pace regardless of how fast people read. Show every step at once, with the shared steps followed by both branches, and each step's packages alongside it. --- .../components/overview/EventJourney.astro | 399 ++++-------------- .../src/components/overview/JourneyStep.astro | 155 +++++++ docs/src/components/overview/library.ts | 17 +- docs/src/content/docs/overview.mdx | 5 +- 4 files changed, 238 insertions(+), 338 deletions(-) create mode 100644 docs/src/components/overview/JourneyStep.astro diff --git a/docs/src/components/overview/EventJourney.astro b/docs/src/components/overview/EventJourney.astro index f2639ab6..cf436fa0 100644 --- a/docs/src/components/overview/EventJourney.astro +++ b/docs/src/components/overview/EventJourney.astro @@ -1,16 +1,7 @@ --- -import { Code } from '@astrojs/starlight/components'; import './styles.css'; -import { journeyPackages, type PackageId } from './library'; - -type Step = { - key: string; - title: string; - pkgs: PackageId[]; - text: string; - code: string; - inspector: string; -}; +import JourneyStep from './JourneyStep.astro'; +import type { JourneyStep as Step, PackageId } from './library'; type Row = [key: string, value: string, state?: 'new' | 'kept' | 'derived']; @@ -264,222 +255,90 @@ NewEvent( }, ]; -const branches = { - demand: { label: 'On demand', steps: [...shared, ...onDemand] }, - background: { label: 'In the background', steps: [...shared, ...background] }, -}; - -const allSteps = [...shared, ...onDemand, ...background]; +const branches = [ + { id: 'journey-on-demand', label: 'On demand', summary: 'work out the state when you need it.', steps: onDemand }, + { + id: 'journey-in-the-background', + label: 'In the background', + summary: 'keep the state up to date as events arrive.', + steps: background, + }, +]; --- -
-
-
- - -
-
    - { - journeyPackages.map((id) => ( -
  • - {id} -
  • - )) - } -
-
- -
- - -
- { - allSteps.map((step) => ( - - )) - } -
- - - -
-
-
- diff --git a/docs/src/components/overview/JourneyStep.astro b/docs/src/components/overview/JourneyStep.astro new file mode 100644 index 00000000..62d38994 --- /dev/null +++ b/docs/src/components/overview/JourneyStep.astro @@ -0,0 +1,155 @@ +--- +import { Code } from '@astrojs/starlight/components'; +import type { JourneyStep } from './library'; + +interface Props { + step: JourneyStep; + number: number; + headingLevel: 3 | 4; +} + +const { step, number, headingLevel } = Astro.props; +const Heading = `h${headingLevel}` as const; +--- + +
  • + +
    +
    + {step.title} +
      + { + step.pkgs.map((id) => ( +
    • + {id} +
    • + )) + } +
    +
    +
    +
    +
    +
    What you have now
    + +
    +
    + +
    +
    +
    +
  • + + diff --git a/docs/src/components/overview/library.ts b/docs/src/components/overview/library.ts index 541ad258..2dd8102a 100644 --- a/docs/src/components/overview/library.ts +++ b/docs/src/components/overview/library.ts @@ -11,12 +11,11 @@ export type PackageId = export const base = '/event.store'; -export const journeyPackages: PackageId[] = [ - 'types', - 'store', - 'sources', - 'persistence', - 'projection', - 'query', - 'processing', -]; +export type JourneyStep = { + key: string; + title: string; + pkgs: PackageId[]; + text: string; + code: string; + inspector: string; +}; diff --git a/docs/src/content/docs/overview.mdx b/docs/src/content/docs/overview.mdx index f8efd7e2..fb5ef69f 100644 --- a/docs/src/content/docs/overview.mdx +++ b/docs/src/content/docs/overview.mdx @@ -45,9 +45,8 @@ The other packages work underneath. You'll import from `persistence` to connect ## The life of an event Follow one event, a grinder added to `cart-42`, through the library. The first four steps are -always the same. Then pick a branch: work out the state **on demand** when you need it, or keep it -up to date **in the background** as events arrive. The chips at the top light up the packages each -step uses. +always the same. Then the path splits: work out the state **on demand** when you need it, or keep it +up to date **in the background** as events arrive. Each step shows the packages it uses.