codepod-io / codepod

Codepod IDE: Scalable Interactive Coding
https://codepod.io
MIT License
74 stars 15 forks source link

[UI] Edit cmd mode patch #431

Closed senwang86 closed 1 year ago

senwang86 commented 1 year ago

Summary

PR #398 introduced CMD mode, and issue #418 and #420 reveal some improvement and bugs.

Test

CMD_mode_patch

lihebi commented 1 year ago

Thanks, this works well to fix #420.

Do you plan to merge selectedPods and cursorNode in the next PR? I think jumping around should change the selected nodes.

senwang86 commented 1 year ago

Thanks, this works well to fix #420.

Do you plan to merge selectedPods and cursorNode in the next PR? I think jumping around should change the selected nodes.

Yes, I plan to have a following PR. I think it's cleaner to use different states for "single-selection" and "multi-selection"; and "multi-selection" could be achieved through keyboard shortcut, say pressing SHIFT+ArrowUP|Down|Left|Right.

An array-based selectedPods can also handle the "single-click" well (by always taking selectedPods[-1]), without bringing in a new state variable.

lihebi commented 1 year ago

SG, thanks!