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

[UI] Edit cmd mode patch #431

Merged
merged 2 commits into from
Aug 4, 2023
Merged

Conversation

senwang86
Copy link
Collaborator

Summary

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

  • For Keyboard shortcuts for jumping around #418,
    • To go into a scope, the key combination is adjusted to SHIFT + ArrowDown
    • To go to a parent scope, the key combination is adjusted to SHIFT + ArrowUp
  • For Incorrect pod selection with "Drag Handler" clicking #420, the reason is that useJump() uses selectedPods to choose the from node, while in a multi-selection scenario, selectedPods contains more than 1 node. As a workaround, a new state variable cursorNode is added for a single node selection.
    • The toolbar pops-up while jumping to a node
  • Misc
    • On a code pod, pressing SHIFT+Enter will run the pod
    • On a scope, pressing SHIFT+Enter will run the scope

Test

CMD_mode_patch

@senwang86 senwang86 requested a review from lihebi August 4, 2023 06:57
@lihebi
Copy link
Collaborator

lihebi commented Aug 4, 2023

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
Copy link
Collaborator Author

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
Copy link
Collaborator

lihebi commented Aug 4, 2023

SG, thanks!

@lihebi lihebi merged commit b77c374 into codepod-io:main Aug 4, 2023
@senwang86 senwang86 deleted the edit_cmd_mode_patch branch August 8, 2023 18:34
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 this pull request may close these issues.

2 participants