Allow clicking voice widget to go back to call

This commit is contained in:
mplorentz
2026-04-03 10:41:05 -04:00
parent f7fd557d96
commit 9eeb6a45a6
+19 -5
View File
@@ -76,6 +76,14 @@
pushModal(VoiceRoomJoinDialog, {url: targetRoom.url, h: targetRoom.h}) pushModal(VoiceRoomJoinDialog, {url: targetRoom.url, h: targetRoom.h})
} }
const goToRoom = () => {
if (!targetRoom) return
const path = makeRoomPath(targetRoom.url, targetRoom.h)
if ($page.url.pathname !== path) {
void goto(path)
}
}
const openCallSettings = () => { const openCallSettings = () => {
pushModal(VoiceCallAudioSettingsDialog) pushModal(VoiceCallAudioSettingsDialog)
} }
@@ -138,8 +146,13 @@
in:fly={{y: 60, duration: 350}} in:fly={{y: 60, duration: 350}}
out:fly={{y: 60, duration: 250}} out:fly={{y: 60, duration: 250}}
class="flex flex-col gap-2 rounded-box bg-base-100 p-3"> class="flex flex-col gap-2 rounded-box bg-base-100 p-3">
<div class="flex items-start justify-between gap-2">
<button
type="button"
class="min-w-0 flex-1 rounded-lg px-1 py-0.5 text-left outline-none hover:bg-base-200/60 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-base-100"
onclick={goToRoom}
aria-label="Open room {roomName}">
<div class="flex flex-col gap-0.5"> <div class="flex flex-col gap-0.5">
<div class="flex items-center justify-between gap-2">
{#if $voiceState === VoiceState.Joining} {#if $voiceState === VoiceState.Joining}
<span class="text-sm font-semibold text-warning">Joining...</span> <span class="text-sm font-semibold text-warning">Joining...</span>
{:else if $voiceState === VoiceState.Connected} {:else if $voiceState === VoiceState.Connected}
@@ -147,6 +160,11 @@
{:else} {:else}
<span class="text-sm font-semibold text-neutral-content">Disconnected</span> <span class="text-sm font-semibold text-neutral-content">Disconnected</span>
{/if} {/if}
<span class="ellipsize text-xs opacity-70">
{roomName} / {spaceName}
</span>
</div>
</button>
{#if showVoiceLayoutToggle} {#if showVoiceLayoutToggle}
<Button <Button
data-tip="Toggle full-screen chat ↔ video (mobile) or split view (desktop)" data-tip="Toggle full-screen chat ↔ video (mobile) or split view (desktop)"
@@ -156,10 +174,6 @@
</Button> </Button>
{/if} {/if}
</div> </div>
<span class="ellipsize text-xs opacity-70">
{roomName} / {spaceName}
</span>
</div>
<div class="flex flex-wrap items-center gap-2"> <div class="flex flex-wrap items-center gap-2">
{#if $voiceState === VoiceState.Joining} {#if $voiceState === VoiceState.Joining}
<span class="loading loading-spinner loading-sm"></span> <span class="loading loading-spinner loading-sm"></span>