feat(canvas): add targeted design revisions - #709
Open
beruro wants to merge 4 commits into
Open
Conversation
beruro
marked this pull request as ready for review
August 6, 2026 10:40
…n-revisions # Conflicts: # src/engines/ChatPanel/ChatHistory/components/__tests__/UserMessageContent.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Canvas follow-up edits currently make the agent regenerate and resend the full Canvas source before the UI shows useful progress. Even small copy changes can therefore take minutes, and the existing flow does not preserve a clear logical relationship between the original Canvas and its revision. The Canvas Design composer also needs to reuse the shared inline pill/composer treatment, and completed revision activity needs to navigate back to the corresponding Canvas without overflowing narrow chat rows.
Solution
Add a complete Canvas Design revision lifecycle:
InputArea;revise_inline_canvaswith a required same-sessiontarget_event_id;editsfor localized changes while retaining complete replacement payloads for structural changes;agent_stepsin the user's language, persist them with the revision event, and derive completion/failure only from the real tool lifecycle; legacy events without valid steps omit the list instead of synthesizing a fixed template;Potential risks
The change spans the Rust tool contract, persisted event projection, streaming UI state, and shared composer presentation. Compact revision ancestry is deliberately bounded to 32 events, and malformed/stale patches preserve the last valid Canvas instead of applying partial content. Agent step metadata is bounded to six labels of 80 characters each; malformed metadata is rejected for new calls and omitted defensively during legacy replay. No schema migration or persistence-format rewrite is introduced; rollback is a normal revert of this commit.
Real Tauri visual verification could not be repeated from the isolated browser surface because it cannot initialize without the desktop sidecar. Component/DOM behavior and the user-provided implementation screenshots were reviewed, but a final desktop recording remains an explicit review gap. GitHub full-repository Clippy and frontend CI were still running when the PR was marked Ready; their results remain required before merge.
Audit
ResizeObserver, andrequestAnimationFrame; cleanup removes listeners, disconnects the observer, cancels the frame, and tolerates remounts. Existing unrelated Effects were not expanded.Verification
Completed during clean-branch assembly before the non-overlapping
developrebase:pnpm typecheck— passed.Completed after rebasing onto latest
develop:git fetch origin developand ancestry check — branch based on the latest target; the six incoming commits touched no PR file.git diff --check origin/develop...HEAD— passed.node_modulesis not tracked.Follow-up verification after the Agent-step and overflow fixes:
agent_coreClippy.origin/developatbbc207c8fe6e592660d4bc478afac428eacce54f; resolved the singleUserMessageContent.test.tsconflict by retaining both Canvas pill and current reference-interaction coverage.pnpm typecheck— passed.git diff --check origin/develop...HEADand focused secrets/debug-output scan — passed; final PR scope remains 81 Canvas lifecycle files.Not completed:
GitHub CI status at Ready transition: AI-attribution check passed; full Rust Clippy was running and full frontend typecheck/lint/test was queued.