-
Notifications
You must be signed in to change notification settings - Fork 349
[feat] Add Storybook setup and NodePreview story #4861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Could you add brief README.md in the
Maybe you can make a CLAUDE.md in the folder as well? |
Documentation added! ✅ I've created comprehensive documentation as requested:
The documentation covers:
Both files are now committed and ready for review! |
I've made storybook works in this branch, but got weird type error from unrelated files in CICD. Do you have any ideas? also @huchenlei > @comfyorg/[email protected] typecheck
> vue-tsc --noEmit
Error: src/components/load3d/Load3D.vue(21,8): error TS2322: Type '(mode: MaterialMode) => void' is not assignable to type '(materialMode: string) => any'.
Types of parameters 'mode' and 'materialMode' are incompatible.
Type 'string' is not assignable to type 'MaterialMode'.
Error: src/components/load3d/Load3D.vue(25,8): error TS2322: Type '(value: CameraType) => void' is not assignable to type '(cameraType: string) => any'.
Types of parameters 'value' and 'cameraType' are incompatible.
Type 'string' is not assignable to type 'CameraType'.
Error: src/components/load3d/Load3D.vue(29,8): error TS2322: Type '(value: UpDirection) => void' is not assignable to type '(upDirection: string) => any'.
Types of parameters 'value' and 'upDirection' are incompatible.
Type 'string' is not assignable to type 'UpDirection'.
Error: src/components/load3d/Load3DAnimation.vue(25,8): error TS2322: Type '(mode: MaterialMode) => void' is not assignable to type '(materialMode: string) => any'.
Types of parameters 'mode' and 'materialMode' are incompatible.
Type 'string' is not assignable to type 'MaterialMode'.
Error: src/components/load3d/Load3DAnimation.vue(29,8): error TS2322: Type '(value: CameraType) => void' is not assignable to type '(cameraType: string) => any'.
Types of parameters 'value' and 'cameraType' are incompatible.
Type 'string' is not assignable to type 'CameraType'.
Error: src/components/load3d/Load3DAnimation.vue(34,8): error TS2322: Type '(value: UpDirection) => void' is not assignable to type '(direction: string) => any'.
Types of parameters 'value' and 'direction' are incompatible.
Type 'string' is not assignable to type 'UpDirection'.
Error: src/components/load3d/Load3DAnimationScene.vue(16,6): error TS2322: Type '(mode: MaterialMode) => void' is not assignable to type '(materialMode: string) => any'.
Types of parameters 'mode' and 'materialMode' are incompatible.
Type 'string' is not assignable to type 'MaterialMode'.
Error: src/components/load3d/Load3DAnimationScene.vue(20,6): error TS2322: Type '(value: CameraType) => void' is not assignable to type '(cameraType: string) => any'.
Types of parameters 'value' and 'cameraType' are incompatible.
Type 'string' is not assignable to type 'CameraType'.
Error: src/lib/litegraph/src/infrastructure/Rectangle.ts(71,5): error TS2578: Unused '@ts-expect-error' directive.
Error: tests-ui/tests/scripts/metadata/gltf.test.ts(53,28): error TS2345: Argument of type 'Uint8Array<ArrayBuffer>' is not assignable to parameter of type 'ArrayBuffer'.
Types of property '[Symbol.toStringTag]' are incompatible.
Type '"Uint8Array"' is not assignable to type '"ArrayBuffer"'.
Error: tests-ui/tests/scripts/metadata/gltf.test.ts(55,41): error TS2345: Argument of type 'Uint8Array<ArrayBuffer>' is not assignable to parameter of type 'ArrayBuffer'.
Types of property '[Symbol.toStringTag]' are incompatible.
Type '"Uint8Array"' is not assignable to type '"ArrayBuffer"'.
Error: Process completed with exit code 2. |
70f1bfe
to
80e4ee1
Compare
@viva-jinyi This branch is ready for review. It runs storybook and generates online viewable storybook and visual change preview URLs. |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 08/19/2025, 02:39:21 AM UTC 📊 Build Summary
🔗 Links🎉 Your Storybook is ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice Work 👍
- Install and configure Storybook v9.1.1 for Vue 3 - Set up Storybook configuration with Vite integration - Add Pinia store support for Storybook environment - Create comprehensive NodePreview.stories.ts with multiple node examples: - KSampler node (complex node with multiple inputs/outputs) - CLIP Text Encode node (simple text input node) - VAE Decode node (image processing node) - Example with long markdown description - Configure project paths and aliases for Storybook - Stories demonstrate various ComfyUI node types with realistic mock data - Update tsconfig.eslint.json to include Storybook files - Fix ESLint issues with imports and number precision - Add Storybook ESLint plugin configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add comprehensive PrimeVue theme setup with ComfyUI preset - Configure proper Vue app setup with Pinia stores, i18n, and services - Remove unused onboarding addon from Storybook dependencies - Improve Vite configuration with better chunking and alias resolution - Add proper CSS imports and styling for ComfyUI components 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add README.md explaining Storybook usage, benefits, and comparison with other tools - Add CLAUDE.md with development guidelines for working with Storybook - Include best practices, troubleshooting tips, and integration notes - Address PR review feedback for better developer onboarding 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Fix type mismatches in Load3DScene eventConfig by casting string values to proper enum types (MaterialMode, CameraType, UpDirection) - Fix Uint8Array vs ArrayBuffer type issues in GLTF test by using .buffer property - Remove unused @ts-expect-error comment in Rectangle.ts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add automated visual regression testing for Storybook components - Configure workflow to run on main branch and PRs - Auto-accept changes on main branch for baseline updates - Uses build-storybook script for optimized builds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Document Chromatic visual testing integration - Add information about automated testing workflow - Include best practices for visual regression testing - Explain how to view and manage test results 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
… workflow management
- Rebase sno-storybook branch onto origin/main with latest changes - Update .storybook/main.ts with additional plugins and component configuration - Add icons and component resolvers for Storybook support - Update .gitignore with new entries - Regenerate package-lock.json after rebase conflicts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Add proper type validation for subgraph node selection before calling SubgraphNode-specific methods. This prevents undefined values from being passed to functions expecting SubgraphNode parameters. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…proper resolution in the project refactor(vite.config.mts): adjust templates proxy configuration for better readability and maintainability
…to main.mjs - Convert .storybook/main.ts to main.mjs to resolve ES module compatibility - Use dynamic imports instead of static imports to avoid require() errors - Add .storybook directory to tsconfig.json includes - Storybook build and dev server now work correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ety and maintainability fix(storybook): remove unused import map plugins in Storybook configuration to prevent potential issues fix(storybook): update color palette store initialization to streamline code and improve readability
- Replace complex GitHub Script actions with edumserrano/find-create-or-update-comment@v3 - Add comprehensive PR comments showing Storybook build progress and results - Include build metrics: components, stories, visual changes, and errors - Add direct links to Chromatic builds and Storybook previews - Reduce workflow complexity by ~60 lines while maintaining functionality - Use native GitHub Actions expressions for cleaner maintainability 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
…deployment job for better organization and clarity
- Use dynamic import for mergeConfig to avoid CJS build warning - Replace static import with dynamic import in viteFinal function - Maintain type safety with separate type import - Fixes "The CJS build of Vite's Node API is deprecated" warning 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…rve existing comments in pull request
__dirname is not available in all environments. Using process.cwd() provides better compatibility and resolves path issues in Storybook. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
This PR introduces a comprehensive Storybook setup for ComfyUI Frontend, enabling component-driven development, visual testing, and improved documentation workflows.
🎨 Storybook Infrastructure
🔧 Visual Testing & CI/CD
chromatic.yaml
) for CI/CD pipeline📖 Documentation & Developer Experience
.storybook/
with setup instructions.storybook/CLAUDE.md
for AI assistance🛠️ Configuration & Build Optimizations
@/
imports🏗️ Project Infrastructure Improvements
🌐 Internationalization & Localization
🎯 Component Development
🔧 Technical Fixes & Improvements
🚀 Developer Workflow Enhancements
Impact
Test Plan
npm run storybook
)npm run build-storybook
)Files Changed
New Files (Key Additions)
.storybook/
- Complete Storybook configuration and documentation.github/workflows/chromatic.yaml
- Visual testing CI/CD pipelinesrc/components/node/NodePreview.stories.ts
- Example component storiesknip.config.ts
- Unused code detection configurationsrc/locales/ar/
- Arabic language supportModified Files (Major Updates)
package.json
,package-lock.json
with Storybook dependenciesvite.config.mts
,tsconfig.json
for proper integration🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]
More stories will add to the following PRs
#4999
#5034