Skip to content

Manager: Keep local preview iframe on host URL when a ref story loads first#35078

Merged
Sidnioulz merged 3 commits into
storybookjs:nextfrom
TheSeydiCharyyev:fix/framesrenderer-ref-first-host-preview
Jun 9, 2026
Merged

Manager: Keep local preview iframe on host URL when a ref story loads first#35078
Sidnioulz merged 3 commits into
storybookjs:nextfrom
TheSeydiCharyyev:fix/framesrenderer-ref-first-host-preview

Conversation

@TheSeydiCharyyev

@TheSeydiCharyyev TheSeydiCharyyev commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Closes #34553

What I did

Follow-up to #35050. That PR fixed Controls for stories from a composed ref, but surfaced a separate, pre-existing bug: after loading a composed-ref story first, navigating to a host story left the host preview stuck (Couldn't find story matching id … → spinner), so host stories never rendered and their Controls stayed in the loading state.

The root cause is in FramesRenderer. The local preview frame is initialized once, and since v10.3.0 (the getStoryHrefs refactor, 2a864fdb) that init passes the current story's refId:

frames['storybook-preview-iframe'] = api.getStoryHrefs(storyId, { queryParams, refId, viewMode }).previewHref;

For a non-empty refId, getStoryHrefs returns the ref's iframe URL, so on a ref-first load the local frame is pointed at the composed ref's Storybook and — because it is only set once (the if (!frames[...]) guard) — never re-pointed. Host stories can then never load. Host-first avoids it because the first call has no refId.

This drops refId from that one call so the local preview frame always uses the host's own iframe URL (the behavior before v10.3.0), and adds a story covering it. Verified on the repro that ref-first → host renders correctly, with host-first still working.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

  1. Request a canary for this PR (see below) and point a composed-ref repro at it — e.g. https://github.com/Sidnioulz/storybook-35050-repro, or the storybook-refs-issue.zip from [Bug]: Controls never load with two Storybooks (refs) if initial page is a ref story #34553.
  2. Build and serve it, then open the host Storybook.
  3. Deep-link/refresh directly on a composed-ref story (e.g. ?path=/story/react_my-button--default). Its Controls should load.
  4. Navigate to a host story. It should render and its Controls should load (before this fix the canvas stayed on a spinner / Couldn't find story matching id …).
  5. Reload on a host story first, then navigate to a ref story — both keep working (this path was already fine; it confirms no regression).

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Declare whether manual QA will be needed for this PR during the next release, through qa:needed or qa:skip

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This pull request has been released as version 0.0.0-pr-35078-sha-e5f7408f. Try it out in a new sandbox by running npx storybook@0.0.0-pr-35078-sha-e5f7408f sandbox or in an existing project with npx storybook@0.0.0-pr-35078-sha-e5f7408f upgrade.

More information
Published version 0.0.0-pr-35078-sha-e5f7408f
Triggered by @Sidnioulz
Repository TheSeydiCharyyev/storybook
Branch fix/framesrenderer-ref-first-host-preview
Commit e5f7408f
Datetime Sat Jun 6 12:05:25 UTC 2026 (1780747525)
Workflow run 27061821162

To request a new release of this pull request, mention the @storybookjs/core team.

core team members can create a new canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=35078

Summary by CodeRabbit

  • Bug Fixes

    • Preview frame no longer navigates to a referenced Storybook instance when selecting composed-reference stories; it stays on the host preview URL and preserves expected local iframe parameters.
  • Tests

    • Added a Storybook regression interaction test that verifies the preview remains on the host environment for composed-reference stories.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8bf59aa8-8b80-4c22-a524-643428cf9eb3

📥 Commits

Reviewing files that changed from the base of the PR and between e79ab39 and 311ce3a.

📒 Files selected for processing (1)
  • code/core/src/manager/components/preview/FramesRenderer.stories.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • code/core/src/manager/components/preview/FramesRenderer.stories.tsx

📝 Walkthrough

Walkthrough

FramesRenderer.tsx stops passing refId when composing the host preview iframe URL so the local preview uses the host's iframe.html. A new Storybook story RefStoryKeepsLocalPreviewOnHost mocks composed-ref hrefs and asserts the local preview iframe remains on the host iframe.html for the selected story.

Changes

Local preview iframe composed-ref fix

Layer / File(s) Summary
Remove refId from local iframe URL composition
code/core/src/manager/components/preview/FramesRenderer.tsx
When the local storybook-preview-iframe entry is missing, api.getStoryHrefs is now called with refId: undefined so the host preview iframe URL is built from the host's iframe.html (including storyId, viewMode, and queryParams) rather than using a composed-ref URL.
Regression test for local preview iframe with composed refs
code/core/src/manager/components/preview/FramesRenderer.stories.tsx
Adds RefStoryKeepsLocalPreviewOnHost: mocks getStoryHrefs to return composed-ref iframe URLs for refs, provides a ManagerContext selecting a host storyId, and its play function asserts the local preview iframe src excludes the composed-ref refUrl and includes iframe.html?id=${storyId}.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
code/core/src/manager/components/preview/FramesRenderer.stories.tsx (1)

71-78: ⚡ Quick win

Add interaction and accessibility checks to the play test.

Line 71-78 currently validates behavior only (iframe URL). Per repo story guidelines, this play should also include at least one interaction assertion and one accessibility assertion.

As per coding guidelines: “For React components, write Storybook stories with play functions containing behavior, accessibility, and interaction assertions — do NOT write separate *.test.tsx unit tests for components”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@code/core/src/manager/components/preview/FramesRenderer.stories.tsx` around
lines 71 - 78, The current play function only checks the iframe URL; extend the
play in FramesRenderer.stories.tsx to also perform an interaction and an
accessibility assertion: use the existing canvasElement and localFrame (selector
'`#storybook-preview-iframe`') to query into the iframe document (e.g., its
contentDocument/body) and perform a user interaction against a visible control
inside the iframe (e.g., click a button or trigger keyboard focus) using the
same play context, then assert the expected change (interaction assertion);
finally run an a11y check (e.g., call the storybook testing-library or axe
accessibility check) against the iframe document and assert no violations
(accessibility assertion). Ensure these checks live inside the same play async
function and reuse localFrame/canvasElement identifiers already present.

