Repository navigation
Add chat and canvas creation modes - #380
Conversation
## summary - Add a Chinese RFC for an Agent-focused view and a 1:2 chat/canvas layout, with the two agreed UI sketches. - Describe switching behavior, shared component state, output limits, implementation steps, and acceptance scenarios. - Link the proposal from the documentation index. Refs: ThinkFlowLab#373 Signed-off-by: congw729 <115451386+congw729@users.noreply.github.com>
## summary Add an isolated browser preference for agent and canvas modes, with canvas as the initial entry point and explicit storage failure results. Cover restoration, invalid values, storage denial and unrelated preference preservation. Refs: ThinkFlowLab#386, ThinkFlowLab#373 Signed-off-by: congw729 <115451386+congw729@users.noreply.github.com>
Share the project, conversation and editor hosts across both modes. Default to a 1:2 chat/canvas split, remember layout preferences, and scope canvas gestures to the visible region. Update both locales and user guides. Refs: ThinkFlowLab#386, ThinkFlowLab#373 Signed-off-by: congw729 <115451386+congw729@users.noreply.github.com>
Verify shared drafts, references, viewport and running turn/job identity across modes. Cover bilingual and narrow layouts, keep a single narrow-screen chat entry, and adapt existing browser checks to the left chat region. Refs: ThinkFlowLab#386, ThinkFlowLab#373 Signed-off-by: congw729 <115451386+congw729@users.noreply.github.com>
Locate crop deselection and Markdown pan-to-fit gestures within the actual canvas region after chat moves to the left. Preserve the crop, resize, editor and persistence assertions; both browser scripts pass after reproducing the old out-of-bounds clicks. Refs: ThinkFlowLab#386, ThinkFlowLab#373 Signed-off-by: congw729 <115451386+congw729@users.noreply.github.com>
Keep project menus and new-project renaming focused when the default-open assistant finishes loading. Let focused menus handle Escape before staged references, and use visible canvas positions in interaction regressions. Add delayed-read coverage and retain the full timeline export and existing interaction assertions. Refs: ThinkFlowLab#386, ThinkFlowLab#373 Signed-off-by: congw729 <115451386+congw729@users.noreply.github.com>
## summary - Use descriptive bilingual choices on the welcome screen and short Chat and Canvas labels in the workspace toolbar. - Align the user guides and verify the visible and accessible labels in the first-run and workspace browser tests. Refs: ThinkFlowLab#386
## summary - Locate provider categories within the named navigation so the Chat workspace switch cannot match a settings action. - Use the same scope for the bilingual Kimi preset check.
## summary - Add session navigation to chat creation and let users float, move, and dock the same conversation while working on the canvas. - Group node types in one picker and keep created or focused content visible beside the floating conversation. - Update the workspace RFC, screenshots, bilingual guides, and browser coverage for the revised creation and navigation flows.
## summary - Bring in suggested replies and the pending timeline output edge fix. - Keep the chat sidebar instructions alongside the new suggested reply instructions in both user guides.
## summary - Keep both fixture nodes within reach after focusing generated video. - Hover the source and drag from its right port so the canvas toolbar cannot intercept the reconnect gesture at a guessed screen position. - Retain immediate reconnect and persisted reference identity checks.
## summary - Drag the separator right to widen chat and left to narrow it before checking that the suggested reply buttons wrap onto more rows.
## summary - Link each saved reply to its published files and completed jobs, including candidates, late results and deleted direct publications. - Preview the original asset, pin it to a draft, or locate its display item on the canvas while preserving the adopted generation result. - Document both languages and cover submission, recovery, downloads and narrow-screen canvas navigation with regression tests.
## summary - Keep the active input, selection, and timeline editor available across layout changes, including when a dialog has focus. - Import and reference project assets from chat and open the shared media or timeline editor by identity. Keep timeline receipts with their originating reply and reuse committed objects on retry. - Verify real MP4 playback, publication retries, and project reopening. Clarify the default dock, movable chat, and local editing in the RFC and user guides. ## validation - 972 frontend tests passed. Relevant backend suites passed 126 tests with one POSIX-only test skipped on Windows. - TypeScript, Vite production build, i18n, and browser manifest passed. - Verified both languages, mode switching, rendering, and local editing with an empty model catalog in Chromium. - All eight production switch timing cases met the RFC budgets. Refs: ThinkFlowLab#373, ThinkFlowLab#386
## summary Set the PNG fixture page locale explicitly, matching the measured workspace pages and the browser locale check. ## validation The browser locale and manifest checks passed. The production mode switch benchmark passed all eight cases with 80 recorded samples.
## summary Keep the workspace result and timeline hooks alongside the media model preference handler introduced in ThinkFlowLab#464. ## validation Compared with the previous PR integration tree, all six changed files have exactly the additions and deletions from ThinkFlowLab#464. The preference, workspace mode, and result tests passed (22 tests).
## summary Open chat in the navigation journey only when the workspace is ready and the toggle is collapsed. A visible toggle can already represent an open panel when the initial project finishes loading. ## validation The production navigation journey passed, including the configured video model ID in the next project turn after reload.
## summary - Connect the assistant before choosing a workspace. Let chat start immediately and require an image or video model for first canvas use. - Open project conversations from the chat header in both layouts. Let creators dock chat on either side using labeled icon controls. - Document the onboarding and docking flows in the RFC and both guides. Cover model eligibility, keyboard tooltips, and session continuity.
|
|
||
| export async function prepareProjectEditorItem(client: CreationClient, target: ProjectEditorTarget, center: () => Point) { | ||
| const item = resolveProjectEditorItem(client.snapshot, target); | ||
| if (item) return showExistingItem(client, item); |
There was a problem hiding this comment.
Opening Edit media from chat and closing it without edits reveals a hidden canvas item and bumps its revision from 3 to 4. Please open the editor without writing to the canvas and leave revealing the item to View on canvas.
There was a problem hiding this comment.
Retested at 74bb805 in English and Chinese. Opening and canceling Edit media kept the hidden item at revision 3 and left the project revision unchanged. Saving advanced the item to revision 4, undo to 5, and the explicit View on canvas action to 6. The assertions run in assistant_result_cards.mjs and the downloaded MP4 was playable.
| </header> | ||
| <div className="cw-settings-body"> | ||
| {canvasEntry && ( | ||
| <div className="cw-settings-notice"> |
There was a problem hiding this comment.
At 390 px in English, the first-time canvas notice overlaps Overview and partly clips Audio. Please place the notice above the model tabs and cover this width in the first-run browser test.
There was a problem hiding this comment.
Retested at 74bb805 with first_run.mjs in English and Chinese at 390 px and 1440 px. The notice sits above the category row. Every tab stays inside the settings panel and both Audio and Overview were clickable at 390 px.
| {(["agent", "canvas"] as const).map(mode => ( | ||
| <button key={mode} type="button" className={`cw-welcome-option cw-welcome-mode-${mode}`} | ||
| aria-labelledby={`${fieldGroup}-${mode}`} aria-describedby={`${fieldGroup}-${mode}-hint`} | ||
| onClick={() => mode === "canvas" ? navigate("tasks") : onEnterWorkspace("agent")}> |
There was a problem hiding this comment.
After connecting only a chat model, choosing Video → Add model opens the settings overview. Please carry the selected media category through to Model Settings so users land on the right tab.
There was a problem hiding this comment.
Retested at 74bb805 with composer_configure_model.mjs. With only a chat model configured, Video → Add model opens Model Settings with Video selected. The test checks the active category and the visible video setup action.
## summary - Open hidden and unplaced result media without changing canvas state. Reuse pending deliveries after a disconnect and preserve source, revision, lock and undo checks when the user saves an edit. - Keep the first-run notice above the model categories on narrow screens and carry the chat picker's media kind into settings. - Integrate main's project asset previews, prompt optimization, original trace export, turn timing and agent lease handling. - Exercise real stored media, model routing, undo, project switches and the assistant reply's original conversation in regression tests. ## validation - 1016 frontend tests passed. Targeted backend suite: 201 passed, four POSIX-only cases skipped on Windows. - TypeScript, production build, generated contracts, import layers, localization and browser manifests passed. - Ran the three review regressions, workspace modes, local editing and the two-provider prompt optimization flow in Chrome. Refs: ThinkFlowLab#380
## summary - Integrate project previews and editing handoffs into the workspace toolbar and shared timeline editor. - Let preview windows browse results and project assets. Guard edits, project imports and hidden-item placement across ownership changes. - Cover both windows with browser checks for previews, navigation and the project history after switching modes. ## validation - Production build, TypeScript checks and 1,016 Node tests passed. - Workspace modes, result cards, local MP4 editing and edit-session journeys passed in Chrome.
## summary - Integrate queued messages with per-turn file and timeline receipts. - Use the active project lease to dispatch an accepted follow-up after the browser switches projects. Release each turn's lease separately. - Verify both replies, their stored results and timing records after reopening the conversation. Reject new writes from the old browser. ## validation - 218 related Python tests passed. Four require a POSIX filesystem. - The assistant run navigation and workspace mode journeys passed against the production frontend and the local fixture backend.
|
@FayeSpica Thanks for catching these. Could you take another look at the three fixes in
|
|
@congw729 Seems need to resolve conflicts. |
…pace-modes-rfc # Conflicts: # src/canvas/workspace/WorkspaceView.tsx # tests/browser/manifest.json
…pace-modes-rfc # Conflicts: # apps/api/src/opendirector_api/agent.py # packages/core/src/opendirector/infrastructure/creation_commit_log.py # src/canvas/selectionPresentation.ts # src/canvas/useSelectionPresentation.ts # tests/browser/manifest.json
## summary Import the checked-in project JSON in the assistant result, creation job and media publication tests. Clone the fixture at each existing setup boundary so project edits stay local to that test setup.
## summary Hold the first conversation read across reload and check that the expanded panel keeps its composer locked until the draft arrives. Resume the request and check the restored text before working with the focused editor again.
|
@FayeSpica, could you recheck the three open review threads on
CI is green on this commit, and CodeQL reports zero new alerts. Release checks · Code scanning Maintainers, could you replace |
|
@congw729 PTAL |
…pace-modes-rfc # Conflicts: # src/canvas/CreationAssetList.tsx
## summary Expose the workspace switch inside open editors so creators can keep an unsaved crop or a rejected edit while moving between chat and canvas. Reuse the same control for timelines and document the switch in both user guides and the workspace RFC. Check in-flight reference uploads, render progress and published MP4 identity across both layouts. Exercise client-side asset filtering and preserve the original revision on an explicit editor save retry.
|
@FayeSpica Thanks for flagging the conflict. I merged Could you recheck the three items below on this revision and mark each conversation as resolved if it looks good?
|

Summary
Implement Create with chat and Create on canvas for #373 (item 5) and the design discussion in #386. The header labels are Chat and Canvas.
Linked issue
Labels
area:canvas,area:agent,area:timeline,area:i18nandarea:docs.Test plan
Current revision
46d8259bincludes upstreamb993743c. The asset list keeps main's client-side search, paging and background refresh together with chat's import, reference and timeline actions. The bilingual guides now show how to switch in an open editor.ffprobe, decoded frames, audio level and a second export after restarting the isolated service were checked.All 14 GitHub checks passed for
46d8259b. Code scanning found no new alerts in the changed code. Workflow results: Release checks, Desktop checks, DSH plugin checks, and CodeQL.Mode-switch performance
All eight cases met the RFC budgets on
46d8259b: first visible feedback P90 ≤ 100 ms, usable median ≤ 500 ms and usable P90 ≤ 1,000 ms. The closest result was the first switch from Chat to Canvas with 12 images. The canvas was usable in 488.05 ms at the median (11.95 ms below budget) and 509.3 ms at P90. Repeating that switch in the same page took 14 ms at the median and 14.3 ms at P90. RFC §8Measured on Windows 11 Pro (build 26200), Intel Core Ultra 7 265K, headless Chrome 158.0.8127.88, 1700 × 1100, with a production build and isolated API on localhost. The empty project had no assets. The media project had 12 distinct 512 × 512 PNGs (7,552,226 bytes total), each imported and bound to a visible canvas item. No model calls were needed.
Each case had 30 samples (240 measured switches). First starts with the source mode already usable in a fresh browser context and measures the first click into the destination. Repeat measures the same destination after switching back in the same page. Both timers start at the trusted click. Feedback requires the selected mode button to be visibly active and clickable. Usability requires the chat input or canvas add button to be clickable and, on canvas, all expected image previews to be loaded. P90 uses nearest rank (the 27th of 30 sorted samples). Benchmark script
Per-switch readings (ms)
Each cell contains feedback / usable time, rounded to 0.1 ms. Sample numbers follow collection order within each case.
Previous verification
The merge at
74bb805bincludes upstream6e0b22ad.Frontend: 1,052 tests passed. TypeScript, the production build, 3,498 bilingual catalog keys, browser locale pins, the browser manifest and generated API contracts passed.
Backend: 200 tests passed, seven skipped on Windows. The five suites cover conversation state, turn traces and timing, queuing, history and storage. A deterministic publication test verifies that the current conversation and list remain readable while an overlapping draft write returns
409 storage_busy.Nine Chrome suites passed:
workspace_modes,first_run,assistant_turn_timing,assistant_result_cards,composer_configure_model,chat_local_editing,prompt_optimizer_workspace,canvas_composer_placementandcreated_node_focus. The last two exercised Vite's development-only browser imports. The production preview was used for the other seven.Review cases: opening and canceling Edit media preserved the hidden item's revision and the project revision; explicit reveal still selected the same item. The first-canvas notice cleared the model tabs at 390 px in English, and Video → Add model selected the video category. In a 1000 × 680 desktop window with both sidebars open, the node composer ended at y=602 with a 16 px gap below its node.
The prompt optimizer test synthesizes MP4 and WAV bytes in memory, targets a loopback service and rejects redirects. Browser checks cover three extracted JPEG frames, original media bytes, undo and isolation of delayed responses. A separate localhost redirect check verified that its destination received zero requests.
At
97f16a80, the result-card, media-publication and job tests load their fixed project fixture as JSON modules. All 23 focused tests, all 1,052 frontend tests and TypeScript passed. The local CodeQL 2.27.6 differential scan found zero results forjs/file-access-to-http. The GitHub code scanning check for that commit reports no new alerts and zero annotations.At
0999b2f8, the created-node focus regression holds the conversation read across a reload. It checks that the panel stays open while the composer is locked and that the persisted draft reappears before editing. The former test closed the panel when that read was slow. The corrected case passed three consecutive Chrome runs, and project switching also passed.All four workflows passed on
0999b2f8. The Release Python suite had 3,168 passed and 119 skipped, and all three browser jobs passed. Release checks, Desktop checks, DSH plugin checks and CodeQL. Code scanning reports zero new alerts.Earlier revisions also passed session switching, keyboard shortcuts, canvas manipulation, timeline editing and MP4 export with real file probes. The download checks verified duration, dimensions, frame order, audio and reopening the project. The earlier Release checks and CodeQL run passed at
30085b7b. An additional non-gatemulti_selection_referencesrun on macOS previously failed.Evidence that it works
These 1440 × 900 captures use the same example project, repository video stills and fixture assistant replies.
RFC and acceptance criteria.
Provider verification
The isolated project API used fixture assistant and generation providers, a loopback prompt-rewrite service and locally generated media. Project persistence, model selection, media bytes, local editing and browser output were exercised. No paid provider calls or creative-quality assessment.
Bilingual UI
zh-CNanden-US. Both layouts were exercised in Chrome in both languages.