Skip to content

Run 3a: Component Updates

Updates the 5 image-related components in ux-prototype for FD-01 compliance and lifecycle framework adoption. Implements all changes that do not require infrastructure#439 (CloudFront CORS). The crossOrigin attribute for CDN image editing is deferred to Run 3b. Corresponds to specification.md tasks T-1 (changes 1–6), T-2, T-3, T-4, T-5, T-6, T-7.

Author: Claude Code for jmpicnic | Date: 2026-04-07 | Status: Planning

Apply lifecycle framework types and FD-01 typed-provider pattern to the 5 image-related components: ImageUploadDialog, ImageCellEditor, ImageFormField, ItemGridColumns, and TypeaheadCellEditor. Verify all checks and Storybook stories. infrastructure#439 (CORS Response Headers Policy) is NOT required for this run — the crossOrigin change is reserved for Run 3b.

#CriterionVerification CommandExpected Output
1Run 2 exit gate passedgit -C /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype log --oneline -3Recent Run 2 commits visible
2ux-prototype worktree on correct branchgit -C /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype branch --show-currentjmpicnic/image-upload-frontend
3Lifecycle types availablenpm --prefix /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype run typecheckExit 0 (edit-lifecycle.ts types compile)
4All existing checks passmake -C /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype check && make -C /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype test && make -C /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype buildAll exit 0
5No TanStack imports in ux-prototypegrep -r "from '@tanstack" /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype/srcNo matches (FD-01 — design system must not import TanStack)
#TaskPersonaDepends OnStatusAcceptance Criteria
3a.1ImageUploadDialog: remove simulated progress timer, add indeterminate indicator, add UploadError phase with retry/discard, adopt EditLifecycleCallbacks<ImageUploadResult> type annotationfront-end-engineerPending6 unit tests pass: indeterminate indicator shown during upload, UploadError renders error message, retry transitions to Uploading, discard transitions to EmptyImage, default onUpload handler works in Storybook, EditLifecycleCallbacks type compiles without errors; change #7 (crossOrigin) NOT included
3a.2ImageCellEditor: extend createImageCellEditor factory config to require useImageUpload and useCheckReachability hooks as required fields (FD-15)front-end-engineerPendingFactory config TypeScript compiles with required hooks; tsc fails when hooks are omitted from config; hooks forwarded to ImageUploadDialog as onUpload/onCheckReachability; factory creates editor component that renders ImageUploadDialog
3a.3ImageFormField: add contextErrors?: FieldError[] prop, adopt EditableComponentProps<string | null> pattern with initialValue as primary prop; mark imageUrl deprecatedfront-end-engineerPendingcontextErrors renders when provided; existing behavior unchanged when omitted; initialValue works as primary; imageUrl still works (backward compat) with @deprecated JSDoc
3a.4ItemGridColumns: expand ItemGridLookups to 9 fields; add ItemGridEditorHooks interface with required useImageUpload and useCheckReachability; wire createImageCellEditor in image column definitionfront-end-engineer3a.2PendingExpanded ItemGridLookups interface compiles; ItemGridEditorHooks required hooks cause tsc to fail when missing; image column uses createImageCellEditor with provided hooks
3a.5TypeaheadCellEditor: document decision to keep promise callback interface (FD-01 compliant, no hook conversion needed); no code changesfront-end-engineerPendingDecision documented (in code comment or decision log); no code changes committed for this task
3a.6Full checks (ux-prototype)front-end-engineer3a.1, 3a.2, 3a.3, 3a.4Pendingmake check (lint + typecheck), make test (unit tests), make build (Storybook build) all exit 0; all existing Storybook stories render with default handlers
3a.7Documentation commitfront-end-engineer3a.6PendingSession log / byproducts updated in documentation worktree; make pr-checks passes; changes committed referencing Phase 3.3a

Single ux-prototype worktree. Tasks 3a.1–3a.5 are largely independent (different components) but the single-agent sequential approach is appropriate given the moderate size of each change.

