Skip to content

[UI] Edit cmd mode patch#431

Merged
lihebi merged 2 commits into
codepod-io:mainfrom
senwang86:edit_cmd_mode_patch
Aug 4, 2023
Merged

[UI] Edit cmd mode patch#431
lihebi merged 2 commits into
codepod-io:mainfrom
senwang86:edit_cmd_mode_patch

Conversation

@senwang86

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

lihebi commented Aug 4, 2023

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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

lihebi commented Aug 4, 2023

Copy link
Copy Markdown
Collaborator

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