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

hledger-ui keeps scrolling at the end of lists #2278

Open
waj opened this issue Oct 31, 2024 · 3 comments
Open

hledger-ui keeps scrolling at the end of lists #2278

waj opened this issue Oct 31, 2024 · 3 comments
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. ui The hledger-ui tool.

Comments

@waj
Copy link

waj commented Oct 31, 2024

Hi! Is there any reason or real usefulness for making the lists keep scrolling once the cursor is at the end of the list?
I personally find this behavior annoying but also unexpected since it's different from any other TUI application or even graphical interfaces. Specially when the entire list of items fits in one page, it's odd that part of it becomes off screen. And even when it doesn't fit, I can see no point in not using as much screen as possible to display information instead of blank space.

I can see this is not a default behavior in brick, but instead made explicit for example here:

-- DOWN key when selection is at the last item: scroll instead of moving, until maximally scrolled
VtyEvent e | e `elem` moveDownEvents, isBlankItem mnextelement -> vScrollBy (viewportScroll $ l^.listNameL) 1
where mnextelement = listSelectedElement $ listMoveDown l

I could try fixing this and send a PR unless there's a good reason or personal attachment to this behavior. 😄

@simonmichael
Copy link
Owner

Hi @waj.. it originally worked as you expected. It may not be optimal right now, but there was a reason. I think it was something to do with preserving a stable selection and/or scroll position as you enter and exit sub-screens.

@simonmichael
Copy link
Owner

Strangely it's not mentioned in the commit messages (or I failed to find it).

@simonmichael simonmichael added A-WISH Some kind of improvement request, hare-brained proposal, or plea. ui The hledger-ui tool. labels Oct 31, 2024
@simonmichael
Copy link
Owner

@waj: PS, if it wasn't clear, experiments with changing this are welcome. But that is one of the things to consider - how selection and scroll position change as you navigate, with various window and data sizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. ui The hledger-ui tool.
Projects
None yet
Development

No branches or pull requests

2 participants