fix: handle version-suffixed frontend_only module names

Strip version suffix before comparing module name to 'frontend_only',
so 'custom_nodes.frontend_only@1.0.0' is also handled correctly.
This commit is contained in:
bymyself
2026-03-16 05:57:04 +00:00
parent 4f431544cc
commit b941526b9d
2 changed files with 12 additions and 2 deletions

View File

@@ -73,6 +73,16 @@ describe('getNodeSource', () => {
})
})
it('should return empty badgeText for version-suffixed frontend_only', () => {
const result = getNodeSource('custom_nodes.frontend_only@1.0.0')
expect(result).toEqual({
type: NodeSourceType.CustomNodes,
className: 'comfy-frontend-only',
displayText: 'Frontend Only',
badgeText: ''
})
})
it('should return UNKNOWN_NODE_SOURCE for unrecognized modules', () => {
const result = getNodeSource('unknown_module.something')
expect(result).toEqual({

View File

@@ -63,7 +63,8 @@ export function getNodeSource(
if (!moduleName) {
return UNKNOWN_NODE_SOURCE
}
if (moduleName === 'frontend_only') {
const customNodeName = moduleName.split('@')[0]
if (customNodeName === 'frontend_only') {
return {
type: NodeSourceType.CustomNodes,
className: 'comfy-frontend-only',
@@ -71,7 +72,6 @@ export function getNodeSource(
badgeText: ''
}
}
const customNodeName = moduleName.split('@')[0]
const displayName = shortenNodeName(customNodeName)
return {
type: NodeSourceType.CustomNodes,