From 950a1afad74524a14439a3914568af2cc2ce96ea Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Thu, 1 Oct 2026 22:37:59 +0200 Subject: [PATCH] Stacked layout: drag the chat taller under a stream, never below its minimum Co-Authored-By: Claude Opus 5.5 --- src/ui/Chat.svelte | 25 +++++++++++++++++++++++-- test/e2e/share.e2e.ts | 12 ++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/ui/Chat.svelte b/src/ui/Chat.svelte index bc5dfc3..7293b63 100644 --- a/src/ui/Chat.svelte +++ b/src/ui/Chat.svelte @@ -3,6 +3,8 @@ import ChatLog from './ChatLog.svelte'; import Composer from './Composer.svelte'; import VoiceStage from './VoiceStage.svelte'; + import ResizeHandle from './ResizeHandle.svelte'; + import { share } from '../lib/share.svelte.ts'; import { ui } from '../lib/ui.svelte.ts'; import { session } from '../lib/session.svelte.ts'; @@ -10,6 +12,14 @@ // videoOnly: streams as a plain picture without the tiles (stacked layout) let { onmenu, onpanel, showMenu, showStage = false, videoOnly = false }: { onmenu: () => void; onpanel: () => void; showMenu: boolean; showStage?: boolean; videoOnly?: boolean } = $props(); + // Stacked layout with a stream above the chat: the chat's height can be dragged larger than + // its minimum; the picture gets the rest. Unset until dragged, then the picture decides. + const LOG_MIN = 124; + const here = (s: { server?: { id: string } | null } | null | undefined) => !!s && s.server?.id === session.server?.id; + const streamAbove = $derived(videoOnly && session.status === 'connected' && ((!!share.stream && here(share.host)) || (!!share.watching && here(share.watching.host)))); + let logHeight = $state(Number((() => { try { return localStorage.getItem('mumh5.stackedChatHeight'); } catch { return null; } })()) || 0); + const logFixed = $derived(streamAbove && logHeight >= LOG_MIN); + const isDm = $derived(session.view.startsWith('dm:')); const title = $derived(session.status === 'connected' ? session.viewTitle() : 'mumh5'); const topic = $derived.by(() => { @@ -18,7 +28,7 @@ }); -
+
{#if showMenu}{/if} @@ -48,6 +58,11 @@ {/if} +
+ {#if streamAbove} + Math.max(LOG_MIN, window.innerHeight - 320)} initial={220} + storageKey="mumh5.stackedChatHeight" label="Resize the chat" /> + {/if} {#snippet empty()}
@@ -67,6 +82,7 @@
{/snippet}
+
{#if session.status === 'connected'} @@ -75,7 +91,12 @@