codepod-io / codepod

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

[UI] Drag-n-drop entire pod/scope #439

Closed senwang86 closed 1 year ago

senwang86 commented 1 year ago

Summary

Test

move_pod_no_drag_handle

lihebi commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

lihebi commented 1 year ago

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 commented 1 year ago

Fixed a few issues.

  1. fix the Monaco cursor & selection using an overlay.
  2. 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