Working directory: /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype Branch: jmpicnic/image-upload-frontend

Task 3a.4 (ItemGridColumns) depends on 3a.2 (ImageCellEditor factory config) because it wires createImageCellEditor. All other tasks are independent.

Single agent executes tasks sequentially. 3a.1, 3a.2, 3a.3, and 3a.5 are independent but short enough that parallelism adds no value.

3a.1 (ImageUploadDialog) ─┐
3a.2 (ImageCellEditor) ──────┼──→ 3a.4 (ItemGridColumns) ─┐
3a.3 (ImageFormField) ─────┤ ├──→ 3a.6 (checks) → 3a.7 (docs)
3a.5 (TypeaheadCellEditor) ──┘ │
(decision only, no code) │

Single agent; no idle time.

PersonaAgent NameTasks AssignedWorking DirectorySpawn Order
front-end-engineerfe-components3a.1 through 3a.7/Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototypeFirst
ArtifactPath (relative to ux-prototype worktree)FormatDescription
Updated ImageUploadDialogsrc/components/canary/organisms/shared/image-upload-dialog/TSXIndeterminate progress, UploadError phase, lifecycle type annotation
Updated ImageCellEditorsrc/components/canary/atoms/grid/image/TSXFactory requires useImageUpload, useCheckReachability hooks
Updated ImageFormFieldsrc/components/canary/molecules/form/image/TSXcontextErrors prop, initialValue primary, imageUrl deprecated
Updated ItemGridColumnssrc/components/canary/organisms/shared/item-grid-columns/TSX9-field ItemGridLookups, ItemGridEditorHooks, image column wired
ImageUploadDialog testsAdjacent to componentTypeScript/Vitest6 new test cases (per task 3a.1)
ImageCellEditor testsAdjacent to componentTypeScript/VitestHook forwarding and compile-time required hooks
ImageFormField testsAdjacent to componentTypeScript/VitestcontextErrors, backward compat, initialValue
ItemGridColumns testsAdjacent to componentTypeScript/VitestExpanded lookups, required hooks
3a.1 (ImageUploadDialog)
3a.2 (ImageCellEditor) ──→ 3a.4 (ItemGridColumns)
3a.3 (ImageFormField)
3a.5 (TypeaheadCellEditor — decision only)
all ──→ 3a.6 (full checks) ──→ 3a.7 (docs commit)
#CriterionVerification CommandExpected Output
1ImageUploadDialog indeterminate progress test passesnpm --prefix <ux-worktree> run test -- --reporter=verbose 2>&1 | grep "indeterminate"Test case PASS
2ImageUploadDialog UploadError tests passnpm --prefix <ux-worktree> run test -- --reporter=verbose 2>&1 | grep "UploadError"3 test cases PASS
3No crossOrigin changes in ImageUploadDialoggit -C <ux-worktree> diff HEAD -- src/components/canary/organisms/shared/image-upload-dialog/ | grep crossOriginNo output (crossOrigin deferred to Run 3b)
4ImageCellEditor hooks required at compile timenpm --prefix <ux-worktree> run typecheckExit 0 (if hooks omitted in test → tsc error)
5ImageFormField contextErrors prop presentnpm --prefix <ux-worktree> run test -- --reporter=verbose 2>&1 | grep "contextErrors"Test cases PASS
6ItemGridLookups has 9 fieldsnpm --prefix <ux-worktree> run typecheckExit 0
7No TanStack imports in ux-prototype srcgrep -r "from '@tanstack" /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype/srcNo matches
8All checks passmake -C <ux-worktree> check && make -C <ux-worktree> test && make -C <ux-worktree> buildAll exit 0
9All existing Storybook stories renderStorybook build exits 0 with no new errorsExit 0
10Documentation make pr-checks passesmake -C /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/documentation pr-checksExit 0

Where <ux-worktree> = /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype.

Working directory: /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/ux-prototype Use absolute paths for all tool calls.

