cli icon indicating copy to clipboard operation
cli copied to clipboard

Redesign `chain serve` output with bubbletea

Open ivanovpetr opened this issue 3 years ago • 1 comments

Since we now plan to start using: https://github.com/charmbracelet/bubbletea, I believe we can benefit from the refreshing feature (I don't know the exact name for it).

For ex, right now when there are changes in the files, the serve command will print the logs related to rebuilding the binary, proto, installing dependencies etc. again and again:

💿 Saving genesis state...
💿 Genesis state saved in /home/gitpod/.ignite/local-chains/mars/exported_genesis.json
🛠️  Building proto...
📦 Installing dependencies...
🛠️  Building the blockchain...
💿 Existent genesis detected, restoring the database...
🌍 Tendermint node: http://0.0.0.0:26657
🌍 Blockchain API: http://0.0.0.0:1317
🌍 Token faucet: http://0.0.0.0:4500

Instead of reprinting all these on every change, we can show a spinner and/or refresh the current text instead of reprinting it again which makes the serve command more pleasant to use.

We could also use something like this for the c serve command, please run the example to see: https://github.com/charmbracelet/bubbletea/tree/master/examples/send-msg

Something like this when refreshing:

image

And following when app is running (but we also need to print the accounts/mnemonics):

image

For this we can also use some sort of a table too to display accounts and mnemonics and server addresses. See all the examples here. And glamour

Originally posted by @ilgooz in https://github.com/ignite-hq/cli/issues/2420#issuecomment-1120458674

ivanovpetr avatar May 10 '22 07:05 ivanovpetr

We previously had good ideas about improvements of chain serve UX in https://github.com/ignite-hq/cli/issues/1079

ivanovpetr avatar May 10 '22 07:05 ivanovpetr