-
Notifications
You must be signed in to change notification settings - Fork 429
Feat: Babel plugin for Vite define replacements in Playwright #6904
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
Implements a solution to handle Vite define replacements during Playwright's Babel compilation for i18n collection tests. This resolves ReferenceErrors caused by unprocessed compile-time constants like __DISTRIBUTION__. Changes: - Add babel-plugin-vite-define.cjs to replace Vite define constants - Add babel-plugin-inject-globals.cjs to inject browser globals setup - Add setup-i18n-globals.mjs for JSDOM-based browser environment - Update playwright.i18n.config.ts with Babel plugin configuration - Install babel-plugin-module-resolver for @ alias support The implementation follows the approach from PR #5515 but is adapted for the current codebase structure. The Babel plugins run during Playwright's test compilation to ensure all Vite define constants are replaced with their actual values before execution. Fixes #10981 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
📝 WalkthroughWalkthroughAdded Babel plugin infrastructure for i18n test compilation to inject globals and replace Vite constants. Expanded CI workflow trigger conditions for i18n updates. Removed deprecated 3D-related node definitions and experimental Vue Nodes entries across all locales. English locale adds new image processing and dataset handling nodes. Changes
Possibly related PRs
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
🎭 Playwright Test Results⏰ Completed at: 12/02/2025, 02:29:35 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 12/02/2025, 02:20:36 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.18 MB (baseline 3.18 MB) • ⚪ 0 BMain entry bundles and manifests
Graph Workspace — 956 kB (baseline 956 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
UI Components — 139 kB (baseline 139 kB) • ⚪ 0 BReusable component library chunks
Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.84 MB (baseline 3.84 MB) • ⚪ 0 BBundles that do not match a named category
|
…ranch to facilitate debugging during development
…nches matching sno-* for better flexibility chore(i18n-update-core.yaml): modify job condition to run on push events for improved automation
…and update condition for job execution to include sno- branches
|
this PR also solves #6943 (comment) |
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.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/locales/en/nodeDefs.json (1)
1-14859: Add 'name' fields to 400+ unnamed outputs throughout the file for improved UI clarity, and fix grammatically incorrect "16:9 square" phrasing.The audit confirms significant schema consistency issues:
Unnamed outputs (400+ instances): Many nodes lack explicit
namefields on their outputs (e.g.,AddNoise.0,CheckpointLoaderSimpleoutputs 0/1/2,SplitImageWithAlphaoutputs 0/1,PorterDuffImageCompositeoutputs 0/1). Adding descriptive names will improve usability and UI rendering.Grammatical error in GeminiImageNode (line 2839): Tooltip states
"a 16:9 square is usually generated"— should be"a 16:9 or square aspect ratio is usually generated"to correctly convey the two separate options.KlingSingleImageVideoEffectNode and KlingStartEndFrameNode are current (not legacy) nodes and appear correctly defined.
model_with_lora label exists only in the Japanese locale file, not in the English file under review.
🧹 Nitpick comments (16)
scripts/setup-i18n-globals.mjs (2)
34-43: Fix formatting for fallback class definitions.The inline fallback classes have formatting issues flagged by Prettier. Consider reformatting:
-global.ResizeObserver = dom.window.ResizeObserver || class ResizeObserver { - observe() {} - unobserve() {} - disconnect() {} -} -global.IntersectionObserver = dom.window.IntersectionObserver || class IntersectionObserver { - observe() {} - unobserve() {} - disconnect() {} -} +global.ResizeObserver = + dom.window.ResizeObserver || + class ResizeObserver { + observe() {} + unobserve() {} + disconnect() {} + } +global.IntersectionObserver = + dom.window.IntersectionObserver || + class IntersectionObserver { + observe() {} + unobserve() {} + disconnect() {} + }
11-15: Consider removingresources: 'usable'for faster test execution.The
resources: 'usable'option enables JSDOM to load external resources (scripts, images, etc.), which may not be necessary for i18n string collection and could slow down test execution. Consider whether this is needed:const dom = new JSDOM('<!DOCTYPE html><html><body></body></html>', { url: 'http://localhost:5173', - pretendToBeVisual: true, - resources: 'usable' + pretendToBeVisual: true })scripts/babel-plugin-vite-define.cjs (2)
55-55: Remove unusedexecSyncimport.
execSyncis imported fromchild_processbut never used. This appears to be leftover from an abandoned approach to synchronously load the Vite config:if (viteDefines === null) { // Synchronously load if not already loaded // This is a workaround since Babel plugins don't support async pre() - const { execSync } = require('child_process') try {
90-98: Add parentheses for clarity in complex condition.While the current logic is correct due to operator precedence, adding explicit parentheses improves readability and satisfies Prettier:
if ( path.isBindingIdentifier() || - path.parent.type === 'MemberExpression' && path.parent.property === path.node || - path.parent.type === 'ObjectProperty' && path.parent.key === path.node || + (path.parent.type === 'MemberExpression' && + path.parent.property === path.node) || + (path.parent.type === 'ObjectProperty' && + path.parent.key === path.node) || path.parent.type === 'ClassMethod' || path.parent.type === 'MethodDefinition' ) {scripts/babel-plugin-inject-globals.cjs (1)
46-46: Consider downgrading to debug-level logging or removing.The
console.logmessage will appear for every matched file during compilation, which could be noisy in CI output. Consider usingconsole.warnonly for issues, or removing the log entirely since the injection is expected behavior:- console.log(`[babel-plugin-inject-globals] Injected setup into ${nodePath.basename(filename)}`)Alternatively, if you want to keep tracing for debugging, you could make it conditional on an environment variable.
playwright.i18n.config.ts (1)
27-59: Avoidas anytype assertion.Per coding guidelines,
as anyshould be avoided. Consider using TypeScript module augmentation to extend Playwright's config type:+// Extend Playwright's config type for internal babelPlugins API +declare module '@playwright/test' { + interface PlaywrightTestConfig { + '@playwright/test'?: { + babelPlugins?: Array<string | [string, Record<string, unknown>]> + } + } +} + const config = defineConfig({ // ...existing config }) -;(config as any)['@playwright/test'] = { +config['@playwright/test'] = { babelPlugins: [ // ... ] }Alternatively, if this is an undocumented internal API that may change, add a comment explaining why
as anyis necessary so future maintainers understand the context.src/locales/en/nodeDefs.json (10)
18-22: Name the AddNoise output for UI clarity.Currently output 0 only has tooltip:null. Consider a friendly name (e.g., "samples" or "latent") to align with other nodes and improve graph readability.
- "outputs": { - "0": { - "tooltip": null - } - } + "outputs": { + "0": { + "name": "samples", + "tooltip": null + } + }
650-671: CenterCropImages: pluralize and clarify center behavior.Tooltips say “Image to process.” while the port is a batch; also specify that crop is center-anchored.
- "images": { - "name": "images", - "tooltip": "Image to process." - }, + "images": { + "name": "images", + "tooltip": "Images to process (batch supported)." + }, @@ - "width": { + "width": { "name": "width", - "tooltip": "Crop width." + "tooltip": "Center crop width (pixels)." }, @@ - "height": { + "height": { "name": "height", - "tooltip": "Crop height." + "tooltip": "Center crop height (pixels)." }
3612-3649: ImageDeduplication: clarify threshold semantics and default.State inclusive/exclusive and default value to reduce ambiguity in tests and docs.
- "tooltip": "Similarity threshold (0-1). Higher means more similar. Images above this threshold are considered duplicates." + "tooltip": "Similarity threshold [0.0–1.0]. Higher = more similar. Images with similarity >= threshold are considered duplicates. Default: 0.95."
3675-3705: ImageGrid: document output size behavior.Add how cell size and padding determine final grid dimensions to avoid user confusion.
- "tooltip": "Processed images" + "tooltip": "Grid image. Final size = (columns * cell_width + (columns-1)*padding) by (rows * cell_height + (rows-1)*padding)."
4535-4566: Mark legacy Kling nodes as deprecated in display_name.Helps users pick the right node and eases migration to Omni Pro.
- "KlingSingleImageVideoEffectNode": { - "display_name": "Kling Video Effects", + "KlingSingleImageVideoEffectNode": { + "display_name": "Kling Video Effects (DEPRECATED)", @@ - "KlingStartEndFrameNode": { - "display_name": "Kling Start-End Frame to Video", + "KlingStartEndFrameNode": { + "display_name": "Kling Start-End Frame to Video (DEPRECATED)",Also applies to: 4567-4611
9530-9544: Add tooltip for Preview3D.bg_image.New input lacks help text; add minimal guidance.
- "bg_image": { - "name": "bg_image" - }, + "bg_image": { + "name": "bg_image", + "tooltip": "Background image used behind the rendered model." + },
9690-9718: RandomCropImages: pluralize and clarify randomness/seed.Align with CenterCropImages pluralization and mention seed determinism.
- "images": { - "name": "images", - "tooltip": "Image to process." - }, + "images": { + "name": "images", + "tooltip": "Images to process (batch supported)." + }, @@ - "seed": { + "seed": { "name": "seed", - "tooltip": "Random seed." + "tooltip": "Random seed (fixed seed = deterministic crops)." },
10345-10362: ResizeImagesByLonger/ShorterEdge: clarify proportional scaling.State that the other edge scales to preserve aspect ratio.
- "tooltip": "Target length for the longer edge." + "tooltip": "Target length for the longer edge; the other edge scales proportionally." @@ - "tooltip": "Target length for the shorter edge." + "tooltip": "Target length for the shorter edge; the other edge scales proportionally."Also applies to: 10364-10381
14635-14677: Save/Load Wan API nodes: watermark/prompt_extend wording parity.Ensure identical tooltip phrasing across text/image/video API nodes for consistency.
- "tooltip": "Whether to add an \"AI generated\" watermark to the result." + "tooltip": "Whether to add an \"AI-generated\" watermark to the result."Also applies to: 14678-14730
12518-12547: Verify ReplaceText overlap with StringReplace; TextToUppercase/TextToLowercase have no String equivalent.ReplaceText and StringReplace both perform text replacement (find/replace). However, TextToUppercase and TextToLowercase are unique case-conversion utilities with no String-equivalent counterpart—they should not be flagged for consolidation. If ReplaceText duplicates StringReplace functionality, consider whether both variants are needed or if one should be removed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (28)
.github/workflows/i18n-update-core.yaml(1 hunks)knip.config.ts(1 hunks)package.json(1 hunks)playwright.i18n.config.ts(2 hunks)pnpm-workspace.yaml(1 hunks)scripts/babel-plugin-inject-globals.cjs(1 hunks)scripts/babel-plugin-vite-define.cjs(1 hunks)scripts/setup-i18n-globals.mjs(1 hunks)src/locales/ar/main.json(0 hunks)src/locales/ar/nodeDefs.json(0 hunks)src/locales/en/main.json(2 hunks)src/locales/en/nodeDefs.json(61 hunks)src/locales/es/main.json(0 hunks)src/locales/es/nodeDefs.json(0 hunks)src/locales/fr/main.json(0 hunks)src/locales/fr/nodeDefs.json(0 hunks)src/locales/ja/main.json(0 hunks)src/locales/ja/nodeDefs.json(0 hunks)src/locales/ko/main.json(0 hunks)src/locales/ko/nodeDefs.json(0 hunks)src/locales/ru/main.json(0 hunks)src/locales/ru/nodeDefs.json(0 hunks)src/locales/tr/main.json(0 hunks)src/locales/tr/nodeDefs.json(0 hunks)src/locales/zh-TW/main.json(0 hunks)src/locales/zh-TW/nodeDefs.json(0 hunks)src/locales/zh/main.json(0 hunks)src/locales/zh/nodeDefs.json(0 hunks)
💤 Files with no reviewable changes (18)
- src/locales/ru/main.json
- src/locales/ko/main.json
- src/locales/ja/main.json
- src/locales/zh/main.json
- src/locales/tr/main.json
- src/locales/zh-TW/main.json
- src/locales/fr/main.json
- src/locales/es/main.json
- src/locales/ar/main.json
- src/locales/ar/nodeDefs.json
- src/locales/tr/nodeDefs.json
- src/locales/ja/nodeDefs.json
- src/locales/zh-TW/nodeDefs.json
- src/locales/ru/nodeDefs.json
- src/locales/zh/nodeDefs.json
- src/locales/fr/nodeDefs.json
- src/locales/ko/nodeDefs.json
- src/locales/es/nodeDefs.json
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json
Files:
knip.config.tsplaywright.i18n.config.ts
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursorrules)
Use es-toolkit for utility functions
Files:
knip.config.tsplaywright.i18n.config.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
Use TypeScript for type safety
**/*.{ts,tsx}: Never useanytype - use proper TypeScript types
Never useas anytype assertions - fix the underlying type issue
Files:
knip.config.tsplaywright.i18n.config.ts
**/*.{ts,tsx,js,vue}
📄 CodeRabbit inference engine (.cursorrules)
Implement proper error handling in components and services
**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in.prettierrc
Organize imports by sorting and grouping by plugin, and runpnpm formatbefore committing
Files:
knip.config.tsplaywright.i18n.config.ts
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
Use camelCase for variable and setting names in TypeScript/Vue files
Files:
knip.config.tsplaywright.i18n.config.ts
**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,vue}: Useconst settingStore = useSettingStore()andsettingStore.get('Comfy.SomeSetting')to retrieve settings in TypeScript/Vue files
Useawait settingStore.set('Comfy.SomeSetting', newValue)to update settings in TypeScript/Vue files
Check server capabilities usingapi.serverSupportsFeature('feature_name')before using enhanced features
Useapi.getServerFeature('config_name', defaultValue)to retrieve server feature configurationEnforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates
Files:
knip.config.tsplaywright.i18n.config.ts
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
UsedefaultsByInstallVersionproperty for gradual feature rollout based on version in settings configuration
Files:
knip.config.tsplaywright.i18n.config.ts
🧠 Learnings (26)
📓 Common learnings
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Use Playwright fixtures for browser tests
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Use Vitest (with happy-dom) for unit and component tests, and Playwright for E2E tests
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.{vue,ts,tsx} : Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.{vue,ts} : Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use vue-i18n for ALL UI strings
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,vue} : Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,js,vue} : Organize imports by sorting and grouping by plugin, and run `pnpm format` before committing
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Use `vitest` for unit testing in this project
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Use `[skip ci]` in commit messages for locale-only updates when appropriate
Applied to files:
.github/workflows/i18n-update-core.yaml
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Prefer the use of `test.extend` over loose variables; import `test as baseTest` from `vitest`
Applied to files:
scripts/babel-plugin-vite-define.cjsscripts/babel-plugin-inject-globals.cjsplaywright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Use `vitest` for unit testing in this project
Applied to files:
scripts/babel-plugin-vite-define.cjsscripts/babel-plugin-inject-globals.cjspackage.jsonplaywright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,js,vue} : Organize imports by sorting and grouping by plugin, and run `pnpm format` before committing
Applied to files:
scripts/babel-plugin-inject-globals.cjsknip.config.tspnpm-workspace.yamlpackage.json
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Mock external dependencies in tests
Applied to files:
scripts/babel-plugin-inject-globals.cjsknip.config.tsscripts/setup-i18n-globals.mjspackage.jsonplaywright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Follow existing test patterns in the codebase
Applied to files:
scripts/babel-plugin-inject-globals.cjspackage.jsonplaywright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Use existing test utilities rather than writing custom utilities
Applied to files:
scripts/babel-plugin-inject-globals.cjsplaywright.i18n.config.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Use Playwright fixtures for browser tests
Applied to files:
scripts/babel-plugin-inject-globals.cjsscripts/setup-i18n-globals.mjsplaywright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,vue} : Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates
Applied to files:
knip.config.tspackage.json
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.vue : Do not use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage). Use replacements: Select, Popover, DatePicker, ToggleSwitch, Drawer, AutoComplete, Tabs, Stepper, Message respectively
Applied to files:
knip.config.ts
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`
Applied to files:
knip.config.tssrc/locales/en/main.json
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.vue : Never use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage)
Applied to files:
knip.config.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use vue-i18n for ALL UI strings
Applied to files:
knip.config.ts
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.{vue,ts,tsx} : Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json
Applied to files:
knip.config.tssrc/locales/en/main.json
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.{vue,ts} : Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json
Applied to files:
knip.config.tssrc/locales/en/main.json
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Use es-toolkit for utility functions instead of other utility libraries
Applied to files:
knip.config.tspackage.json
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features
Applied to files:
scripts/setup-i18n-globals.mjsplaywright.i18n.config.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test user workflows in browser tests
Applied to files:
scripts/setup-i18n-globals.mjsplaywright.i18n.config.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Check assets/ directory for test data when writing tests
Applied to files:
scripts/setup-i18n-globals.mjsplaywright.i18n.config.ts
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.{ts,tsx,js} : Use es-toolkit for utility functions
Applied to files:
package.json
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Tests should be cross-platform compatible using `path.resolve`, `path.join`, and `path.sep` for Windows, macOS, and Linux compatibility
Applied to files:
playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to browser_tests/**/*.{test,spec}.ts : Playwright E2E tests can use optional tags like `mobile` and `2x` which are respected by the Playwright configuration
Applied to files:
playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Use Vitest (with happy-dom) for unit and component tests, and Playwright for E2E tests
Applied to files:
playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Vitest test files should use coverage enabled with text, json, and html reporters as configured in `vitest.config.ts`
Applied to files:
playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test across multiple viewports
Applied to files:
playwright.i18n.config.ts
🧬 Code graph analysis (2)
scripts/babel-plugin-inject-globals.cjs (1)
scripts/babel-plugin-vite-define.cjs (3)
require(10-10)require(55-55)path(9-9)
playwright.i18n.config.ts (1)
scripts/babel-plugin-vite-define.cjs (1)
path(9-9)
🪛 ESLint
scripts/babel-plugin-vite-define.cjs
[error] 9-9: A require() style import is forbidden.
(@typescript-eslint/no-require-imports)
[error] 9-9: 'require' is not defined.
(no-undef)
[error] 10-10: A require() style import is forbidden.
(@typescript-eslint/no-require-imports)
[error] 10-10: 'require' is not defined.
(no-undef)
[error] 23-23: '__dirname' is not defined.
(no-undef)
[error] 31-31: 'console' is not defined.
(no-undef)
[error] 31-31: Unexpected console statement. Only these console methods are allowed: warn, error.
(no-console)
[error] 31-31: Replace '[babel-plugin-vite-define]·Loaded·Vite·defines:',·Object.keys(viteDefines) with ⏎········'[babel-plugin-vite-define]·Loaded·Vite·defines:',⏎········Object.keys(viteDefines)⏎······
(prettier/prettier)
[error] 34-34: 'console' is not defined.
(no-undef)
[error] 38-38: 'console' is not defined.
(no-undef)
[error] 38-38: Replace '[babel-plugin-vite-define]·Error·loading·Vite·config:',·error with ⏎······'[babel-plugin-vite-define]·Error·loading·Vite·config:',⏎······error⏎····
(prettier/prettier)
[error] 44-44: 'module' is not defined.
(no-undef)
[error] 55-55: A require() style import is forbidden.
(@typescript-eslint/no-require-imports)
[error] 55-55: 'require' is not defined.
(no-undef)
[error] 67-67: 'console' is not defined.
(no-undef)
[error] 67-67: Unexpected console statement. Only these console methods are allowed: warn, error.
(no-console)
[error] 67-67: Replace '[babel-plugin-vite-define]·Using·default·defines·for·Playwright·tests' with ⏎············'[babel-plugin-vite-define]·Using·default·defines·for·Playwright·tests'⏎··········
(prettier/prettier)
[error] 69-69: 'console' is not defined.
(no-undef)
[error] 69-69: Replace '[babel-plugin-vite-define]·Error·setting·up·defines:',·error with ⏎············'[babel-plugin-vite-define]·Error·setting·up·defines:',⏎············error⏎··········
(prettier/prettier)
[error] 92-92: Replace path.parent.type·===·'MemberExpression'·&&·path.parent.property·===·path.node with (path.parent.type·===·'MemberExpression'·&&⏎············path.parent.property·===·path.node)
(prettier/prettier)
[error] 93-93: Replace path.parent.type·===·'ObjectProperty'·&&·path.parent.key·===·path.node with (path.parent.type·===·'ObjectProperty'·&&⏎············path.parent.key·===·path.node)
(prettier/prettier)
[error] 135-136: Delete ⏎·········
(prettier/prettier)
[error] 137-137: 'console' is not defined.
(no-undef)
[error] 137-137: Replace ``[babel-plugin-vite-define]·Unsupported·replacement·type·for·${name}:,·typeof·replacement with `⏎··············`[babel-plugin-vite-define]·Unsupported·replacement·type·for·${name}:`,⏎··············typeof·replacement⏎············`
(prettier/prettier)
[error] 143-143: 'console' is not defined.
(no-undef)
[error] 143-143: Replace ``[babel-plugin-vite-define]·Error·replacing·${name}:,·error with `⏎············`[babel-plugin-vite-define]·Error·replacing·${name}:`,⏎············error⏎··········`
(prettier/prettier)
scripts/babel-plugin-inject-globals.cjs
[error] 8-8: A require() style import is forbidden.
(@typescript-eslint/no-require-imports)
[error] 8-8: 'require' is not defined.
(no-undef)
[error] 10-10: 'module' is not defined.
(no-undef)
[error] 11-11: Replace ·filenamePattern·=·'collect-i18n-',·setupFile·=·'./setup-i18n-globals.mjs' with ⏎····filenamePattern·=·'collect-i18n-',⏎····setupFile·=·'./setup-i18n-globals.mjs'⏎·
(prettier/prettier)
[error] 46-46: 'console' is not defined.
(no-undef)
[error] 46-46: Unexpected console statement. Only these console methods are allowed: warn, error.
(no-console)
[error] 46-46: Replace [babel-plugin-inject-globals]·Injected·setup·into·${nodePath.basename(filename)} with ⏎············[babel-plugin-inject-globals]·Injected·setup·into·${nodePath.basename(filename)}⏎··········
(prettier/prettier)
scripts/setup-i18n-globals.mjs
[error] 8-8: Unable to resolve path to module 'jsdom'.
(import-x/no-unresolved)
[error] 18-18: 'global' is not defined.
(no-undef)
[error] 19-19: 'global' is not defined.
(no-undef)
[error] 22-22: 'global' is not defined.
(no-undef)
[error] 29-29: 'global' is not defined.
(no-undef)
[error] 30-30: 'global' is not defined.
(no-undef)
[error] 31-31: 'global' is not defined.
(no-undef)
[error] 32-32: 'global' is not defined.
(no-undef)
[error] 33-33: 'global' is not defined.
(no-undef)
[error] 34-34: 'global' is not defined.
(no-undef)
[error] 34-34: Replace ·dom.window.ResizeObserver·|| with ⏎··dom.window.ResizeObserver·||⏎·
(prettier/prettier)
[error] 35-35: Insert ··
(prettier/prettier)
[error] 36-36: Insert ··
(prettier/prettier)
[error] 37-37: Replace ·· with ····
(prettier/prettier)
[error] 38-38: Insert ··
(prettier/prettier)
[error] 39-39: 'global' is not defined.
(no-undef)
[error] 39-39: Replace ·dom.window.IntersectionObserver·|| with ⏎··dom.window.IntersectionObserver·||⏎·
(prettier/prettier)
[error] 40-40: Insert ··
(prettier/prettier)
[error] 41-41: Insert ··
(prettier/prettier)
[error] 42-42: Replace ·· with ····
(prettier/prettier)
[error] 43-43: Insert ··
(prettier/prettier)
[error] 46-46: 'global' is not defined.
(no-undef)
[error] 52-52: 'global' is not defined.
(no-undef)
[error] 60-60: 'global' is not defined.
(no-undef)
[error] 60-60: 'setTimeout' is not defined.
(no-undef)
[error] 61-61: 'global' is not defined.
(no-undef)
[error] 61-61: 'clearTimeout' is not defined.
(no-undef)
🔇 Additional comments (10)
src/locales/en/main.json (2)
1110-1110: Experimental feature label consolidation looks good.The consolidation of multiple experimental Vue Nodes entries into a single
"Experimental: Enable Nodes 2_0"key is appropriate and aligns with the feature reorganization.
1325-1327: Node category translations are correctly formatted and follow established patterns.The three new translations (dataset, text, image) match the structure of existing nodeCategories entries. These are i18n entries for node categories that are auto-generated from backend node definitions via
collect-i18n-node-defs.ts, not manually-defined node types in nodeDefs.json. The translations are valid and will be populated when the category collection script runs against nodes that declare these categories.package.json (1)
79-79: LGTM!The addition of
babel-plugin-module-resolveras a dev dependency is correctly placed and uses the catalog reference consistently with other dependencies. This supports the new Babel plugin infrastructure for i18n test compilation.pnpm-workspace.yaml (1)
49-49: LGTM!The catalog entry for
babel-plugin-module-resolveris properly sorted and uses a reasonable version range..github/workflows/i18n-update-core.yaml (1)
15-18: Consider removing thesno-branch trigger before merging.The
sno-prefix appears to be a developer-specific branch naming convention (likely for testing this PR). Keeping this condition in the workflow would cause the i18n update job to run for any future PR branches starting withsno-, which may not be intended behavior.If this is for testing purposes only, consider removing line 18 before merging:
if: | github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-')) - || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'sno-'))knip.config.ts (1)
37-39: LGTM!Good addition with a helpful comment explaining why the dependency is ignored. Knip cannot detect the usage since the plugin is referenced dynamically in the Playwright Babel configuration.
scripts/babel-plugin-inject-globals.cjs (1)
10-11: LGTM!Good use of configurable options with sensible defaults. The plugin correctly handles the pattern matching and prevents duplicate imports.
playwright.i18n.config.ts (2)
2-5: LGTM!Standard ESM pattern for computing
__dirnamesinceimport.meta.urlis the ESM equivalent.
7-23: LGTM!The configuration is well-structured with appropriate timeouts and
reuseExistingServer: truefor CI efficiency.src/locales/en/nodeDefs.json (1)
11610-11616: LGTM: SplitSigmas outputs are now named.Clear “high_sigmas” and “low_sigmas” improve graph legibility without changing behavior. Nice.
| [ | ||
| path.join(__dirname, 'scripts/babel-plugin-inject-globals.cjs'), | ||
| { | ||
| filenamePattern: 'collect-i18n-', | ||
| setupFile: './setup-i18n-globals.mjs' | ||
| } | ||
| ] |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
echo "=== Checking setup file existence ==="
fd -t f 'setup-i18n-globals.mjs'
echo -e "\n=== Checking inject-globals plugin implementation ==="
cat scripts/babel-plugin-inject-globals.cjs 2>/dev/null || echo "File not found"
echo -e "\n=== Listing scripts directory ==="
ls -la scripts/ | grep -E '\.(cjs|mjs)$'Repository: Comfy-Org/ComfyUI_frontend
Length of output: 1924
Use absolute path for setupFile to ensure correct resolution from test files.
The setupFile: './setup-i18n-globals.mjs' is a relative path that gets injected directly into test files as an import statement. Since test files are in the test/ directory, this relative path will fail to resolve. Use an absolute path instead:
[
path.join(__dirname, 'scripts/babel-plugin-inject-globals.cjs'),
{
filenamePattern: 'collect-i18n-',
- setupFile: './setup-i18n-globals.mjs'
+ setupFile: path.join(__dirname, 'scripts/setup-i18n-globals.mjs')
}
]📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| [ | |
| path.join(__dirname, 'scripts/babel-plugin-inject-globals.cjs'), | |
| { | |
| filenamePattern: 'collect-i18n-', | |
| setupFile: './setup-i18n-globals.mjs' | |
| } | |
| ] | |
| [ | |
| path.join(__dirname, 'scripts/babel-plugin-inject-globals.cjs'), | |
| { | |
| filenamePattern: 'collect-i18n-', | |
| setupFile: path.join(__dirname, 'scripts/setup-i18n-globals.mjs') | |
| } | |
| ] |
🤖 Prompt for AI Agents
In playwright.i18n.config.ts around lines 51 to 57, the plugin option uses a
relative setupFile ('./setup-i18n-globals.mjs') which will be injected into
tests and fail to resolve from the test/ directory; change it to an absolute
path (built from __dirname, e.g. path.join/__dirname or path.resolve to the
setup-i18n-globals.mjs file) so the injected import is an absolute path that
resolves regardless of the test file location.
| async function loadViteDefines() { | ||
| if (viteDefines !== null) { | ||
| return viteDefines | ||
| } | ||
|
|
||
| try { | ||
| const configFile = path.resolve(__dirname, '../vite.config.mts') | ||
| const result = await loadConfigFromFile( | ||
| { command: 'build', mode: 'production' }, | ||
| configFile | ||
| ) | ||
|
|
||
| if (result && result.config && result.config.define) { | ||
| viteDefines = result.config.define | ||
| console.log('[babel-plugin-vite-define] Loaded Vite defines:', Object.keys(viteDefines)) | ||
| } else { | ||
| viteDefines = {} | ||
| console.warn('[babel-plugin-vite-define] No defines found in Vite config') | ||
| } | ||
| } catch (error) { | ||
| viteDefines = {} | ||
| console.error('[babel-plugin-vite-define] Error loading Vite config:', error) | ||
| } | ||
|
|
||
| return viteDefines | ||
| } |
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.
🛠️ Refactor suggestion | 🟠 Major
Remove unused loadViteDefines function.
The loadViteDefines async function is never called. The plugin uses hardcoded defaults in the pre() hook instead. Consider removing this dead code to avoid confusion:
-let viteDefines = null
-
-/**
- * Load Vite config and extract define replacements
- */
-async function loadViteDefines() {
- if (viteDefines !== null) {
- return viteDefines
- }
-
- try {
- const configFile = path.resolve(__dirname, '../vite.config.mts')
- const result = await loadConfigFromFile(
- { command: 'build', mode: 'production' },
- configFile
- )
-
- if (result && result.config && result.config.define) {
- viteDefines = result.config.define
- console.log('[babel-plugin-vite-define] Loaded Vite defines:', Object.keys(viteDefines))
- } else {
- viteDefines = {}
- console.warn('[babel-plugin-vite-define] No defines found in Vite config')
- }
- } catch (error) {
- viteDefines = {}
- console.error('[babel-plugin-vite-define] Error loading Vite config:', error)
- }
-
- return viteDefines
-}
+let viteDefines = nullAlso remove the unused imports at the top:
const path = require('path')
-const { loadConfigFromFile } = require('vite')📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| async function loadViteDefines() { | |
| if (viteDefines !== null) { | |
| return viteDefines | |
| } | |
| try { | |
| const configFile = path.resolve(__dirname, '../vite.config.mts') | |
| const result = await loadConfigFromFile( | |
| { command: 'build', mode: 'production' }, | |
| configFile | |
| ) | |
| if (result && result.config && result.config.define) { | |
| viteDefines = result.config.define | |
| console.log('[babel-plugin-vite-define] Loaded Vite defines:', Object.keys(viteDefines)) | |
| } else { | |
| viteDefines = {} | |
| console.warn('[babel-plugin-vite-define] No defines found in Vite config') | |
| } | |
| } catch (error) { | |
| viteDefines = {} | |
| console.error('[babel-plugin-vite-define] Error loading Vite config:', error) | |
| } | |
| return viteDefines | |
| } | |
| let viteDefines = null |
🧰 Tools
🪛 ESLint
[error] 23-23: '__dirname' is not defined.
(no-undef)
[error] 31-31: 'console' is not defined.
(no-undef)
[error] 31-31: Unexpected console statement. Only these console methods are allowed: warn, error.
(no-console)
[error] 31-31: Replace '[babel-plugin-vite-define]·Loaded·Vite·defines:',·Object.keys(viteDefines) with ⏎········'[babel-plugin-vite-define]·Loaded·Vite·defines:',⏎········Object.keys(viteDefines)⏎······
(prettier/prettier)
[error] 34-34: 'console' is not defined.
(no-undef)
[error] 38-38: 'console' is not defined.
(no-undef)
[error] 38-38: Replace '[babel-plugin-vite-define]·Error·loading·Vite·config:',·error with ⏎······'[babel-plugin-vite-define]·Error·loading·Vite·config:',⏎······error⏎····
(prettier/prettier)
🤖 Prompt for AI Agents
In scripts/babel-plugin-vite-define.cjs around lines 17 to 42, remove the unused
async function loadViteDefines (and its internal logic) because it's never
called; also remove any now-unused imports at the top of the file that were only
required by this function (e.g., loadConfigFromFile, path or similar) so there
are no dead functions or unused imports left; ensure any remaining references to
viteDefines are preserved or replaced by the existing hardcoded defaults in
pre().
| "name": "aspect_ratio", | ||
| "tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, generates a 1:1 square." | ||
| "tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, a 16:9 square is usually generated." | ||
| }, |
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.
🛠️ Refactor suggestion | 🟠 Major
Fix Gemini aspect ratio tooltip (“16:9 square”).
Square is 1:1; 16:9 is widescreen. Suggest:
- "tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, a 16:9 square is usually generated."
+ "tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, a 1:1 square is usually generated."📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "name": "aspect_ratio", | |
| "tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, generates a 1:1 square." | |
| "tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, a 16:9 square is usually generated." | |
| }, | |
| "name": "aspect_ratio", | |
| "tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, a 1:1 square is usually generated." | |
| }, |
🤖 Prompt for AI Agents
In src/locales/en/nodeDefs.json around lines 2838 to 2840, the tooltip text for
"aspect_ratio" incorrectly calls "16:9" a square; update the tooltip to replace
"16:9 square" with a correct phrase such as "16:9 widescreen" or "16:9
rectangle" so the message reads that if no image is provided a 16:9 widescreen
(not square) image is usually generated; keep punctuation and quotation style
consistent with surrounding entries.
| "display_name": "Kling Omni Image to Video (Pro)", | ||
| "description": "Use up to 7 reference images to generate a video with the latest Kling model.", | ||
| "inputs": { | ||
| "model_name": { | ||
| "name": "model_name" | ||
| }, | ||
| "prompt": { | ||
| "name": "prompt", | ||
| "tooltip": "A text prompt describing the video content. This can include both positive and negative descriptions." | ||
| }, | ||
| "aspect_ratio": { | ||
| "name": "aspect_ratio" | ||
| }, | ||
| "duration": { | ||
| "name": "duration" | ||
| }, | ||
| "reference_images": { | ||
| "name": "reference_images", | ||
| "tooltip": "Up to 7 reference images." | ||
| } | ||
| }, | ||
| "outputs": { | ||
| "0": { | ||
| "tooltip": null | ||
| } | ||
| } | ||
| }, | ||
| "KlingOmniProTextToVideoNode": { | ||
| "display_name": "Kling Omni Text to Video (Pro)", | ||
| "description": "Use text prompts to generate videos with the latest Kling model.", | ||
| "inputs": { | ||
| "model_name": { | ||
| "name": "model_name" | ||
| }, | ||
| "prompt": { | ||
| "name": "prompt", | ||
| "tooltip": "A text prompt describing the video content. This can include both positive and negative descriptions." | ||
| }, | ||
| "aspect_ratio": { | ||
| "name": "aspect_ratio" | ||
| }, | ||
| "duration": { | ||
| "name": "duration" | ||
| } | ||
| }, | ||
| "outputs": { | ||
| "0": { | ||
| "tooltip": null | ||
| } | ||
| } | ||
| }, | ||
| "KlingOmniProVideoToVideoNode": { | ||
| "display_name": "Kling Omni Video to Video (Pro)", | ||
| "description": "Use a video and up to 4 reference images to generate a video with the latest Kling model.", | ||
| "inputs": { | ||
| "model_name": { | ||
| "name": "model_name" | ||
| }, | ||
| "prompt": { | ||
| "name": "prompt", | ||
| "tooltip": "A text prompt describing the video content. This can include both positive and negative descriptions." | ||
| }, | ||
| "aspect_ratio": { | ||
| "name": "aspect_ratio" | ||
| }, | ||
| "duration": { | ||
| "name": "duration" | ||
| }, | ||
| "reference_video": { | ||
| "name": "reference_video", | ||
| "tooltip": "Video to use as a reference." | ||
| }, | ||
| "keep_original_sound": { | ||
| "name": "keep_original_sound" | ||
| }, | ||
| "reference_images": { | ||
| "name": "reference_images", | ||
| "tooltip": "Up to 4 additional reference images." | ||
| } | ||
| }, | ||
| "outputs": { | ||
| "0": { | ||
| "tooltip": null | ||
| } | ||
| } | ||
| }, | ||
| "KlingSingleImageVideoEffectNode": { | ||
| "display_name": "Kling Video Effects", | ||
| "description": "Achieve different special effects when generating a video based on the effect_scene.", | ||
| "inputs": { | ||
| "image": { | ||
| "name": "image", |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find references to legacy Kling nodes mentioned in the comment
rg -nP 'KlingSingleImageVideoEffectNode|KlingStartEndFrameNode'Repository: Comfy-Org/ComfyUI_frontend
Length of output: 2589
🏁 Script executed:
#!/bin/bash
# Search for all Kling node definitions in nodeDefs.json
rg -n 'Kling.*Node.*":' src/locales/en/nodeDefs.json | head -40Repository: Comfy-Org/ComfyUI_frontend
Length of output: 724
🏁 Script executed:
#!/bin/bash
# Check the file size and structure around the added content
wc -l src/locales/en/nodeDefs.json
# Also look for any deprecation patterns in the file
rg -n 'deprecated|deprecated_in_favor_of|legacy' src/locales/en/nodeDefs.json | head -20Repository: Comfy-Org/ComfyUI_frontend
Length of output: 178
🏁 Script executed:
#!/bin/bash
# Check if new Pro nodes have pricing entries
rg -n 'KlingOmniPro.*Node.*:' src/composables/node/useNodePricing.ts | head -20Repository: Comfy-Org/ComfyUI_frontend
Length of output: 52
🏁 Script executed:
#!/bin/bash
# Look for any deprecation patterns in the TypeScript codebase
rg -n 'deprecated|isDeprecated' src/ -t ts --max-count 20Repository: Comfy-Org/ComfyUI_frontend
Length of output: 15868
🏁 Script executed:
#!/bin/bash
# Check what the relationship is between legacy and Pro nodes - do they have similar inputs?
cat src/locales/en/nodeDefs.json | sed -n '4535,4566p'Repository: Comfy-Org/ComfyUI_frontend
Length of output: 930
🏁 Script executed:
#!/bin/bash
# Verify new Pro nodes don't have pricing entries yet
rg -n 'KlingOmniPro' src/composables/node/useNodePricing.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 52
Add deprecated flag to legacy Kling nodes; coordinate with pricing and test updates.
The codebase has an established deprecation mechanism (deprecated: boolean in nodeDefSchema). Since Omni Pro nodes supersede the legacy variants, add "deprecated": true to KlingSingleImageVideoEffectNode and KlingStartEndFrameNode in all locale files. This will automatically hide them from the palette unless explicitly enabled.
Before deprecating, ensure pricing entries exist for the new Pro nodes in src/composables/node/useNodePricing.ts (currently missing), and update or maintain test cases in tests-ui/tests/composables/node/useNodePricing.test.ts that reference the legacy nodes.
🤖 Prompt for AI Agents
In src/locales/en/nodeDefs.json around lines 4449-4540, add "deprecated": true
to the KlingSingleImageVideoEffectNode and KlingStartEndFrameNode entries (and
mirror this change across all locale nodeDefs files) so the legacy nodes are
hidden by the deprecation mechanism; then add pricing entries for the new Pro
nodes (KlingOmniProImageToVideoNode, KlingOmniProTextToVideoNode,
KlingOmniProVideoToVideoNode) in src/composables/node/useNodePricing.ts and
update tests in tests-ui/tests/composables/node/useNodePricing.test.ts to
reference the new Pro nodes (or adjust assertions) so pricing and tests remain
consistent with the deprecation change.
| "name": "model", | ||
| "tooltip": "The modified diffusion model." | ||
| } | ||
| } |
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.
🧩 Analysis chain
🏁 Script executed:
sed -n '5470,5490p' src/locales/en/nodeDefs.jsonRepository: Comfy-Org/ComfyUI_frontend
Length of output: 603
🏁 Script executed:
rg -nP 'model_with_lora' --max-count=20Repository: Comfy-Org/ComfyUI_frontend
Length of output: 138
🏁 Script executed:
rg -nP '"model"' src/locales/en/nodeDefs.json | head -20Repository: Comfy-Org/ComfyUI_frontend
Length of output: 560
🏁 Script executed:
rg -nP 'nodeDefs|outputs.*name' src --type=ts --type=tsx --type=js --max-count=30Repository: Comfy-Org/ComfyUI_frontend
Length of output: 97
🏁 Script executed:
grep -n "model_with_lora" src/locales/ja/nodeDefs.jsonRepository: Comfy-Org/ComfyUI_frontend
Length of output: 109
🏁 Script executed:
rg -nP 'nodeDefs' src --type=ts --type=js | head -20Repository: Comfy-Org/ComfyUI_frontend
Length of output: 1599
🏁 Script executed:
rg -nP 'outputs.*name|name.*output' src --type=ts --type=js | head -20Repository: Comfy-Org/ComfyUI_frontend
Length of output: 2068
🏁 Script executed:
fd -e ts -e js src | head -5Repository: Comfy-Org/ComfyUI_frontend
Length of output: 52
🏁 Script executed:
rg -nP 'model_with_lora' --type=ts --type=jsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 52
🏁 Script executed:
rg -nP 'LoraModelonly' src --type=ts --type=jsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 52
Update Japanese locale to match English output name change.
The English locale was renamed from model_with_lora to model in the output definition, but the Japanese locale (ja/nodeDefs.json, line 11534) still has the old name. While no code hardcodes this string, the output names are read by the UI layer, so translations should remain consistent across locales.
Update src/locales/ja/nodeDefs.json line 11534 to align with the English version.
🤖 Prompt for AI Agents
In src/locales/ja/nodeDefs.json around line 11534, the output name still uses
the old key "model_with_lora"; update that entry so its "name" value matches the
English change to "model" (and ensure the "tooltip" remains the appropriate
Japanese translation of "The modified diffusion model."), keeping JSON syntax
and localization formatting intact.
|
Converting to draft as a backup. |
|
closed, can open later if needed :D @DrJKL |
Summary
Implements Babel plugins to handle Vite define replacements during Playwright's compilation for i18n collection tests. This resolves ReferenceErrors caused by unprocessed compile-time constants like
__DISTRIBUTION__.Related to Notion task: https://www.notion.so/comfy-org/Implement-Babel-plugin-for-Vite-define-replacements-in-Playwright-2b56d73d365081d5bb63e02712912b17
Problem
Playwright's Babel compilation does not run Vite's
definereplacements, causing reference errors during i18n collection. The__DISTRIBUTION__reference fromcoreMenuCommands.ts(viasrc/platform/distribution/types.ts) remains raw and causes failures.See failing CI: https://github.com/Comfy-Org/ComfyUI_frontend/actions/runs/19624786760/job/56191480523
Solution
Following the approach from PR #5515, this PR adds:
1. babel-plugin-vite-define.cjs
__DISTRIBUTION__,__COMFYUI_FRONTEND_VERSION__, etc.) during Babel transformation2. babel-plugin-inject-globals.cjs
collect-i18n-3. setup-i18n-globals.mjs
window,document,navigator, and other browser globals4. Updated playwright.i18n.config.ts
@alias supportChanges
babel-plugin-vite-define.cjsto replace Vite define constantsbabel-plugin-inject-globals.cjsto inject browser globals setupsetup-i18n-globals.mjsfor JSDOM-based browser environmentplaywright.i18n.config.tswith Babel plugin configurationknip.config.tsto ignore babel-plugin-module-resolverbabel-plugin-module-resolverfor @ alias supportTest Plan
__DISTRIBUTION__and other defines are properly replacedNotes
__DISTRIBUTION__ = "localhost")🤖 Generated with Claude Code
Fixes #10981
┆Issue is synchronized with this Notion page by Unito