fix: v2 - proper undo for del action on canvas#2194
Merged
maxy-shpfy merged 1 commit intoMay 7, 2026
Conversation
🎩 PreviewA preview build has been created at: |
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
5522bd8 to
5a1f6ef
Compare
8 tasks
This was referenced May 4, 2026
Collaborator
|
I'm curious the motivation to skip over ReactFlow's built-in deletion and make our own custom logic? |
5a1f6ef to
4b8814b
Compare
Collaborator
Author
|
@camielvs fair question. I explored the option. it is doable via |
4b8814b to
11e9a88
Compare
Mbeaulne
reviewed
May 7, 2026
Mbeaulne
reviewed
May 7, 2026
Mbeaulne
reviewed
May 7, 2026
11e9a88 to
90ed331
Compare
Mbeaulne
approved these changes
May 7, 2026
Collaborator
Author
Merge activity
|
90ed331 to
0b64883
Compare
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.

Description
Closes https://github.com/Shopify/oasis-frontend/issues/609
Delete and Backspace key handling for the canvas has been moved out of ReactFlow's built-in
deleteKeyCodeprop and into a dedicateduseCanvasDeleteShortcutshook. This gives full control over deletion logic, allowing mixed selections of nodes and edges to be deleted together in a single undo group.The
useNodeEdgeChangeshook no longer handlesremove-type changes from ReactFlow — those change events are now filtered out entirely, preventing ReactFlow from triggering its own deletion path. Instead,useCanvasDeleteShortcutsdrives all deletion through the editor's action layer, correctly handling conduit metadata cleanup (stripBindingIdsFromConduitMetadata) and undo grouping.deleteSelectedNodesCorehas been extracted fromdeleteSelectedNodesto allow node deletion to be composed with edge deletion inside a shared undo group.edgeIdToBindingIdandremoveBindingsAndStripConduitshave been introduced to consolidate edge-to-binding resolution and conduit cleanup.DELETEandBACKSPACEkey constants are now exported fromkeys.tsfor use in the new hook.Related Issue and Pull requests
Type of Change
Checklist
Screenshots (if applicable)
Screen Recording 2026-05-03 at 4.35.52 PM.mov (uploaded via Graphite)
Test Instructions
DeleteorBackspace— nodes should be removed and the action should be undoable as a single step.DeleteorBackspace— edges and their associated bindings should be removed, with conduit metadata cleaned up.Additional Comments
The
actions.tsbarrel file has been marked with atodo: remove this filecomment anddeleteEdgehas been removed from its exports as part of the ongoing cleanup of the action layer.