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

Collapse/uncollapse all files in tree #4131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtrajano
Copy link

@mtrajano mtrajano commented Dec 27, 2024

Seems like this feature is highly requested #4095 #3554

Ability to collpase/expand all files in the tree both for working files and commit view files. One issue I noticed is that currently any functionality that we want to add related to the file tree has to be duplicated across both controllers/models. I would like to try to unite the functionality using generics but I would prefer if it was done as part of a separate PR as it will greatly increase the scope of this PR and doesn't look trivial. Any feedback is welcome, thanks!

Example of functionality working:
example

@stefanhaller
Copy link
Collaborator

What keymaps if any to add to these

I could imagine - for collapsing, and = for expanding. At least they are easy to reach on a US keyboard layout. Anybody got any better ideas?

should the functionality be to toggle vs collapse and uncollapse separately

I would probably do separate ones. For toggling it wouldn't be quite clear what the exact logic would be.

and if this should be added anywhere else (right now it's just for the file tree)

Yes, in commits_files_controller.go; this handles the list of files that you see when pressing enter on a commit. I'm not aware of any other places besides these two.

@jesseduffield
Copy link
Owner

I could imagine - for collapsing, and = for expanding.

That sounds good to me

Seems like this feature is highly requested jesseduffield#4095 jesseduffield#3554

Did a quick wip pr. I got the core functionality working with files and
had some questions on what can be improved in order to polish it more.
I.e. What keymaps if any to add to these, should the functionality be to
toggle vs collapse and uncollapse separately, and if this should be
added anywhere else (right now it's just for the file tree)

Once I figure this out I can add the tests, documentations and anything
else that's missing. I'm also pretty new to the language so if there's a
way I can structure this better please let me know
@mtrajano mtrajano force-pushed the feature/collapse-all branch from 9ee58f0 to ffffe2e Compare January 6, 2025 22:01
@mtrajano mtrajano changed the title WIP: collapse/uncollapse all files in tree Collapse/uncollapse all files in tree Jan 6, 2025
@mtrajano mtrajano force-pushed the feature/collapse-all branch 2 times, most recently from f01a8fe to ffffe2e Compare January 7, 2025 23:26
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 this pull request may close these issues.

3 participants