fix(tui): register storybook only for story runs - #39733
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
storybookplugin 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) orOPENCODE_STORY=<story>(direct) registers it exactly as before.How
packages/tui/src/plugin/builtins.ts: includeStorybookin the builtin list only whenprocess.env.OPENCODE_STORYis 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 typecheckcd packages/tui && bun run test— 569 pass / 5 skip / 0 fail