Conversation
stijnpotters1
left a comment
There was a problem hiding this comment.
Ik zie dat je import { subscribeWithSelector } from 'zustand/middleware' gebruikt en hierin een eigen undo redo maakt.
Ik zie dat er een aparte undo redo middleware library voor zustand is.
https://github.com/charkour/zundo
Wellicht kan je dit bekijken om te kijken of dit niet een betere oplossing is?
| if (isCmdOrCtrl && event.key.toLowerCase() === 'z') { | ||
| event.preventDefault() | ||
| // Redo if Shift is also pressed, otherwise undo | ||
| if (event.shiftKey) { | ||
| useFlowStore.getState().redo() | ||
| } else { | ||
| useFlowStore.getState().undo() | ||
| } | ||
| } | ||
|
|
||
| // Or redo with Cmd/Ctrl + Y, which is common on Windows | ||
| if (isCmdOrCtrl && event.key.toLowerCase() === 'y') { | ||
| event.preventDefault() | ||
| useFlowStore.getState().redo() | ||
| } | ||
|
|
||
| if (event.key === 'g' || event.key === 'G') { | ||
| event.preventDefault() | ||
| handleGrouping() |
There was a problem hiding this comment.
Is this the only component looking for key or mouse events?
I'm thinking that maybe having an overarching system to manage key and mouse event handling could be nice since a lot of repetition might happen if this is used in multiple components
I can elaborate further but maybe its better to make an issue and let it be like this for this PR, if you agree with me here
|



Uh oh!
There was an error while loading. Please reload this page.