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

fix: help line wrapping #36

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

fix: help line wrapping #36

wants to merge 2 commits into from

Conversation

mainrs
Copy link

@mainrs mainrs commented Nov 22, 2024

This commit adds wrapping behavior to the help line at the bottom.
It measures the required lines based on the current frame buffer
area and creates a matching layout.

The commit required a dependency update of ratatui to 0.29.0
to gain access to the Frame#area method.

Fixes #35.

This commit adds wrapping behavior to the help line at the bottom.
It measures the required lines based on the current frame buffer
area and creates a matching layout.

The commit required a dependency update of `ratatui` to `0.29.0`
to gain access to the `Frame#area` method.
Copy link
Owner

@kabouzeid kabouzeid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. I think I would prefer lazygit's behavior of just truncating the help string and show an ellipsis:
Screenshot 2024-11-22 at 18 11 22

@@ -17,5 +17,5 @@ crossterm = "0.27.0"
itertools = "0.12.1"
lazy_static = "1.4.0"
notify = "6.1.1"
ratatui = "0.27.0"
ratatui = "0.29.0"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary for some new API?

Copy link
Author

@mainrs mainrs Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary for the Frame#area function. But that function is just a name change. It's the same as the Frame#size function. I originally used another approach that required the version bump. I can revert the version change if you want. It is not necessary for the code change I did.

@mainrs
Copy link
Author

mainrs commented Nov 22, 2024

Looks good overall. I think I would prefer lazygit's behavior of just truncating the help string and show an ellipsis.

Is it possible to somehow show the full help string in that case? Like focusing the UI component and let it scroll? At least on my machine and the way my display is configured, my maximized terminal is too small to see the whole help string. The whole idea of the change was that even in these cases one can see the whole help message!

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

Successfully merging this pull request may close these issues.

Help line cut off if terminal size is too small
2 participants