TUI is done, tsk is live
So last time I had the CLI working. Today I finished the TUI and shipped the whole thing.
Getting ratatui going was interesting. It doesn’t work like anything I’ve done before. Instead of just printing stuff, you’ve got a loop that redraws the whole screen every time you press a key. You also have to set up and tear down the terminal manually. If you don’t, your terminal just breaks after you exit. Took me a second to get my head around it but once it clicked it made sense.
The TUI has two modes, Normal and Adding. Normal is where you scroll around and do things to tasks. Adding turns the bottom bar into a text input where you type your task and hit Enter. I think using enums for that was pretty clean.
I added two things that weren’t in the original plan. A reset command that wipes everything and brings the IDs back to 1, and making the done button a toggle instead of one way. The toggle was annoying, but in the end it worked out fine. The problem was that I forgot to update the function’s name to the updated one. Small thing but it tripped me up.
After that, I published to crates.io as task-manager-kotter (tsk) because task-manager was already taken. Then I set up GitHub Actions to build binaries for Linux, Windows, and Mac automatically when I push a tag. Hit a permissions error first try, so I had to go into the repo settings and flip on read/write for workflows. After that I programmed the yml file wrong, so it would merge the binaries instead of having them seperate. I fixed that, and it worked, all three binaries showed up in the release.
What’s working
- Full TUI with scrolling, adding, toggling, deleting, and resetting
- cargo install tsk works
- Prebuilt binaries on GitHub Releases for all three platforms
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.