From f5e1dbf3c16d61d668f24fdaa111656f8a276e8d Mon Sep 17 00:00:00 2001 From: Diego Imbert <70353967+diegoimbert@users.noreply.github.com> Date: Thu, 30 Oct 2025 20:33:13 +0100 Subject: [PATCH] Pause toast if any is hovered (#6965) --- frontend/src/lib/components/EditorBar.svelte | 6 +++--- frontend/src/lib/components/Toast.svelte | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/EditorBar.svelte b/frontend/src/lib/components/EditorBar.svelte index 36149f061e..9085d48bfa 100644 --- a/frontend/src/lib/components/EditorBar.svelte +++ b/frontend/src/lib/components/EditorBar.svelte @@ -1005,9 +1005,9 @@ JsonNode ${windmillPathToCamelCaseName(path)} = JsonNode.Parse(await client.GetS class="inline-flex h-6 w-6 items-center justify-center rounded-full ring-2 ring-white bg-gray-600" title={user.name} > - {user.name.substring(0, 2).toLocaleUpperCase()} + + {user.name.substring(0, 2).toLocaleUpperCase()} + {/each} diff --git a/frontend/src/lib/components/Toast.svelte b/frontend/src/lib/components/Toast.svelte index 8728a631dd..a70855c8de 100644 --- a/frontend/src/lib/components/Toast.svelte +++ b/frontend/src/lib/components/Toast.svelte @@ -7,9 +7,11 @@ function update(time: number) { isLoopRunning = true const delta = time - lastTime + + let hover = Object.values(toastStates).some((state) => state.hover) for (const toastId in toastStates) { const state = toastStates[toastId] - if (state.hover) continue + if (hover) continue if (state.elapsed >= state.duration) { delete toastStates[toastId] continue @@ -82,6 +84,8 @@ let color = error ? { text: 'text-red-400', bg: 'bg-red-400' } : { text: 'text-green-400', bg: 'bg-green-300' } + + let hover = $derived(Object.values(toastStates).some((state) => state.hover)) @@ -140,7 +144,7 @@