GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore(app): replace Storybook with a story server for component tests by kitlangton · Pull Request #57966 · anomalyco/opencode

Conversation

@kitlangton

@kitlangton kitlangton commented Oct 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Kit picked "Lab Replaces Storybook" on D-13; the lab itself landed in #57908. This is the removal half, rebased onto beta as one commit.

Storybook's UI is replaced by the components lab in the app. Its other job, running the component tests (40 spec files in packages/app/component-tests and packages/session-ui/component-tests), moves to a small story server that needs no Storybook.

What changes

  • packages/storybook becomes packages/stories: a plain Vite page that renders one story at /?id=<story id>&args=…&globals=….
    • src/frame.tsx holds the decorators preview.tsx had (theme, direction, locale, motion, dialog and markdown providers, an extension's context), plus the app's SettingsProvider.
    • src/index-plugin.ts indexes every *.stories.tsx by the id Storybook gave it (<meta id or title>--<export>), so every spec keeps its ids. A spec loads only its own story file.
    • vite.config.ts keeps Storybook's mock aliases, dedupe and dependency-scan entries.
    • mocks/ and playwright/ move over unchanged apart from their paths.
  • The story fixture navigates to the frame and returns #story-root. The mount(id, { args, globals }) signature is unchanged; every arg in the URL is applied, typed by the story's own default.
  • Removed:
    • Storybook, its addons (a11y, docs, links, onboarding, vitest) and the React it pulled in;
    • .storybook/ (main, preview, manager, theme tool, playground CSS plugin);
    • the storybook build workflow (it only ran on dev);
    • bun dev:storybook.
  • Updated: the test.yml affected filter (@opencode/stories), ui's Tailwind @source, the component-tests skill, the AGENTS.md line, and the playwright README.
  • Kept: every *.stories.tsx file, unchanged.

Fixed along the way

  • activity-chips.spec.ts has failed on beta since a1e0aa4 made the activity capsule read settings, which no story frame provided. The frame now provides them.
  • Lint in four spec files whose import line changed: blank lines, a tuple loop instead of a nested ternary, and a per-case reveal instead of a conditional spread.

Testing

  • Every id the specs mount (57 literal ones plus the 5 built in loops) resolves in the index and renders in the frame. activity-chips now renders as well.
  • bun typecheck in app, session-ui and gui-extensions; lint:changed is clean against beta. terminal-focus.spec.ts (app) and file.spec.ts (session-ui) pass locally on the story server.
  • CI on cfe1fd2: unit, build and session-ui-components pass on Linux and Windows. app-components has 5 failures on each OS against beta's 12, all of which also fail on beta (websearch at 360px, timeline-virtualizer offset-only). activity-chips and six websearch cases now pass.
  • Windows checkouts have CRLF line endings, so the story index normalises them before reading a file's meta (cfe1fd2).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added the contributor label Oct 21, 2026
Base automatically changed from components-lab to beta October 22, 2026 05:21
@kitlangton
chore(app): replace Storybook with a story server for component tests
60f4720
packages/storybook becomes packages/stories: a plain Vite page that renders one story by its Storybook id with the same mocks and decorators, so every component test keeps its ids and mount(). The components lab is the place to browse stories. Removes Storybook, its addons, .storybook/, its workflow and dev:storybook. The frame also provides settings, which fixes activity-chips.spec, and the story index reads CRLF checkouts.
@kitlangton
kitlangton force-pushed the remove-storybook branch from ba5ec6f to 60f4720 Compare October 22, 2026 05:23
@kitlangton
docs: describe component tests without Storybook
5b93291
@kitlangton
kitlangton marked this pull request as ready for review October 22, 2026 06:45
@kitlangton
kitlangton requested review from Brendonovich and Hona as code owners October 22, 2026 06:45
@kitlangton
kitlangton merged commit 28c2a86 into beta Oct 22, 2026
9 of 17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kitlangton
kitlangton deleted the remove-storybook branch October 22, 2026 06:45
opencode-agent[bot]
opencode-agent Bot reviewed Oct 22, 2026
View reviewed changes

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sound. Both component suites run on the new story server with the same results as beta's Storybook: app 146 passed / 5 failed, and the same 5 (websearch at 360px ×4, timeline-virtualizer offset-only reconnect) fail on beta. session-ui passed all 156. In my environment activity-chips also passed on beta, so I couldn't reproduce that particular failure. Typecheck is clean in app, session-ui and gui-extensions.

Public API: unchanged. This only touches internal dev tooling: the @opencode/storybook package becomes @opencode/stories, the root dev:storybook script is removed, and the PLAYWRIGHT_STORYBOOK_PORT/_URL test env vars become PLAYWRIGHT_STORIES_PORT/_URL. None of these are user-facing.

One small point: the play functions in about 40 *.stories.tsx files now run nowhere (the story frame ignores them). That's fine if the lab is meant to replace them, but it's worth knowing they're now dead code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/stories/src/frame.tsx
{(loaded) => {
const meta = asStory(loaded().exports.default)
const own = loaded().exports[story!.name]
const entry = typeof own === "function" ? { render: own } : asStory(own)

@opencode-agent opencode-agent Bot Oct 22, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing type-checks this package: packages/stories has no typecheck script, and app's tsconfig only includes ../stories/playwright/*.ts. tsc -p packages/stories reports TS2339 here and on line 47, because { render: own } has no args/parameters. Annotating entry as StoryObject would fix it. Adding a typecheck script (and fixing the tsconfig lib so ../util passes) would keep frame.tsx, extension.tsx and the index plugin checked in CI.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kitlangton kitlangton mentioned this pull request Oct 25, 2026
chore: merge dev into beta #59055
Closed
@opencodejr opencodejr Bot mentioned this pull request Nov 13, 2026
feat(session-ui): make session stories configurable and preview file media #63738
Merged
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencode-agent opencode-agent[bot] opencode-agent[bot] left review comments
@Hona Hona Awaiting requested review from Hona
@Brendonovich Brendonovich Awaiting requested review from Brendonovich

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@kitlangton
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.