Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
5d00cfd
fix(create-storybook): drop contextual dependencies
43081j Jul 27, 2025
a7bb7d0
Merge branch 'next' into config-files-context
ndelangen Sep 15, 2025
3408388
test: Update vitestConfigFiles.test.ts to mock fs/promises with dynam…
ndelangen Sep 15, 2025
1853097
Integrate launch-editor-middleware for enhanced editor support. Added…
yannbf Sep 15, 2025
b665876
Introduce open in editor and copy story name actions in sidebar conte…
yannbf Sep 15, 2025
534e35b
add open in editor action in interactions panel
yannbf Sep 15, 2025
e5bcac0
Add share tool functionality with QR code support in the preview comp…
yannbf Sep 15, 2025
90b7020
surface network address to Storybook's UI
yannbf Sep 15, 2025
c110aed
fix types and most tests
yannbf Sep 15, 2025
4c3209a
fix story
yannbf Sep 16, 2025
c83b79c
only hide tooltip on escape key
yannbf Sep 16, 2025
f16eb5d
update storybook icons and use new bug icon
yannbf Sep 16, 2025
f72aa77
fix exports
yannbf Sep 16, 2025
33f12f1
use share icon
yannbf Sep 16, 2025
19a909d
Merge branch 'next' into config-files-context
43081j Sep 16, 2025
983e479
in the interactions panel, show just story name as text on deployed/c…
yannbf Sep 16, 2025
7a74161
fix shortcuts fonts
yannbf Sep 16, 2025
22e796c
fix registering shortcuts with alt on macos
yannbf Sep 16, 2025
cceb627
fix tests
yannbf Sep 16, 2025
6a3ae4b
chore: run format
43081j Sep 16, 2025
6756ac0
test: mock find.any
43081j Sep 16, 2025
4ce4bfd
cleanup and add copyStoryLink shortcut
yannbf Sep 16, 2025
03ddcf9
temporarily disable copy story name shortcut
yannbf Sep 16, 2025
1af1dbb
small rename on measure addon shortcut
yannbf Sep 16, 2025
0036635
fix qr url
yannbf Sep 16, 2025
f252cdb
small refactor
yannbf Sep 16, 2025
383fe6f
fix types
yannbf Sep 16, 2025
f4bb5fa
fix types
yannbf Sep 16, 2025
09cdcc3
Merge branch 'next' into yann/open-in-editor-feature
yannbf Sep 16, 2025
6636c1d
make qrcode fallback to current url
yannbf Sep 16, 2025
809d220
add copy story link default shortcut
yannbf Sep 16, 2025
45daed4
skip vitest test
yannbf Sep 16, 2025
632561d
fix qr code url calculation
yannbf Sep 16, 2025
0ec0168
stop using better-opn when open has improved
ndelangen Sep 17, 2025
4d43dc3
Fix: Handle browser opening error gracefully in storybookDevServer
ndelangen Sep 17, 2025
72d98b7
Merge branch 'next' into yann/open-in-editor-feature
yannbf Sep 17, 2025
5be73b1
update icons and use the new editor icon
yannbf Sep 17, 2025
63bb329
Merge pull request #32484 from storybookjs/norbert/updates-2025-septe…
ndelangen Sep 17, 2025
c8e2ac3
Merge branch 'next' into yann/open-in-editor-feature
ndelangen Sep 17, 2025
6984ccd
Enhance exports: Add 'EditorIcon' to the list of exported icons in gl…
ndelangen Sep 17, 2025
e442493
Merge branch 'yann/open-in-editor-feature' of github.com:storybookjs/…
yannbf Sep 17, 2025
b7f1e1b
Add AppleScript for reusing existing Chrome tabs and enhance browser …
ndelangen Sep 17, 2025
4eb6f4e
Enhance error handling and browser opening logic in `openInBrowser` a…
ndelangen Sep 17, 2025
8abb1e3
move code into common folder
ndelangen Sep 17, 2025
90817f1
rework the open in editor feature and add error handling
yannbf Sep 17, 2025
65a4506
remove globalization we decided to remove
ndelangen Sep 17, 2025
cf13e70
address PR feedback
yannbf Sep 17, 2025
63a55b0
Refactor error handling in `openInBrowser` and clean up logging in `o…
ndelangen Sep 17, 2025
244fac1
revamp context menu and support opening mdx stories
yannbf Sep 17, 2025
93eb503
Merge pull request #32488 from storybookjs/norbert/improve-open-again
ndelangen Sep 17, 2025
7fad5ab
Merge branch 'next' into yann/open-in-editor-feature
ndelangen Sep 17, 2025
cd1b6e5
replace qrcode library
yannbf Sep 17, 2025
43d966b
Merge branch 'yann/open-in-editor-feature' of github.com:storybookjs/…
yannbf Sep 17, 2025
a363ba8
more fixes
yannbf Sep 17, 2025
5528525
Merge pull request #32491 from storybookjs/norbert/remove-deprecated-…
ndelangen Sep 17, 2025
aeb30b3
Merge branch 'next' into yann/open-in-editor-feature
yannbf Sep 17, 2025
b2b20b4
Merge branch 'next' into pr/43081j/32134
ndelangen Sep 17, 2025
12ded7f
Refactor `coerce` function for improved readability in `vitestConfigF…
ndelangen Sep 17, 2025
d0653ad
fix stories
yannbf Sep 17, 2025
472d593
fix linting
ndelangen Sep 17, 2025
8c61a23
Merge branch 'next' into yann/open-in-editor-feature
ndelangen Sep 17, 2025
1190cb5
fix: add missing newline in no-stories-of.md documentation
ndelangen Sep 17, 2025
efd5294
fix: update comments and formatting in test and CSS files
ndelangen Sep 17, 2025
aa7d21c
Update documentation for `no-stories-of` rule to include correct impo…
ndelangen Sep 17, 2025
7ebc251
Merge branch 'next' into yann/open-in-editor-feature
ndelangen Sep 17, 2025
a8ba6a1
Update addon-designs to sb10 canary
ndelangen Sep 17, 2025
5335ed9
bumb to new canary
ndelangen Sep 17, 2025
e194a32
prebundle qrcode.react
yannbf Sep 18, 2025
c58e9e9
add "open in editor" action to component nodes
yannbf Sep 18, 2025
39f52e4
Merge pull request #32496 from storybookjs/norbert/bump-addon-designs…
ndelangen Sep 18, 2025
a744783
address PR feedback
yannbf Sep 18, 2025
bbfa9e9
write E2E tests
yannbf Sep 18, 2025
97f2089
Merge pull request #32134 from 43081j/config-files-context
ndelangen Sep 18, 2025
a6b51dc
revamp open in editor api and bring it into useStorybookApi
yannbf Sep 18, 2025
6c985c5
Merge branch 'next' into yann/open-in-editor-feature
yannbf Sep 18, 2025
21529d2
fix test
yannbf Sep 18, 2025
3b49d88
Merge branch 'yann/open-in-editor-feature' of github.com:storybookjs/…
yannbf Sep 18, 2025
af37fd7
fix tests
yannbf Sep 18, 2025
d399876
Enhance error handling in telemetry by queuing errors when the channe…
ndelangen Sep 18, 2025
6b967f1
Merge pull request #32499 from storybookjs/norbert/queue-telemetry-ma…
ndelangen Sep 18, 2025
269c931
better structure E2E tests
yannbf Sep 18, 2025
cc2ffba
Merge branch 'next' into yann/open-in-editor-feature
yannbf Sep 18, 2025
2d630a4
Merge pull request #32452 from storybookjs/yann/open-in-editor-feature
yannbf Sep 18, 2025
a8e4d83
Update CHANGELOG.md for v9.1.7 [skip ci]
storybook-bot Sep 18, 2025
a530612
Refactor FormComponent to use Angular signals and standalone module. …
ndelangen Sep 18, 2025
4c52fbf
Merge pull request #32502 from storybookjs/norbert/fix-angular-form-c…
ndelangen Sep 18, 2025
98c9bc7
Fix: Ensure newline at the end of JSON output in version bump scripts
ndelangen Sep 19, 2025
50ed0dd
Merge pull request #32505 from storybookjs/norbert/add-end-of-file-ne…
ndelangen Sep 19, 2025
9dc2e67
Fix: Ensure consistent newline at the end of JSON output in version b…
ndelangen Sep 19, 2025
d012461
Refactor: Update version test assertions to use expect.stringContaini…
ndelangen Sep 19, 2025
795e05c
Fix: Remove extra newline at the end of JSON output in version bump s…
ndelangen Sep 19, 2025
14c9b73
Write changelog for 10.0.0-beta.6 [skip ci]
storybook-bot Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 9.1.7

