From 1f4d67dc773d7b1de31144963e34e09ada15ca2d Mon Sep 17 00:00:00 2001 From: root Date: Sat, 11 Apr 2026 16:00:46 +0500 Subject: [PATCH] fix: player float mode now works; add minimal player style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Float mode was broken because AudioPlayer was unmounted the moment audioStore.active became true — exactly when the float overlay needs to render. Fix: keep AudioPlayer mounted in float and minimal modes regardless of audioStore.active; only standard mode shows the 'Controls below' message. Adds a third 'minimal' style: a compact single-row bar (skip ±, play/pause, seek, time) with no voice picker or chapter browser. Voice picker and chapter button are hidden in the idle pill too. Settings UI updated to show all three options with a live description of what each style does. --- ui/src/lib/components/AudioPlayer.svelte | 74 +++++++++++++++++-- .../books/[slug]/chapters/[n]/+page.svelte | 57 ++++++++------ 2 files changed, 103 insertions(+), 28 deletions(-) diff --git a/ui/src/lib/components/AudioPlayer.svelte b/ui/src/lib/components/AudioPlayer.svelte index a3cc036..a4b7f38 100644 --- a/ui/src/lib/components/AudioPlayer.svelte +++ b/ui/src/lib/components/AudioPlayer.svelte @@ -71,8 +71,11 @@ voices?: Voice[]; /** Called when the server returns 402 (free daily limit reached). */ onProRequired?: () => void; - /** Visual style of the player card. 'standard' = inline card; 'float' = draggable overlay. */ - playerStyle?: 'standard' | 'float'; + /** Visual style of the player card. + * 'standard' = full inline card with voice/chapter controls; + * 'minimal' = compact single-row bar (play + seek + time only); + * 'float' = draggable overlay anchored bottom-right. */ + playerStyle?: 'standard' | 'minimal' | 'float'; /** Approximate word count for the chapter, used to show estimated listen time in the idle state. */ wordCount?: number; } @@ -1034,7 +1037,8 @@ - + + {#if playerStyle !== 'minimal'}

{m.reader_play_narration()} @@ -1091,9 +1095,10 @@ {/if}

+ {/if} - - {#if chapters.length > 0} + + {#if chapters.length > 0 && playerStyle !== 'minimal'} + + + + + + + + + +
+
+
+ + + + {formatTime(audioStore.currentTime)}/{formatDuration(audioStore.duration)} + + + +{:else}
@@ -1372,6 +1435,7 @@
{/if} {/if} +{/if} -
- - - - Controls are in the player bar below. -
- {:else} - { audioProRequired = true; }} + {#if audioStore.slug === data.book.slug && audioStore.chapter === data.chapter.number && audioStore.active && layout.playerStyle === 'standard'} + +
+ + + + Controls are in the player bar below. +
+ {:else} + { audioProRequired = true; }} /> {/if}
@@ -1169,7 +1169,7 @@
Style
- {#each ([['standard', 'Standard'], ['float', 'Float']] as const) as [s, lbl]} + {#each ([['standard', 'Standard'], ['minimal', 'Minimal'], ['float', 'Float']] as const) as [s, lbl]}
+
+

+ {#if layout.playerStyle === 'standard'} + Full panel with voice picker and chapter browser. + {:else if layout.playerStyle === 'minimal'} + Compact bar: play/pause, seek, and time only. + {:else} + Draggable overlay — stays visible while you read. + {/if} +

+