Tree: add "go up" the tree button (second merge)
Created by: oleggromov
As the previous merge was reverted, I am making the new one.
Description
Part of the Tree improvements, it adds the option to navigate up the tree.
The tree still retains the "confusing behaviour", which is the inconsistency between:
- Navigating to the root of the repo - which opens up the entire tree at root, as expected
- Going to a deeply nested file, which only opens the subtree - which is confusing
This part will be fixed later on, with a bigger refactoring of the entire Tree
component, including data fetching, tree processing, and rendering.
Test plan
- Check out the branch
- Open up a few repos:
- A regular one with lots of subfolders: https://sourcegraph.test:3443/github.com/sourcegraph/code-intel-extensions
- Something with a deeply nested single children: https://sourcegraph.test:3443/github.com/sgtest/java-pom-with-deps-javaconfig/-/blob/src/main/java/com/sourcegraph/depuser/ApacheCommonsUser.java
- A single-file one: https://sourcegraph.test:3443/github.com/sgtest/head-branch/-/blob/foo
- Make sure that ".." is shown and navigates up the tree
- Make sure that tests are passing
https://user-images.githubusercontent.com/2196347/180196529-e712b6cb-2fef-4185-8079-2b12a328b4fb.mov
App preview:
Check out the client app preview documentation to learn more.