fix: event detail SSR children guard, state_referenced_locally warnings, a11y warnings

This commit is contained in:
AlacrisDevs
2026-02-07 10:09:00 +02:00
parent 556955f349
commit 36496e8cdb
3 changed files with 28 additions and 8 deletions

View File

@@ -339,6 +339,7 @@
<!-- Create Event Modal -->
{#if showCreateModal}
<!-- svelte-ignore a11y_no_static_element_interactions -->
<!-- svelte-ignore a11y_interactive_supports_focus -->
<div
class="fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4"
onkeydown={(e) => e.key === "Escape" && (showCreateModal = false)}
@@ -356,6 +357,7 @@
type="button"
class="text-light/40 hover:text-white transition-colors"
onclick={() => (showCreateModal = false)}
aria-label="Close"
>
<span
class="material-symbols-rounded"
@@ -453,6 +455,7 @@
<!-- Color -->
<div class="flex flex-col gap-1.5">
<!-- svelte-ignore a11y_label_has_associated_control -->
<label class="text-body-sm text-light/60 font-body"
>Color</label
>
@@ -466,6 +469,7 @@
: 'border-transparent hover:border-light/30'}"
style="background-color: {color}"
onclick={() => (newEventColor = color)}
aria-label="Select color {color}"
></button>
{/each}
</div>

View File

@@ -195,6 +195,8 @@
<!-- Module Content -->
<div class="flex-1 overflow-auto">
{@render children()}
{#if children}
{@render children()}
{/if}
</div>
</div>

View File

@@ -33,15 +33,28 @@
// Edit mode
let editing = $state(false);
let editName = $state(data.event.name);
let editDescription = $state(data.event.description ?? "");
let editStatus = $state(data.event.status);
let editStartDate = $state(data.event.start_date ?? "");
let editEndDate = $state(data.event.end_date ?? "");
let editVenueName = $state(data.event.venue_name ?? "");
let editVenueAddress = $state(data.event.venue_address ?? "");
let editName = $state("");
let editDescription = $state("");
let editStatus = $state<string>("planning");
let editStartDate = $state("");
let editEndDate = $state("");
let editVenueName = $state("");
let editVenueAddress = $state("");
let saving = $state(false);
// Sync edit fields when data changes or edit mode opens
$effect(() => {
if (editing) {
editName = data.event.name;
editDescription = data.event.description ?? "";
editStatus = data.event.status;
editStartDate = data.event.start_date ?? "";
editEndDate = data.event.end_date ?? "";
editVenueName = data.event.venue_name ?? "";
editVenueAddress = data.event.venue_address ?? "";
}
});
// Delete confirmation
let showDeleteConfirm = $state(false);
let deleting = $state(false);
@@ -522,6 +535,7 @@
<!-- Delete Confirmation -->
{#if showDeleteConfirm}
<!-- svelte-ignore a11y_no_static_element_interactions -->
<!-- svelte-ignore a11y_interactive_supports_focus -->
<div
class="fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4"
onkeydown={(e) => e.key === "Escape" && (showDeleteConfirm = false)}