gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Feat adjusting size status tab

Open Hari-Oggy opened this issue 3 months ago • 6 comments

This Pull Request fixes/closes #2669.

It changes the following:

  • Added dynamic layout resizing in the status view
  • Introduced new keybindings (Alt+Arrow keys) to adjust horizontal and vertical splits
  • Replaced hardcoded Constraint::Percentage values with configurable state

I followed the checklist:

  • [ ] I added unittests
  • [X] I ran make check without errors
  • [X] I tested the overall application
  • [X] I added an appropriate item to the changelog

here is preview: gituidynamicsizeworking.webm

Hari-Oggy avatar Oct 06 '25 13:10 Hari-Oggy

here is preview :

gituidynamicsizeworking.webm

Hari-Oggy avatar Oct 06 '25 13:10 Hari-Oggy

@Hari-Oggy Thanks for the PR!

@extrawurst @naseschwarz I’m wondering whether we should go for the manual solution presented in this PR or rather for an automatic one that doesn’t require manual intervention, but would make customization impossible. What do you think?

cruessler avatar Oct 07 '25 17:10 cruessler

@extrawurst @naseschwarz Friendly ping: what do you think about whether the left column’s width should be resized automatically by gitui vs. fully controlled by the user?

cruessler avatar Oct 20 '25 15:10 cruessler

In this PR, GitUI automatically manages the left column's width while still allowing users to manually adjust both width and height. This approach provides a responsive layout with user customization options.

Screencast from 2025-10-23 10-15-02.webm

The preview shows two versions:

  • Left side: Standard GitUI with automatic left column width
  • Right side: Same layout with added user width customization options

Hari-Oggy avatar Oct 23 '25 05:10 Hari-Oggy

an automatic one that doesn’t require manual intervention, but would make customization impossible. What do you think?

@cruessler what automated solution would that be?

extrawurst avatar Oct 28 '25 15:10 extrawurst

@extrawurst Sorry for the long delay!

I was thinking of responsive web design where the layout is completely determined by CSS or of tiling window managers that arrange windows automatically according to the space available.

I think there might be different use cases here that made me hesitate:

  • People who always use gitui at the same size. In these situations, I imagine it makes a lot of sense to give users the option to resize splits manually.
  • People who use terminal multiplexers such as tmux or zellij and open gitui at more than one size. In these situations, it’s less clear to me that manual resizing is the optimal solution as the same percentages can look perfectly fine at one size, but less so at others.

I admit that this might not be the strongest argument for completely automatic layout. If you think it’s a good idea to provide the manual level of control proposed in this PR, I’m happy to start the actual review!

cruessler avatar Nov 15 '25 14:11 cruessler

If I might chime in...

  • Resizing top-left area to be larger than content and +1 line/column probably doesn't make sense as this already conveys "that's all we've got, no more content to show".

  • As one of those "people who use terminal multiplexers", I can see situations where staged and unstaged changes compete for vertical space. In such situations manual resize of the horizontal split between them and vertical scrollbar in each would make a lot of sense.

EDIT

Builds on top of master, seems to work fine :)

savchenko avatar Dec 29 '25 11:12 savchenko

Small issue: Up/Down arrows are reversed. E.g. Alt+down with "Unstaged changes" in focus increases size of the "Staged changes".

savchenko avatar Dec 30 '25 00:12 savchenko