Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

carlosallexandre
Copy link
Contributor

Motivation

It adds another view type for sidebar. Now, the user could choose between FLAT_VIEW and TREE_VIEW. The FLAT_VIEW is the default to keep compatibility with old versions.

Related issues

Close #1065

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.
Copy link

changeset-bot bot commented Feb 10, 2025

⚠️ No Changeset found

Latest commit: c6fb67f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@boyney123
Copy link
Collaborator

Thanks @carlosallexandre I think this is great!

A few things I wonder if we can add?

  • Open all root nodes by default (e.g domains is open by default)

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}>
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@boyney123
Copy link
Collaborator

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

@carlosallexandre
Copy link
Contributor Author

A few things I wonder if we can add?

  • Open all root nodes by default (e.g domains is open by default)

I'll add this.

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?

Great point! I'll add a caching layer to getTreeView.

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

This will be similar to the visualizer page, where teams/users/channels aren't added to the treeview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Group the generated events from the OpenAPI by the owning service
2 participants