Skip to content

Conversation

@IdrisGit
Copy link

@IdrisGit IdrisGit commented Jan 12, 2026

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

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

Screenshots

Wide Terminal

before:
lazygit_fullscreen

after fix:
fix_fullscreen

Narrow/Small Terminal

before:
lazygit_smallscreen

after fix:
fix_smallscreen

@IdrisGit
Copy link
Author

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.

@stefanhaller
Copy link
Collaborator

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:

  • for new users who don't know the auto-wrap feature, it is not obvious that we are doing the wrapping for real. It looks like we might simply be soft-wrapping at the window width, but a long line would end up in the commit message, so I find it important that the window is a little wider to make it easy to tell what's happening.
  • in some cases we don't wrap a long line, for example when there's a very long URL in the commit message that's longer than the auto-wrap width. You'd have to scroll horizontally to see all of it, which is inconvenient.

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.)

@IdrisGit
Copy link
Author

@stefanhaller thank you for the clarification.

I agree with you on limiting the getPopupPanelWidth instead, keeps rest of the UI consistent, I also don't think anyone will use auto-wrap more than 120 (could be very rare), my assumption is 90% of users are not even aware of auto-wrap only.

@stefanhaller
Copy link
Collaborator

@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.)

@IdrisGit
Copy link
Author

@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.

@IdrisGit IdrisGit force-pushed the fix/commit-message-panel-width-limit branch from 39fa697 to 08bc153 Compare January 21, 2026 08:39
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
@IdrisGit IdrisGit force-pushed the fix/commit-message-panel-width-limit branch from 08bc153 to efeb733 Compare January 21, 2026 11:24
@IdrisGit IdrisGit changed the title fix: Limit commit message panel width to AutoWrapWidth + 2 characters fix: limit popup panel width on large screens Jan 21, 2026
@IdrisGit
Copy link
Author

@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 terminal width - 2 logic when popup width becomes larger than terminal width.

let me know what your thoughts are.

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.

2 participants