-
-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/treeview #1132
base: main
Are you sure you want to change the base?
feat/treeview #1132
Conversation
It reduces the VerticalSideBarLayout's size/responsabilities.
The `CatalogResourcesSideBar` is only used within `SideNav`, so colocating it improves organization and maintainability.
It lets the user choose between the sidebar type they want. The options are 'FLAT_VIEW' or 'TREE_VIEW'. The 'FLAT_VIEW' is the default type.
|
Thanks @carlosallexandre I think this is great! A few things I wonder if we can add?
I wonder if getTreeView needs to be cached or not? Like we do other pages etc, for large catalogs, this tree view will be called multiple times or is it a build time thing? |
else if (SIDENAV_TYPE === 'TREE_VIEW') props = getTreeView({ projectDir: process.env.PROJECT_DIR!, currentPath }); | ||
--- | ||
|
||
<div {...Astro.props}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious, what does this do? Spreading the props onto the div?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The primary reason for spreading the props onto the <div />
is that id
and className
are used in VerticalSideBarLayout.astro
. The id
is specifically used in the VerticalSideBarLayout.astro
script to handle the ?embed=true
case, where the sidebar
is hidden. I chose this approach to keep these attributes closer to where they are used, but we can adjust it if you prefer.
Also I'm working on a new feature that is moving users/teams away from the docs sidebars into their own views... just a heads up but that shoul dnot change this PR, keep them where they are |
I'll add this.
Great point! I'll add a caching layer to
This will be similar to the visualizer page, where |
Motivation
It adds another view type for sidebar. Now, the user could choose between
FLAT_VIEW
andTREE_VIEW
. TheFLAT_VIEW
is the default to keep compatibility with old versions.Related issues
Close #1065