fix(editor): Show node executing status shortly before switching to success on new canvas (#11675)

This commit is contained in:
Alex Grozav 2024-11-11 14:58:26 +02:00 committed by GitHub
parent c0aa67b8f0
commit b0ba24cbbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -12,7 +12,7 @@ const {
hasIssues,
executionStatus,
executionWaiting,
executionRunning,
executionRunningThrottled,
hasRunData,
runDataIterations,
isDisabled,
@ -58,7 +58,7 @@ const hideNodeIssues = computed(() => false); // @TODO Implement this
<!-- Do nothing, unknown means the node never executed -->
</div>
<div
v-else-if="executionRunning || executionStatus === 'running'"
v-else-if="executionRunningThrottled || executionStatus === 'running'"
data-test-id="canvas-node-status-running"
:class="[$style.status, $style.running]"
>

View file

@ -7,6 +7,7 @@ import { CanvasNodeKey } from '@/constants';
import { computed, inject } from 'vue';
import type { CanvasNodeData } from '@/types';
import { CanvasNodeRenderType, CanvasConnectionMode } from '@/types';
import { refThrottled } from '@vueuse/core';
export function useCanvasNode() {
const node = inject(CanvasNodeKey);
@ -58,6 +59,7 @@ export function useCanvasNode() {
const executionStatus = computed(() => data.value.execution.status);
const executionWaiting = computed(() => data.value.execution.waiting);
const executionRunning = computed(() => data.value.execution.running);
const executionRunningThrottled = refThrottled(executionRunning, 300);
const runDataOutputMap = computed(() => data.value.runData.outputMap);
const runDataIterations = computed(() => data.value.runData.iterations);
@ -89,6 +91,7 @@ export function useCanvasNode() {
executionStatus,
executionWaiting,
executionRunning,
executionRunningThrottled,
render,
eventBus,
};