Skip to content

Add an action to collapse the selected entry and its children#27703

Closed
jackTabsCode wants to merge 1 commit intozed-industries:mainfrom
jackTabsCode:collapse-selected-entry-and-children
Closed

Add an action to collapse the selected entry and its children#27703
jackTabsCode wants to merge 1 commit intozed-industries:mainfrom
jackTabsCode:collapse-selected-entry-and-children

Conversation

@jackTabsCode
Copy link
Contributor

@jackTabsCode jackTabsCode commented Mar 28, 2025

I found that I wanted to be able to collapse1 any project panel and its children. That's currently only possible on the root entry. This PR adds an action to collapse the selected entry and its children. It also replaces the implementation for CollapseAllEntries by checking if it's a root entry, and if so, using its old function which seems to do something special that I don't understand (feel free to let me know). Otherwise, it uses the existing code to collapse all for a given entry. If this isn't desirable, we can unify these two.

image

Closes #21731 (I think?)

Release Notes:

  • Added an action to collapse any project panel entry and its children

Footnotes

  1. There seems to be mixed verbiage on what "collapse" means (or maybe I'm misreading things). CollapseSelectedEntry collapses it, I guess, but not its children. CollapseAllEntries collapses every entry from the root and its children. I'm not completely sold on the name for this action.. something more fitting could be in order.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 28, 2025
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's indeed unite the actions, as it's the same collapsing approach we're doing?

Also, there's project_panel_tests.rs file where we would need to add a test for the new functionality, let's do that to ensure nothing regresses in the future for this bit.

@SomeoneToIgnore SomeoneToIgnore self-assigned this May 5, 2025
@SomeoneToIgnore
Copy link
Contributor

Fair enough, will close this PR as stale.
Sounds nice to have though.

@jackTabsCode
Copy link
Contributor Author

@SomeoneToIgnore Sorry, I haven't had the time yet to write tests for this. I should be able to at some point!

@SomeoneToIgnore
Copy link
Contributor

No worries and rush at all, thank you for making this PR.

smitbarmase added a commit that referenced this pull request Feb 5, 2026
Thanks to @jackTabsCode for the original commit that I based my work off
of.

See: #27703

Release Notes:

- Fixed clicking "Collapse All" from context menu on a project root
collapsing all project roots instead of that one.
- Added new `project panel: collapse selected entry and children` action
that collapses the selected directory and all its subdirectories.
- Added "Collapse All" option to the context menu for all directories,
not just project roots.

---------

Co-authored-by: Jack T <jack@jackt.space>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
rtfeldman pushed a commit that referenced this pull request Feb 5, 2026
Thanks to @jackTabsCode for the original commit that I based my work off
of.

See: #27703

Release Notes:

- Fixed clicking "Collapse All" from context menu on a project root
collapsing all project roots instead of that one.
- Added new `project panel: collapse selected entry and children` action
that collapses the selected directory and all its subdirectories.
- Added "Collapse All" option to the context menu for all directories,
not just project roots.

---------

Co-authored-by: Jack T <jack@jackt.space>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add folding/collapsing folders button

2 participants