diff --git a/frontend/src/lib/components/FlowRestartButton.svelte b/frontend/src/lib/components/FlowRestartButton.svelte index 8b387b3c11..962138798e 100644 --- a/frontend/src/lib/components/FlowRestartButton.svelte +++ b/frontend/src/lib/components/FlowRestartButton.svelte @@ -5,7 +5,6 @@ import { FlowService, JobService, type FlowVersion } from '$lib/gen' import { workspaceStore } from '$lib/stores' import { emptyString, sendUserToast } from '$lib/utils' - import { goto } from '$lib/navigation' interface Props { jobId: string @@ -17,7 +16,10 @@ enterpriseOnly?: boolean variant?: 'default' | 'accent' unifiedSize?: 'xs' | 'sm' | 'md' | 'lg' + /** Called when flow is restarted. If not provided, will navigate to the new run using goto (requires SvelteKit) */ onRestart?: (stepId: string, branchOrIterationN: number, flowVersion?: number) => void + /** Called when flow restart completes with the new job ID. Used for navigation in non-SvelteKit contexts */ + onRestartComplete?: (newJobId: string) => void } let { @@ -30,7 +32,8 @@ enterpriseOnly = false, variant = 'default', unifiedSize = 'md', - onRestart + onRestart, + onRestartComplete }: Props = $props() let branchOrIterationN = $state(0) @@ -49,7 +52,7 @@ flow_version: flowVersion } }) - await goto('/run/' + run + '?workspace=' + $workspaceStore) + onRestartComplete?.(run) } async function loadFlowVersions() { diff --git a/frontend/src/lib/components/RunsPage.svelte b/frontend/src/lib/components/RunsPage.svelte index b2be11739c..dfe41a90f5 100644 --- a/frontend/src/lib/components/RunsPage.svelte +++ b/frontend/src/lib/components/RunsPage.svelte @@ -44,7 +44,8 @@ import ToggleButton from '$lib/components/common/toggleButton-v2/ToggleButton.svelte' import Select from '$lib/components/select/Select.svelte' import AnimatedPane from '$lib/components/splitPanes/AnimatedPane.svelte' - import { useSearchParams, StaleWhileLoading } from '$lib/svelte5Utils.svelte' + import { useSearchParams } from '$lib/svelte5UtilsKit.svelte' + import { StaleWhileLoading } from '$lib/svelte5Utils.svelte' interface Props { /** Initial path from route params (e.g., /runs/u/user/script) */ diff --git a/frontend/src/lib/components/sidebar/OperatorMenu.svelte b/frontend/src/lib/components/sidebar/OperatorMenu.svelte index 8f2688898d..eacb5dbac9 100644 --- a/frontend/src/lib/components/sidebar/OperatorMenu.svelte +++ b/frontend/src/lib/components/sidebar/OperatorMenu.svelte @@ -28,7 +28,7 @@ } from '$lib/stores' import { twMerge } from 'tailwind-merge' import { USER_SETTINGS_HASH } from './settings' - import { logout } from '$lib/logout' + import { logout } from '$lib/logoutKit' import DarkModeObserver from '../DarkModeObserver.svelte' import BarsStaggered from '../icons/BarsStaggered.svelte' import { Menu, Menubar, MenuItem } from '$lib/components/meltComponents' diff --git a/frontend/src/lib/components/sidebar/UserMenu.svelte b/frontend/src/lib/components/sidebar/UserMenu.svelte index 77f791c6c8..e303d180b9 100644 --- a/frontend/src/lib/components/sidebar/UserMenu.svelte +++ b/frontend/src/lib/components/sidebar/UserMenu.svelte @@ -1,6 +1,6 @@