Skip to content

stories: fix api reference table #95396

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

stories: fix api reference table #95396

wants to merge 3 commits into from

Conversation

JonasBa
Copy link
Member

@JonasBa JonasBa commented Jul 12, 2025

Fixes API reference table - we need to export only the types we want to show, as some components will have multiple. I have also improved the story types, which surfaced some potential runtime cases we weren't handling correctly

@JonasBa JonasBa requested a review from a team as a code owner July 12, 2025 14:04
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 12, 2025
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: MDX Stories Render Empty Tables Incorrectly

The StoryResources component now incorrectly renders an empty table (headers only) for MDX stories that lack resources. Previously, it would return null if story.exports.frontmatter?.resources was undefined. The updated logic removes this check, instead only checking !isMDXStory(story) for an early exit, and defaults resources to an empty object, causing the table to render for all MDX stories regardless of resource availability.

static/app/stories/view/storyResources.tsx#L13-L18

if (!isMDXStory(story)) {
return null;
}
const resources: Resources = story.exports.frontmatter?.resources ?? {};

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant