Add in-app browser with reader mode
All checks were successful
CI / build-and-deploy (push) Successful in 22s

Tapping a bookmark now opens an in-app WKWebView instead of bouncing to
Safari. Reader mode injects JS to extract article content and rerender
with clean serif typography and dark-mode support. Bottom toolbar has
back/forward, reader toggle, share, and open-in-Safari escape hatch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Krishna Kumar
2026-05-21 12:43:33 -05:00
parent 7d1b53bac6
commit ac2f9cf85d
3 changed files with 214 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ struct BookmarksView: View {
@State private var showCollections = false
@State private var showAddBookmark = false
@State private var editingBookmark: Bookmark?
@State private var browsingBookmark: Bookmark?
var body: some View {
NavigationStack {
@@ -16,7 +17,7 @@ struct BookmarksView: View {
ForEach(viewModel.bookmarks) { bookmark in
BookmarkRow(bookmark: bookmark)
.onTapGesture {
if let url = URL(string: bookmark.url) { openURL(url) }
browsingBookmark = bookmark
}
.onAppear { maybeLoadMore(bookmark) }
.listRowInsets(EdgeInsets(top: 0, leading: 20, bottom: 0, trailing: 20))
@@ -48,10 +49,15 @@ struct BookmarksView: View {
} label: {
Label("Edit", systemImage: "pencil")
}
Button {
browsingBookmark = bookmark
} label: {
Label("Open", systemImage: "globe")
}
Button {
if let url = URL(string: bookmark.url) { openURL(url) }
} label: {
Label("Open", systemImage: "safari")
Label("Open in Safari", systemImage: "safari")
}
Divider()
Button {
@@ -139,6 +145,11 @@ struct BookmarksView: View {
.sheet(item: $editingBookmark) { bookmark in
EditBookmarkView(viewModel: viewModel, bookmark: bookmark)
}
.sheet(item: $browsingBookmark) { bookmark in
if let url = URL(string: bookmark.url) {
BrowserView(url: url, title: bookmark.displayTitle)
}
}
.refreshable {
await viewModel.load()
}