Skip to content

feat: add Storybook for backend-free UI work#308

Open
hsiez wants to merge 1 commit intoe2b-dev:mainfrom
hsiez:add-storybook
Open

feat: add Storybook for backend-free UI work#308
hsiez wants to merge 1 commit intoe2b-dev:mainfrom
hsiez:add-storybook

Conversation

@hsiez
Copy link
Copy Markdown

@hsiez hsiez commented Apr 29, 2026

Adds Storybook 10 with the @storybook/nextjs framework so design and component work no longer requires standing up the full dashboard backend.

Highlights:

  • .storybook config mirrors tsconfig path aliases and wraps stories in ThemeProvider, TooltipProvider, and Toaster (no tRPC needed).
  • Server actions are aliased to a stub and next-safe-action/hooks is redirected to a controllable mock so server-only deps stay out of the bundle and stories can drive success / pending / error states.
  • First story: CreateApiKeyDialog with five play-driven states (empty form, validation error, submitting, server error, success with revealed key), used to iterate on the dialog UX.

Dialog UX follow-ups while writing the stories:

  • Title/description switch on the success step ("Your New API Key", no description); removed the now-redundant inner label.
  • Close button is variant=secondary; the X is hidden on the success step.
  • Copy button is variant=primary; clicking the readonly key field also copies and shares the same animation state as the button.
  • Input primitive: readOnly inputs no longer show hover/focus affordances intended for editable fields.

Run with bun run storybook (defaults to port 6006).

Adds Storybook 10 with the @storybook/nextjs framework so design and
component work no longer requires standing up the full dashboard backend.

Highlights:
- .storybook config mirrors tsconfig path aliases and wraps stories in
  ThemeProvider, TooltipProvider, and Toaster (no tRPC needed).
- Server actions are aliased to a stub and next-safe-action/hooks is
  redirected to a controllable mock so server-only deps stay out of the
  bundle and stories can drive success / pending / error states.
- First story: CreateApiKeyDialog with five play-driven states
  (empty form, validation error, submitting, server error, success
  with revealed key), used to iterate on the dialog UX.

Dialog UX follow-ups while writing the stories:
- Title/description switch on the success step ("Your New API Key", no
  description); removed the now-redundant inner label.
- Close button is variant=secondary; the X is hidden on the success step.
- Copy button is variant=primary; clicking the readonly key field also
  copies and shares the same animation state as the button.
- Input primitive: readOnly inputs no longer show hover/focus affordances
  intended for editable fields.

Run with `bun run storybook` (defaults to port 6006).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

@hsiez is attempting to deploy a commit to the E2B Team on Vercel.

A member of the Team first needs to authorize it.

@hsiez
Copy link
Copy Markdown
Author

hsiez commented Apr 29, 2026

Before
CleanShot 2026-04-28 at 20 49 58@2x

After
CleanShot 2026-04-28 at 20 48 36@2x

@hsiez
Copy link
Copy Markdown
Author

hsiez commented Apr 29, 2026

@ben-fornefeld I totally understand if the storybook integration is too intrusive, worth an attempt.

@hsiez hsiez marked this pull request as ready for review April 29, 2026 03:52
@hsiez hsiez requested a review from ben-fornefeld as a code owner April 29, 2026 03:52
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ab9189b0b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

const screen = await openDialog(canvasElement)
const input = await screen.findByLabelText('Name')
await userEvent.type(input, 'production-key')
await userEvent.click(await screen.findByRole('button', { name: /^create key$/i }))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update success-story assertion to current dialog title

The SuccessWithRevealedKey play function still expects Your API Key, but the component now renders Your New API Key on success (create-api-key-dialog.tsx). This makes the play function fail whenever the story runs, so the success state story is effectively broken and no longer validates the intended UI flow.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant