feat(canvas): collect generated images and videos in My Works drawer
This commit is contained in:
1 parent
436f7ba1ea
commit
b1eed1be5c
23 files changed
+1905
-14
No files matched your search
@@ -0,0 +1,53 @@
|
||||
# Task: Implement approved Canvas My Works drawer
|
||||
|
||||
## Identity
|
||||
|
||||
- Task ID: 20261014-canvas-works-drawer-7b4e92c1
|
||||
- Mode: Feature
|
||||
- Branch: codex/20261014-canvas-works-drawer-7b4e92c1-canvas-works-drawer
|
||||
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20261014-canvas-works-drawer-7b4e92c1
|
||||
- Base commit: 436f7ba1eab500e41866f890f49816ff622ef6fe
|
||||
- Owner: codex
|
||||
- Status: Ready for Integration
|
||||
|
||||
## Scope
|
||||
|
||||
- Implement the approved Canvas My Works drawer based on the selected image concept. Aggregate generated image/video works across the user's Canvas projects; clear type labels/filter, preview/download, and return to source creation; coordinate open/close with the existing right-hand work pane.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
- User explicitly approved implementation following the mock and clarified that the current right pane is a working area. Preserve its editing, split/focus, task/history, and generation-confirmation behavior. Temporary-app updates are coordinated separately; this worktree does not alter the trial.
|
||||
- Base is the current complete trial source `436f7ba1eab500e41866f890f49816ff622ef6fe`, verified from read-only runtime metadata. Main checkout and foreign docs remain untouched; own isolated feature worktree/branch identity verified.
|
||||
- Planning Gate passed: 81 readable peer records / 243 permitted sections. Canvas create recovery and existing Gallery migration are separate scopes; preserve their changes during any future integration. Do not update/restart/refresh the trial, merge main, push, deploy, or call paid models.
|
||||
- New collection is a Main-owned read-only projection of existing cloud V2 Workspace Tasks/Assets; no server schema, pricing/Quote, credential, or cross-account boundary changes. No fake product works or arbitrary storage paths.
|
||||
- Use approved calm light layout and existing project tokens/Lucide. Generic search suggestions that conflict with this visual target are not adopted. Generated mock is a visual target, not product artwork data.
|
||||
- Delegation: server agent owns shared/Main/Host collection contract/tests; root owns UI integration/state/navigation and final checks; UI agent will own drawer rendering and focused tests after data contract is fixed.
|
||||
|
||||
## Outcome
|
||||
|
||||
- Implemented Canvas header “我的作品” and right drawer using existing app tokens, Sheet, icon and asset pathways. Collections read completed generated image/video outputs across account Workspaces in read-only pages. Reference/uploads/intermediate and unsuccessful results are excluded by successful Task result association.
|
||||
- Added explicit image/video badges, all/image/video filtering, video play/duration, same-drawer preview, save-to-computer and return to exact source task. Collection loading, empty, unavailable pages, partial retry and truncated-history states remain distinct. Failed-page retries retain prior works for currently unavailable Workspaces while replacing successful authoritative reads, including empty results.
|
||||
- Preserved existing work pane, split ratio, focus, current plan and drafts on drawer open/close. Source navigation reads and validates first, then atomically changes Workspace and opens the matching task; failed/missing/stale/changed-account/read-during-draft scenarios preserve the original Workspace and event connection. Same-project source return does not replace local drafts. No quote/confirmation/generation mutations are introduced.
|
||||
- Main holds collection account binding, one pinned credential per page and epoch checks; no credential or full form/conversation data enters the collection DTO. Whole-page credential/list/detail/body reads share a deadline; bounded detail concurrency and explicit pagination keep the scan finite. Closing/unmounting/account changes abort or ignore collection responses; preview video pauses on departure.
|
||||
- Updated README and project-root `design-qa.md`; selected mock vs rendered exact-size full/focused montage reviewed, desktop density P2 fixed, QA final result passed. Public fixture-only browser preview runs at `http://127.0.0.1:4179/` for isolated review.
|
||||
- Verified trusted human authorization in “推代码” conversation `01a12eba-e98b-76a3-8fd5-206f2820d623` for project-task coordination. Integration task `20261014-all-thread-trial-6d72e4f1` owns combined trial refresh/main merge/push; this task will hand over one final commit and does not perform those operations. Primary/foreign files, trial profiles and runtime records remain untouched.
|
||||
|
||||
## Verification
|
||||
|
||||
- Scoped unit suite: **149 passed across 8 files**. First run: works-square-generated-works, image-workspace-route, works-square-design-workspace, design-my-works-drawer, image-canvas-page, image-workspace-api — 92 total. Second run: image-workspace-store (48), canvas-workspace-layout (9), 57 total. Store tests exercise actual atomic source selection failures/404/invalid target/drafts/account changes/reset/new selection/success/same project.
|
||||
- Final drawer CSS change: focused component 14/14 and E2E 3/3 repeated; three screenshots per viewport **1600×1000, 1440×960, 390×844**. List/filter/image/video detail/Escape/focus return/background drafts and safe source-task navigation passed; no page errors or unexpected external requests. Responsive geometry and all six sample-card captions measured before footer.
|
||||
- TypeScript `tsc --noEmit`: PASS. ESLint across all changed/new TypeScript and E2E harness files: PASS. Source review: PASS after two P2 fixes (partial retry crossed failures; failed source switch losing original Workspace).
|
||||
- CUA opened the isolated browser and inspected actual drawer list, filter and video detail. Exact-size automated screenshots compared with the source in one full montage and one readable focused montage; final visual QA PASS. Media fixture uses repository posters and DOM stub, so this is not a real cloud playback or download smoke.
|
||||
- Production Vite Renderer/Main/Preload/utility build PASS; existing Browserslist-data/chunk-size warnings only. Final CSS build completed successfully for all four targets; task-aware drift check and `git diff --check` PASS. No packaged app, real cloud generation or user trial interaction performed.
|
||||
|
||||
## Follow-ups
|
||||
|
||||
- Current cloud V2 Workspace reads expose recent assets/tasks only (100 assets / 50 tasks per Workspace). Drawer conservatively warns at either cap or missing task result. Complete older history requires server pagination or an account-scoped generated-works route; do not describe the current collection as a complete archive.
|
||||
- No immutable per-work title is available in the existing API; actual collection uses current Workspace title and source caption. Fixture artwork/names are QA-only and never product fallbacks.
|
||||
- Coordinated trial should confirm real account media playback/save behavior using the existing Main asset flow; local media stub cannot supply that evidence.
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
- Target `.project-docs/20-architecture/` Canvas/client documents and canonical current state: record account-scoped read-only collection projection (`GET /api/works/image-workspace/generated-works?offset=N`), 12 Workspace page size / lookahead / bounded detail reads, account/deadline guard, partial/truncated semantics and atomic source navigation. Evidence: source + 149 unit / 3 viewport tests. Future impact: cloud pagination may replace scan without changing user journey. Semantic conflict: none with generation/Quote or Gallery; existing right work pane is retained. Human confirmation: not required; implementation explicitly approved.
|
||||
- Target accepted Canvas experience/current specification: “我的作品” consolidates generated image/video outputs with type filters, one-drawer preview/save and exact creation return; preserve work pane and local drafts. Evidence: approved mock/current user instruction, exact-size comparison in `design-qa.md`. Future impact: clarify collection vs current/history work pane and prevent navigation regressions. Semantic conflict: earlier single-project history-only presentation; add the collection while preserving its work pane. Human confirmation: already supplied for this task.
|
||||
- Target canonical follow-up aggregation: cloud ability to read complete older completed outputs is still needed. Evidence: source V2 history caps and explicit `historyTruncated` cases. Future impact: complete all-history promise requires upstream capability, not hiding the existing cap in the client. Human confirmation: needed before assigning/deploying the upstream change, not for this client implementation.
|
||||
Reference in new issue
Block a user