Skip to content

fix(tui): register storybook only for story runs - #39733

Merged
kitlangton merged 1 commit into
v2from
storybook-gate
Jul 30, 2026
Merged

fix(tui): register storybook only for story runs#39733
kitlangton merged 1 commit into
v2from
storybook-gate

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

The component storybook (#39548) is a development tool, but it registered as an always-on builtin plugin — every user saw Open storybook and Storybook: Session tabs in their command palette (Debug group).

Before / After

Before: typing "story" (or browsing) in any user's command palette surfaced the storybook entries, and the storybook plugin route was navigable in every session.

After: normal launches register no storybook plugin at all — no palette entries, no route, no keymap layer. Launching with OPENCODE_STORY=1 (index) or OPENCODE_STORY=<story> (direct) registers it exactly as before.

How

packages/tui/src/plugin/builtins.ts: include Storybook in the builtin list only when process.env.OPENCODE_STORY is set — the same variable the boot route already keys on, so story runs remain self-contained. The module stays statically imported (a few component definitions, no module-scope effects); the gate removes the meaningful cost: plugin activation, its keymap layer, and per-palette-query command evaluation.

Testing

  • cd packages/tui && bun typecheck
  • cd packages/tui && bun run test — 569 pass / 5 skip / 0 fail

@kitlangton
kitlangton merged commit 22d2012 into v2 Jul 30, 2026
11 of 13 checks passed
@kitlangton
kitlangton deleted the storybook-gate branch July 30, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant