From 4bbdd3334474fbdac0c3b6e1f5715291519061b6 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 31 May 2026 12:19:36 +0200 Subject: [PATCH] feat(ui): show read-only transcription header without an edit tab (#697) TranscriptionPanelHeader gains a canEdit prop (default true). Editors keep the Lesen/Bearbeiten segmented toggle; read-only users get a plain "Transkription" heading instead of a lone single-option pill, while the "N Abschnitte" status line stays visible. Co-Authored-By: Claude Opus 4.8 --- .../TranscriptionPanelHeader.svelte | 75 +++++++++++-------- .../TranscriptionPanelHeader.svelte.test.ts | 21 ++++++ 2 files changed, 65 insertions(+), 31 deletions(-) diff --git a/frontend/src/lib/document/transcription/TranscriptionPanelHeader.svelte b/frontend/src/lib/document/transcription/TranscriptionPanelHeader.svelte index a7c91784..f6c6ee07 100644 --- a/frontend/src/lib/document/transcription/TranscriptionPanelHeader.svelte +++ b/frontend/src/lib/document/transcription/TranscriptionPanelHeader.svelte @@ -8,11 +8,20 @@ type Props = { hasBlocks: boolean; blockCount: number; lastEditedAt: string | null; + canEdit?: boolean; onModeChange: (mode: 'read' | 'edit') => void; onClose: () => void; }; -let { mode, hasBlocks, blockCount, lastEditedAt, onModeChange, onClose }: Props = $props(); +let { + mode, + hasBlocks, + blockCount, + lastEditedAt, + canEdit = true, + onModeChange, + onClose +}: Props = $props(); const formattedDate = $derived( lastEditedAt @@ -34,37 +43,41 @@ function handleReadClick() {
- -
-
- - + + {#if canEdit} +
+
+ + +
+ +

{m.transcription_mode_help_body()}

+
- -

{m.transcription_mode_help_body()}

-
-
+ {:else} +

{m.transcription_panel_title()}

+ {/if}