Implement Phase 3.3 (pre-infrastructure) component updates: specification.md.

Load skills: ui-component, unit-tests-frontend.

IMPORTANT — scope boundary: Do NOT implement change #7 from T-1 (crossOrigin="use-credentials" on ImagePreviewEditor). That change requires infrastructure#439 (CloudFront CORS) and is reserved for Run 3b.

Task ordering: Start with 3a.2 (ImageCellEditor) before 3a.4 (ItemGridColumns) because ItemGridColumns wires createImageCellEditor. Tasks 3a.1, 3a.3, and 3a.5 can proceed in any order.

FD-15 (required hooks): The ImageCellEditorConfig.useImageUpload and useCheckReachability fields, and ItemGridEditorHooks.useImageUpload and useCheckReachability fields, must be required (no ?). This shifts missing-hook errors from runtime to compile time.

FD-01 compliance: Verify after each change that no TanStack imports exist in src/. Run grep -r "@tanstack" src/ from the worktree.

TypeaheadCellEditor (3a.5): The current promise callback interface is already FD-01 compliant. No code changes are needed. Document the decision to keep it as-is in a code comment on the interface.

After 3a.6 (full checks), commit everything in the ux-prototype worktree. Then for 3a.7, update byproducts in the documentation worktree at /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/documentation and run make pr-checks there before committing.

ArtifactProducer RunPath
EditLifecycleCallbacks<T>, EditableComponentProps<T>, FieldError typesRun 2src/types/canary/utilities/edit-lifecycle.ts
useDraft<T> hookRun 2src/types/canary/utilities/use-draft.ts
ArtifactConsumer RunPath
Updated ImageUploadDialog (no crossOrigin yet)Run 3bux-prototype worktree
Updated ImageCellEditor factoryRun 4ux-prototype worktree
Updated ImageFormFieldRun 4ux-prototype worktree
Updated ItemGridColumnsRun 4ux-prototype worktree

STOP: Review component changes before proceeding to Run 3b (CORS integration).

#QuestionOptionsRecommendationDecision
1ImageFormField prop namingA: rename imageUrl to initialValue, B: keep both + alias, C: keep imageUrl onlyBDecided: B — add initialValue, mark imageUrl deprecated
2TypeaheadCellEditor interfaceA: convert to hook, B: keep promise callbackBDecided: B — already FD-01 compliant
  • ImageUploadDialog: indeterminate progress indicator, UploadError state with retry/discard, lifecycle type annotation; crossOrigin NOT included
  • ImageCellEditor: factory requires useImageUpload and useCheckReachability (compile-time enforcement)
  • ImageFormField: contextErrors prop, initialValue primary, imageUrl deprecated
  • ItemGridColumns: 9-field ItemGridLookups, ItemGridEditorHooks with required hooks, image column wired
  • TypeaheadCellEditor: decision documented, no code changes
  • All unit tests pass including new test cases for each change
  • All Storybook stories render with default handlers
  • make check, make test, make build all pass
  • No TanStack imports in ux-prototype src/
  • Documentation make pr-checks passes; changes committed
Risk / BlockerImpactMitigation
ImageUploadDialog state machine refactoring causes story regressionsMediumVerify default onUpload handler still works in Storybook stories
ItemGridLookups expansion breaks existing callersLow — all new fields are optionalVerify typecheck passes; existing callers omitting new fields are valid TypeScript
ImageCellEditor required hooks break existing story configMedium — Storybook stories need updateStories provide stub implementations via factory config
FileDescription
changelog.mdSummary of component changes in Run 3a
learnings.mdObservations about component state machine patterns, FD-01 enforcement
suggestions.mdImprovement suggestions, crossOrigin preparation notes

The team’s TaskList is the single source of truth for task status. Follow the protocol at every phase boundary per the team-lead agent definition.

DateEventNotes
2026-04-07Plan created

Copyright: (c) Arda Systems 2025-2026, All rights reserved