Sources: Coding guidelines, Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@code/core/src/manager/components/preview/FramesRenderer.stories.tsx`:
- Around line 71-78: The current play function only checks the iframe URL;
extend the play in FramesRenderer.stories.tsx to also perform an interaction and
an accessibility assertion: use the existing canvasElement and localFrame
(selector '`#storybook-preview-iframe`') to query into the iframe document (e.g.,
its contentDocument/body) and perform a user interaction against a visible
control inside the iframe (e.g., click a button or trigger keyboard focus) using
the same play context, then assert the expected change (interaction assertion);
finally run an a11y check (e.g., call the storybook testing-library or axe
accessibility check) against the iframe document and assert no violations
(accessibility assertion). Ensure these checks live inside the same play async
function and reuse localFrame/canvasElement identifiers already present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 93bbc829-b9ae-4494-858d-651aee9a5a1f

📥 Commits

Reviewing files that changed from the base of the PR and between f7a30cb and e5f7408.

📒 Files selected for processing (2)
  • code/core/src/manager/components/preview/FramesRenderer.stories.tsx
  • code/core/src/manager/components/preview/FramesRenderer.tsx

@TheSeydiCharyyev

Copy link
Copy Markdown
Contributor Author

@Sidnioulz this is the fix we discussed on #34553 — it drops refId from the local preview-iframe init in FramesRenderer, so a ref-first load no longer points the local preview at the ref's Storybook. Ready for a canary whenever you have a moment; I'll verify it against storybook-35050-repro and the original zip from the issue once it's published.

@TheSeydiCharyyev

TheSeydiCharyyev commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai This story is a targeted regression test for which iframe URL the local preview frame is built with. FramesRenderer only renders <iframe> elements pointing at preview URLs (mocked here), so its own output has no interactive control or accessible inner DOM to exercise — the iframes don't load real content in the test and their documents are cross-origin, so interacting with a control inside the iframe or running axe against the iframe document isn't possible or meaningful. Interaction and a11y of the previewed stories are covered where those stories live. The guideline lists behavior/a11y/interaction as the assertion types that belong in stories rather than *.test.tsx; it doesn't mandate all three in every play, and only the URL-construction behavior is meaningful to assert here, so I'll keep the play focused on that.

@TheSeydiCharyyev

Copy link
Copy Markdown
Contributor Author

