-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: limit popup panel width on large screens #5200
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: master
Are you sure you want to change the base?
fix: limit popup panel width on large screens #5200
Conversation
|
hey @stefanhaller sorry to bother you in comment section, I don't like to bug maintainers like this but idk how the review process in lazygit works. can you please look into this PR, if it's not relevant let me know I will close it as well, but this bug has been bugging me for quite a while, sorry to bother. |
|
Pinging me is fine. When there's a phase where there are more PRs than I have time to look at (this has been the case the last couple of weeks), I tend to focus on the ones that are either important to me personally, or that I think are important for a lot of users, and neither was true for this one. Oh, or the ones that are trivial and straightforward and can simply be merged as is, but this is very, very rare. Ok, let's see: I don't like the change of restricting the panel width to the autowrap width for two reasons:
So, I'd be ok with restricting the panel width to, say, 1.5 times the auto-wrap width or something like that. But then I wonder: doesn't the same problem exist for confirmation panels and menus? On extremely large monitors these also get ridiculously wide. So maybe a simple fix could be to put a restriction inside of getPopupPanelWidth (which is used by all of them), and simply limit it to, say, 120 there. (This would be a problem if people use an auto-wrap width larger than 120, but I find this unlikely.) |
|
@stefanhaller thank you for the clarification. I agree with you on limiting the |
|
@IdrisGit Ok, so what next? Are you planning to change this PR in that way? (If you do, remember to change the PR title and description.) |
|
@stefanhaller yes I am going to update the PR, instead of limiting to 74 characters in commit window, I will instead limit the popup width itself, will do some testing on my end and will update the PR and will also update the title and description. |
39fa697 to
08bc153
Compare
Prevents menus like commit description panel from being much wider than the text wrapping width, leaving empty space on the right side, or confirmation menus and keybinding menus getting ridiculously wide on larger screens
08bc153 to
efeb733
Compare
|
@stefanhaller I have updated the PR to now limit the popup panel width to "user's auto-wrap width + padding", this also solves the issue of what if someone has auto-wrap value more than 120. I tested few different configurations including adding a hard max cap of 120 but it still looked too wide on my 2K monitor, also tried updating the existing ratio which was scaling the popup to 4/7 or ~57% of the terminal size to some other values, eventually found the auto-wrap + padding approach to me more consistent. This does mean that, if someone has let's say 100-120 as their auto-wrap value, the commit popup will be fine but things like keybind menus will be a bit wider than required and might become more than or equal to the 57% ratio, I feel like this tradeoff is worth it for the sake of UI consistency and it's in a very unlikely scenario. I have kept the original let me know what your thoughts are. |
PR Description
Fix visual annoyance on large monitors (e.g. 2K, ultrawide) where popup panels become unnecessarily wide, leaving excessive empty space on the right side.
Problem: popup panels (commit description, confirmations, menus) used 57% of terminal width, which made them very wide on larger screens.
Solution: Popup panel width now derives from git.commit.autoWrapWidth + 25 (padding)
Before: Panel width = 57% of terminal (regardless of auto-wrap setting)
After: Panel width = commitAutoWrapWidth + 25 (capped to terminal width - 2)
Please check if the PR fulfills these requirements
go generate ./...)Screenshots
Wide Terminal
before:

after fix:

Narrow/Small Terminal
before:

after fix:
