Skip to content

Run 3: Preview and Confirm

GEN-MEDIA-0001 scenarios 0005.FS (Preview and Crop) and 0006.FS (Confirm and Persist). Stories compose ImagePreviewEditor, ImageComparisonLayout, CopyrightAcknowledgment, and ImageUploadDialog.

#CriterionVerification CommandExpected Output
1On branch jmpicnic/uc-stories with Run 2 checkpoint commitgit -C <worktree> log --oneline -1 --grep='Run 2 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
3Input stories exist (pattern reference)find <worktree>/src/use-cases/general-behaviors/entity-media/set-entity-image/0002-input-detection -name '*.stories.tsx' | wc -l8
ArtifactPathFormatDescription
Set Entity Image UC descriptionset-entity-image/description.mdxMDXUse case description with scenarios table
2 scenario descriptionsset-entity-image/0005-preview-and-crop/description.mdx, 0006-confirm-and-persist/description.mdxMDXOne per scenario
6 preview storiesset-entity-image/0005-preview-and-crop/*.stories.tsxTypeScriptPreview, comparison, edit ops, states
4 confirm storiesset-entity-image/0006-confirm-and-persist/*.stories.tsxTypeScriptCopyright ack, confirm, cancel
#TaskPersonaDepends OnStatusAcceptance Criteria
3.1Create set-entity-image/description.mdx with full scenarios tablefePendingMDX renders, lists all 7 scenarios with status
3.2Create scenario directories: 0005-preview-and-crop/, 0006-confirm-and-persist/fePendingDirectories exist
3.3Create 0005-preview-and-crop/description.mdxfe3.2PendingMDX renders
3.4Create 0006-confirm-and-persist/description.mdxfe3.2PendingMDX renders
3.50005-preview-and-crop/new-image.stories.tsx — 1:1 preview, no comparisonfe3.3PendingStory renders preview, playground exposes aspectRatio
3.60005-preview-and-crop/comparison-desktop.stories.tsx — side-by-sidefe3.3PendingStory shows existing + new layout
3.70005-preview-and-crop/comparison-mobile.stories.tsx — tabbed layoutfe3.3PendingStory renders at mobile viewport with tabs
3.80005-preview-and-crop/crop-zoom-rotate.stories.tsx — edit operationsfe3.3PendingPlay function exercises crop, zoom, rotate, pan, reset
3.90005-preview-and-crop/url-loading.stories.tsx — shimmer + timeoutfe3.3PendingStory shows loading then loaded/timeout states
3.100005-preview-and-crop/interaction-states.stories.tsx — 5-state playgroundfe3.3PendingControls toggle View, EmptyImage, ProvidedImage, FailedValidation, Warn
3.110006-confirm-and-persist/copyright-acknowledgment.stories.tsx — checkbox + disabled confirmfe3.4PendingConfirm disabled until acknowledged, playground controls
3.120006-confirm-and-persist/managed-upload.stories.tsx — upload progress + successfe3.4PendingPlay function confirms, shows progress, grid/form updates
3.130006-confirm-and-persist/external-url.stories.tsx — URL stored as-isfe3.4PendingStory confirms URL, entity display updates
3.140006-confirm-and-persist/cancel-no-change.stories.tsx — cancel aborts uploadfe3.4PendingStory cancels, entity unchanged
3.15Wave gate: lint, tsc, build-storybook, test, VRTfe3.5–3.14PendingAll checks pass
3.16Quality review of all new filesqr3.15PendingNo anti-patterns, consistent style, description.mdx in every scenario dir
3.1 (UC description.mdx) 3.2 (scenario dirs)
├─► 3.3 (0005 description.mdx)
└─► 3.4 (0006 description.mdx)
3.5–3.14 (10 stories, parallelizable)
3.15 (wave gate)
3.16 (quality review)
#CriterionVerification CommandExpected Output
1Set Entity Image description.mdx existstest -f <set-dir>/description.mdxExit 0
22 scenario directories existls -d <set-dir>/0005-* <set-dir>/0006-* 2>/dev/null | wc -l2
32 scenario description.mdx filesfind <set-dir> -path '*/000[56]-*/description.mdx' | wc -l2
46 preview story filesfind <set-dir>/0005-preview-and-crop -name '*.stories.tsx' | wc -l6
54 confirm story filesfind <set-dir>/0006-confirm-and-persist -name '*.stories.tsx' | wc -l4
6Lint passesnpm run lint --prefix <ux-prototype>Exit 0
7TypeScript compilesnpx tsc --noEmit --project <ux-prototype>Exit 0
8Storybook buildsnpm run build-storybook --prefix <ux-prototype>Exit 0
9Unit tests passnpm run test --prefix <ux-prototype>Exit 0
10VRT baselines currentnpx playwright test --project=vrt --prefix <ux-prototype>Exit 0
11Rebased 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
12Post-rebase checks pass (lint, tsc, build, test)Re-run criteria 6–10 after rebaseAll pass

Implement Storybook use case stories for GEN-MEDIA-0001 scenarios 0005.FS and 0006.FS. Working directory: <worktree-path>.

Read the specification — sections “0005.FS — Preview and Crop” and “0006.FS — Confirm and Persist”.

These stories compose ImagePreviewEditor, ImageComparisonLayout, CopyrightAcknowledgment, and ImageUploadDialog in focused context. Use mockUpload and mockUploadSlow from _shared/mock-data.ts. Follow patterns established by Run 1 and Run 2 stories.

Review all new preview-*, edit-*, interaction-states, copyright-*, confirm-*, and cancel-* story files. Verify: canary-only imports, mock data usage, play function coverage, interaction state completeness, sidebar title conventions.

ArtifactSource RunPath
Use-case mock dataRun 1_shared/mock-data.ts
Input story patternsRun 2set-entity-image/input-*
ArtifactConsumer RunPath
Set Entity Image MDXRun 4 (referenced by entity-media.mdx)set-entity-image/set-entity-image.mdx
Preview/confirm storiesRun 4 (pattern reference for end-to-end)set-entity-image/preview-*, confirm-*