From c6f6746201f99159d2ad3002a5a040dae58355d6 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Fri, 6 Feb 2026 18:32:42 +0100 Subject: [PATCH] nit batch rerun fixes --- .../runs/BatchReRunOptionsPane.svelte | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/frontend/src/lib/components/runs/BatchReRunOptionsPane.svelte b/frontend/src/lib/components/runs/BatchReRunOptionsPane.svelte index a635089caf..a6542393ad 100644 --- a/frontend/src/lib/components/runs/BatchReRunOptionsPane.svelte +++ b/frontend/src/lib/components/runs/BatchReRunOptionsPane.svelte @@ -17,7 +17,7 @@ import type { Schema } from '$lib/common' import InputTransformForm from '../InputTransformForm.svelte' import type { FlowPropPickerConfig, PropPickerContext } from '../prop_picker' - import { setContext, untrack } from 'svelte' + import { setContext } from 'svelte' import { writable } from 'svelte/store' import type { PickableProperties } from '../flows/previousResults' import Alert from '../common/alert/Alert.svelte' @@ -31,6 +31,7 @@ import { readFieldsRecursively } from '$lib/utils' import Button from '../common/button/Button.svelte' import ResizeTransitionWrapper from '../common/ResizeTransitionWrapper.svelte' + import { resource, watch } from 'runed' let { selectedIds, @@ -41,13 +42,16 @@ } = $props() let selected: JobGroup | undefined = $state() - $effect(() => { - jobGroupsPromise.then((jobGroups) => { + watch( + () => jobGroups.current, + () => { selected = selected - ? jobGroups.find((g) => g.script_path === selected?.script_path && g.kind === selected.kind) - : jobGroups[0] - }) - }) + ? jobGroups.current?.find( + (g) => g.script_path === selected?.script_path && g.kind === selected.kind + ) + : jobGroups.current?.[0] + } + ) setContext('PropPickerContext', { flowPropPickerConfig: writable(undefined), @@ -152,24 +156,21 @@ (options[selected.kind][selected.script_path]?.use_latest_version ?? false)) ) - const jobGroupsPromise = $derived.by(() => { - readFieldsRecursively(selectedIds) - return untrack(() => fetchJobGroups()) - }) + const jobGroups = resource(() => readFieldsRecursively(selectedIds), fetchJobGroups)
- - -
- {#await jobGroupsPromise then jobGroup} - {#each jobGroup as group} + {#if jobGroups.current?.length !== 1 && selectedIds.length > 1} + + +
+ {#each jobGroups.current ?? [] as group} {/each} - {/await} -
-
-
+
+
+
+ {/if}