codepod icon indicating copy to clipboard operation
codepod copied to clipboard

Command mode and edit mode

Open forrestbao opened this issue 3 years ago • 7 comments

Jupyter/VIM has two modes, Edit/Insert mode and Command mode (ESC+:). We should support both too? In command mode, we can change the interpreter (Python, Markdown, Shell) and in edit mode we edit the code.

forrestbao avatar Nov 24 '22 05:11 forrestbao

Yes, we should have this. Further, when a pod is not in edit mode, we should be able to use anywhere on the pod as the handle. @nibilin33 maybe you can help on this?

As for changing interpreter, let’s do a toolbar button instead. I’ll handle this. We can have the VIM keyboard binding later in another issue/PR.

lihebi avatar Nov 26 '22 08:11 lihebi

what...add a button to change the interpreter in the toolbar?

nibilin33 avatar Nov 27 '22 14:11 nibilin33

Yeah, after a second thought, we don’t need to change the interpreter for a pod. We can just create different types of pods at the beginning (Python, shell, markdown, other languages).

lihebi avatar Nov 27 '22 15:11 lihebi

Where do you want to let users select the types of pods? @lihebi

forrestbao avatar Nov 27 '22 21:11 forrestbao

In the right click context menu? In Jupyter, users also choose to create markdown or code cells at the beginning.

lihebi avatar Nov 28 '22 20:11 lihebi

In Jupyter or VSCode's Jupyter, you can edit the type of a pod, code to markdown or back.

I am against using right clicks. It's not explicit. Maybe just an icon in the toolbar of a pod? Associate a shortcut key with it. (It's hard to do on laptop touchpads. It's not touch-friendly. And it requires users to keep mind that there are two kinds of clicks. )

One thing we need to keep in mind in advance is that we will support mixed runtimes/kernels in one repo. So our switch is not binary (code of only one language and Markdown) as in Jupyter but multi-class (e.g., Python, Markdown, and bash).

forrestbao avatar Nov 28 '22 22:11 forrestbao

The toolbar sounds good. For touch screen, the user could long press the pod, and pop up some bigger buttons. E.g., this is tg's UI:

lihebi avatar Nov 30 '22 18:11 lihebi