feat: Add "clear canvas" functionality#23
Open
hayzedd2 wants to merge 3 commits into
Open
Conversation
|
@hayzedd2 is attempting to deploy a commit to the Akinkunmi Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/src/components/scene-editor.tsx">
<violation number="1" location="frontend/src/components/scene-editor.tsx:1295">
P2: `clearCanvas` does not reset `textEditingId`, leaving stale edit-mode state after deleting all objects and causing behavior like blocked paste until edit mode is cleared.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
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.
Overview
Added a "Clear Canvas" button to the editor header. This gives users a quick way to wipe their workspace clean and start a new design without manually deleting every object.
Changes Made
New
clearCanvasLogic:-Added a function to the scene editor that resets the objects array to empty and clears any active selection focus.
New Component:
EditorClearCanvas(editor-clear-canvas.tsx):onClearCanvascallback via props that executes the actionIntegration in
create.tsxlayout:<EditorClearCanvas />component in the application header.onClearCanvascallback to invokeeditorRef.current?.clearCanvas().How to test
Summary by cubic
Add a Clear Canvas button to the editor header so users can wipe all objects and selections in one click. It also exits any active edit mode to prevent stuck text edits.
EditorClearCanvascomponent with consistent styling and a refresh icon.clearCanvas()toSceneEditorHandleto emptyobjects, clear selection, and end text editing.create.tsxheader, wired toeditorRef.current?.clearCanvas().Written for commit 8062d76. Summary will update on new commits. Review in cubic