diff --git a/frontend/src/lib/components/DocumentBottomPanel.svelte b/frontend/src/lib/components/DocumentBottomPanel.svelte index 514f808f..f2bdfd3c 100644 --- a/frontend/src/lib/components/DocumentBottomPanel.svelte +++ b/frontend/src/lib/components/DocumentBottomPanel.svelte @@ -68,7 +68,6 @@ let { }: Props = $props(); const MIN_HEIGHT = 52; // drag handle (8px) + tab bar (~44px) -const DEFAULT_HEIGHT = 320; let isDragging = $state(false); let dragStartY = 0; @@ -78,7 +77,7 @@ function openTab(tab: Tab) { activeTab = tab; if (!open) { open = true; - if (height <= MIN_HEIGHT) height = DEFAULT_HEIGHT; + if (height <= MIN_HEIGHT) height = Math.floor(window.innerHeight * 0.8); } } @@ -104,7 +103,7 @@ function onDragMove(e: PointerEvent) { open = false; } else { open = true; - height = Math.max(DEFAULT_HEIGHT / 4, Math.min(newHeight, maxHeight)); + height = Math.max(80, Math.min(newHeight, maxHeight)); } } diff --git a/frontend/src/routes/documents/[id]/+page.svelte b/frontend/src/routes/documents/[id]/+page.svelte index b866dc0f..5e26f946 100644 --- a/frontend/src/routes/documents/[id]/+page.svelte +++ b/frontend/src/routes/documents/[id]/+page.svelte @@ -73,7 +73,7 @@ const LS_KEY_HEIGHT = 'doc-panel-height'; const LS_KEY_TAB = 'doc-panel-tab'; let panelOpen = $state(false); -let panelHeight = $state(320); +let panelHeight = $state(0); // set to 80vh on mount let activeTab = $state('metadata'); let localStorageRestored = $state(false); @@ -85,6 +85,7 @@ onMount(() => { if (savedTab && ['metadata', 'transcription', 'discussion', 'history'].includes(savedTab)) { activeTab = savedTab as Tab; } + panelHeight = Math.floor(window.innerHeight * 0.8); if (savedHeight) { const h = parseInt(savedHeight, 10); if (!isNaN(h) && h >= 80) panelHeight = h;