@coderabbitai see above — FramesRenderer renders only preview iframes (mocked, cross-origin here), so there's no inner DOM to interact with or run axe against; the play asserts the URL-construction contract, which is the regression. Keeping it focused.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@TheSeydiCharyyev That's a valid and clear explanation — acknowledged. Since FramesRenderer renders cross-origin preview <iframe> elements that don't load real content in tests, querying the inner DOM, running axe, or driving interactions inside them isn't feasible. Asserting the src URL of the local preview iframe is the correct and only meaningful observable contract here, and it directly covers the regression. No changes needed on that front.


✏️ Learnings added
Learnt from: TheSeydiCharyyev
URL: https://github.com/storybookjs/storybook/pull/35078

Timestamp: 2026-06-06T04:23:12.508Z
Learning: In storybookjs/storybook, `code/core/src/manager/components/preview/FramesRenderer.tsx` renders only cross-origin preview `<iframe>` elements (mocked in tests). Its Storybook stories' `play` functions cannot interact with iframe inner content, query accessible DOM inside the iframes, or run axe against them — they are cross-origin and do not load real content. The only meaningful assertion in `FramesRenderer` stories is the `src` URL of the rendered iframes (e.g., asserting the local preview iframe uses the host URL and not a composed-ref URL). Do not flag the absence of accessibility or interaction assertions in `FramesRenderer` stories.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-05T19:50:27.156Z
Learning: Avoid redundant tests already covered by TypeScript, linting, Storybook play functions, or Playwright tests

Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.

Learnt from: psychobolt
Repo: storybookjs/storybook PR: 0
File: :0-0
Timestamp: 2026-03-21T17:23:03.931Z
Learning: In storybookjs/storybook PR `#34025`, `code/addons/vitest/src/vitest-plugin/index.ts` has a Windows-specific bug: `previewOrConfigFile` (an absolute filesystem path like `d:\...\preview.ts`) is incorrectly passed through `import.meta.resolve()`, which only accepts package specifiers or `file://` URLs, causing `TypeError: The URL must be of scheme file` on Windows with CSF4 setups. The fix is to check `path.isAbsolute(filePath)` and return absolute paths as-is, only calling `fileURLToPath(import.meta.resolve(filePath))` for package specifiers.

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-05T19:50:27.156Z
Learning: Applies to **/*.stories.tsx : For React components, write Storybook stories with `play` functions containing behavior, accessibility, and interaction assertions — do NOT write separate `*.test.tsx` unit tests for components

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-17T15:50:53.740Z
Learning: Use Storybook UI (`cd code && yarn storybook:ui`) for visual validation before switching to sandbox or CI-parity (`-c production`) workflows

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-05T19:50:27.156Z
Learning: Applies to **/*.stories.ts : For React components, write Storybook stories with `play` functions containing behavior, accessibility, and interaction assertions — do NOT write separate `*.test.tsx` unit tests for components

Learnt from: psychobolt
Repo: storybookjs/storybook PR: 0
File: :0-0
Timestamp: 2026-03-21T17:22:50.698Z
Learning: In storybookjs/storybook PR `#34025`, `code/addons/vitest/src/vitest-plugin/index.ts` maps all `internalSetupFiles` entries (including `previewOrConfigFile`) through `fileURLToPath(import.meta.resolve(filePath))`. On Windows, `previewOrConfigFile` is a raw absolute path (e.g. `d:\...\preview.ts`) which is not a valid argument for `import.meta.resolve()` — causing "TypeError: The URL must be of scheme file". The fix is to check `isAbsolute(filePath)` (from `pathe`, already imported) and return the path directly when it is already absolute, only calling `import.meta.resolve()` for bare module specifiers.

Learnt from: TheSeydiCharyyev
Repo: storybookjs/storybook PR: 0
File: :0-0
Timestamp: 2026-05-14T04:49:22.982Z
Learning: In the Storybook `Radio.tsx` control (`code/addons/docs/src/blocks/controls/options/Radio.tsx`), `name` is set equal to `controlId`. Therefore, a test asserting uniqueness of `control-*` IDs across `<Controls />` block instances transitively guarantees uniqueness of radio `name` attributes across blocks. Within a single radio group, sharing `name` is intentional browser-grouping behavior and should not be flagged. A dedicated radio-specific name-uniqueness story is not required to cover the cross-block collision fix introduced in PR `#34793`.

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-17T15:50:53.740Z
Learning: Use `cd code && yarn test` for unit tests, Storybook UI or Chromatic for visual validation, and sandbox-based E2E/test-runner/smoke tests for behavior validation

