-
Notifications
You must be signed in to change notification settings - Fork 491
Feat/3d dropdown #8765
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
Feat/3d dropdown #8765
Conversation
|
Playwright: ✅ 525 passed, 0 failed · 1 flaky 📊 Browser Reports
|
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 02/10/2026, 07:01:40 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
📝 WalkthroughWalkthroughThe changes extend 3D model upload functionality by introducing mesh asset support with subfolder organization. They centralize supported file extensions into a reusable constant, add mesh-specific metadata to input specs, expand widget components to handle mesh uploads and subfolders, and update type definitions and schemas accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 22.2 kB (baseline 22.2 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 855 kB (baseline 855 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 68.8 kB (baseline 68.8 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 11 added / 11 removed Panels & Settings — 451 kB (baseline 451 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 23 added / 23 removed User & Accounts — 16 kB (baseline 16 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 5 added / 5 removed Editors & Dialogs — 751 B (baseline 751 B) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 1 added / 1 removed UI Components — 36.6 kB (baseline 36.6 kB) • ⚪ 0 BReusable component library chunks
Status: 8 added / 8 removed Data & Services — 2.12 MB (baseline 2.12 MB) • 🔴 +118 BStores, services, APIs, and repositories
Status: 13 added / 13 removed Utilities & Hooks — 237 kB (baseline 237 kB) • 🔴 +209 BHelpers, composables, and utility bundles
Status: 14 added / 14 removed Vendor & Third-Party — 8.77 MB (baseline 8.77 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Status: 1 added / 1 removed Other — 7.21 MB (baseline 7.21 MB) • 🔴 +1.47 kBBundles that do not match a named category
Status: 116 added / 115 removed |
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: 4
🤖 Fix all issues with AI agents
In `@src/extensions/core/load3d/constants.ts`:
- Around line 17-18: Add a new constant VALIDATED_MESH_EXTENSIONS_ACCEPT in the
same module as SUPPORTED_EXTENSIONS_ACCEPT that joins only the security-approved
mesh extensions (".obj", ".stl", ".ply", ".spz"); do not modify
SUPPORTED_EXTENSIONS_ACCEPT (leave it for load3d.ts). Then update
WidgetSelectDropdown.vue to import and use VALIDATED_MESH_EXTENSIONS_ACCEPT in
the acceptTypes computed property for the 'mesh' case (instead of
SUPPORTED_EXTENSIONS_ACCEPT), while leaving load3d.ts imports of
SUPPORTED_EXTENSIONS_ACCEPT unchanged.
In
`@src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDropdown.vue`:
- Around line 298-299: Add the missing i18n key
"widgets.uploadSelect.placeholderMesh" by inserting a new entry into the English
locale's uploadSelect object (same level as "placeholder" and
"placeholderImage"), supply an appropriate string value for the mesh
placeholder, and ensure the locale JSON remains valid (no trailing commas) so
the t('widgets.uploadSelect.placeholderMesh') lookup in WidgetSelectDropdown.vue
resolves.
- Around line 324-325: The dropdown case for 'mesh' returns
SUPPORTED_EXTENSIONS_ACCEPT which currently includes formats (.gltf, .glb, .fbx,
.splat, .ksplat) that were excluded by the security review; update the
client-side accept list to match the validated subset or ensure server-side
accepts/validates the extra types. Change SUPPORTED_EXTENSIONS_ACCEPT to only
'.obj,.stl,.ply,.spz' (or alternatively adjust the 'mesh' case to return a new
constant like VALIDATED_MESH_ACCEPT) and confirm any server upload handler
(e.g., mesh upload validation code) is updated to accept and securely validate
any additional formats if you choose to keep them.
- Around line 375-376: The uploadSubfolder value (props.uploadSubfolder) is
appended to the FormData without client-side path-traversal validation; add the
same validation used by assetFilenameSchema (the regex that forbids '..' and
leading '/') before appending. In WidgetSelectDropdown.vue, either import/reuse
the assetFilenameSchema validation function or replicate the exact regex check
and if the value fails, block submission (or clear the field) and surface a
validation error to the user; only append to body.append('subfolder',
props.uploadSubfolder) when the value passes that check.
🧹 Nitpick comments (1)
src/locales/en/main.json (1)
1804-1804: Hardcoded extension list duplicatesSUPPORTED_EXTENSIONS— consider generating dynamically.This string manually lists all supported extensions, duplicating the
SUPPORTED_EXTENSIONSset inconstants.ts. If extensions are added/removed in the future, this message could drift out of sync. Consider using an i18n interpolation parameter to pass the extensions dynamically, e.g.:"unsupportedFileType": "Unsupported file type (supports {extensions})"Then pass
SUPPORTED_EXTENSIONS_ACCEPT(or a formatted version) as theextensionsparameter at the call site.
| case 'mesh': | ||
| return t('widgets.uploadSelect.placeholderMesh') |
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:
rg -n 'placeholderMesh' src/locales/Repository: Comfy-Org/ComfyUI_frontend
Length of output: 52
🏁 Script executed:
rg -A 2 -B 2 'uploadSelect' src/locales/en/main.jsonRepository: Comfy-Org/ComfyUI_frontend
Length of output: 239
Add missing i18n key widgets.uploadSelect.placeholderMesh to src/locales/en/main.json.
The key referenced in the code does not exist in the locale file. The uploadSelect section currently only contains placeholder and placeholderImage keys. Add the placeholderMesh entry to the uploadSelect object in src/locales/en/main.json.
🤖 Prompt for AI Agents
In `@src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDropdown.vue`
around lines 298 - 299, Add the missing i18n key
"widgets.uploadSelect.placeholderMesh" by inserting a new entry into the English
locale's uploadSelect object (same level as "placeholder" and
"placeholderImage"), supply an appropriate string value for the mesh
placeholder, and ensure the locale JSON remains valid (no trailing commas) so
the t('widgets.uploadSelect.placeholderMesh') lookup in WidgetSelectDropdown.vue
resolves.
src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDropdown.vue
Show resolved
Hide resolved
src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDropdown.vue
Show resolved
Hide resolved
| let cleanPath = modelPath.trim() | ||
| let forcedType: 'output' | 'input' | undefined | ||
|
|
||
| if (cleanPath.endsWith('[output]')) { |
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.
I don't love that we have a magic suffix...
(Not introduced in this PR, just noting)
## Summary - Refactor getModelUrl to use const instead of let - add missing language key improve for #8765 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8779-fix-address-review-nits-in-load3d-3036d73d36508183af11c5e9bc545650) by [Unito](https://www.unito.io)
Summary
Add mesh_upload and upload_subfolder to combo input schema so WidgetSelect detects mesh uploads generically instead of hardcoding node type checks. Inject these flags in load3dLazy.ts so they are available before THREE.js loads.
Also unify SUPPORTED_EXTENSIONS_ACCEPT across load3d and dropdown, pass uploadSubfolder prop through to WidgetSelectDropdown for correct upload path, and update error message to list all supported extensions.
replacement for #7975
(We should include thumbnail but not yet, will do it later)
Screenshots (if applicable)
2026-02-09.21-10-25.mp4
┆Issue is synchronized with this Notion page by Unito