Did you make that TUI? Why? What does the TUI do? I've written TUIs using that framework before (assuming it is dialog) and the file browser I don't like, so I always end up making my own file pickers for it.
What I would do if I needed a typewriter like device, to not be detracted by, pooh shiny thing.
I would want a bigger screen, the pi400 looks like a great choice, I agree that a mechanical keyboard would be better but what is more important, having everything in one unit, or having better parts?
What about just using an older laptop, if you have one. Install Linux, any flavor, I see you are comfortable with raspbian, so Debian, Ubuntu, mint etc should make you feel right at home. Most any other option is also fine, like fedora, or arch Linux if you want a little bit torture, or nixos if you want more pleasure and torture.
Any hardware you ended up with, any distro you ended up with. Just delete all apps that are not for your one specific need. Including the web browser!
Any desktop environment should be okay, as long as you remove all apps not for let's say writing and file management. Optionally switch to a window manager, like i3wm, sway, or hyprland (hyprland is the first thing I've recommended thus far I haven't used extensively), to make it feel more like a focused machine!
Optionally, if your text editor is terminal based (like mine, I use vim or neovim), if it helps you focus even more, just disable the display manager (the login program) so you log right into the tty. The main drawback over using a window manager like sway and a nice terminal emulator like kitty or Ghostty, is that you can't view images or all nice effects in let's say neovim. But this might be a plus in the end. If you don't need emojis.
A bonus tip! If you continue with your setup like you do right now, or if you chose a window manager, or just straight tty. Use udisks / udiskie to auto mount USB drives, similar to how KDE or gnome does it.
Also for file manager i now use yazi, it's in the terminal, will work in tty or a terminal in a desktop or window manager. There are just a couple of things I miss from my old file manager I used before called ranger, but yazi is much faster and light weight.
Also maybe use ssh to copy over your files? If you want to have network access, maybe network access is a bad idea