gitui icon indicating copy to clipboard operation
gitui copied to clipboard

File autofocus fails on embed folders

Open non-descriptive opened this issue 2 years ago β€’ 2 comments

Describe the bug Suppose we have folder structure like this

β”œβ”€πŸ“ level_1
β”‚  β”œβ”€β”€πŸ“ level_2
β”‚      β”œβ”€β”€ File1
β”œβ”€πŸ“ level_1
   β”œβ”€β”€πŸ“ level_2
   β”‚   β”œβ”€β”€πŸ“ level_3
   β”‚       β”œβ”€β”€ File2
   β”œβ”€β”€File3

If we start staging file from top to bottom then after staging File1 we will end up focused on folder level_3 but not the first changed file on the list. This generally affects two places - folder tree view and diff view. Tree view sets focus on the folder and diff view just becomes empty, since cursor focused on the folder.

If start to stage things from the bottom up it's obviously will focus on the last changed file and works just as intended.

To Reproduce Have folder structure similar to above Start staging files from up to bottom.

Expected behavior Automatic focus on next file changed, not an offset from common root.

Screenshots I have asciinema recording with example: gitui_bug.txt to replay

asciinema play gitui_bug.txt

First we stage bottom up and everything goes fine, then unstage all and start stage from up to bottom and the view becomes blank after first stage and tree focused on the folder.

Context:

  • GitUI Version [e.g. 0.24.3]

non-descriptive avatar Nov 21 '23 14:11 non-descriptive

please just post a video of the problem

extrawurst avatar Nov 21 '23 14:11 extrawurst

https://asciinema.org/a/622371 this way is fine?

non-descriptive avatar Nov 21 '23 20:11 non-descriptive