Skip to content
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

Optimize scrolling UI #54

Closed
maximbaz opened this issue Apr 12, 2021 · 6 comments · Fixed by #55
Closed

Optimize scrolling UI #54

maximbaz opened this issue Apr 12, 2021 · 6 comments · Fixed by #55
Labels
help wanted Extra attention is needed

Comments

@maximbaz
Copy link
Contributor

$ cd "$(mktemp -d)"
$ for i in `seq 0 1000`; do echo $i > $i; done
$ xplr

I expect xplr to show as much files as it could possibly fit, but in fact there is a lot of empty unused space:

image

If I begin to scroll down, it's not using more space:

image

If I resize terminal such that there is less vertical space, xplr even adjusts on the fly - but if I resize back, at some point it just stops using extra space, resulting in the pictures above.

It would be nice to always use all the available space 🙂

Furthermore, once you scroll down (like on the second picture above - so I'm on 946), and then I begin to scroll up again, I expect the cursor to go up but I expect 946 to still be in the view, i.e. view should not be scrolled at this point - like try scrolling up and down in vim in a long document, cursor goes up but screen scrolling should only begin when cursor reaches the top of the screen. Does this make sense? And what do you think in general? 🙂

@sayanarijit
Copy link
Owner

If I resize terminal such that there is less vertical space, xplr even adjusts on the fly - but if I resize back, at some point it just stops using extra space, resulting in the pictures above.

I forgot to make the limit dynamic. it's an easy fix.

cursor goes up but screen scrolling should only begin when cursor reaches the top of the screen.

This depends on fdehau/tui-rs#328

@maximbaz
Copy link
Contributor Author

Just to clarify, it's not only about scrolloff (which would also be awesome btw), but in vim even with scrolloff=0, see how I can scroll to the bottom to line 40, and then I go back up but my "view" doesnt begin to scroll until on my way up my cursor reaches 20 and continues up?

record_1618237659

@sayanarijit
Copy link
Owner

sayanarijit commented Apr 12, 2021

Ah got it... Let me see how to implement this (without sacrificing performance).

sayanarijit added a commit that referenced this issue Apr 12, 2021
sayanarijit added a commit that referenced this issue Apr 12, 2021
@sayanarijit
Copy link
Owner

Reopening this as the navigation isn't vim-like yet.

@sayanarijit sayanarijit reopened this Apr 12, 2021
@sayanarijit sayanarijit added the help wanted Extra attention is needed label May 11, 2021
@sayanarijit
Copy link
Owner

sayanarijit commented Apr 28, 2023

I think we have an easy and "good enough" scrolling system. Some plugins have adapted to this system to calculate the display area of the content in a layout. Making a stateful scrolling system will contribute to the complexity not only for xplr, but those plugins as well. So, being not interested in doing so, closing this issue.

@ElSamhaa
Copy link

I'd really like to see this introduced. I believe XPLR is nearing perfection except for the current scrolling behavior which is so annoying and feels weirdly outstanding among all the CLI tools I regularly use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants