Add mini-player, per-row podcast button, and resume-from-position
Some checks failed
CI / build-and-deploy (push) Failing after 9s

- MiniPlayerView: persistent bar above tab bar, shows title/progress,
  play/pause and close buttons, slides in when audio starts
- PodcastPlayerViewModel lifted to BookmarksViewModel so it persists
  across sheet dismissals — audio keeps playing in background
- Headphone button on every bookmark row (filled = cached, outline = not)
- start() is idempotent: re-tapping same article resumes without restart
- stop() saves playback position before teardown (PodcastProgress)
- setupPlayer restores saved position on next open
- BrowserView keeps its own local VM (stopOnDismiss: true)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Krishna Kumar
2026-05-22 16:19:21 -05:00
parent 65efe708ee
commit abe35f47d6
5 changed files with 238 additions and 43 deletions

View File

@@ -202,6 +202,7 @@ struct BrowserView: View {
@State private var state: BrowserState
@State private var readerMode = false
@State private var showPodcast = false
@State private var podcastVM = PodcastPlayerViewModel()
init(url: URL, title: String, claude: ClaudeService) {
self.initialURL = url
@@ -290,7 +291,13 @@ struct BrowserView: View {
if p > 0.01 { ReadingProgress.set(url: urlStr, progress: p) }
}
.sheet(isPresented: $showPodcast) {
PodcastPlayerView(articleUrl: (state.currentURL ?? initialURL).absoluteString, claude: claude)
PodcastPlayerView(
vm: podcastVM,
articleUrl: (state.currentURL ?? initialURL).absoluteString,
articleTitle: state.pageTitle.isEmpty ? initialTitle : state.pageTitle,
claude: claude,
stopOnDismiss: true
)
}
}
}