From ef260c31c4a507cce59a3759807648bccfe9a6ba Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:48:17 +0000 Subject: [PATCH 1/7] Update ./docs/versions/next.json for v10.4.0-alpha.0 --- docs/versions/next.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/versions/next.json b/docs/versions/next.json index af2866491c13..85230521a24e 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"10.3.0-beta.3","info":{"plain":"- Addon-Vitest: Handle additional vitest config export patterns in postinstall - [#34106](https://github.com/storybookjs/storybook/pull/34106), thanks @copilot-swe-agent!\n- CLI: Add vike CLI metadata - [#34189](https://github.com/storybookjs/storybook/pull/34189), thanks @yannbf!\n- Maintenance: Revert pull request #33930 HMR events - [#34190](https://github.com/storybookjs/storybook/pull/34190), thanks @yannbf!\n- UI: Ensure Link without href is keyboard-reachable - [#34163](https://github.com/storybookjs/storybook/pull/34163), thanks @Sidnioulz!\n- UI: Zoom faster when pressing shift - [#34185](https://github.com/storybookjs/storybook/pull/34185), thanks @Sidnioulz!\n- Vite: Add mock entries to optimizeDeps.entries - [#34167](https://github.com/storybookjs/storybook/pull/34167), thanks @valentinpalkovic!"}} \ No newline at end of file +{"version":"10.4.0-alpha.0","info":{"plain":""}} \ No newline at end of file From 69d6f37797b6cddfc9d02d637005ff677dd22c59 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:16:30 +0000 Subject: [PATCH 2/7] Update ./docs/versions/next.json for v10.4.0-alpha.1 --- docs/versions/next.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/versions/next.json b/docs/versions/next.json index 85230521a24e..14e663050a09 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"10.4.0-alpha.0","info":{"plain":""}} \ No newline at end of file +{"version":"10.4.0-alpha.1","info":{"plain":"- Docs: Ensure unique control id attributes across multiple Controls blocks - [#34021](https://github.com/storybookjs/storybook/pull/34021), thanks @TheSeydiCharyyev!"}} \ No newline at end of file From 3b5c56e498ab2b79ed2b8a196550dc201dcc3440 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Thu, 19 Mar 2026 14:44:46 +0000 Subject: [PATCH 3/7] Update ./docs/versions/next.json for v10.4.0-alpha.2 --- docs/versions/next.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/versions/next.json b/docs/versions/next.json index 14e663050a09..59bb1f6dd62c 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"10.4.0-alpha.1","info":{"plain":"- Docs: Ensure unique control id attributes across multiple Controls blocks - [#34021](https://github.com/storybookjs/storybook/pull/34021), thanks @TheSeydiCharyyev!"}} \ No newline at end of file +{"version":"10.4.0-alpha.2","info":{"plain":"- CLI: Use npm info to fetch versions in repro command - [#34214](https://github.com/storybookjs/storybook/pull/34214), thanks @yannbf!\n- Core: Prevent story-local viewport from persisting in URL - [#34153](https://github.com/storybookjs/storybook/pull/34153), thanks @ghengeveld!\n- Maintenance: Remove dead-code copy of wrap-getAbsolutePath-utils - [#34168](https://github.com/storybookjs/storybook/pull/34168), thanks @mixelburg!\n- Security: Makes sure `serialize-javascript` is at latest version - [#34034](https://github.com/storybookjs/storybook/pull/34034), thanks @50bbx!"}} \ No newline at end of file From e9b881aa84b9f6b5122940dec2ec5f5f333b844e Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Thu, 19 Mar 2026 13:03:19 +0100 Subject: [PATCH 4/7] Merge pull request #34153 from storybookjs/fix-persistent-story-viewport Core: Prevent story-local viewport from persisting in URL (cherry picked from commit b00ebfa64526a9822e0d1052badee6b9dbb73ab6) --- code/core/src/manager-api/modules/globals.ts | 12 ++++---- .../src/manager-api/tests/globals.test.ts | 28 ++++++++++++++++++- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/code/core/src/manager-api/modules/globals.ts b/code/core/src/manager-api/modules/globals.ts index 4c706a19ee28..d27a33da8ce3 100644 --- a/code/core/src/manager-api/modules/globals.ts +++ b/code/core/src/manager-api/modules/globals.ts @@ -130,7 +130,7 @@ export const init: ModuleFn = ({ store, fullAPI, provider }) = SET_GLOBALS, function handleSetGlobals(this: any, { globals, globalTypes }: SetGlobalsPayload) { const { ref } = getEventMetadata(this, fullAPI)!; - const currentGlobals = store.getState()?.globals; + const currentUserGlobals = store.getState()?.userGlobals; if (!ref) { store.setState({ globals, userGlobals: globals, globalTypes }); @@ -138,14 +138,12 @@ export const init: ModuleFn = ({ store, fullAPI, provider }) = logger.warn('received globals from a non-local ref. This is not currently supported.'); } - // If we have stored globals different to what the preview just inited with, - // we should update it to those values if ( - currentGlobals && - Object.keys(currentGlobals).length !== 0 && - !deepEqual(globals, currentGlobals) + currentUserGlobals && + Object.keys(currentUserGlobals).length !== 0 && + !deepEqual(globals, currentUserGlobals) ) { - api.updateGlobals(currentGlobals); + api.updateGlobals(currentUserGlobals); } } ); diff --git a/code/core/src/manager-api/tests/globals.test.ts b/code/core/src/manager-api/tests/globals.test.ts index 829e771ae4d8..264df9d676e2 100644 --- a/code/core/src/manager-api/tests/globals.test.ts +++ b/code/core/src/manager-api/tests/globals.test.ts @@ -71,7 +71,7 @@ describe('globals API', () => { }); }); - it('emits UPDATE_GLOBALS if retains a globals value different to what receives on SET_GLOBALS', () => { + it('emits UPDATE_GLOBALS if retains a user globals value different to what receives on SET_GLOBALS', () => { const channel = new EventEmitter(); const listener = vi.fn(); channel.on(UPDATE_GLOBALS, listener); @@ -83,6 +83,7 @@ describe('globals API', () => { } as unknown as ModuleArgs); store.setState({ ...state, + userGlobals: { a: 'c' }, globals: { a: 'c' }, }); @@ -103,6 +104,31 @@ describe('globals API', () => { }); }); + it('does not push story globals to preview when SET_GLOBALS fires with empty globals', () => { + const channel = new EventEmitter(); + const listener = vi.fn(); + channel.on(UPDATE_GLOBALS, listener); + + const store = createMockStore(); + const { state } = initModule({ + store, + provider: { channel }, + } as unknown as ModuleArgs); + store.setState({ + ...state, + userGlobals: {}, + storyGlobals: { viewport: 'mobile1' }, + globals: { viewport: 'mobile1' }, + }); + + channel.emit(SET_GLOBALS, { + globals: {}, + globalTypes: {}, + } satisfies SetGlobalsPayload); + + expect(listener).not.toHaveBeenCalled(); + }); + it('ignores SET_STORIES from other refs', () => { const channel = new EventEmitter(); const api = { findRef: vi.fn() }; From c4d4fbd02266bc456b0d8d58c216df2eccd3af6c Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Thu, 19 Mar 2026 12:45:24 +0100 Subject: [PATCH 5/7] Merge pull request #34214 from storybookjs/fix/repro-command CLI: Use npm info to fetch versions in repro command (cherry picked from commit ac8171ecbf47b63343fd174b0fdfdb43fafc9ac5) --- code/lib/cli-storybook/src/sandbox.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/lib/cli-storybook/src/sandbox.ts b/code/lib/cli-storybook/src/sandbox.ts index 5bfcc854048f..003841ea8bbd 100644 --- a/code/lib/cli-storybook/src/sandbox.ts +++ b/code/lib/cli-storybook/src/sandbox.ts @@ -2,7 +2,7 @@ import { existsSync } from 'node:fs'; import { mkdir, readdir, rm } from 'node:fs/promises'; import { isAbsolute } from 'node:path'; -import type { PackageManagerName } from 'storybook/internal/common'; +import { PackageManagerName } from 'storybook/internal/common'; import { JsPackageManagerFactory, isCI, @@ -42,10 +42,10 @@ export const sandbox = async ({ let selectedConfig: Template | undefined = TEMPLATES[filterValue as TemplateKey]; let templateId: Choice | null = selectedConfig ? (filterValue as TemplateKey) : null; - const { packageManager: pkgMgr } = options; - + // Always use npm to fetch versions, as other package manager commands may fail when running in + // non-project directories (e.g. parent sandbox directory). We just need to use npm info for this use case. const packageManager = JsPackageManagerFactory.getPackageManager({ - force: pkgMgr, + force: PackageManagerName.NPM, }); const latestVersion = (await packageManager.latestVersion('storybook'))!; const nextVersion = (await packageManager.latestVersion('storybook@next')) ?? '0.0.0'; From 52ac06b9670f1af9bee13e4376c412f7fe155e01 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 17 Mar 2026 19:04:06 +0100 Subject: [PATCH 6/7] Merge pull request #34179 from storybookjs/norbert/test-runner-ci-flake Build: Update `test-runner` to use a single jest-worker (cherry picked from commit 2f5025f3f0165b8647760cc27ea99c16667acda6) From c1ad926aaff1cf9cce83dd49f43664cf2bf116a4 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Thu, 19 Mar 2026 14:59:38 +0000 Subject: [PATCH 7/7] Write changelog for 10.3.1 [skip ci] --- CHANGELOG.md | 5 +++++ code/package.json | 3 ++- docs/versions/latest.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 903f17a62adb..5533cae86eab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 10.3.1 + +- CLI: Use npm info to fetch versions in repro command - [#34214](https://github.com/storybookjs/storybook/pull/34214), thanks @yannbf! +- Core: Prevent story-local viewport from persisting in URL - [#34153](https://github.com/storybookjs/storybook/pull/34153), thanks @ghengeveld! + ## 10.3.0 _> Improved developer experience, AI-assisting tools, and broader ecosystem support_ diff --git a/code/package.json b/code/package.json index 04d1824c33b0..81688c494b20 100644 --- a/code/package.json +++ b/code/package.json @@ -209,5 +209,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "10.3.1" } diff --git a/docs/versions/latest.json b/docs/versions/latest.json index 44c97657584e..d4295e4106fd 100644 --- a/docs/versions/latest.json +++ b/docs/versions/latest.json @@ -1 +1 @@ -{"version":"10.3.0","info":{"plain":""}} \ No newline at end of file +{"version":"10.3.1","info":{"plain":"- CLI: Use npm info to fetch versions in repro command - [#34214](https://github.com/storybookjs/storybook/pull/34214), thanks @yannbf!\n- Core: Prevent story-local viewport from persisting in URL - [#34153](https://github.com/storybookjs/storybook/pull/34153), thanks @ghengeveld!"}} \ No newline at end of file