diff --git a/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleMainOutput.spec.ts b/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleMainOutput.spec.ts index 6027bda5cd..944c790633 100644 --- a/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleMainOutput.spec.ts +++ b/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleMainOutput.spec.ts @@ -32,6 +32,23 @@ describe('CanvasHandleMainOutput', () => { expect(queryByTestId('canvas-handle-plus')).not.toBeInTheDocument(); }); + it('should render CanvasHandlePlus with success state when runData.total > 1', () => { + const { queryByTestId } = renderComponent({ + global: { + provide: { + ...createCanvasHandleProvide({ + runData: { + total: 2, + iterations: 1, + }, + }), + }, + }, + }); + + expect(queryByTestId('canvas-handle-plus')).toHaveClass('success'); + }); + it('should render run data label', async () => { const runData = { total: 1, diff --git a/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleMainOutput.vue b/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleMainOutput.vue index 6b816ea00b..6a44924916 100644 --- a/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleMainOutput.vue +++ b/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleMainOutput.vue @@ -38,7 +38,7 @@ const runDataLabel = computed(() => const isHandlePlusVisible = computed(() => !isConnecting.value || isHovered.value); -const plusType = computed(() => (runData.value ? 'success' : 'default')); +const plusType = computed(() => ((runData.value?.total ?? 0) > 0 ? 'success' : 'default')); const plusLineSize = computed( () => diff --git a/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleNonMainInput.vue b/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleNonMainInput.vue index 8d4e7a8258..bd03ffdd9e 100644 --- a/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleNonMainInput.vue +++ b/packages/editor-ui/src/components/canvas/elements/handles/render-types/CanvasHandleNonMainInput.vue @@ -10,7 +10,7 @@ const emit = defineEmits<{ const $style = useCssModule(); -const { label, isConnected, isConnecting, isRequired, type, runData } = useCanvasNodeHandle(); +const { label, isConnected, isConnecting, isRequired, type } = useCanvasNodeHandle(); const handleClasses = 'target'; @@ -30,8 +30,6 @@ const isHandlePlusVisible = computed( () => !isConnecting.value || isHovered.value || supportsMultipleConnections.value, ); -const plusType = computed(() => (runData.value ? 'success' : 'ai')); - const isHovered = ref(false); function onMouseEnter() { @@ -55,7 +53,7 @@ function onClickAdd() { v-if="isHandlePlusAvailable" v-show="isHandlePlusVisible" :handle-classes="handleClasses" - :type="plusType" + type="secondary" position="bottom" @mouseenter="onMouseEnter" @mouseleave="onMouseLeave" diff --git a/packages/editor-ui/src/components/canvas/elements/handles/render-types/parts/CanvasHandlePlus.vue b/packages/editor-ui/src/components/canvas/elements/handles/render-types/parts/CanvasHandlePlus.vue index 5cb973d610..9afc8105c9 100644 --- a/packages/editor-ui/src/components/canvas/elements/handles/render-types/parts/CanvasHandlePlus.vue +++ b/packages/editor-ui/src/components/canvas/elements/handles/render-types/parts/CanvasHandlePlus.vue @@ -7,7 +7,7 @@ const props = withDefaults( handleClasses?: string; plusSize?: number; lineSize?: number; - type?: 'success' | 'ai' | 'default'; + type?: 'success' | 'secondary' | 'default'; }>(), { position: 'right', @@ -135,7 +135,7 @@ function onClick(event: MouseEvent) { .wrapper { position: relative; - &.ai { + &.secondary { .line { stroke: var(--node-type-supplemental-color); }