Skip to content

Tree: add "go up" the tree button (second merge)

Administrator requested to merge og/tree-nav-up-two into main

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:

  1. Navigating to the root of the repo - which opens up the entire tree at root, as expected
  2. 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

  1. Check out the branch
  2. Open up a few repos:
    1. A regular one with lots of subfolders: https://sourcegraph.test:3443/github.com/sourcegraph/code-intel-extensions
    2. 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
    3. A single-file one: https://sourcegraph.test:3443/github.com/sgtest/head-branch/-/blob/foo
  3. Make sure that ".." is shown and navigates up the tree
  4. 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.

Merge request reports

Loading