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

Fix x-codeSamples load when switching language tabs #707

Conversation

lucasassisrosa
Copy link
Contributor

Description

Use merged languages to have updated set of languages on change language and code tabs

Motivation and Context

Fix an issue when switching from a non custom code sample language tab to a custom code sample one

How Has This Been Tested?

https://docusaurus-openapi-36b86--pr660-xou63k6x.web.app/petstore/add-pet, switching from Java to PHP for example

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@lucasassisrosa lucasassisrosa changed the title Fix x-codeSamples load when switching language tabs Fix x-codeSamples load when switching language tabs in V3 Jan 18, 2024
@lucasassisrosa lucasassisrosa changed the title Fix x-codeSamples load when switching language tabs in V3 Fix x-codeSamples load when switching language tabs Jan 18, 2024
Copy link

github-actions bot commented Jan 19, 2024

Visit the preview URL for this PR (updated for commit 7398453):

https://docusaurus-openapi-36b86--pr707-wrynrwd6.web.app

(expires Thu, 22 Feb 2024 15:20:04 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@sserrata
Copy link
Member

sserrata commented Jan 19, 2024

Hi @lucasassisrosa, I noticed that I see an empty code snippet sometimes on first load/render. A reload seems to always correct the issue.

Screenshot 2024-01-19 at 8 54 01 AM

@lucasassisrosa
Copy link
Contributor Author

Hi @lucasassisrosa, I noticed that I see an empty code snippet sometimes on first load/render. A reload seems to always correct the issue.

Screenshot 2024-01-19 at 8 54 01 AM

thanks. Let me check to fix that

@lucasassisrosa
Copy link
Contributor Author

I noticed that I see an empty code snippet sometimes on first load/render

@sserrata I tried the following scenarios on the PR Preview and couldn't replicate the empty code snippet issue:

  • landing on the page with no docusaurus.tab.code-samples language set then clicking on php tab
  • landing on the page with docusaurus.tab.code-samples set to php

Could you share the scenario that uncovers the issue?

@lucasassisrosa
Copy link
Contributor Author

Could you share the scenario that uncovers the issue?

Maybe it's an issue with the localStorage docusaurus.tab.code-samples language that I cannot reproduce. Anyway, I added a piece of code to load code sample source from language on codeSampleCodeText initial state

@sserrata sserrata merged commit a3b467c into PaloAltoNetworks:main Jan 24, 2024
13 checks passed
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.

None yet

2 participants