Skip to content

Conversation

@kylediaz
Copy link
Contributor

@kylediaz kylediaz commented Dec 8, 2025

We're getting 500s on several pages because the Tab markdoc component only has one child. This PR prevents the Tab component from breaking when it only has one child.

https://docs.trychroma.com/integrations/embedding-models/text2vec
https://docs.trychroma.com/integrations/embedding-models/nomic
https://docs.trychroma.com/integrations/embedding-models/open-clip

Additionally, this changes the persistent language behavior for tabs. Before, if you chose "Typescript" and then went on this page where there is no Typescript option, it would simply have no tab selected and show nothing.

Now, if the preferred tab is not available, it will default to the first tab option. This is at the cost of the tabs not updating to your new preferred language while you're on the page -- only when you change pages.

Screenshot 2025-12-08 at 3.21.09 PM.png

@kylediaz kylediaz mentioned this pull request Dec 8, 2025
Copy link
Contributor Author

kylediaz commented Dec 8, 2025

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@kylediaz kylediaz requested a review from itaismith December 8, 2025 23:26
@kylediaz kylediaz marked this pull request as ready for review December 8, 2025 23:26
@propel-code-bot
Copy link
Contributor

Handle single-child tabs and adjust language fallback

Updates the Markdoc Tabs component to tolerate single-child usage and to select an appropriate default tab when the preferred language is unavailable. The component now derives a childrenArray, builds a list of available tab labels, and picks either the stored language or the first available option as the default value while leaving UITabs uncontrolled.

Key Changes

• Normalize children into childrenArray so tab rendering works when only one child is supplied
• Compute languages from tab labels and choose defaultValue based on the stored language with a fallback to the first tab
• Remove the controlled value={language} prop from UITabs to rely on the computed default selection

Affected Areas

• docs/docs.trychroma.com/components/markdoc/tabs.tsx

This summary was automatically generated by @propel-code-bot

Copy link
Contributor Author

kylediaz commented Dec 13, 2025

Merge activity

  • Dec 13, 8:27 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Dec 13, 8:29 PM UTC: @kylediaz merged this pull request with Graphite.

@kylediaz kylediaz changed the base branch from kylediaz/_doc_fix_doc_404_and_500_and_other_stuff to graphite-base/5989 December 13, 2025 20:27
@kylediaz kylediaz changed the base branch from graphite-base/5989 to main December 13, 2025 20:27
@kylediaz kylediaz merged commit d5fedcf into main Dec 13, 2025
127 of 129 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.

2 participants