docs(stories): add Storybook catalog for SlackBlockPreview - #18
Merged
Conversation
Adds one story per supported block type (header, section, divider, context, actions, image, markdown, rich_text, input, card, carousel, context_actions, alert, table), plus a DarkTheme variant and a WithDirectiveHooks demo. Provides a visual catalog of every block type the preview renders, with a live theme toggle in the controls panel. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Markdown link, Carousel scrollable region, and DarkTheme button
trip axe rules that live in the upstream slack-blocks-to-jsx markup
and can't be fixed from the consumer side. Match the rest of the
story suite by setting `a11y: { test: 'todo' }` on the meta so axe
still reports the violations in the addon panel without failing the
vitest storybook project.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds three #slack_blocks_to_jsx-scoped CSS overrides so the preview
satisfies axe a11y rules at render time instead of suppressing them at
test time:
- Inline code: darken from #e01e5a to #c4144b (4.31:1 → 5.9:1 vs the
tinted background, hits WCAG AA's 4.5:1).
- Markdown links: always-on underline so links don't rely on color
alone (WCAG 1.4.1). Upstream only underlines on :hover.
- Primary / danger buttons in dark mode: force white text on
.bg-green-primary and .bg-red-primary, where upstream applied the
light-grey dark-text token (3.52:1 and 3.19:1) on saturated fills.
Also drops the now-redundant DarkTheme story (the meta already exposes
`theme` as an inline-radio arg, so any story can be toggled) and adds
focusable buttons to the Carousel fixture so the scrollable region has
keyboard-reachable content. With these fixes, the previous
`a11y: { test: 'todo' }` flag is removed and axe runs as a hard check
against every story.
Verified locally: `vitest run --project storybook` 39/39 passing,
axe.run() returns zero violations on Markdown, Carousel, and Actions
(dark theme).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
src/components/preview/slack-block-preview.stories.tsxwith one story per supported block type (header, section, divider, context, actions, image, markdown, rich_text, input, card, carousel, context_actions, alert, table).DarkThemestory showingdata-theme="dark"styling, and aWithDirectiveHooksstory demonstrating user/channel/emoji hook resolution.themeprop as a Storybook arg so reviewers can toggle light/dark from the controls panel without opening a separate story.Why
SlackBlockPreviewis the visual core of the builder, but until now it was only exercised through the fullBlockKitBuilderstory. This adds a per-block-type catalog that doubles as living documentation for which block payloads render correctly.Test plan
pnpm typecheck(clean)pnpm test(52/52 passing via pre-push hook)data-theme="dark", slack-dark background), and WithDirectiveHooks (<@U123>→@user-U123,<#C456>→#channel-C456).🤖 Generated with Claude Code