mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
fix: prefer user-renamed label over interior widget store label for promoted widgets
The PromotedWidgetView.label getter read from widgetValueStore first, returning the interior widget's own name (e.g. "value") instead of the user's renamed label (e.g. "prompt"). Swap priority so displayName (from input.label) is checked first. For legacy canvas, the projected interior BaseWidget reads its own store label directly, so temporarily override it during draw(). For Vue Node rendering, NodeWidgets.vue fetches widgetState from the store independently; prefer slotName (which carries the renamed label) over widgetState.label. Fixes promoted widget label regression introduced by PR #9896/#9928.
This commit is contained in:
@@ -189,7 +189,7 @@ class PromotedWidgetView implements IPromotedWidgetView {
|
||||
|
||||
get label(): string | undefined {
|
||||
const state = this.getWidgetState()
|
||||
return state?.label ?? this.displayName ?? this.sourceWidgetName
|
||||
return this.displayName ?? state?.label ?? this.sourceWidgetName
|
||||
}
|
||||
|
||||
set label(value: string | undefined) {
|
||||
@@ -237,11 +237,15 @@ class PromotedWidgetView implements IPromotedWidgetView {
|
||||
const originalY = projected.y
|
||||
const originalComputedHeight = projected.computedHeight
|
||||
const originalComputedDisabled = projected.computedDisabled
|
||||
const originalLabel = projected.label
|
||||
|
||||
projected.y = this.y
|
||||
projected.computedHeight = this.computedHeight
|
||||
projected.computedDisabled = this.computedDisabled
|
||||
projected.value = this.value
|
||||
if (this.displayName && this.displayName !== this.sourceWidgetName) {
|
||||
projected.label = this.displayName
|
||||
}
|
||||
|
||||
projected.drawWidget(ctx, {
|
||||
width: widgetWidth,
|
||||
@@ -253,6 +257,7 @@ class PromotedWidgetView implements IPromotedWidgetView {
|
||||
projected.y = originalY
|
||||
projected.computedHeight = originalComputedHeight
|
||||
projected.computedDisabled = originalComputedDisabled
|
||||
projected.label = originalLabel
|
||||
}
|
||||
|
||||
onPointerDown(
|
||||
|
||||
@@ -412,7 +412,7 @@ const processedWidgets = computed((): ProcessedWidget[] => {
|
||||
borderStyle,
|
||||
callback: widget.callback,
|
||||
controlWidget: widget.controlWidget,
|
||||
label: widgetState?.label,
|
||||
label: widget.slotName ?? widgetState?.label,
|
||||
linkedUpstream,
|
||||
options: widgetOptions,
|
||||
spec: widget.spec
|
||||
|
||||
Reference in New Issue
Block a user