- Dependencies: Update `vite-plugin-storybook-nextjs` to 2.0.7 - [#32331](https://github.com/storybookjs/storybook/pull/32331), thanks @k35o!
- React: Preserve `@ts-expect-error` in preview - [#32442](https://github.com/storybookjs/storybook/pull/32442), thanks @mrginglymus!
- Telemetry: Queue error reporting & filter browser-extention - [#32499](https://github.com/storybookjs/storybook/pull/32499), thanks @ndelangen!

## 9.1.6

- CLI: Capture the version specifier used in `create-storybook` - [#32344](https://github.com/storybookjs/storybook/pull/32344), thanks @shilman!
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 10.0.0-beta.6

- Core: Add "open in editor" feature - [#32452](https://github.com/storybookjs/storybook/pull/32452), thanks @yannbf!
- Dev: Improve the browser opening experience - [#32488](https://github.com/storybookjs/storybook/pull/32488), thanks @ndelangen!
- Maintenance: Remove globalization for dropped entrypoints - [#32491](https://github.com/storybookjs/storybook/pull/32491), thanks @ndelangen!
- Telemetry: Queue error reporting & filter browser-extention - [#32499](https://github.com/storybookjs/storybook/pull/32499), thanks @ndelangen!
- Upgrade: Packages `open` - [#32484](https://github.com/storybookjs/storybook/pull/32484), thanks @ndelangen!

## 10.0.0-beta.5

- Dependencies: Update `vite-plugin-storybook-nextjs` to 2.0.7 - [#32331](https://github.com/storybookjs/storybook/pull/32331), thanks @k35o!
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"devDependencies": {
"@radix-ui/react-tabs": "1.0.4",
"@storybook/icons": "^1.4.0",
"@storybook/icons": "^1.6.0",
"@testing-library/react": "^14.0.0",
"execa": "^9.5.2",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"dependencies": {
"@mdx-js/react": "^3.0.0",
"@storybook/csf-plugin": "workspace:*",
"@storybook/icons": "^1.4.0",
"@storybook/icons": "^1.6.0",
"@storybook/react-dom-shim": "workspace:*",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"upath": "^2.0.1"
},
"devDependencies": {
"@storybook/icons": "^1.4.0",
"@storybook/icons": "^1.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-resize-detector": "^7.1.2",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/onboarding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"devDependencies": {
"@neoconfetti/react": "^1.0.0",
"@storybook/icons": "^1.4.0",
"@storybook/icons": "^1.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-joyride": "^2.8.2",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/pseudo-states/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"prep": "jiti ../../../scripts/build/build-package.ts"
},
"devDependencies": {
"@storybook/icons": "^1.4.0",
"@storybook/icons": "^1.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.8.3"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"ts-dedent": "^2.0.0"
},
"devDependencies": {
"@storybook/icons": "^1.4.0",
"@storybook/icons": "^1.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.8.3"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
},
"dependencies": {
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.4.0",
"@storybook/icons": "^1.6.0",
"prompts": "^2.4.0",
"ts-dedent": "^2.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ export const InSidebarContextMenu: Story = {
importPath: './path/to/story',
prepared: true,
parent: 'parent-id',
exportName: 'ExampleStory',
depth: 1,
},
},
Expand Down
1 change: 1 addition & 0 deletions code/builders/builder-webpack5/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({
immutable: true,
})
);

router.use(compilation);
router.use(webpackHotMiddleware(compiler, { log: false }));

Expand Down
94 changes: 94 additions & 0 deletions code/core/assets/server/openBrowser.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
(*
Copyright (c) 2015-present, Facebook, Inc.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*)

property targetTab: null
property targetTabIndex: -1
property targetWindow: null
property theProgram: "Google Chrome"

on run argv
set theURL to item 1 of argv
set matchURL to item 2 of argv

-- Allow requested program to be optional,
-- default to Google Chrome
if (count of argv) > 2 then
set theProgram to item 3 of argv
end if

using terms from application "Google Chrome"
tell application theProgram

if (count every window) = 0 then
make new window
end if

-- 1: Looking for tab running debugger
-- then, Reload debugging tab if found
-- then return
set found to my lookupTabWithUrl(matchURL)
if found then
set targetWindow's active tab index to targetTabIndex
tell targetTab to reload
tell targetWindow to activate
set index of targetWindow to 1
return
end if

-- 2: Looking for Empty tab
-- In case debugging tab was not found
-- We try to find an empty tab instead
set found to my lookupTabWithUrl("chrome://newtab/")
if found then
set targetWindow's active tab index to targetTabIndex
set URL of targetTab to theURL
tell targetWindow to activate
return
end if

-- 3: Create new tab
-- both debugging and empty tab were not found
-- make a new tab with url
tell window 1
activate
make new tab with properties {URL:theURL}
end tell
end tell
end using terms from
end run

-- Function:
-- Lookup tab with given url
-- if found, store tab, index, and window in properties
-- (properties were declared on top of file)
on lookupTabWithUrl(lookupUrl)
using terms from application "Google Chrome"
tell application theProgram
-- Find a tab with the given url
set found to false
set theTabIndex to -1
repeat with theWindow in every window
set theTabIndex to 0
repeat with theTab in every tab of theWindow
set theTabIndex to theTabIndex + 1
if (theTab's URL as string) contains lookupUrl then
-- assign tab, tab index, and window to properties
set targetTab to theTab
set targetTabIndex to theTabIndex
set targetWindow to theWindow
set found to true
exit repeat
end if
end repeat

if found then
exit repeat
end if
end repeat
end tell
end using terms from
return found
end lookupTabWithUrl
7 changes: 4 additions & 3 deletions code/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,12 @@
},
"dependencies": {
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.4.0",
"@storybook/icons": "^1.6.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/user-event": "^14.6.1",
"@vitest/expect": "3.2.4",
"@vitest/mocker": "3.2.4",
"@vitest/spy": "3.2.4",
"better-opn": "^3.0.2",
"esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0",
"recast": "^0.23.5",
"semver": "^7.6.2",
Expand Down Expand Up @@ -318,13 +317,14 @@
"jiti": "^2.4.2",
"js-yaml": "^4.1.0",
"jsdoc-type-pratt-parser": "^4.0.0",
"launch-editor": "^2.11.1",
"lazy-universal-dotenv": "^4.0.0",
"leven": "^4.0.0",
"memfs": "^4.11.1",
"memoizerific": "^1.11.3",
"nanoid": "^4.0.2",
"npmlog": "^7.0.0",
"open": "^8.4.0",
"open": "^10.2.0",
"p-limit": "^6.2.0",
"package-manager-detector": "^1.1.0",
"picocolors": "^1.1.0",
Expand All @@ -335,6 +335,7 @@
"prettier": "^3.5.3",
"pretty-hrtime": "^1.0.3",
"prompts": "^2.4.0",
"qrcode.react": "^4.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet-async": "^1.3.0",
Expand Down
4 changes: 4 additions & 0 deletions code/core/src/builder-manager/utils/framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,9 @@ export const buildFrameworkGlobalsFromOptions = async (options: Options) => {
globals.STORYBOOK_FRAMEWORK = framework;
}

if (options.networkAddress) {
globals.STORYBOOK_NETWORK_ADDRESS = options.networkAddress;
}

return globals;
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const managerContext: any = {
api: {
getDocsUrl: fn().mockName('api::getDocsUrl'),
emit: fn().mockName('api::emit'),
getData: fn()
.mockName('api::getData')
.mockImplementation(() => ({
importPath: 'core/src/component-testing/components/InteractionsPanel.stories.tsx',
})),
},
};

Expand Down
10 changes: 10 additions & 0 deletions code/core/src/component-testing/components/InteractionsPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';

import { transparentize } from 'polished';
import type { API } from 'storybook/manager-api';
import { styled } from 'storybook/theming';

import { type Call, type CallStates, type ControlStates } from '../../instrumenter/types';
Expand Down Expand Up @@ -44,6 +45,9 @@ interface InteractionsPanelProps {
onScrollToEnd?: () => void;
hasResultMismatch?: boolean;
browserTestStatus?: CallStates;
importPath?: string;
canOpenInEditor?: boolean;
api: API;
}

const Container = styled.div(({ theme }) => ({
Expand Down Expand Up @@ -104,6 +108,9 @@ export const InteractionsPanel: React.FC<InteractionsPanelProps> = React.memo(
endRef,
hasResultMismatch,
browserTestStatus,
importPath,
canOpenInEditor,
api,
}) {
const filter = useAnsiToHtmlFilter();
const hasRealInteractions = interactions.some((i) => i.id !== INTERNAL_RENDER_CALL_ID);
Expand All @@ -120,6 +127,9 @@ export const InteractionsPanel: React.FC<InteractionsPanelProps> = React.memo(
status={status}
storyFileName={fileName}
onScrollToEnd={onScrollToEnd}
importPath={importPath}
canOpenInEditor={canOpenInEditor}
api={api}
/>
<div aria-label="Interactions list">
{interactions.map((call) => (
Expand Down
11 changes: 11 additions & 0 deletions code/core/src/component-testing/components/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
useAddonState,
useChannel,
useParameter,
useStorybookApi,
useStorybookState,
} from 'storybook/manager-api';

import {
Expand Down Expand Up @@ -191,6 +193,12 @@ export const Panel = memo<{ refId?: string; storyId: string; storyUrl: string }>
});

// shared state
const state = useStorybookState();
const api = useStorybookApi();
const data = api.getData(state.storyId, state.refId);
const importPath = data?.importPath as string | undefined;
const canOpenInEditor = global.CONFIG_TYPE === 'DEVELOPMENT' && !state.refId;

const [panelState, set] = useAddonState<PanelState>(ADDON_ID, {
status: 'rendering' as PlayStatus,
controlStates: INITIAL_CONTROL_STATES,
Expand Down Expand Up @@ -406,6 +414,9 @@ export const Panel = memo<{ refId?: string; storyId: string; storyUrl: string }>
// @ts-expect-error TODO
endRef={endRef}
onScrollToEnd={scrollTarget && scrollToTarget}
importPath={importPath}
canOpenInEditor={canOpenInEditor}
api={api}
/>
</Fragment>
);
Expand Down
17 changes: 17 additions & 0 deletions code/core/src/component-testing/components/Subnav.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React from 'react';

import { action } from 'storybook/actions';

import { Subnav } from './Subnav';
Expand Down Expand Up @@ -132,3 +134,18 @@ export const Detached = {
},
},
};

export const WithOpenInEditorLink = {
args: {
status: 'completed',
controlStates: {
detached: true,
start: false,
back: false,
goto: false,
next: false,
end: false,
},
canOpenInEditor: true,
},
};
Loading
Loading