Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File tree pane: folders won't collapse on Windows #761

Closed
enizor opened this issue Jun 2, 2021 · 8 comments · Fixed by #762
Closed

File tree pane: folders won't collapse on Windows #761

enizor opened this issue Jun 2, 2021 · 8 comments · Fixed by #762
Milestone

Comments

@enizor
Copy link

enizor commented Jun 2, 2021

Description

The new file tree pane [3] has some problematic behavior on Windows.

Using Left/Right Arrow [→←] to collapse/expand folders will correctly toggle the little triangle ▾ ▸ next to the folder (and jump to parent/child on second press). However the file list is not updated so all the subfolders are still visible in the tree after a collapse.
All subfolders are visible when opening the file tree (but marked collapsed ▸) so the result is a list of all folders and files in the repository.

Note: the bug is not present when using Ubuntu via WSL.

Reproduction

Launch gitui, open File Tree pane with [3].

Expected behavior
Only the first-level folders and files are visible

Actual behavior
All folders and files are visible

In the file tree, use arrow keys to collapse and expand some folders

Expected behavior
Files and folders appear and disappear when their parent is collapsed / expanded

Actual behavior
No change in the file list, excepted for the triangles ▾ ▸

Context

  • OS/Distro + Version: Windows 10, reproduced on both cmd.exe and Windows Terminal
  • GitUI Version 0.16.0
  • Rust version: 1.52.1

Additional Notes

It's not a big issue (for me) since the file tree pane is not the main feature I use in gitui. However I understood that the file tree component is to be reused in other places, in particular in the status view. That would really get in my way (and most Windows users too).

@extrawurst
Copy link
Owner

Does the view update correctly after a couple of seconds (it refreshes every few seconds even if no input is given)?

@enizor
Copy link
Author

enizor commented Jun 2, 2021

Nothing changes over time without inputs.

@extrawurst
Copy link
Owner

extrawurst commented Jun 2, 2021

argh damn windows path separators. ok I think I found the problem

@enizor
Copy link
Author

enizor commented Jun 2, 2021

Seems like it, changing / to \ in the input of filetreeitems::tests::test_collapse will break the test. If the paths are not normalized before using FileTree::new() this might be the cause

@extrawurst
Copy link
Owner

Will be fixed in a few

@enizor
Copy link
Author

enizor commented Jun 2, 2021

I can test a patch/commit on my machine should you need it

@extrawurst
Copy link
Owner

@enizor you can test the PR

@enizor
Copy link
Author

enizor commented Jun 3, 2021

Thanks a lot!

@extrawurst extrawurst added this to the v0.16.1 milestone Jun 6, 2021
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 a pull request may close this issue.

2 participants