Skip to content

Run 5: Sidebar Clean-Up

Reorganize the Storybook sidebar to follow the hierarchical convention established by this project: scenario-level grouping within use cases, and a corrected top-level section order.

#CriterionVerification CommandExpected Output
1On branch jmpicnic/uc-stories with Run 4 checkpoint commitgit -C <worktree> log --oneline -1 --grep='Run 4 complete'Commit hash
2Branch up-to-date with basegit -C <worktree> fetch origin jmpicnic/item-image-upload-components && git -C <worktree> merge-base --is-ancestor origin/jmpicnic/item-image-upload-components HEADExit 0
3All 47 story files existfind <worktree>/src/use-cases -name '*.stories.tsx' | wc -l47+ (includes pre-existing stories)
ArtifactPathFormatDescription
Updated preview.ts.storybook/preview.tsTypeScriptCorrected storySort.order configuration
Updated story titlesVarious *.stories.tsxTypeScriptHierarchical title paths with scenario grouping
Updated MDX titlesVarious *.mdxMDX<Meta title="..." /> updated to match hierarchy

Current Top-Level Sidebar Order (preview.ts)

Section titled “Current Top-Level Sidebar Order (preview.ts)”
1. Docs
2. Components
3. Visual Elements
4. Dev Witness
5. Canary Refactor
6. Use Cases
7. Archive
1. Docs
2. Visual Elements
3. Components
4. Use Cases
5. Canary Refactor
6. Dev Witness
7. Archive

Current Use Cases Sidebar Structure (flat)

Section titled “Current Use Cases Sidebar Structure (flat)”
Use Cases/General Behaviors/Entity Media/GEN-MEDIA-0001 Set Entity Image/Happy Path

Target Use Cases Sidebar Structure (hierarchical)

Section titled “Target Use Cases Sidebar Structure (hierarchical)”
Use Cases/General Behaviors/Entity Media/GEN-MEDIA-0001 Set Entity Image/0001 Set Image/Happy Path

Adding a scenario grouping level between the use case and the individual stories so each scenario can be folded/expanded independently.

Note: The hierarchical story title paths and scenario-level directory structure are baked in from Runs 1–4. This run only handles preview.ts configuration.

#TaskPersonaDepends OnStatusAcceptance Criteria
5.1Update preview.ts storySort.order — reorder top-level sections to: Docs, Visual Elements, Components, Use Cases, Canary Refactor, Dev Witness, ArchivefePendingTop-level sidebar matches target order
5.2Update preview.ts storySort.order — add Entity Media section with scenario-level ordering under Use Casesfe5.1PendingEntity Media stories appear in correct hierarchical order
5.3Verify existing Use Cases stories (Business Affiliates, List Views, Items ITM-0001/0002/0004) still render correctly — no regressions from sidebar reorderfe5.1PendingExisting stories appear in sidebar, play functions pass
5.4Verify all new stories appear at correct sidebar positions matching the specification treefe5.2PendingEvery scenario folder is foldable, stories nest correctly
5.5Wave gate: lint, tsc, build-storybook, test, VRTfe5.1–5.4PendingAll checks pass
5.6Quality review — sidebar structure matches specification treeqr5.5PendingEvery story appears at the correct sidebar position
5.1 (top-level reorder) ──► 5.2 (Entity Media sort config) ──► 5.6 (verify existing)
5.3 (GEN::MEDIA titles) ──────────────────────────────────────────────►│
5.4 (REF::ITM titles) ────────────────────────────────────────────────►│
5.5 (MDX titles) ─────────────────────────────────────────────────────►│
5.7 (wave gate)
5.8 (quality review)

Tasks 5.3, 5.4, 5.5 are independent of 5.1/5.2 and can run in parallel.

#CriterionVerification CommandExpected Output
1Top-level sidebar order correctInspect preview.ts storySort.order[0..6]Docs, Visual Elements, Components, Use Cases, Canary Refactor, Dev Witness, Archive
2Entity Media stories hierarchicalGrep story titles for scenario grouping patternAll match {UC}/{Scenario}/{Story}
3Lint passesnpm run lint --prefix <ux-prototype>Exit 0
4TypeScript compilesnpx tsc --noEmit --project <ux-prototype>Exit 0
5Storybook buildsnpm run build-storybook --prefix <ux-prototype>Exit 0
6Unit tests passnpm run test --prefix <ux-prototype>Exit 0
7VRT baselines currentnpx playwright test --project=vrt --prefix <ux-prototype>Exit 0
8Rebased onto base branchgit -C <worktree> fetch origin jmpicnic/item-image-upload-components && git -C <worktree> rebase origin/jmpicnic/item-image-upload-componentsExit 0, no conflicts
9Post-rebase checks pass (lint, tsc, build, test, VRT)Re-run criteria 3–7 after rebaseAll pass

Reorganize the Storybook sidebar for the ux-prototype repository. Working directory: <worktree-path>.

Two changes:

  1. Top-level reorder in .storybook/preview.ts storySort.order: Current: Docs, Components, Visual Elements, Dev Witness, Canary Refactor, Use Cases, Archive. Target: Docs, Visual Elements, Components, Use Cases, Canary Refactor, Dev Witness, Archive.

  2. Hierarchical Use Cases sidebar — add Entity Media section config with scenario-level nesting. Update all new story title paths from {UC}/{Story} to {UC}/{Scenario}/{Story}. Update MDX <Meta title> accordingly.

Do NOT change existing story titles for Business Affiliates, List Views, or existing Item stories (ITM-0001, ITM-0002, ITM-0004) — only the new image stories created in Runs 1–4.

Verify the complete Storybook sidebar structure matches the specification tree in index.md. Check every story appears at the correct position. Verify existing stories are not affected by the reorder.

ArtifactSource RunPath
All story and MDX filesRuns 1–4src/use-cases/general-behaviors/entity-media/, src/use-cases/reference/items/
ArtifactConsumerPath
Organized sidebar configPR review, stakeholders.storybook/preview.ts
Hierarchical story titlesPR review, stakeholdersAll *.stories.tsx title fields