gitui-org / gitui-org/gitui

File autofocus fails on embed folders

Aperta
#1,958 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.