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

mo.ui.code_editor UI improvements #2921

Open
liquidcarbon opened this issue Nov 21, 2024 · 3 comments
Open

mo.ui.code_editor UI improvements #2921

liquidcarbon opened this issue Nov 21, 2024 · 3 comments

Comments

@liquidcarbon
Copy link
Contributor

liquidcarbon commented Nov 21, 2024

This is most useful for using Code Editor cells in marimo run (app) mode. Alternative could be making SQL cells available outside marimo edit.

sql_editor = mo.ui.code_editor(
    language="sql",
    value=placeholder,
    # min_height=5,         <- 1. this does not do anything
    # debounce=True,        <- 2. new feature requested
    # tab_moves_focus=True  <- 3. new feature requested
)
sql_editor = sql_editor.form(label="### SQL Editor")  # <- 4. on hitting submit (Ctrl+Enter), new line should not be created in editor
  1. height option doesn't seem to have an effect
  2. debounce requested, like in mo.ui.text
  3. currently Tab changes indentation; with this option, Tab would move focus out of the editor; when debounce=True this would effectively run a query
  4. If using code editor in a form, Submit can be activated by Ctrl+Enter, but it also creates a new line in the editor.
@liquidcarbon
Copy link
Contributor Author

Illustration of app-mode SQL editor

Image

@mscolnick
Copy link
Contributor

@liquidcarbon - min_height is "minimum height of the code editor in pixels". it works fine for me. 5 is too small for a single line

for the other feature requests, would you be interested in contributing those? i think they are great ideas

@liquidcarbon
Copy link
Contributor Author

Aaaah, I didn't even consider the unit of measure - I assumed it height means number of rows, which is how they have it in Gradio.

Alas I have zero experience with TS, so I'll defer to the experts :)

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

No branches or pull requests

2 participants