From e78c44459ed6b01e3ed5dc2a7817d8a170ffbb98 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 10 Apr 2026 22:30:39 +0500 Subject: [PATCH] refactor(profile): visual voice picker, playback toggles, danger zone - Replace voice - - +

No voices available.

{:else} - + + {#each [ + { label: 'Kokoro (GPU)', voices: kokoroVoices }, + { label: 'Pocket TTS (CPU)', voices: pocketVoices }, + { label: 'Cloudflare AI', voices: cfaiVoices }, + ].filter(g => g.voices.length > 0) as group} +
+

{group.label}

+
+ {#each group.voices as v (v.id)} + {@const isSelected = audioStore.voice === v.id} + {@const isPlaying = samplePlayingVoice === v.id} + +
{ audioStore.voice = v.id; }} + onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); audioStore.voice = v.id; } }} + class={cn( + 'flex items-center justify-between gap-2 px-3 py-2 rounded-lg border text-sm transition-colors cursor-pointer select-none', + isSelected + ? 'border-(--color-brand) bg-(--color-brand)/10 text-(--color-brand)' + : 'border-(--color-border) bg-(--color-surface-3) text-(--color-text) hover:border-(--color-brand)/40' + )} + > +
+ {#if isSelected} + + + + {:else} + + {/if} + {voiceLabel(v)} +
+ + +
+ {/each} +
+
+ {/each} {/if} @@ -540,36 +644,101 @@
- {speed.toFixed(1)}x + {audioStore.speed.toFixed(1)}x
-
0.5x3.0x
- -
-
-

{m.profile_auto_advance()}

-

Automatically load the next chapter when audio finishes

+ +
+

Playback

+ + +
+
+

{m.profile_auto_advance()}

+

Automatically load the next chapter when audio finishes

+
+ +
+ + +
+
+

Announce chapter

+

Read the chapter title aloud before auto-advancing

+
+ +
+ + +
+
+

Audio mode

+

+ {#if audioStore.audioMode === 'stream'} + Stream — audio starts within seconds, saved in background + {:else} + Generate — wait for full audio before playing + {/if} +

+
+
-
- +

{m.profile_sessions_heading()}

@@ -585,7 +754,12 @@ {:else}
    {#each sessions as session (session.id)} -
  • +
  • {parseUA(session.user_agent)} @@ -606,10 +780,12 @@ @@ -618,7 +794,74 @@
{/if}
- {/if} + + +
+ + + {#if deleteConfirmOpen} +
+
+

Delete account

+

+ This permanently deletes your account, reading history, settings, and all associated data. This action cannot be undone. +

+
+ +
+ + +
+ + {#if deleteError} +

{deleteError}

+ {/if} + + +
+ {/if} +
+ + {/if} {#if activeTab === 'stats'}
@@ -629,9 +872,9 @@
{#each [ { label: 'Chapters Read', value: data.stats.totalChaptersRead, icon: '📖' }, - { label: 'Completed', value: data.stats.booksCompleted, icon: '✅' }, - { label: 'Reading', value: data.stats.booksReading, icon: '📚' }, - { label: 'Plan to Read', value: data.stats.booksPlanToRead, icon: '🔖' }, + { label: 'Completed', value: data.stats.booksCompleted, icon: '✅' }, + { label: 'Reading', value: data.stats.booksReading, icon: '📚' }, + { label: 'Plan to Read', value: data.stats.booksPlanToRead, icon: '🔖' }, ] as stat}

{stat.value}

@@ -670,8 +913,12 @@

Favourite Genres

{#each data.stats.topGenres as genre, i} - + {#if i === 0}🏆{/if} {genre} @@ -680,7 +927,6 @@ {/if} - {#if data.stats.booksDropped > 0}

{data.stats.booksDropped} dropped book{data.stats.booksDropped !== 1 ? 's' : ''} — @@ -706,7 +952,6 @@ href="/books/{item.slug}/chapters/{item.chapter}" class="flex items-center gap-3 px-4 py-3 bg-(--color-surface-2) rounded-xl border border-(--color-border) hover:border-zinc-500 transition-colors group" > -

{#if item.cover} {item.title} @@ -718,14 +963,10 @@
{/if}
- -

{item.title}

Chapter {item.chapter}

- -

{#if item.updated} {(() => {