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

Clicking 'Introduction' in sidebar (grouped by tagGroup) expands all groups instead of one #1076

Open
JeremiasIsnardyEA opened this issue Jan 30, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@JeremiasIsnardyEA
Copy link

Describe the bug

When using the tagGroup option for groupPathsBy in docusaurus.config.ts, each group gets an "Introduction" page. Clicking on this page in any group expands the menu for all groups, which negatively impacts the user experience.

Expected behavior

Clicking on an "Introduction" page should only expand the corresponding group in the sidebar, rather than affecting all groups.

Current behavior

Clicking on an "Introduction" page in any group expands the menu for all groups, making the sidebar feel unintuitive.

Possible solution

One possible fix could be to place a single "Introduction" page at the beginning of the grouped pages instead of having one per group. Additionally, ensuring that each "Introduction" page has a unique ID in the generated sidebar.ts might prevent the issue.

Steps to reproduce

  1. Configure groupPathsBy with tagGroup in docusaurus.config.ts.
  2. Generate the sidebar.
  3. Observe that each group gets an "Introduction" page.
  4. Click on any "Introduction" page and notice that all groups expand simultaneously.

Screenshots

Image

Context

This behavior makes navigation confusing, as users expect only the clicked group to expand rather than all groups.

Your Environment

  • Version used: 4.3.3
  • Environment name and version:
  • Operating System and version: Windows 11 & Ubuntu 22
  • Link to your project:
@JeremiasIsnardyEA JeremiasIsnardyEA added the bug Something isn't working label Jan 30, 2025
@sserrata
Copy link
Member

Hi @JeremiasIsnardyEA, it's hard to reproduce or fully grasp what you're seeing without steps/details, but have you already tried setting categorySourceLink to "tag"?

@JeremiasIsnardyEA
Copy link
Author

Thanks for you reply.

I tried to use this option yes. Did not help.

Here a more detailed way to reproduce it with the initial demo of the repo:

Change the configuration to:

petstore: {
           specPath: "examples/petstore.yaml",
           outputDir: "docs/petstore",
           sidebarOptions: {
             groupPathsBy: "tagGroup",
             categoryLinkSource: "tag",
           },
         } satisfies OpenApiPlugin.Options,

After regenerating the docs, building and serving you can navigate to the menu and click on the "introduction" below General and see the described behaviour:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants