Skip to content

Run 1: View and Fallback

Mock data infrastructure, GEN-MEDIA-0003 (View Entity Image) stories, and verification of existing Item stories after the ImageCellDisplay swap.

#CriterionVerification CommandExpected Output
1On branch jmpicnic/uc-stories (created from jmpicnic/item-image-upload-components)git -C <worktree> branch --show-currentjmpicnic/uc-stories
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
3Storybook buildsnpm run build-storybook --prefix <ux-prototype>Exit code 0
3All unit tests passnpm run test --prefix <ux-prototype>Exit code 0
4Lint passesnpm run lint --prefix <ux-prototype>Exit code 0
5Component mock data existstest -f <ux-prototype>/src/components/canary/__mocks__/image-story-data.tsExit code 0
ArtifactPathFormatDescription
Use-case mock datasrc/use-cases/general-behaviors/entity-media/_shared/mock-data.tsTypeScriptFile/Blob mocks, URL mocks, upload variants
Section descriptionentity-media/description.mdxMDXEntity Media section (placeholder — finalized in Run 4)
View UC descriptionview-entity-image/description.mdxMDXView Entity Image use case description
3 scenario descriptionsview-entity-image/0001-view-in-grid/description.mdx, 0002-inspector-overlay/description.mdx, 0003-thumbnail-fallback/description.mdxMDXOne per scenario
10 story filesview-entity-image/{0001,0002,0003}-*/*.stories.tsxTypeScriptSee task list below
#TaskPersonaDepends OnStatusAcceptance Criteria
1.1Create directory structure: entity-media/, _shared/, set-entity-image/, remove-entity-image/, view-entity-image/ with scenario subdirectories (0001-view-in-grid/, 0002-inspector-overlay/, 0003-thumbnail-fallback/)fePendingDirectories exist
1.2Create _shared/mock-data.ts with all use-case-specific mock objects (MOCK_FILE_JPEG, MOCK_FILE_PNG, MOCK_FILE_OVERSIZED, MOCK_FILE_BMP, MOCK_CLIPBOARD_IMAGE_BLOB, MOCK_EXTERNAL_URL, MOCK_EXTERNAL_URL_BROKEN, MOCK_EXTERNAL_URL_NON_IMAGE, mockUploadSlow, mockUploadFail)fe1.1PendingFile exports all listed mocks, TypeScript compiles
1.3Create entity-media/description.mdx section description (stub — finalized in Run 4)fe1.1PendingMDX renders in Storybook sidebar
1.4Create view-entity-image/description.mdx use case description with scenarios tablefe1.1PendingMDX renders, links to specification
1.5Create 0001-view-in-grid/description.mdx scenario descriptionfe1.1PendingMDX renders
1.6Create 0002-inspector-overlay/description.mdx scenario descriptionfe1.1PendingMDX renders
1.7Create 0003-thumbnail-fallback/description.mdx scenario descriptionfe1.1PendingMDX renders
1.80001-view-in-grid/grid-thumbnails.stories.tsx — AG Grid with ImageCellDisplay, mixed image statesfe1.2PendingStory renders, play function passes
1.90001-view-in-grid/hover-preview.stories.tsx — hover popoverfe1.2PendingStory renders, play function verifies popover
1.100001-view-in-grid/playground.stories.tsx — argTypes controlsfe1.2PendingStory renders with controls
1.110002-inspector-overlay/open-and-close.stories.tsx — modal open/dismissfe1.2PendingStory renders, play function exercises 3 dismiss methods
1.120002-inspector-overlay/edit-transition.stories.tsx — Edit button flowfe1.2PendingStory renders, play function verifies transition
1.130002-inspector-overlay/no-edit.stories.tsx — read-only inspectorfe1.2PendingStory renders, no Edit button visible
1.140003-thumbnail-fallback/error-badge.stories.tsx — broken URL error statefe1.2PendingStory renders error badge on placeholder
1.150003-thumbnail-fallback/loading-shimmer.stories.tsx — shimmer transitionfe1.2PendingStory renders shimmer then loaded image
1.160003-thumbnail-fallback/no-image.stories.tsx — null imageUrl placeholderfe1.2PendingStory renders initials placeholder, no error badge
1.170003-thumbnail-fallback/playground.stories.tsx — state controlsfe1.2PendingStory renders with controls for image states
1.18Verify existing ITM-0001 story — grid renders with ImageCellDisplayfe1.8PendingExisting play function passes, thumbnails visible
1.19Verify existing ITM-0002 story — details drawer with image columnfe1.8PendingExisting play function passes
1.20Verify existing ITM-0004 story — inline edit still worksfe1.8PendingExisting play function passes
1.21Wave gate: lint, tsc, build-storybook, test, VRTfe1.8–1.20PendingAll checks pass, VRT baselines updated
1.22Quality review of all new filesqr1.21PendingNo anti-patterns, consistent style, description.mdx in every scenario dir
1.1 (dirs + scenario subdirs)
├─► 1.2 (mock data)
├─► 1.3 (entity-media description.mdx stub)
├─► 1.4 (view-entity-image description.mdx)
└─► 1.5–1.7 (3 scenario description.mdx, parallelizable)
1.8–1.17 (10 stories, parallelizable)
1.18–1.20 (verification of existing stories, parallelizable)
1.21 (wave gate)
1.22 (quality review)

Tasks 1.5–1.7 (scenario MDX) can run in parallel. Tasks 1.8–1.17 can be implemented in parallel by multiple front-end agents. Tasks 1.18–1.20 can run in parallel after at least one grid story renders.

#CriterionVerification CommandExpected Output
110 new story files existfind <ux-prototype>/src/use-cases/general-behaviors/entity-media/view-entity-image -name '*.stories.tsx' | wc -l10
25 description.mdx files exist (1 section + 1 UC + 3 scenarios)find <ux-prototype>/src/use-cases/general-behaviors/entity-media -name 'description.mdx' | wc -l5
33 scenario directories existls -d <ux-prototype>/src/use-cases/general-behaviors/entity-media/view-entity-image/0001-* <ux-prototype>/src/use-cases/general-behaviors/entity-media/view-entity-image/0002-* <ux-prototype>/src/use-cases/general-behaviors/entity-media/view-entity-image/0003-* 2>/dev/null | wc -l3
4Mock data file existstest -f <ux-prototype>/src/use-cases/general-behaviors/entity-media/_shared/mock-data.tsExit 0
4Lint passesnpm run lint --prefix <ux-prototype>Exit 0
5TypeScript compilesnpx tsc --noEmit --project <ux-prototype>Exit 0
6Storybook buildsnpm run build-storybook --prefix <ux-prototype>Exit 0
7Unit tests passnpm run test --prefix <ux-prototype>Exit 0
8VRT baselines currentnpx playwright test --project=vrt --prefix <ux-prototype>Exit 0
9Rebased 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
10Post-rebase checks pass (lint, tsc, build, test)Re-run criteria 5–8 after rebaseAll pass

Implement Storybook use case stories for GEN-MEDIA-0003 (View Entity Image) in the ux-prototype repository. Working directory: <worktree-path>.

Read the specification at documentation/src/content/docs/roadmap/completed/item-image-upload/ux-design/use-cases/specification.md — section “GEN::MEDIA::0003 — View Entity Image”.

Follow the conventions in the specification: sidebar title format, MDX template, story artifact pattern (primary + playground), mock data from _shared/mock-data.ts.

Use only canary components — zero vendored imports. Compose ImageDisplay, ImageCellDisplay, ImageHoverPreview, ImageInspectorOverlay from @/components/canary/. Follow existing story patterns in src/use-cases/reference/items/browse-and-search/view-items-list.stories.tsx.

Review all new files in src/use-cases/general-behaviors/entity-media/ for: coding standards, consistent imports (canary only, no vendored/extras), MDX formatting (HTML tables, numeric entities, no bare braces), story title conventions, play function coverage.

ArtifactSource RunPath
Component implementationsPre-existing (branch jmpicnic/item-image-upload-components, PR #63)src/components/canary/
Component mock dataPre-existingsrc/components/canary/__mocks__/image-story-data.ts
ArtifactConsumer RunPath
Use-case mock dataRuns 2, 3, 4src/use-cases/general-behaviors/entity-media/_shared/mock-data.ts
Directory structureRuns 2, 3, 4src/use-cases/general-behaviors/entity-media/
Updated VRT baselinesRuns 2, 3, 4VRT snapshot directory