fix(frontend): open bottom panel to full height below the document header

Instead of an arbitrary 80 % cap, the panel now measures the actual
DocumentTopBar height at open time and fills the remaining viewport
exactly — so the PDF is fully covered and the drawer reaches right up
to the header. Drag-to-shrink still works as before.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-03-24 23:10:26 +01:00
parent f18649fb79
commit 1eb2659ba0
3 changed files with 10 additions and 3 deletions

View File

@@ -73,11 +73,16 @@ let isDragging = $state(false);
let dragStartY = 0;
let dragStartHeight = 0;
function fullHeight() {
const topbar = document.querySelector('[data-topbar]');
return window.innerHeight - (topbar?.getBoundingClientRect().height ?? 0);
}
function openTab(tab: Tab) {
activeTab = tab;
if (!open) {
open = true;
if (height <= MIN_HEIGHT) height = Math.floor(window.innerHeight * 0.8);
if (height <= MIN_HEIGHT) height = fullHeight();
}
}
@@ -96,7 +101,7 @@ function onDragMove(e: PointerEvent) {
if (!isDragging) return;
const delta = dragStartY - e.clientY; // positive = dragging up = bigger panel
const newHeight = dragStartHeight + delta;
const maxHeight = Math.floor(window.innerHeight * 0.8);
const maxHeight = fullHeight();
if (newHeight <= MIN_HEIGHT + 20) {
// collapsed past threshold → close