Skip to content
Snippets Groups Projects

Tree: add "go up" the tree button

Created by: oleggromov

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
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: olafurpg

    Review: Approved

    I just tried this locally and it works great! A huge improvement over before. The .. link is a bit difficult to see, I think it would be a nice (followup) improvement to add file/folder icons to make it clearer that .. exists

  • Merged by: oleggromov at 2022-07-21 10:58:36 UTC

Please register or sign in to reply
Loading