Skip to content

[core] Add Storybook stories for Toast#7969

Open
mm-wang wants to merge 6 commits intodevelopfrom
stories/toast
Open

[core] Add Storybook stories for Toast#7969
mm-wang wants to merge 6 commits intodevelopfrom
stories/toast

Conversation

@mm-wang
Copy link
Copy Markdown
Contributor

@mm-wang mm-wang commented Mar 25, 2026

Summary

  • Extracted Storybook stories for Toast component
  • Stories provide visual regression testing coverage

Files

  • Toast.stories.tsx

Test plan

  • Verify stories render correctly in Storybook
  • Check all story variants display properly in light and dark themes

🤖 Generated with Claude Code

@blueprint-previews
Copy link
Copy Markdown

[core] Add Storybook stories for Toast

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

@blueprint-previews
Copy link
Copy Markdown

[core] Add Storybook stories for Toast

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

@blueprint-previews
Copy link
Copy Markdown

Remove redundant AllIntents story, run pnpm format

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

@blueprint-previews
Copy link
Copy Markdown

Remove redundant AllIntents story, run pnpm format

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

@blueprint-previews
Copy link
Copy Markdown

Replace native HTML elements with Blueprint components

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

@blueprint-previews
Copy link
Copy Markdown

Replace native HTML elements with Blueprint components

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

@blueprint-previews
Copy link
Copy Markdown

Replace native HTML elements with Blueprint components

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

@mm-wang mm-wang marked this pull request as ready for review April 3, 2026 22:47
Copilot AI review requested due to automatic review settings April 3, 2026 22:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new Storybook story file for the Toast component to support visual regression coverage and interactive exploration of props.

Changes:

  • Introduces Toast.stories.tsx with default, intent matrix, icon variants, and a playground story
  • Configures Storybook controls/args and a centering decorator for consistent rendering

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +94 to +97
<Toast {...args} icon="tick-circle" intent="success" message="File saved successfully" />
<Toast {...args} icon="warning-sign" intent="warning" message="Connection is unstable" />
<Toast {...args} icon="error" intent="danger" message="Failed to save changes" />
<Toast {...args} icon="info-sign" intent="primary" message="New update available" />
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

intent is set using string literals in multiple places while the stories elsewhere use Intent enum values (e.g., Intent.NONE). If Toast’s intent prop is typed as Intent (string enum), these string literals will not type-check. Use Intent.SUCCESS, Intent.WARNING, Intent.DANGER, Intent.PRIMARY, etc., for consistency and to satisfy the prop type.

Copilot uses AI. Check for mistakes.
args: {
message: "Playground toast message",
icon: "info-sign",
intent: "primary",
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

intent is set using string literals in multiple places while the stories elsewhere use Intent enum values (e.g., Intent.NONE). If Toast’s intent prop is typed as Intent (string enum), these string literals will not type-check. Use Intent.SUCCESS, Intent.WARNING, Intent.DANGER, Intent.PRIMARY, etc., for consistency and to satisfy the prop type.

Copilot uses AI. Check for mistakes.
intent: { table: { disable: true } },
},
render: args => (
<div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The same inline style object is duplicated in multiple stories. Consider extracting it to a shared constant (e.g., const columnContainerStyle = { ... }) and reusing it to reduce duplication and keep visual/layout tweaks consistent across stories.

Copilot uses AI. Check for mistakes.
icon: { table: { disable: true } },
},
render: args => (
<div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The same inline style object is duplicated in multiple stories. Consider extracting it to a shared constant (e.g., const columnContainerStyle = { ... }) and reusing it to reduce duplication and keep visual/layout tweaks consistent across stories.

Copilot uses AI. Check for mistakes.
@blueprint-previews
Copy link
Copy Markdown

Rename story

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

mm-wang and others added 6 commits April 16, 2026 12:10
Files:
- packages/core/src/components/toast/Toast.stories.tsx
- Consolidate stories following Button/Tag/Card pattern
- Use standard naming: IntentExample, SizeExample, StateExample, etc.
- Remove redundant/overly-specific stories
- Remove DarkTheme stories (handled by Storybook globally)
- Keep visual regression matrix and Playground stories

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AllIntents does not add better examples beyond IntentExample.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace <h3>, <h4>, <h5> with Blueprint H3, H4, H5
- Replace <p> with Blueprint Text component
- Remove intent !== none filter to show None intent in examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@blueprint-previews
Copy link
Copy Markdown

Rename story

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

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.

2 participants