Learnt from: kasperpeulen
Repo: storybookjs/storybook PR: 0
File: :0-0
Timestamp: 2026-01-28T09:16:24.155Z
Learning: In Storybook CSF factories codemod, preview files with only named exports (including re-exports like `export { withTheme } from './decorators'`) still require a default export to be added via `export default definePreview({})`, because story files import the preview default with `import preview from '../.storybook/preview'`. Named exports do not count as default exports, so the codemod correctly adds a default export even when re-exports are present.

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-05T19:50:27.156Z
Learning: Test contracts and side effects, not private implementation details; avoid assertions about internals not part of public contract, DOM output, or externally observable behavior

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@TheSeydiCharyyev This is already covered — I acknowledged this in my previous reply and saved a learning about it. The FramesRenderer play function asserting only the src URL of the local preview iframe is correct and sufficient given the cross-origin, no-real-content nature of those iframes. No changes needed.


🧠 Learnings used
Learnt from: TheSeydiCharyyev
Repo: storybookjs/storybook PR: 0
File: :0-0
Timestamp: 2026-06-06T04:23:12.508Z
Learning: In storybookjs/storybook, `code/core/src/manager/components/preview/FramesRenderer.tsx` renders only cross-origin preview `<iframe>` elements (mocked in tests). Its Storybook stories' `play` functions cannot interact with iframe inner content, query accessible DOM inside the iframes, or run axe against them — they are cross-origin and do not load real content. The only meaningful assertion in `FramesRenderer` stories is the `src` URL of the rendered iframes (e.g., asserting the local preview iframe uses the host URL and not a composed-ref URL). Do not flag the absence of accessibility or interaction assertions in `FramesRenderer` stories.

Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-05T19:50:27.156Z
Learning: Applies to **/*.stories.tsx : For React components, write Storybook stories with `play` functions containing behavior, accessibility, and interaction assertions — do NOT write separate `*.test.tsx` unit tests for components

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-05T19:50:27.156Z
Learning: Applies to **/*.stories.ts : For React components, write Storybook stories with `play` functions containing behavior, accessibility, and interaction assertions — do NOT write separate `*.test.tsx` unit tests for components

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-05T19:50:27.156Z
Learning: Avoid redundant tests already covered by TypeScript, linting, Storybook play functions, or Playwright tests

Learnt from: TheSeydiCharyyev
Repo: storybookjs/storybook PR: 0
File: :0-0
Timestamp: 2026-05-14T04:49:22.982Z
Learning: In the Storybook `Radio.tsx` control (`code/addons/docs/src/blocks/controls/options/Radio.tsx`), `name` is set equal to `controlId`. Therefore, a test asserting uniqueness of `control-*` IDs across `<Controls />` block instances transitively guarantees uniqueness of radio `name` attributes across blocks. Within a single radio group, sharing `name` is intentional browser-grouping behavior and should not be flagged. A dedicated radio-specific name-uniqueness story is not required to cover the cross-block collision fix introduced in PR `#34793`.

Learnt from: psychobolt
Repo: storybookjs/storybook PR: 0
File: :0-0
Timestamp: 2026-03-21T17:23:03.931Z
Learning: In storybookjs/storybook PR `#34025`, `code/addons/vitest/src/vitest-plugin/index.ts` has a Windows-specific bug: `previewOrConfigFile` (an absolute filesystem path like `d:\...\preview.ts`) is incorrectly passed through `import.meta.resolve()`, which only accepts package specifiers or `file://` URLs, causing `TypeError: The URL must be of scheme file` on Windows with CSF4 setups. The fix is to check `path.isAbsolute(filePath)` and return absolute paths as-is, only calling `fileURLToPath(import.meta.resolve(filePath))` for package specifiers.

