Comfy-Org / Comfy-Org/ComfyUI_frontend

Vue node renderer ignores Hide built-in for the id and lifecycle badges

Open
#15,567 0 comments 0 reactions 1 assignee Claimed by @AustinMroz View on GitHub
area:vue-migration Potential Bug
Dominant language
TypeScript
Stars
2k
Forks
702
Avg merge
1d 8h
Merged PRs (30d)
512

Description

## Summary

The `Hide built-in` option of `Comfy.NodeBadge.NodeIdBadgeMode` and `Comfy.NodeBadge.NodeLifeCycleBadgeMode` is ignored by the Vue node renderer. A core node keeps showing its `#id` and `[BETA]`/`[DEPR]` badges under `Hide built-in`, while the legacy canvas hides them.

## Root cause

The two renderers derive badge visibility independently.

Legacy (`src/composables/node/useNodeBadge.ts:63-71`):

```ts
function badgeTextVisible(nodeDef, badgeMode): boolean {
return !(
badgeMode === NodeBadgeMode.None ||
(nodeDef?.isCoreNode && badgeMode === NodeBadgeMode.HideBuiltIn)
)
}
```

Vue (`src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts:193-204`):

```ts
if (
settingStore.get('Comfy.NodeBadge.NodeLifeCycleBadgeMode') !==
NodeBadgeMode.None
) { ...push lifecycle... }
if (
settingStore.get('Comfy.NodeBadge.NodeIdBadgeMode') !== NodeBadgeMode.None
)
core.push({ text: `#${nodeData.id}` })
```

The Vue path only checks for `None`, so `HideBuiltIn` behaves like `ShowAll` for the id and lifecycle badges. The source badge is handled separately and does agree.

## Reproduction

1. Enable `Comfy.VueNodes.Enabled`.
2. Set `Node ID badge mode` to `Hide built-in`.
3. Look at any core node.

The `#id` badge is still drawn. Turning Vue nodes off hides it.

Unit reproduction (green on `main` today, pinned in `src/composables/node/badgeRendererParity.test.ts`):

```ts
const node = setup(NodeBadgeMode.HideBuiltIn, 'CoreNode', 'nodes')
expect(legacyBadgeFacts(node)).toEqual([])
expect(vueBadgeFacts(node)).toEqual(['#1', 'BETA'].sort())
```

## Impact

A setting silently does nothing in one renderer. Relevant to the ECS migration's invariant I2 (no silent authority split): "which badges does this node show" is derived twice, from the same settings, with different rules.

## Suggested fix

Give both renderers one derivation of badge visibility rather than duplicating the rule, so `HideBuiltIn` cannot mean different things in the two paths.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.