Skip to content

Commit

Permalink
fix(editor): Show node executing status shortly before switching to s…
Browse files Browse the repository at this point in the history
…uccess on new canvas (#11675)
  • Loading branch information
alexgrozav authored Nov 11, 2024
1 parent c0aa67b commit b0ba24c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const {
hasIssues,
executionStatus,
executionWaiting,
executionRunning,
executionRunningThrottled,
hasRunData,
runDataIterations,
isDisabled,
Expand Down Expand Up @@ -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]"
>
Expand Down
3 changes: 3 additions & 0 deletions packages/editor-ui/src/composables/useCanvasNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -89,6 +91,7 @@ export function useCanvasNode() {
executionStatus,
executionWaiting,
executionRunning,
executionRunningThrottled,
render,
eventBus,
};
Expand Down

0 comments on commit b0ba24c

Please sign in to comment.