accord
accord copied to clipboard
Implement a TUI client using console_engine
Hello !
I wanted to try to implement the TUI client of Accord using my own crate console_engine.
It's more of a "proof-of-concept", so I won't mind if you close this PR right away.
Feel free to comment my code if you see anything wrong, I'm still learning the language so any comment is appreciated.
Here's a changelog of what this PR changes :
🆕 Features
- used console_engine to implement a TUI client for Accord
🐞 Bugfixes
- Fixed Windows terminals sending
\r\nas Enter key instead of the expected\n
📋 Todos (for later)
- ~Implement login with the TUI crate~
- ~Implement auto scrolling~
- ~Allow moving the text cursor~
- ~handle more keyboard keys (home, end, del, ...)~
I fixed the issues, and also resolved conflicts.
I'm working on implementing the rest of the todolist, I'm changing this PR to a draft.
Thanks for your review !
I just finished implementing my todolist into this PR, I hope I haven't made too much of a mess, moving all this code around and writing some cryptic code like in Message::print() where I "enabled" text_wrapping by inserting \n in messages (console_engine only handles text wrapping when we try to print \n characters).
Thanks for the review ! I'll look into it in detail later.
All this motivated me to implement Forms into my TUI crate directly, to simplify the code here but also allow everybody to have access to this kind of input in their own application. I'd be glad if one day you could review the PR out (when I'll be done with it), you've given me some precious advice and I truly appreciate the time you take to help me. Thank you !
I finally finished my PR to add forms directly into the TUI crate, adding more features like checkboxes and radios, validation...
If you ever feel like taking a peek at the code, it's here.
Once the PR is merged (in a day or two, in case of someone wanting to review), I'll work on cleaning this mess up once and for all 🙂
Sorry for the late reply 😅 I got kinda busy and forgot about this. I can take a look at that PR tomorrow.
No worries about this, take your time and thanks a million for your help on this 😄 If you don't have time to check it it's also fine.
I'm on my way to adapt my work here to the future release, by the way. It's looking cleaner for sure 😉
Hello ! Since I released console_engine version 2.4.0, I updated my code here to use the new features. I used clap to manage parameters (like address and port of the server)
I also took the freedom to change colors of the terminal, to mimic the GUI version
Let me know if you see anything I should change