Skip to content

feat: Add Storybook component library with 46 presentational components#1156

Draft
cliffhall wants to merge 32 commits intov2/mainfrom
add-storybook
Draft

feat: Add Storybook component library with 46 presentational components#1156
cliffhall wants to merge 32 commits intov2/mainfrom
add-storybook

Conversation

@cliffhall
Copy link
Member

@cliffhall cliffhall commented Mar 17, 2026

Summary

  • Storybook component plan (specification/v2_ux_storybook.md) defining all components, props, stories, and build order
  • Mantine theme with component extensions, CSS custom properties (--inspector-* design tokens), and dark/light mode support
  • 46 presentational components built in isolation with Storybook stories, organized bottom-up:
    • 12 atoms: StatusIndicator, AnnotationBadge, CapabilityItem, LogEntry, ProgressDisplay, ContentViewer, ListChangedIndicator, CopyButton, ConnectionToggle, TransportBadge, InlineError, MessageBubble
    • 25 molecules: SchemaForm, ServerCard, AddServerMenu, ToolListItem, ToolDetailPanel, ResultPanel, ResourceListItem, ResourcePreviewPanel, ResourceTemplateInput, PromptArgumentsForm, PromptMessagesDisplay, LogControls, TaskCard, HistoryEntry, ServerInfoContent, ServerSettingsForm, RootsTable, SamplingRequestPanel, ElicitationFormPanel, ElicitationUrlPanel, InlineSamplingRequest, InlineElicitationRequest, PendingClientRequests, ImportServerJsonPanel, ExperimentalFeaturesPanel
    • 7 organisms: ServerListScreen, ToolsScreen, ResourcesScreen, PromptsScreen, LoggingScreen, TasksScreen, HistoryScreen
    • 2 layouts: HomeLayout (disconnected state), ConnectedLayout (with tab navigation)

All components follow the presentational/container pattern — they receive data and callbacks via props with no store access, making them testable in Storybook isolation.

Example Storybook Screenshots

Desktop

Screenshot 2026-03-17 at 6 03 29 PM

Tablet

Screenshot 2026-03-17 at 6 00 55 PM

Large Mobile

Screenshot 2026-03-17 at 6 02 03 PM

Outline

Screenshot 2026-03-17 at 6 04 03 PM

Measure

Screenshot 2026-03-17 at 6 05 19 PM

Test plan

  • Run npm run build succeeds
  • Run npm run lint succeeds
  • Run npm run format:check succeeds
  • Run npm run storybook:build succeeds
  • Run npm run storybook and visually verify components in light/dark mode
  • Verify all story variations render correctly

🤖 Generated with Claude Code

cliffhall and others added 9 commits March 10, 2026 10:22
* Broke v2_tech_stack.md into v2_web_client.md, v2_server.md, and v2_storage.md
* Added v2 components with information on the presenttional components pattern.
Defines all presentational components to be built in Storybook with Mantine,
organized bottom-up (atoms, molecules, organisms, layouts) with props interfaces,
Mantine implementation notes, story variations, build order, and configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Added storybook build plan
…ts with Storybook stories

- Mantine theme with component extensions (Badge, Card, Paper, Button, etc.)
- CSS custom properties for design tokens (--inspector-* vars)
- Dark/light mode support with auto detection
- 12 atoms: StatusIndicator, AnnotationBadge, CapabilityItem, LogEntry,
  ProgressDisplay, ContentViewer, ListChangedIndicator, CopyButton,
  ConnectionToggle, TransportBadge, InlineError, MessageBubble
- 25 molecules: ServerCard, AddServerMenu, SchemaForm, ToolListItem,
  ToolDetailPanel, ResultPanel, ResourceListItem, ResourcePreviewPanel,
  ResourceTemplateInput, PromptArgumentsForm, PromptMessagesDisplay,
  LogControls, TaskCard, HistoryEntry, ServerInfoContent, ServerSettingsForm,
  RootsTable, SamplingRequestPanel, ElicitationFormPanel, ElicitationUrlPanel,
  InlineSamplingRequest, InlineElicitationRequest, PendingClientRequests,
  ImportServerJsonPanel, ExperimentalFeaturesPanel
- Exclude storybook-static from version control
- Exclude .stories.tsx from app tsconfig (Storybook-only modules)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ServerListScreen: Home page with server card grid and add server menu
- ToolsScreen: Three-panel layout (tool list, detail/form, results)
- ResourcesScreen: Two-panel with accordion sections and content preview
- PromptsScreen: Two-panel with prompt selection and message display
- LoggingScreen: Two-panel with log controls and real-time log stream
- TasksScreen: Active and completed task card sections
- HistoryScreen: Request history with search, filter, and pinned entries

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ories

