feat: discussion sub-tab navigation for annotation threads (#60) #63

Merged
marcel merged 17 commits from feat/60-discussion-panel-tabs into main 2026-03-25 12:38:45 +01:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit f18649fb79 - Show all commits

View File

@@ -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));
}
}

View File

@@ -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<Tab>('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;