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

Expanding a sub-chapter opens another sub-chapter #1932

Open
melindafekete opened this issue Feb 6, 2024 · 4 comments · Fixed by #1942
Open

Expanding a sub-chapter opens another sub-chapter #1932

melindafekete opened this issue Feb 6, 2024 · 4 comments · Fixed by #1942
Assignees
Labels
🐛 Type: Bug Something isn't working

Comments

@melindafekete
Copy link

melindafekete commented Feb 6, 2024

I found an edge case where expanding a sub-chapter opens another sub-chapter as well. However, I could not reproduce the behavior in all instances. Please see the video for more info.

To reproduce:

  1. Navigate to the API reference preview using this PR.
  2. Expand the Customers chapter
  3. Expand the Business Units chapter
  4. Expand the Associates sub-chapter (inside Customers)
Screenshare.-.2024-02-06.2_58_51.PM.mp4
@melindafekete melindafekete added the 🐛 Type: Bug Something isn't working label Feb 6, 2024
@melindafekete
Copy link
Author

Linking the Foundry B2B example here for reference.

@gabriele-ct
Copy link
Contributor

gabriele-ct commented Mar 15, 2024

@melindafekete
I had a more in depth look to the issue and the 2 cases you're pointing out as reproduction examples. There is a bug indeed, but it's not the case of both of the issues you're experiencing. Let me add some details:

  • API website: In this case it's clearly a bug, the code is not differentiating between different sub chapter that are at the same level, I'm working on a fix
  • Foundry website: in this case, the way in which navigation.yaml is defined is not correct, meaning that the current implementation doesn't support 2 navigation items pointing to the exact same page. if you want 2 navigation items pointing to the same content you must create 2 different pages with the same content. This is not a bug but it's the intended behaviour as we can't uniquely identify what's the correct item to expand/highlight in the navigation since both the navigation items point to the same page

Possible solutions for the Foundry site:

  • Use content inclusion: the content is defined in a separate .mdx file and the included in both of the pages (pro: single content to maintain, cons: the right bar TOC is not supported)
  • Duplicate the content in 2 pages. For example one can be called b2c-project-steering.mdx and b2b-project.steering.mdx

FYI: @FFawzy

@melindafekete
Copy link
Author

Thanks! I'll have a chat with the team, but I think given the TOC thing we'll probably have to go for duplicating the pages

@gabriele-ct
Copy link
Contributor

Thank you @melindafekete .
Have a thought also about how often this use case could happen in the future, so we could evaluate better if it's needed to invest time on the TOC generation for included content

@FFawzy FFawzy linked a pull request Mar 18, 2024 that will close this issue
@FFawzy FFawzy removed a link to a pull request Mar 18, 2024
@gabriele-ct gabriele-ct linked a pull request Mar 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants