wmjordan / wmjordan/Codist

Suggestion: Turn NaviBar's Dropdowns into Tree / Grid

Open
#148 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request Navigation
Dominant language
C#
Stars
394
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Your latest addition of displaying parent namespaces to the NaviBar and general functionality improvements you have done to the NaviBar recently suggested to me a possible, more holistic approach of using NaviBar as a kind of super-source-code navigator, which really shines with bigger code bases.

In particular 2 major areas stand out:

Area 1: Tree View instead of List View

The idea is basically to replace the current ListView/ListBox-like control that lists subitems (namespaces, types, etc.) linearly with a tree-like control. Most likely this feature makes sense only for parent namespace elements in the NaviBar (since the current type's sub elements (nested types, methods, members) are already listed in the list directly as part of a current file or other partial files).

The way it would work for Namespaces as well as for Types not defined in the currently opened document is basically that each such item (representing either a Namespace or a Type in the dropdown) would be turned into expandable tree item, which, when clicked would dynamically expand and show its members (other namespaces and types for namespaces, and nested types and members for types). These nested subitems, in turn may too be expandable if they have any logical subitems.

So for example, assuming we have A.AB.TypeAB1.cs opened and there exists a type A.AC.TypeAC2.cs, when a user clicks on the A parent namespace node on the NaviBar, he would see AB and AC namespaces in the dropdown. These should be rendered as expandable items since both of them are namespaces that contain types. So, when user expands AC namespace item, it would list TypeAC2 as a subitem, which, in turn, too can be expanded further to reveal TypeAC2's members.

I have no idea how hard it is to turn a ListView into a dynamic TreeView like this, so I don't expect this be done anytime soon, but I thought I would share this idea. I find it would make code navigation / understanding even better!

Area 2: Tree Grid instead of Tree View

Expanding on the idea of a Tree above. Even better would be to make it into a Tree Grid, i.e. a tree with multiple, header-sortable, and perhaps even filterable columns.

The current design has a small toolbar at the top of every NaviBar dropdown where user can search by name and filter by item type (like classes vs structs vs enums). An alternative and a more flexible approach would be to merge that toolbar with a clickable Tree Grid / Grid header. Clicking on the header of a column would show basically 2 options: 1) sort by directions 2) filter (a menu with checkboxes for example that list all possible variants). So the idea is to make it very similar to how MS Access does it for example in its tables.

So, this way instead of having just one column (basically item name with syntax), there would be more columns, all of which could be sorted by / filtered by:

  • Item Type (namespace, class, struct, etc.)
  • Project / Assembly Names
  • File count
  • Line count
  • Something else?
Final Thoughts
  • Both of these areas can be done independently of each other. Meaning, if easier, it's possible to start with Area 2 and add tree capabilities later on.
  • Both of these features would enable a much better understanding of a big codebase.
  • NaviBar can thus be extended to be a replacement / a much better version of VS's Class View window.

Thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The proposal concerns NaviBar's current ListView/ListBox-like dropdowns and toolbar. Start by locating the NaviBar implementation and understanding how namespace, type, and member items are populated; then determine whether a tree view or tree grid is feasible. Done would require an agreed scope and implemented navigation behavior, sorting, or filtering.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.