fix: use slot aliases for promoted widget rings

This commit is contained in:
dante01yoon
2026-04-12 17:25:53 +09:00
parent e6e1b5ff05
commit 4a8fd059fe
2 changed files with 41 additions and 1 deletions

View File

@@ -247,6 +247,46 @@ describe('computeProcessedWidgets borderStyle', () => {
).toBe(true)
})
it('uses slotName when ancestor promotion keeps the host widget alias', () => {
const promotedWidget = createMockWidget({
name: 'string_a',
type: 'combo',
nodeId: 'inner-subgraph:10',
storeNodeId: 'inner-subgraph:10',
storeName: 'string_a',
slotName: 'value_1'
})
usePromotionStore().promote('graph-test', '5', {
sourceNodeId: '6',
sourceWidgetName: 'value_1',
disambiguatingSourceNodeId: '10'
})
const result = computeProcessedWidgets({
nodeData: {
id: '6',
type: 'SubgraphNode',
widgets: [promotedWidget],
title: 'Test',
mode: 0,
selected: false,
executing: false,
inputs: [],
outputs: []
},
graphId: 'graph-test',
showAdvanced: false,
isGraphReady: false,
rootGraph: null,
ui: noopUi
})
expect(
result.some((w) => w.simplified.borderStyle?.includes('promoted'))
).toBe(true)
})
it('does not apply promoted border styling to outermost widgets', () => {
const promotedWidget = createMockWidget({
name: 'text',

View File

@@ -270,7 +270,7 @@ export function computeProcessedWidgets({
? { ...mergedOptions, disabled: true }
: mergedOptions
const sourceWidgetName = widget.storeName ?? widget.name
const sourceWidgetName = widget.slotName ?? widget.name
const isPromoted =
graphId &&
promotionStore.isWidgetPromoted(