Learnt from: kasperpeulen
Repo: storybookjs/storybook PR: 0
File: :0-0
Timestamp: 2026-01-28T09:16:24.155Z
Learning: In Storybook CSF factories codemod, preview files with only named exports (including re-exports like `export { withTheme } from './decorators'`) still require a default export to be added via `export default definePreview({})`, because story files import the preview default with `import preview from '../.storybook/preview'`. Named exports do not count as default exports, so the codemod correctly adds a default export even when re-exports are present.

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-17T15:50:53.740Z
Learning: Use `cd code && yarn test` for unit tests, Storybook UI or Chromatic for visual validation, and sandbox-based E2E/test-runner/smoke tests for behavior validation

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-17T15:50:53.740Z
Learning: Use Storybook UI (`cd code && yarn storybook:ui`) for visual validation before switching to sandbox or CI-parity (`-c production`) workflows

Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-05T19:50:27.156Z
Learning: Test contracts and side effects, not private implementation details; avoid assertions about internals not part of public contract, DOM output, or externally observable behavior

@Sidnioulz Sidnioulz added bug ci:normal Run our default set of CI jobs (choose this for most PRs). qa:skip Pull Requests that do not need any QA. labels Jun 6, 2026
@storybook-app-bot

storybook-app-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

Package Benchmarks

Commit: 311ce3a, ran on 9 June 2026 at 03:46:25 UTC

The following packages have significant changes to their size or dependencies:

storybook

Before After Difference
Dependency count 72 74 🚨 +2 🚨
Self size 20.74 MB 20.44 MB 🎉 -303 KB 🎉
Dependency size 36.11 MB 36.65 MB 🚨 +539 KB 🚨
Bundle Size Analyzer Link Link

@storybook/ember

Before After Difference
Dependency count 189 188 🎉 -1 🎉
Self size 15 KB 15 KB 0 B
Dependency size 30.77 MB 30.67 MB 🎉 -101 KB 🎉
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 203 205 🚨 +2 🚨
Self size 908 KB 908 KB 0 B
Dependency size 88.98 MB 89.22 MB 🚨 +235 KB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 196 198 🚨 +2 🚨
Self size 32 KB 32 KB 🎉 -36 B 🎉
Dependency size 87.47 MB 87.71 MB 🚨 +235 KB 🚨
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 73 75 🚨 +2 🚨
Self size 1.08 MB 1.08 MB 0 B
Dependency size 56.85 MB 57.08 MB 🚨 +235 KB 🚨
Bundle Size Analyzer node node

@TheSeydiCharyyev

Copy link
Copy Markdown
Contributor Author

Verified 0.0.0-pr-35078-sha-e5f7408f against the reporter's extends: true repro:

  • Deep-link a composed-ref story first → its Controls load.
  • Navigate to a host story → it now renders and its Controls load (3 controls), where before it stayed on the "Couldn't find story matching id …" spinner.
  • Reload on a host story first, then a ref story → both still work.

The local preview frame no longer gets stuck on the ref's Storybook on a ref-first load.

Comment thread code/core/src/manager/components/preview/FramesRenderer.tsx
@Sidnioulz Sidnioulz self-assigned this Jun 8, 2026
@Sidnioulz Sidnioulz added qa:needed Pull Requests that will need manual QA prior to release. and removed qa:skip Pull Requests that do not need any QA. labels Jun 8, 2026

@Sidnioulz Sidnioulz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Just a small improvement to make on the story to avoid maintainer confusion or Chromatic warnings.

Comment thread code/core/src/manager/components/preview/FramesRenderer.stories.tsx Outdated
@Sidnioulz

Copy link
Copy Markdown
Contributor

@TheSeydiCharyyev could you please check the CI errors as well? LMK if some of them look wrong/unrelated. Thanks!

@TheSeydiCharyyev

Copy link
Copy Markdown
Contributor Author

Switched the story to the existing Icons ref so the active frame renders a real story instead of a non-existent URL — that was the react-…-chromatic failure.

On the rest of the CI: the other four (angular-cli build, next-js vite/webpack build, and the normal-generated aggregate) look unrelated to this change — it's a manager-runtime one-liner that can't affect framework builds, and the same jobs are green on #35037, which is rebased onto current next. This branch is a few days behind next, so a rebase should clear them. Want me to rebase it (like you did for #35037), or would you prefer to?

@Sidnioulz Sidnioulz merged commit d5f75ee into storybookjs:next Jun 9, 2026
138 checks passed
@github-project-automation github-project-automation Bot moved this from On Hold to Done in Core Team Projects Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-scan:human bug ci:normal Run our default set of CI jobs (choose this for most PRs). qa:needed Pull Requests that will need manual QA prior to release.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Controls never load with two Storybooks (refs) if initial page is a ref story

3 participants