From d04ab733d269dc9fcdb5c651b18f452a29dc8741 Mon Sep 17 00:00:00 2001 From: ru-aish Date: Wed, 11 Feb 2026 17:15:16 +0530 Subject: [PATCH] Add background playback toggle and fix tab-switch audio overlap --- src/components/DocumentSettings.tsx | 15 +++++++++++++ src/components/SettingsModal.tsx | 26 +++++++++++++++++++++- src/contexts/ConfigContext.tsx | 3 +++ src/contexts/TTSContext.tsx | 6 ++++-- src/hooks/audio/useBackgroundState.ts | 31 +++++++++++++++++++++------ src/lib/dexie.ts | 3 ++- src/types/config.ts | 2 ++ 7 files changed, 75 insertions(+), 11 deletions(-) diff --git a/src/components/DocumentSettings.tsx b/src/components/DocumentSettings.tsx index 3434417..4e4a7df 100644 --- a/src/components/DocumentSettings.tsx +++ b/src/components/DocumentSettings.tsx @@ -28,6 +28,7 @@ export function DocumentSettings({ isOpen, setIsOpen, epub, html }: { const { viewType, skipBlank, + keepPlayingInBackground, epubTheme, smartSentenceSplitting, headerMargin, @@ -316,6 +317,20 @@ export function DocumentSettings({ isOpen, setIsOpen, epub, html }: { Automatically skip pages with no text content

} + {!html &&
+ +

+ Continue TTS playback when this tab is not active +

+
} {!html && (