#16623

feat(file_tree): add feature to expand and colapse folders and subfolder

Opencoslatteopened 8d ago

Pre-submit Checks

Describe the solution you'd like?

I've added a Expand / Collapse feature to the file_tree component. This provides expanding and collapsing immediate folders and sub-folders, as we search for files inside folders more quickly.

Is your feature request related to a problem? Please describe.

Not exactly.

Additional context

When I was searching through folders inside this tree view, I witnessed that we needed a bottom to expand full sub-folders so I've added one.

Operating system (OS)

Any.

How important is this feature to you?

1 (Not too important)

Warp Internal (ignore) - linear-label:39cc6478-1249-4ee7-950b-c428edfeecd1

None

Activity

3
warp-for-oss[bot]8d ago

@coslatte

Here's what I found while triaging this issue:

Project Explorer already supports expanding and collapsing individual folders by selecting/clicking folder rows and using keyboard expand/collapse controls. Could you clarify what new behavior you want beyond the existing per-folder toggle?

I have a few follow-up questions before I can narrow this down:

  1. Are you asking for a bulk or recursive expand/collapse control, a more visible disclosure arrow/button, or another behavior beyond expanding one folder at a time?

Reply in-thread with those details and the triage workflow will automatically re-evaluate the issue and update the diagnosis, labels, and next steps.

Maintainer details

I concluded that feature request for File Tree folder expand/collapse needs clarification because per-folder expand/collapse already appears to exist in Project Explorer..

Triage summary

This is a feature request for Project Explorer/File Tree folder expansion and collapse, but the requested behavior needs clarification before it can be routed as a concrete implementation task. The current client already maintains expanded folder state and toggles directory rows, and integration coverage exercises opening nested files by expanding src and utils.

Evidence

  • app/src/code/file_tree/view.rs defines FileTreeAction::Expand, FileTreeAction::Collapse, per-root expanded_folders, and toggle_folder_expansion.
  • Directory rows call toggle_folder_expansion when executed/clicked, and right/left keyboard actions expand or collapse the selected folder.
  • crates/integration/src/test/file_tree.rs includes a nested-file workflow that expands parent directories before opening a nested file.
  • Warp docs for File Tree describe browsing/opening files and context menu actions, but do not clearly document folder expand/collapse controls.

Duplicate check

I searched open issues across the repository and checked recent closed issues for File Tree/Project Explorer folder expand-collapse requests. Nearby issues cover related but distinct requests such as preserving navigation state, auto-revealing the active file, tree search, choosing a subfolder root, or nested-folder display bugs; there were not two likely duplicate issues matching this exact request.

Next step

Clarify the desired UX beyond the existing per-folder toggle before moving this to spec or implementation. If the intended request is bulk/recursive expand-collapse or a visible disclosure affordance, it may need product/design confirmation rather than a narrow code fix.

Question reasoning

  1. Are you asking for a bulk or recursive expand/collapse control, a more visible disclosure arrow/button, or another behavior beyond expanding one folder at a time? — The current File Tree code already supports per-folder expand/collapse, so the implementation scope depends on which additional UX the reporter wants.

This is my automated analysis and may be incorrect. A maintainer will verify the details.

Powered by Oz

coslatte8d ago

I've added a recursive expansion in the context menu right click, so it expands ever further than just clicking. I find this helpful while searching for multiple libraries and I want full detail of what's inside.

warp-for-oss[bot]8d ago

@coslatte

Here's what I found while triaging this issue:

This looks like a feature request for recursively expanding and collapsing folders in the Project Explorer file tree, likely through the folder context menu. I found related Project Explorer requests, but not enough matching issues to mark this as a duplicate.

Maintainer details

I concluded that feature request to add recursive expand/collapse actions for folders and subfolders in the Project Explorer file tree..

Triage summary

This is a feature request for recursive folder expansion/collapse in the Project Explorer file tree, likely exposed from a folder context menu. The reporter clarified that the goal is to expand beyond the currently selected folder so users can quickly inspect all nested folders while searching through a project.

Maintainer notes

  • Current file-tree state tracks expanded paths per root in FileTreeView::expanded_folders and toggles a single directory through FileTreeView::toggle_folder_expansion.
  • The directory context menu currently offers actions like new file, cd to directory, open in new tab, reveal, rename/delete, attach as context, and path-copy actions, but does not include recursive expand/collapse actions.
  • Implementing this likely needs new file-tree actions/menu items plus traversal/loading behavior for descendant directories, with care for lazy-loaded local and remote file-tree entries.

Duplicate check

I enumerated open issues and recently closed issues. Related Project Explorer requests exist, including state persistence and keyboard navigation, but I did not find two or more likely duplicates for recursive folder expand/collapse, so this is not being marked as a duplicate.

This is my automated analysis and may be incorrect. A maintainer will verify the details.

Powered by Oz