feat(canvas): delete a canvas with a confirm and an undo window - #3895
Draft
adamleithp wants to merge 1 commit into
Draft
feat(canvas): delete a canvas with a confirm and an undo window#3895adamleithp wants to merge 1 commit into
adamleithp wants to merge 1 commit into
Conversation
The canvas "…" menu had no way to delete; the canvases grid had one that deleted on click with no confirmation. Both now open an alert dialog, and confirming doesn't delete straight away: the canvas is marked pending and the host isn't told until the "Deleted artifact" toast's timer expires, so Undo simply cancels the timer rather than recreating anything. Pending canvases stay in their lists — the artifacts row swaps its template icon for a pulsing trash can and stops opening, the grid card dims behind the same icon — so undoing restores them in place. The commit runs outside React (module-level timer + hostClient) because deleting from inside a canvas navigates away immediately. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
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.
What
Adds Delete… to a canvas's
…menu (it had none), and puts both delete paths behind a confirm dialog + an undo window.Screen.Recording.2026-07-28.at.19.41.59.mov
…menu and the canvases-grid card menu now open a quillAlertDialog("Delete canvas") instead of deleting on click — the grid one used to delete immediately, no confirmation.hostClient) so it survives that unmount.deleteis only tracked when it actually commits; a cancelled one tracks the newdelete_undoaction type.Files
deleteCanvasWithUndo.ts— the undo window: mark pending → schedule commit → toast with Undo. Re-deleting the same canvas restarts the window instead of stacking commits.stores/pendingCanvasDeleteStore.ts— state-only zustand map of ids inside their window.WebsiteLayout.tsx,WebsiteDashboardsIndex.tsx,WebsiteChannelArtifacts.tsx— menus, dialogs, deleting state.useDashboards.ts— exposesinvalidateDashboardsfor the out-of-React commit.Testing
4 unit tests in
deleteCanvasWithUndo.test.ts(defers the send, undo cancels outright, failure restores + toasts, re-delete restarts). Full@posthog/uisuite passes (2303).Manually:
…→Delete…→ confirm → row stays with a pulsing red trash icon and "Deleting…", click does nothing → Undo → back to normal in place.🤖 Generated with Claude Code