- HomeLayout: AppShell with header (title + theme toggle) for disconnected state
- ConnectedLayout: AppShell with server name, status indicator, tab navigation,
  theme toggle, and disconnect button for connected state

All 6 phases of the Storybook component plan are now complete:
12 atoms, 25 molecules, 7 organisms, 2 layouts = 46 components total

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace placeholder Paper elements with actual ServerListScreen organism
containing properly configured ServerCard components.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cliffhall cliffhall changed the base branch from main to v2/main March 17, 2026 20:18
@cliffhall cliffhall marked this pull request as draft March 17, 2026 21:32
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Mar 17, 2026
@cliffhall cliffhall self-assigned this Mar 17, 2026
cliffhall and others added 11 commits March 21, 2026 19:16
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tentViewer

Rename HistoryEntry's children prop to childEntries to avoid React's
reserved prop name. Replace ContentViewer's onCopy callback with a
copyable flag and overlay CopyButton in the top-right corner.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add tsconfig.storybook.json to cover *.stories.tsx files excluded by
tsconfig.app.json, resolving TS2307 for @storybook/react-vite imports.
Replace 1x1 pixel PNG with a visible red/white checkerboard in the
ImagePreview story.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only render InlineError details Stack when there is content to show.
Add wrapping Code theme variant for long URLs that would push buttons
offscreen.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add @storybook/addon-actions for action logging in stories
- Add onTestCapability callback to ExperimentalFeaturesPanel
- Use CopyButton overlay in ResourcePreviewPanel and ResultPanel
- Replace includeContext checkbox with badge in SamplingRequestPanel
- Add LongServerName story for ServerCard
- Fix long tool name overflow with truncation and contained Paper variant
- Add optional title prop to ToolListItem and ToolDetailPanel
- Move tool annotations from list to detail panel form
- Vertically center static text in ResourceTemplateInput
- Fix InlineError blank space when no details

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- InlineError: show more/less toggle on same line as message, collapsible
  details, doc link as button
- ServerCard: use ContentViewer with CopyButton for command, remove
  onCopyCommand prop, combine action rows, add responsive Card variant
- HistoryEntry: use ContentViewer with CopyButton for JSON blocks, swap
  duration and status badge positions
- LoggingScreen: stretch log stream panel to full height, center empty
  message vertically

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add color scheme toggle to Storybook preview via globalTypes
- Remove @storybook/addon-actions (built into Storybook 9+)
- Include .storybook/ files in tsconfig.storybook.json
- Fix InlineError show more button color for readability
- Use transparent variant on Remove button for consistent red in dark mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add grid-align-start class to SimpleGrid so cards size to their own
content instead of stretching to match the tallest card in the row.
Remove unused card-responsive CSS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix ContentViewer background invisible against card in dark mode
- Fix Remove button not red in dark mode by using color="red.6"
- Add distinct card background for light mode (gray-0) vs app background
- Use CSS custom properties for card background across color schemes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add MCP logo (light/dark variants) to ConnectedLayout header
- Replace Tabs with SegmentedControl in header, split into 1/3 sections
- Wrap all screens in Container for consistent margins
- Use Card instead of Paper for panel backgrounds across all screens
- Add SubscribeButton atom, CopyButton for resource URI
- Move annotations from ResourceListItem to ResourcePreviewPanel
- Improve AnnotationBadge colors for dark mode visibility
- Add Tools, Resources, and Prompts headers to list panels
- Add ConnectedLayout stories for Tools, Resources, and Prompts tabs
- Remove unused onCopy prop and copy button from PromptMessagesDisplay

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cliffhall and others added 6 commits March 23, 2026 18:59
Add HistoryActive and other missing stories to ConnectedLayout, wrap
HistoryScreen and TasksScreen in consistent Container/Paper layout,
add copy button to MessageBubble, and clean up various component props.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Suppress react-refresh lint rule in Storybook preview config, fix
LogLevel type annotation in LoggingScreen stories, and apply consistent
formatting and layout improvements across multiple components.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…t inline code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tract inline code

- Add UnstyledButton listItem theme variant to replace inline style for border-radius
- Extract subcomponent constants with .withProps() across all molecules
- Replace raw <span /> with Mantine <Flex /> in ResourcePreviewPanel
- Extract inline template literals and expressions to named functions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tract inline code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants