sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.11k stars 1.29k forks source link

Automatically collapse single-child directory chains in the file tree view and directory pages #25432

Open olafurpg opened 3 years ago

olafurpg commented 3 years ago

Feature request description

It would be nice if directory pages and the tree view automatically collapsed directory chains where every directory only contains a single sub-directory.

Is your feature request related to a problem? If so, please describe.

Currently, you need to click on a link and load a new page for every nested subdirectory.

CleanShot 2021-09-28 at 10 55 04

Describe alternatives you've considered.

If you want to open a specific filename, you can use the fuzzy file finder to open it directly.

Additional context

Here's an example of how GitHub automatically collapses several directories into a single link in directory pages

https://github.com/google/google-java-format/tree/master/core/src/main

image

Here's an example of how the Octotree browser extension collapses several directories in the file tree view

image

The VS Code file explorer does something similar

image
github-actions[bot] commented 3 years ago

Heads up @macraig - the "team/code-intelligence" label was applied to this issue.