-
Notifications
You must be signed in to change notification settings - Fork 755
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
fix: remove presence of leftover data from previous page in TUI (#592) #725
Conversation
acd41d5
to
99204b9
Compare
…onaio#592) consider height of other ui components ('title' header in this case) while setting window height for workspaces list. Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
99204b9
to
992e9f8
Compare
i demand additional tip for the level of stupid ways i tried to solve this.. :p 😅 |
PS: subtracting height by 4 is more safer (due to title header + 'current profile' line tag at end of tui), just check it out once on your screens, using 3 just worked for me. Also one of other tried ways:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @abhishek818, thanks for the PR
As you can see on this closed PR, there was a similar attempt with changing the height of the view which resulted in big empty bars on the top and bottom of the view. We were hoping for a solution that doesn't make this compromise and fixes the underlying issue instead which is why we kept the issue open. Please let me know if you find a solution that gets rid of the residue without sacrificing the space
Here are the screenshot from your branch and main
![Screenshot 2024-07-04 at 10 09 41](https://private-user-images.githubusercontent.com/25279767/345751343-bc71bb53-a6e9-4aaa-849a-473dbeea3407.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE1MTA1NjAsIm5iZiI6MTcyMTUxMDI2MCwicGF0aCI6Ii8yNTI3OTc2Ny8zNDU3NTEzNDMtYmM3MWJiNTMtYTZlOS00YWFhLTg0OWEtNDczZGJlZWEzNDA3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIwVDIxMTc0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRlODQ3NGQ2YWVlYjliZDBkOGE4MTY2ODNlZDVmYjAzOTkxNWJlMTU3OWIyZjNkNzdhNDdlODg0ZjNkMTMzNDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.GHmhp7t_NbuoEu1F8sLSi1enZx7hfClblCh3e1vj-uY)
![Screenshot 2024-07-04 at 10 08 57](https://private-user-images.githubusercontent.com/25279767/345751372-9572f37b-8350-46e9-861f-e15e72b6de13.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE1MTA1NjAsIm5iZiI6MTcyMTUxMDI2MCwicGF0aCI6Ii8yNTI3OTc2Ny8zNDU3NTEzNzItOTU3MmYzN2ItODM1MC00NmU5LTg2MWYtZTE1ZTcyYjZkZTEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIwVDIxMTc0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgxZjg4ZTkzOWFhNjA2OGUzOTNlYjY5NmVlYzg0ZTkzMjNjMjRjNDk0Y2E2MDM4ODQyZGQxZjg3MzZkNWRlNTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.oqYT73AOfr3ThmZjIDmOUsiTHz7Qwb3-6QGCAjSch0E)
@idagelic hey I have pushed 1 more commit related to this issue. My fixes results in listing of 11 repo results instead of 12. I have found several other repos like this where they are hardcoding a value to be sub/add to the height/widths. Overall, all these ui issues are related to allotment of appropriate heights/widths for respective ui components. I find this is the only way to fix this. Refer some discussions on bubbletea repos: here1 and here2 Also, I think the tradeoff of some empty space for these fixes is a better deal. |
PS: had tried fixing empty spaces at header and footer by changing padding etc. Nothing works once height is manipulated for workspaces list in the view file.. |
set a max height for workspace selection view. Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
b1ec8cc
to
05761a0
Compare
@idagelic you got time to review ? |
@abhishek818 The difference is less obvious on full screen terminal windows, but when there would only be 3 elements in the list page, that number is now reduced to 2 for example. Also, you unintentionally "lost" the "Active profile" footer under the view. |
Also, losing the active profile footer label is not an option. It needs to be shown in all the places as before. |
Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
fixed, brought it back.
yeah, unfortunately cant resolve the empty height issue. This is weird, have tried resizing to terminal's height everywhere but once list's size is fixed here nothing can be done. Ultimately, this fix solves both the last page residue and filter input getting duplicated issues. Upto you guys. |
if m.list.FilterState() == list.Filtering {
return views.DocStyle.MaxWidth(terminalWidth - 4).Height(terminalHeight - 4).Render(m.list.View() + m.footer)
}
return views.DocStyle.MaxWidth(terminalWidth - 4).Height(terminalHeight - 2).Render(m.list.View() + m.footer) I believe this solution works best. It minimizes space lost at the top (it remains at 2 empty rows which is what we want) and doesn't cause "ghosted items" when filtering. |
Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
yes, works best, thanks. (now only leaves out a single trace only when the list size is 2 items but thats okay..) Only 2 small issues with filter mode left :
Just replacing with 'MaxHeight' below resolves it.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work great now. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well now.
I see that you put this PR closes #668 as well - yes, it fixes the filter issue which is great. Have you had any success reproducing and fixing the problem when the cursor sometimes moves to the bottom of the screen making it impossible to select items?
Perhaps pressing any key or '/' during the loading time (i.e. when it is about to render the next view) is the way to reproduce this. Not sure about it and not sure if this can even be resolved.. Will checkout this issue some other day. |
bounty not credited yet, Is it delayed on algora's side? @Tpuljak |
@abhishek818 my bad on that one. I configured auto-payouts shortly after abut this one didn't go through so I processed it manually now. |
fix: remove presence of leftover data from previous page in TUI (#592)
fix: filter input gets duplicated in full screen tui (#668)
This PR addresses issue #592 and #668
closes #592
closes #668
/claim #592