Set up StrataKit in storybook and test-app - #1614
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The Storybook theme-bridge context provider is incorrect (so the bridge never enables for consumers) and the Vite assetsInlineLimit callbacks can return undefined, both of which can break the intended StrataKit integration behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR wires StrataKit into the Storybook environment and the test-app, including dependency updates, Storybook theme-bridge plumbing, and updated widget stories to showcase multiple icon formats (with a fallback when the theme bridge is disabled).
Changes:
- Update workspace/catalog dependencies to use
@stratakit/mui(and@mui/material) alongside updated StrataKit package versions. - Add Storybook theme-bridge addon structure (
ThemeBridge,ThemeBridgeRoot,StrataKitIcon) and adjust preview wiring. - Consolidate widget icon stories into a single story that demonstrates available icon formats and deprecated icon specs.
File summaries
| File | Description |
|---|---|
| pnpm-workspace.yaml | Updates catalog dependencies for StrataKit + MUI integration. |
| pnpm-lock.yaml | Lockfile updates reflecting new/updated dependencies. |
| docs/storybook/tsconfig.json | Adds StrataKit MUI type inclusion for Storybook TS compilation. |
| docs/storybook/src/widget/Widget.tsx | Wraps widget story rendering with PreviewFeaturesProvider to toggle preview features. |
| docs/storybook/src/widget/Widget.stories.tsx | Consolidates icon stories and adds a StrataKit icon fallback component usage. |
| docs/storybook/package.json | Adds @mui/material and @stratakit/mui dependencies (removes bricks). |
| docs/storybook/.storybook/preview.ts | Updates ThemeBridge addon import path. |
| docs/storybook/.storybook/main.ts | Adds Vite build config to avoid inlining StrataKit SVG icons. |
| docs/storybook/.storybook/addons/theme-bridge/ThemeBridgeRoot.tsx | Refactors root wrapper for theme bridge and StrataKit Root integration. |
| docs/storybook/.storybook/addons/theme-bridge/ThemeBridge.tsx | Adds ThemeBridge decorator, toolbar global, and theme bridge context. |
| docs/storybook/.storybook/addons/theme-bridge/StrataKitIcon.tsx | Adds a StrataKit icon renderer with fallback when theme bridge is disabled. |
| apps/test-app/vite.config.ts | Adds Vite build config to avoid inlining StrataKit SVG icons. |
| apps/test-app/tsconfig.json | Adds StrataKit MUI type inclusion for test-app TS compilation. |
| apps/test-app/src/routes/__root.tsx | Switches to @stratakit/mui Root and adjusts ThemeBridge Root props. |
| apps/test-app/package.json | Adds @mui/material, @stratakit/icons, and @stratakit/mui dependencies (removes bricks). |
Review details
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Suppressed comments (1)
docs/storybook/.storybook/addons/theme-bridge/ThemeBridgeRoot.tsx:16
- ThemeBridgeContext is a React context, but it is being rendered as a component. This means the Provider is never applied and consumers will always see the default (false), so the StrataKit icon fallback will always be used even when theme bridge is enabled.
- Files reviewed: 14/15 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Changes
Extracted from #1587
Applied initial setup to
test-appandstorybook.Additionally, updated widget stories to use a single story to display available icon formats (which required to add render StrataKit icon with a fallback, when theme bridge is not enabled).
Testing
N/A