You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an optional options parameter to initOpenInEditorChannel to let callers specify an editor priority (single id or ordered array). Pass that preference to the existing launch(command, options) call so users with multiple installed editors can control which editor opens first.
Problem Statement
Storybook 10 added "Open in editor". Currently initOpenInEditorChannel invokes launch(command) without passing editor preference; users cannot control which IDE is attempted first. Developers often have multiple editors (VS Code, WebStorm, etc.) and expect to pick a preferred one. This improves DX and reduces friction when opening source from Storybook.
Non-goals
No response
Implementation
Add a non-breaking optional options param to initOpenInEditorChannel:
editorPreference?: string | string[] — editor id(s) or well-known names in priority order. (optional) launchArgs?: Record<string, unknown> — passthrough for launch.
When opening, call launch(command, { editorPreference, ...launchArgs }) so the launch implementation can try editors in order.
typeOpenInEditorOptions={editorPreference?: string|string[];// e.g. 'vscode' or ['vscode', 'webstorm']launchArgs?: Record<string,unknown>;};exportfunctioninitOpenInEditorChannel(/* ...existing params... */,options?: OpenInEditorOptions){// ...existing code...// previous: launch(command);launch(command,{editorPreference: options?.editorPreference, ...(options?.launchArgs??{})});// ...existing code...}
Verify launch already accepts a second options parameter; if not, extend launch to accept { editorPreference?: string | string[], ... } and attempt editors in given order.
Add a small mapping of common ids/names to underlying commands (e.g. 'vscode' -> 'code', 'webstorm' -> 'webstorm'), with platform-aware command variations if needed.
When editorPreference is an array, attempt each entry until one succeeds; fall back to existing default behavior if none do.
Maintain existing logging via storybook logger APIs for success/failure messages.
Prior Art
No response
Deliverables
No response
Risks
Options are optional. If absent, existing behavior is preserved.
No breaking API changes.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Add an optional options parameter to initOpenInEditorChannel to let callers specify an editor priority (single id or ordered array). Pass that preference to the existing launch(command, options) call so users with multiple installed editors can control which editor opens first.
Problem Statement
Storybook 10 added "Open in editor". Currently initOpenInEditorChannel invokes launch(command) without passing editor preference; users cannot control which IDE is attempted first. Developers often have multiple editors (VS Code, WebStorm, etc.) and expect to pick a preferred one. This improves DX and reduces friction when opening source from Storybook.
Non-goals
No response
Implementation
Add a non-breaking optional options param to initOpenInEditorChannel:
editorPreference?: string | string[]— editor id(s) or well-known names in priority order.(optional) launchArgs?: Record<string, unknown>— passthrough for launch.When opening, call
launch(command, { editorPreference, ...launchArgs })so the launch implementation can try editors in order.Verify launch already accepts a second options parameter; if not, extend launch to accept
{ editorPreference?: string | string[], ... }and attempt editors in given order.Add a small mapping of common ids/names to underlying commands (e.g. 'vscode' -> 'code', 'webstorm' -> 'webstorm'), with platform-aware command variations if needed.
When editorPreference is an array, attempt each entry until one succeeds; fall back to existing default behavior if none do.
Maintain existing logging via storybook logger APIs for success/failure messages.
Prior Art
No response
Deliverables
No response
Risks
Options are optional. If absent, existing behavior is preserved.
No breaking API changes.
Unresolved Questions
No response
Alternatives considered / Abandoned Ideas
No response
Beta Was this translation helpful? Give feedback.
All reactions