-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update gocui #94
Update gocui #94
Conversation
Thanks for the good work !
|
Right, it happens if the routing view is empty. My node gets routing attempts every few seconds so I think it was never the case but I can reproduce if I switch immediately after start. I think the same would happen with the channels view if it's empty. The new column views need to be initialized, it's also a good opportunity to move some properties initialization there instead of doing it on every render. |
Should work now! |
Thanks it is working better, but there is still a minor problem: My guess: every occurrence of |
Hmm, that's odd. I don't quite understand what "Menu > ROUTING > TRANSACTION" means, |
Sorry, I meant: I click on
|
I can't reproduce it. Does it happen with your mainnet node or some Polar setup? I created an empty network in Polar with just one bitcoind and one lnd, connected to it and I can switch between the views normally. They're all empty of course, but the program doesn't exit. Maybe your working tree isn't clean or something else is wrong locally? Incomplete checkout or such. |
I am using a simple Polar setup with the three different nodes. I found a fix, I believe the problem does not relate to this PR so I am happy to merge it ! |
Thanks for the great work @rkfg! Just a quick check-in - is hovering over rows supposed to look like this? It shows the text in a greyish color. |
Yeah, it is like this for me too. Should it be black? I think it's not hard to fix, will take a look later. And hey, thanks for the tip! |
Yeah, agree. For some reason it looks like this in the new library unless |
This is quite a big patch, it fixes #89. Updating to the supported and more recent gocui fork (awesome-gocui) allows to print emojis and wide characters better and also offers true color terminal support (that we don't use but it's still nice to have). Some highlights and explanations:
.Clear()
is replaced with.Rewind()
;awesome-gocui
resets the cursor position on.Clear()
unlike the old library and it causes the cursor to lock up. We can store and restore these coords but it's easier to use rewind instead. The only downside is that it doesn't actually clear the buffer but we don't even need it because all columns refresh the whole row anyway withPrintf
.Printf
if wide characters are in play. If we compensate them for the rows (channels) that have them it all looks good, but if we scroll to the right and the alias column becomes invisible all rows lose proper alignment because there are no more wide characters on screen but we still artificially remove spaces for them. Individual view buffers solve this easily and the underlying library do these calculations for us depending on what is actually on screen..SetView
now has a mandatory argumentoverlaps
which is used for drawing borders correctly. We don't use borders so it's just 0 everywhere.cursorCompat
function is used to restore the old library behavior regarding cursor positioning and updating origin if it goes outside the visible space;awesome-gocui
doesn't return an error in this case so I do it myself. Maybe it's better to rewrite this code (incursor.go
) to do it better but for now I decided to use this adapter instead.ToggleView
typo is corrected, it didn't matter before the library update but now that we don't clear the views with cursor it caused visual bugs.Overall, despite the number of changes the UI looks and feels exactly the same except it now works properly with wide characters, and as we know node operators love them so it's important!