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

Refactor: Create ScrollableTextView component #2155

Open
MichaelAug opened this issue Mar 25, 2024 · 4 comments
Open

Refactor: Create ScrollableTextView component #2155

MichaelAug opened this issue Mar 25, 2024 · 4 comments
Assignees
Milestone

Comments

@MichaelAug
Copy link
Contributor

Multiple UI elements have a text area with a vertical scroll bar. This can be refactored into a reusable component to reduce code duplication and improve UI consistency.

Tasks:

  1. Create ScrollableTextView component
  2. Refactor MsgPopup to use new component
  3. Refactor DetailsComponent to use new component
@extrawurst extrawurst added this to the v0.26 milestone Mar 26, 2024
@extrawurst extrawurst modified the milestones: v0.26, v0.27 Apr 14, 2024
@MichaelAug
Copy link
Contributor Author

Looks like we could use ratatui's built in Scrollbar widget instead of our custom one. This could simplify scroll_vertical.rs and scroll_horizontal.rs and probably remove scrollbar.rs entirely. Would you like this done?

Here's a comparison of the current scrollbar:
old_scrollbar
And the ratatui built in (default look):
new_scrollbar

@extrawurst
Copy link
Owner

I havent looked into the impact of this but i am all for simplifying and using a upstream solution where we can if it does not degrade performance

@MichaelAug
Copy link
Contributor Author

I havent looked into the impact of this but i am all for simplifying and using a upstream solution where we can if it does not degrade performance

I think swapping the custom scrollbar with the ratatui one shouldn't be too difficult, I'll make a PR so we can test the changes

@MichaelAug
Copy link
Contributor Author

I've made a small PR to test the scrollbar. You can see the new scrollbar in e.g. tag description or the file list. Looks like a lot of scrollable components don't use VerticalScroll.
#2393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants