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] Drag-n-drop entire pod/scope #439

Merged
merged 7 commits into from
Aug 11, 2023

Conversation

senwang86
Copy link
Collaborator

Summary

  • Drag-n-drop the entire pod by dragging anywhere within the pod
  • "Double click" to enter Edit mode.
  • Bug: Monaco editor's cursor can't be hidden in CMD mode

Test

move_pod_no_drag_handle

@senwang86 senwang86 requested a review from lihebi August 10, 2023 18:23
@lihebi
Copy link
Collaborator

lihebi commented Aug 10, 2023

Nice! A few issues:

  1. In Edit mode, we should disable dragging, so that we can move cursor or select text.
  2. In Edit mode of the Rich pod, I cannot chick to move the cursor or select text. This is related to 1.
  3. There's a console warning that seems to be a rendering dependency issue.
Screenshot 2023-08-10 at 12 46 03 PM

@senwang86
Copy link
Collaborator Author

Nice! A few issues:

  1. In Edit mode, we should disable dragging, so that we can move cursor or select text.
  2. In Edit mode of the Rich pod, I cannot chick to move the cursor or select text. This is related to 1.

Nice catch, 136479f fixed 1 and 2.

  1. There's a console warning that seems to be a rendering dependency issue.
Screenshot 2023-08-10 at 12 46 03 PM

It says that certain changes in Rich.tsx breaks different components(RepoImpl, SyncStatus, etc) occasionally, but I didn't figure out the reason yet.

@lihebi
Copy link
Collaborator

lihebi commented Aug 11, 2023

Cool. I'll examine the console warning and the Monaco editor's cursor issue.

@lihebi
Copy link
Collaborator

lihebi commented Aug 11, 2023

Fixed a few issues.

  1. we need to show some visual differences when a pod is selected
  2. fix the Monaco cursor & selection using an overlay.
    • Note: This not only "hides the cursor"
    • but also makes the code pod "selectable".
      • E.g., it is now possible to (a) click on a rich pod, (b) hold , then (c) click on the code pod. It wasn't possible without this overlay.
  3. the console warning is caused by editable=fasle not compatible with YjsExtension
  4. avoid un-needed moveIntoScope (there were console warnings)

@lihebi lihebi merged commit b5b7f9c into codepod-io:main Aug 11, 2023
@lihebi
Copy link
Collaborator

lihebi commented Aug 11, 2023

Fixed a few issues.
2. fix the Monaco cursor & selection using an overlay.
3. the console warning is caused by editable=fasle not compatible with YjsExtension

It turns out that editable=false+selectively load YjsExtension solution will prevent Yjs from syncing. Now I'm using the same overlay in both code & rich pods. See commit f4d9892 in #440

@senwang86 senwang86 deleted the drag_n_drop_whole_pod branch September 7, 2023 22:01
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