Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting selecting multiple cells and move them all at once #112

Closed
forrestbao opened this issue Dec 1, 2022 · 5 comments · Fixed by #125
Closed

Supporting selecting multiple cells and move them all at once #112

forrestbao opened this issue Dec 1, 2022 · 5 comments · Fixed by #125

Comments

@forrestbao
Copy link
Collaborator

I am using DeepNote. Horrible to use. I can only move one cell each time. This is killing me.
We shall allow selecting multiple cells and move them together.

In addition, can we support grouping cells/pods? Then we move them as a whole. This is like grouping in PPT.

@li-xin-yi
Copy link
Collaborator

li-xin-yi commented Dec 6, 2022

In fact, Reactflow have already supported multi-selection (see xyflow/xyflow#609), in our current version CodePod, a user can try it in two ways:

  1. Press Shift, use the mouse to draw a rectangle area covering those pods you want to select, like what we often do to choose multiple files on a Windows desktop, then you can drag them together.

image

  1. Select one pod, press the meta key on your keyboard (for my Windows OS, that is the Win key, I don't know the corresponding key on MacOS, maybe ⌘ Command, @lihebi can you do me a favor to confirm that?) and click on another pod at the same time, then you can drag the both two pods together.

I can change the shortcut if you feel uncomfortable with those keys (yes, I also hate win key, which toggles the windows menu), or we can discuss how to group pods in a more flexible way, for example, assigning them with customized tags and then dragging on the tag?

@lihebi
Copy link
Collaborator

lihebi commented Dec 6, 2022

Option 1 works, but you have to drag over the entire node to select it. Not the best experience.

Option 2 sounds better to me. It is the⌘ Command key on mac. But this only works on React Flow nodes (on their website), not our Code/Scope nodes. I guess we need to set some "selected" property.

@forrestbao
Copy link
Collaborator Author

I prefer the shift way. Maybe we can even add the ctrl way where you can select without a box.

@lihebi
Copy link
Collaborator

lihebi commented Dec 7, 2022

@forrestbao If you try option 1, you won't like it. You have to drag over the entire node to select it.

I propose to disable option 1, and re-use the shift key for option 2. Because

  1. The ctrl key does not work on mac, and the meta key does not work on windows. The shift key seems to be the best choice.
  2. But the shift key can only be used in either option 1 or option 2, not both (v10 multiSelectionKeyCode? xyflow/xyflow#2208 (comment)).

@li-xin-yi
Copy link
Collaborator

@lihebi I can check the OS first and then bind the hotkey if you need. Shift method may be hard to implement when considering the single-parent rule because almost all nodes are selected at the same time, I can't determine which node to drop if the rule is violated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants