quackduck / devzat

The devs are over here at devzat, chat over SSH!
MIT License
3.7k stars 136 forks source link

Better input system #138

Open Arkaeriit opened 1 year ago

Arkaeriit commented 1 year ago

The input in Devzat is quite poor. The fact that it is not possible to comfortably edit multi-lines messages is a bit sad. We should probably refactor that system. Maybe there are some external library to handle that kind of tasks.

quackduck commented 1 year ago

By edit, do you mean before sending or after sending?

Arkaeriit commented 1 year ago

Before sending message. The editing of the first line works well, but once a new line is inserted by line warping, it becomes impossible to edit the first line.

quackduck commented 1 year ago

huh, that doesn't happen for me. what terminal are you using?

Arkaeriit commented 1 year ago

I have this problem on Konsole, Alacritty, and st.

Arkaeriit commented 1 year ago

image What I get when I try to add some text at the beginning of a multi-line message.

quackduck commented 1 year ago

here's an asciinema of what I see: https://asciinema.org/a/1dhK4SCMVSAnm8l6FFBdvxtcZ

(unrelated but this shows the line counting algo is broken)

could you send an asciinema of what you see?

Arkaeriit commented 1 year ago

You can see it here.

When you use the raw cast file, if the terminal window is wide enough, it looks normal. But when it is the proper size, it looks like what I had, which is very funky. I thik the issue comes from the fact that Devzat does not try to handle multiple lines and move the cursor around when editing a message. I saw the issue #140 and the related code and it doesn't look like the code can handle all cases.

quackduck commented 1 year ago

Wow um yeah input is really jank lol

Arkaeriit commented 1 year ago

I looked at potential solutions and Bubbles' textinput looks like a pretty decent solution for us. Do you think I should look into integrating it?

Arkaeriit commented 1 year ago

After looking at Bubble Tea, it seems that the inputs are very abstracted. Thus, getting the inputs from the user might be tricky. Bubble Tea might not be the solution to our problem.

quackduck commented 1 year ago

I see