From 08bd27b5cd060a1b32481322f9a955a0999f6ef4 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 12 Apr 2026 13:21:34 +0200 Subject: [PATCH] feat(layout): mount ConfirmDialog in root layout and provide confirm service provideConfirmService() sets up context for the entire component tree. ConfirmDialog is mounted once at the bottom of the layout shell. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/routes/+layout.svelte | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index c25a1abe..3aada446 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -7,9 +7,15 @@ import ThemeToggle from '$lib/components/ThemeToggle.svelte'; import NotificationBell from '$lib/components/NotificationBell.svelte'; import AppNav from './AppNav.svelte'; import UserMenu from './UserMenu.svelte'; +import ConfirmDialog from '$lib/components/ConfirmDialog.svelte'; +import { provideConfirmService } from '$lib/services/confirm.svelte.js'; let { children, data } = $props(); +// Provide the confirmation service to the entire component tree. +// ConfirmDialog below reads it via getConfirmService() and renders the . +provideConfirmService(); + const isAdmin = $derived( data?.user?.groups?.some((g: { permissions: string[] }) => g.permissions.includes('ADMIN')) ); @@ -70,4 +76,7 @@ const userInitials = $derived.by(() => {
{@render children()}
+ + +