diff --git a/frontend/src/lib/components/JobLoader.svelte b/frontend/src/lib/components/JobLoader.svelte
index 256f356467..b21cb218eb 100644
--- a/frontend/src/lib/components/JobLoader.svelte
+++ b/frontend/src/lib/components/JobLoader.svelte
@@ -44,6 +44,7 @@
jobUpdateLastFetch?: Date | undefined
toastError?: boolean
onlyResult?: boolean
+ loadPlaceholderJobOnStart?: Job
// If you want to find out progress of subjobs of a flow, check job.flow_status.progress
scriptProgress?: number | undefined
@@ -60,6 +61,7 @@
jobUpdateLastFetch = $bindable(undefined),
toastError = false,
onlyResult = false,
+ loadPlaceholderJobOnStart = undefined,
scriptProgress = $bindable(undefined),
noLogs = false,
children
@@ -326,7 +328,11 @@
syncIteration = 0
errorIteration = 0
currentId = testId
- job = undefined
+ if (loadPlaceholderJobOnStart) {
+ job = structuredClone(loadPlaceholderJobOnStart)
+ } else {
+ job = undefined
+ }
startedWatchingJob = Date.now()
// Clean up any existing SSE connection
@@ -564,7 +570,7 @@
if (isCurrentJob(id)) {
try {
// First load the job to get initial state
- if (!job && !onlyResult) {
+ if ((!job || job.id == '') && !onlyResult) {
job = await JobService.getJob({
workspace: workspace!,
id,
diff --git a/frontend/src/lib/components/ModulePreviewResultViewer.svelte b/frontend/src/lib/components/ModulePreviewResultViewer.svelte
index 69e8c71e4e..6c4be420b6 100644
--- a/frontend/src/lib/components/ModulePreviewResultViewer.svelte
+++ b/frontend/src/lib/components/ModulePreviewResultViewer.svelte
@@ -51,6 +51,12 @@
let preview: 'mock' | 'job' | undefined = $state(undefined)
let jobProgressReset: () => void = $state(() => {})
+ $effect(() => {
+ if (preview != undefined && testJob) {
+ preview = undefined
+ }
+ })
+
let forceJson = $state(false)
const logJob = $derived(testJob ?? selectedJob)
diff --git a/frontend/src/lib/components/ModuleTest.svelte b/frontend/src/lib/components/ModuleTest.svelte
index 496b33f2f2..aacd0b10a6 100644
--- a/frontend/src/lib/components/ModuleTest.svelte
+++ b/frontend/src/lib/components/ModuleTest.svelte
@@ -146,4 +146,16 @@
}
}
bind:job={modulesTestStates.states[mod.id].testJob}
+ loadPlaceholderJobOnStart={{
+ type: 'QueuedJob',
+ id: '',
+ running: false,
+ canceled: false,
+ job_kind: 'preview',
+ permissioned_as: '',
+ is_flow_step: false,
+ email: '',
+ visible_to_owner: true,
+ tag: ''
+ }}
/>
diff --git a/frontend/src/lib/components/flows/propPicker/OutputBadge.svelte b/frontend/src/lib/components/flows/propPicker/OutputBadge.svelte
index 4d08b6b306..b9d2412b30 100644
--- a/frontend/src/lib/components/flows/propPicker/OutputBadge.svelte
+++ b/frontend/src/lib/components/flows/propPicker/OutputBadge.svelte
@@ -3,6 +3,7 @@
import { twMerge } from 'tailwind-merge'
import { base } from '$lib/base'
import { ExternalLink } from 'lucide-svelte'
+ import { emptyString } from '$lib/utils'
export let job:
| Job
@@ -28,17 +29,18 @@
)}
title={'success' in job && job.success ? 'Success' : 'Failed'}
>
-
{job.id.slice(-5)}
-
-