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:
jaeone94
2026-03-22 21:06:09 +09:00
parent b33c8c2d30
commit b6cafe7d2b
2 changed files with 7 additions and 2 deletions

View File

@@ -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(

View File

@@ -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