From f7fd557d967bc8a1f6edeca9961bca89201e91d0 Mon Sep 17 00:00:00 2001 From: mplorentz Date: Fri, 3 Apr 2026 10:36:14 -0400 Subject: [PATCH] rework video + text chat display controls --- src/app.css | 11 +++ src/app/components/VideoCallContent.svelte | 101 +++++++++++---------- src/app/components/VoiceWidget.svelte | 69 ++++++++++++-- src/app/voice.ts | 33 +++---- src/routes/spaces/[relay]/[h]/+page.svelte | 68 ++++---------- 5 files changed, 158 insertions(+), 124 deletions(-) diff --git a/src/app.css b/src/app.css index ab733efb..18cfd961 100644 --- a/src/app.css +++ b/src/app.css @@ -22,6 +22,17 @@ @apply pl-sai pr-sai; } +/* root */ + +:root { + font-family: Lato; + --sait: var(--safe-area-inset-top, env(safe-area-inset-top)); + --saib: var(--safe-area-inset-bottom, env(safe-area-inset-bottom)); + --sail: var(--safe-area-inset-left, env(safe-area-inset-left)); + --sair: var(--safe-area-inset-right, env(safe-area-inset-right)); + --video-call-panel-bg: #181e24; +} + @utility py-sai { @apply pt-sai pb-sai; } diff --git a/src/app/components/VideoCallContent.svelte b/src/app/components/VideoCallContent.svelte index ca1eaa82..6fda6390 100644 --- a/src/app/components/VideoCallContent.svelte +++ b/src/app/components/VideoCallContent.svelte @@ -7,10 +7,10 @@ import Icon from "@lib/components/Icon.svelte" import ProfileCircle from "@app/components/ProfileCircle.svelte" import VideoCallVideo from "@app/components/VideoCallVideo.svelte" + import VoiceWidget from "@app/components/VoiceWidget.svelte" import { currentVoiceSession, currentVoiceRoom, - videoCallContentActive, videoCallLayoutRevision, videoPrimaryTileKey, toggleVideoPrimaryTile, @@ -41,13 +41,7 @@ const roomMatches = $derived($currentVoiceRoom?.url === url && $currentVoiceRoom?.h === h) - const allowEmptyPanel = $derived(variant === "desktop-split" || variant === "desktop-full") - - const showPanel = $derived( - visible && - roomMatches && - (variant === "mobile" ? $videoCallContentActive : $videoCallContentActive || allowEmptyPanel), - ) + const showPanel = $derived(visible && roomMatches) const tiles = $derived.by(() => { // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- re-run when remote video subscribes @@ -158,11 +152,11 @@ const panelChrome = $derived( cx( variant === "mobile" && - "cb ct cw z-compose bg-base-300/95 fixed inset-x-0 flex min-h-0 flex-col gap-2 overflow-hidden p-2 md:hidden", + "cb top-[calc(var(--sait)+6rem)] cw z-compose bg-[var(--video-call-panel-bg)] fixed inset-x-0 flex min-h-0 flex-col gap-2 overflow-y-auto overflow-x-hidden px-2 pb-2 pt-1 md:hidden", variant === "desktop-split" && - "cb ct cw-split-video z-compose bg-base-300/95 fixed hidden min-h-0 flex-col gap-2 overflow-hidden p-2 md:flex", + "cb ct cw-split-video z-compose bg-[var(--video-call-panel-bg)] fixed hidden min-h-0 flex-col gap-2 overflow-hidden p-2 md:flex", variant === "desktop-full" && - "cb ct cw z-compose bg-base-300/95 fixed hidden min-h-0 flex-col gap-2 overflow-hidden p-2 md:flex", + "cb ct cw z-compose bg-[var(--video-call-panel-bg)] fixed hidden min-h-0 flex-col gap-2 overflow-hidden p-2 md:flex", className, ), ) @@ -208,43 +202,56 @@ {/snippet} -{#if showPanel && (showTileGrid || allowEmptyPanel)} -
- {#if showTileGrid} - {#if useSpotlightLayout && primaryTile} -
- {@render videoTile(primaryTile, "spotlight")} - {#if secondaryTiles.length > 0} -
- {#each secondaryTiles as tile (tileKey(tile))} - {@render videoTile(tile, "strip")} - {/each} -
- {/if} -
- {:else if useMultiGrid} -
- {#each tiles as tile (tileKey(tile))} - {@render videoTile(tile, "default")} - {/each} -
- {:else} -
- {#each tiles as tile (tileKey(tile))} - {@render videoTile(tile, "default")} - {/each} -
- {/if} - {:else} -
-

No camera or screen share yet.

-

- Use the camera or screen share control in the voice widget to share video. -

+{#snippet videoPanelBody()} + {#if showTileGrid} + {#if useSpotlightLayout && primaryTile} +
+ {@render videoTile(primaryTile, "spotlight")} + {#if secondaryTiles.length > 0} +
+ {#each secondaryTiles as tile (tileKey(tile))} + {@render videoTile(tile, "strip")} + {/each} +
+ {/if}
+ {:else if useMultiGrid} +
+ {#each tiles as tile (tileKey(tile))} + {@render videoTile(tile, "default")} + {/each} +
+ {:else} +
+ {#each tiles as tile (tileKey(tile))} + {@render videoTile(tile, "default")} + {/each} +
+ {/if} + {:else} +
+

No camera or screen share yet.

+

Use the camera or screen share control to share video.

+
+ {/if} +{/snippet} + +{#if showPanel} +
+ {#if variant === "mobile"} +
+
+ {@render videoPanelBody()} +
+
+ +
+
+ {:else} + {@render videoPanelBody()} {/if}
{/if} diff --git a/src/app/components/VoiceWidget.svelte b/src/app/components/VoiceWidget.svelte index 7270b930..dfcdebb6 100644 --- a/src/app/components/VoiceWidget.svelte +++ b/src/app/components/VoiceWidget.svelte @@ -1,6 +1,7 @@ @@ -96,18 +139,28 @@ out:fly={{y: 60, duration: 250}} class="flex flex-col gap-2 rounded-box bg-base-100 p-3">
- {#if $voiceState === VoiceState.Joining} - Joining... - {:else if $voiceState === VoiceState.Connected} - Voice Connected - {:else} - Disconnected - {/if} +
+ {#if $voiceState === VoiceState.Joining} + Joining... + {:else if $voiceState === VoiceState.Connected} + Voice Connected + {:else} + Disconnected + {/if} + {#if showVoiceLayoutToggle} + + {/if} +
{roomName} / {spaceName}
-
+
{#if $voiceState === VoiceState.Joining} - -
- - {/if}