File autofocus fails on embed folders
- Lingua principale
- Rust
- Stelle
- 22.5k
- Fork
- 773
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**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](https://github.com/extrawurst/gitui/files/13430558/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`]
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Lβissue non indica alcun file o test; riproduci innanzitutto il problema con la struttura di cartelle annidate e lβordine di staging dallβalto verso il basso descritto. Traccia quindi la gestione del focus nelle viste dellβalbero delle cartelle e del diff, poi verifica che lo staging di un file selezioni il file modificato successivo anzichΓ© una cartella incorporata e che entrambe le viste rimangano utilizzabili.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- git, rust
- Ambito
- cli
- Tipo di issue
- Bug
- DifficoltΓ
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attivitΓ
- Ferma
- Chiarezza
- Abbastanza chiara
- IdoneitΓ per principianti
- 45/100