fix(design): distinguish saved video settings from preparation needs

This commit is contained in:
2026-09-27 16:32:38 +08:00
parent 0eed70fa63
commit bbea6eba82
6 changed files with 203 additions and 28 deletions

View File

@@ -0,0 +1,45 @@
# Task: Diagnose stale video form validation messages
## Identity
- Task ID: 20260927-design-video-form-d2b96e41
- Mode: Feature
- Branch: codex/20260927-design-video-form-d2b96e41-design-video-form
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260927-design-video-form-d2b96e41
- Base commit: 0eed70fa637f70b22be5eda7af400a702ee4a7f2
- Owner: codex
- Status: Ready for Integration
## Scope
- Reproduce the visible six-second video duration alongside missing-duration/missing-shots errors through YouthCreationCard and its real store. Own only that form/quote preparation path, focused tests and this record; no navigation, billing or provider changes.
## Intent And Constraints
- Concurrent and Planning Gates Passed: official check/start/status verified the exact isolated feature identity and base above. Read entry, own task, positioning/current integrated snapshot, Design ADR, relevant architecture/domain/evidence/reflection/commitments. Peer task records inspected read-only; historical Design tasks share code paths but retain the same server-owned Specification and prepare-before-quote contract. Placeholder peer scopes remain unknown; no concrete dependency or semantic conflict affects this isolated work. Preserve unrelated dirty root documents and completed draft-diagnosis task. No subagents or live model calls.
## Outcome
- Reproduced the screenshot's contradictory duration display: a canonical null duration rendered as six seconds while video_duration_required remained. Independently reproduced an unsuccessful parameter save retaining the unaccepted optimistic duration.
- Missing duration now renders an explicit selector populated solely from server-supported durations; quotation remains disabled until selection is saved. Existing accepted durations retain the stepper, including normal video-mode conversion's existing explicit duration write.
- Parameter controls reconcile to accepted Workspace values after completion or failure, without applying a response to another selected Workspace.
- video_shots_required remains visible as actionable AI-preparation guidance, not a red instruction for a child to write internal shots. Other compilation blockers remain unchanged; the server's compile/confirm authority is not relaxed.
- Product ownership: src/pages/ImageCanvas/YouthCreationCard.tsx and youth-issue-copy.ts. Regression ownership: tests/unit/youth-creation-card.test.tsx, tests/e2e/image-workspace-v2.spec.ts and scripts/diagnostics/design-video-flow.test.tsx.
## Verification
- Red evidence: real React component test rendered six seconds for null; a second test rendered the misleading shot error with a valid saved duration; a failed-save test retained seven instead of saved six. Each was run before its correction.
- pnpm 10.33.4: 71 tests passed across youth-creation-card, image-workspace-store and image-canvas-page. Existing store regression confirms blockers clear only on a new canonical Specification revision; preparation failure still stops quotation.
- Offline cross-repository flow: 3 passed using real React controls, Zustand commands, server reducer/preparation orchestration/capability compiler, fixture model output and in-memory asset. New incomplete-video case starts with a selected first frame, null duration and no shots, sees the placeholder, saves six seconds, clears the old duration error, prepares one shot, and reaches explicit confirmation. Also reran original image-to-video path and playback projection.
- Server companion 20260927-design-video-validation-a9e4317b: 10 preparation tests passed.
- pnpm run typecheck, scoped ESLint, pnpm run build:vite passed. Build reports existing Browserslist age, chunk-size and mixed dynamic/static import warnings.
- Electron image-workspace-v2 spec: 2 passed, including new duration selection/reload persistence assertions in the existing production-plan flow. Host API/model/provider transport remain fixtures; no paid generation or production database access.
## Follow-ups
- Main is unchanged. This fix needs a client merge and rebuilt client rollout; it requires no server product patch, database migration or environment variable. The separate server Reasoner fix 7799a746699571d71ac0b009d6faa5fd989b501a remains independently ready, not included here.
- The screenshot alone cannot prove the deployed Workspace's exact stored duration or that a save failed; the supported code paths and matching contradiction were reproduced locally. Real-account installed-client generation is not claimed.
## Promotion Candidates
- Target: ADR-007/README video UI clarification during integration. Proposal: an absent duration must never look accepted, rejected edits must reconcile to accepted state, and AI-owned motion preparation must not be phrased as user-required internal shots. Evidence: red/green component tests, paired offline compiler flow and Electron persistence test. Future impact: preserve the existing single Specification authority and prepare-before-quote contract; no semantic conflict or new product-direction decision.