From db8e681120ac5682dc09cd449a859473bb4d8020 Mon Sep 17 00:00:00 2001 From: Till JS Date: Wed, 15 Apr 2026 19:42:20 +0200 Subject: [PATCH] feat(workbench): render scene header left of the first page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New SceneHeader component: big scene name (clamp 2.75rem–4.5rem responsive) plus a muted description underneath, or an italic "Beschreibung hinzufügen…" placeholder when empty. The whole block is a button — clicking it opens the existing scene edit dialog, now pulling double duty for both name and description. Wired through PageCarousel's new leading snippet from the previous commit, so the header scrolls with the track and stays anchored to the visual start of the carousel without needing a second scroll container. SceneRenameDialog grows a description textarea (maxlength 240, 3 rows, vertically resizable) and onSubmit now passes (name, description). The caller translates an empty description to null so the DB column reflects "no description set" rather than an empty string — keeps WorkbenchScene.description truthy checks honest. handleEditActiveScene resolves the currently-active scene and opens the dialog pre-filled; used by the SceneHeader click. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../workbench/scenes/SceneHeader.svelte | 87 +++++++++++++++++++ .../workbench/scenes/SceneRenameDialog.svelte | 24 ++++- .../apps/web/src/routes/(app)/+page.svelte | 29 +++++-- 3 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 apps/mana/apps/web/src/lib/components/workbench/scenes/SceneHeader.svelte diff --git a/apps/mana/apps/web/src/lib/components/workbench/scenes/SceneHeader.svelte b/apps/mana/apps/web/src/lib/components/workbench/scenes/SceneHeader.svelte new file mode 100644 index 000000000..9db1236ab --- /dev/null +++ b/apps/mana/apps/web/src/lib/components/workbench/scenes/SceneHeader.svelte @@ -0,0 +1,87 @@ + + + +{#if scene} + +{/if} + + diff --git a/apps/mana/apps/web/src/lib/components/workbench/scenes/SceneRenameDialog.svelte b/apps/mana/apps/web/src/lib/components/workbench/scenes/SceneRenameDialog.svelte index e1f63bf89..9981700a9 100644 --- a/apps/mana/apps/web/src/lib/components/workbench/scenes/SceneRenameDialog.svelte +++ b/apps/mana/apps/web/src/lib/components/workbench/scenes/SceneRenameDialog.svelte @@ -6,8 +6,9 @@ show: boolean; title: string; initialName?: string; + initialDescription?: string; confirmLabel?: string; - onSubmit: (name: string) => void | Promise; + onSubmit: (name: string, description: string) => void | Promise; onCancel: () => void; } @@ -15,18 +16,21 @@ show, title, initialName = '', + initialDescription = '', confirmLabel = 'Speichern', onSubmit, onCancel, }: Props = $props(); let name = $state(''); + let description = $state(''); let pending = $state(false); let inputEl = $state(null); $effect(() => { if (show) { name = initialName; + description = initialDescription; queueMicrotask(() => inputEl?.focus()); } }); @@ -36,7 +40,7 @@ if (pending || !name.trim()) return; pending = true; try { - await onSubmit(name.trim()); + await onSubmit(name.trim(), description); } finally { pending = false; } @@ -75,6 +79,16 @@ required /> +