-
Notifications
You must be signed in to change notification settings - Fork 30
feat: Add scrollbar #131
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
base: main
Are you sure you want to change the base?
feat: Add scrollbar #131
Conversation
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.
Tested, looks good, thanks! Will review soon™
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.
I refactored scrollbar widget a bit. Also I think single line for scrollbar track is better than double in this case
6a3c7e3
to
826670d
Compare
I rephrased comment a bit and removed |
@Cretezy could you enable rebase merge? I don't want to loose commit history |
The TODO note was because I forgot why I did a -1 in the first place, but I rediscovered during testing: |
When I tested it, it worked well, reaching the bottom just fine when the cursor was at the last element (didn't test your last change) |
Apparently the scroll offset bug is a known problem: ratatui/ratatui#1681 |
I think we can ignore it, since this problem is rare. When this issue will be fixed in ratatui, we will just get fix with an update Also, about splitting to logical commits:
|
I see your point on DetailsPanel api. I guess I'm still learning when is the best time to use "jj absorb". I will move these changes. Given that this further simplifies the "feat Scroll bar" commits, I can see your point on merging them. I will merge these 4 changes into 1. |
This should be ready to merge. @Cretezy, are there any more things I need to do? |
I can merge too, I just want to do "rebase" merge, not "squash" |
If we don't want to wait, and you want to keep the individual commits (I'd want to, too), the slightly annoying approach would be to create individual PRs for them. 🤷🏻 |
Lets be pragmatic. I'd much prefer the individual commits but if the project prefers squashing PR then so be it. The other approach feels like working around the intention of project management. I will prefer good social relations over individual commits any day. |
Instead of relying on access to DetailsPanel.scroll, provide a setter function.
The scrollbar is used automatically, and less boilerplate code is needed for drawing in all the tabs.
This PR adds scrollbars to windows that can scroll. This gives a visual indicator of how far you have scrolled.