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

Adding option to keep the api categories closed by default - #289

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

Conversation

arian0zen
Copy link
Contributor

@arian0zen arian0zen commented Oct 23, 2024

  • The section opens when a particular category is active.

Here is how it looks - Loom video

  • Added a key defaultCollapsed to the API config to determine if it should be collapsed by default.
  • Try adding this key to the API config to test that.

image

Closes #280

This commit adds the collapsed property to the sidebar categories in order to allow collapsing and expanding of category sections. The collapsed property is used to control the initial state of the category, and it is set to true for the "Get started" category and the API category. This change enables a more compact and organized sidebar navigation experience for users.

Refs zuplo#279
Copy link

vercel bot commented Oct 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
zudoku-www ⬜️ Skipped (Inspect) Oct 23, 2024 4:40pm

@vercel vercel bot temporarily deployed to Preview – zudoku-www October 23, 2024 14:27 Inactive
Copy link

vercel bot commented Oct 23, 2024

@arian0zen is attempting to deploy a commit to the Zuplo WWW Team on Vercel.

A member of the Team first needs to authorize it.

@@ -32,6 +32,7 @@ export type SidebarItemCategory = Omit<
items: SidebarItem[];
link?: SidebarItemCategoryLinkDoc;
icon?: LucideIcon | string;
apiReference?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure about the naming of this toggle. I think we should better describe the behaviour that we are toggleing here, like openOnScroll?

Copy link
Contributor Author

@arian0zen arian0zen Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • the key apiReference is not actually user-facing, this one is just to identify if the collapsable categories are apiRef or not, if they are not apis and just documentation I figured we should not add the open on scroll ability.

  • the open-on-scroll actually defined by the key defaultCollapsed, that one is user-facing. ( I think here this should be defined as openOnScroll )

  • Although, I am very much open to this suggestion.. what do you say?

@mosch mosch added the feature New feature or request label Oct 23, 2024
@mosch
Copy link
Contributor

mosch commented Oct 23, 2024

Great feature! I'm thinking if this may be something that should be enabled / disabled on the first level of Zudoku.

@vercel vercel bot temporarily deployed to Preview – zudoku-www October 23, 2024 16:40 Inactive
@arian0zen
Copy link
Contributor Author

Great feature! I'm thinking if this may be something that should be enabled / disabled on the first level of Zudoku.

Thanks for the feedback, really appreciate it! Just to clarify, are you suggesting that this feature should be configurable at the 'Zudoku' level, so users can enable or disable it while initiating? If so, I have implemented that in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Development

Successfully merging this pull request may close these issues.

Sidebar Items by default closed
2 participants