summaryrefslogtreecommitdiff
path: root/app/src/main/java/org/terst/feedreader/ui/MainActivity.kt
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-22 18:26:14 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-22 18:26:14 +0000
commit91edd1f5f29a3336fa9e3bd1762c70ea74e3e48d (patch)
tree6ebe8615b61d174348a8467aa1fd7dbbfdb03a0a /app/src/main/java/org/terst/feedreader/ui/MainActivity.kt
parent9da3fbcdef71e90d52045531c7c18faff02f2ff6 (diff)
Split save/Stash actions, follow links in-app via reader pipeline, tune scroll, fix title entities
- ReaderScreen: bookmark icon is now a purely local save (just flips isSaved, no network) -- Stash archiving is a separate explicit action (new cloud icon), since it's a heavier networked action the user should trigger on purpose rather than have bundled into "save." Verified via direct DB queries and (once I stopped misreading small screenshots) the icon updates immediately in-session for both actions. - New ReaderWebView.kt: shared WebView factory for the dark reader palette and link handling, used by both ReaderScreen and the new LinkReaderScreen. Links tapped inside an article's WebView now open in a lightweight in-app reader (extracted via the same Readability pipeline, no DB persistence) instead of falling through to the system browser -- recursive, so a chain of links stays in-app. Verified live: tapping a link mid-article navigated to a real extracted page with a working back stack. - WebView scroll tuning: overscroll glow and scrollbars off, on both the article reader and the new link reader -- aimed at the reported "still a little choppy" scrolling on top of the previous reload-on-recompose fix. - FeedParser: some feeds (kottke.org among them) double-encode titles -- the XML parser resolves outer XML escaping, but leftover HTML entities like "&#8220;" were showing up literally in the title text. Titles are now run through a second HTML-entity decode pass. Verified: a kottke title that previously showed a literal &#8220; now renders the actual curly quote. All changes verified live on the emulator against the real 107-feed dataset.
Diffstat (limited to 'app/src/main/java/org/terst/feedreader/ui/MainActivity.kt')
-rw-r--r--app/src/main/java/org/terst/feedreader/ui/MainActivity.kt20
1 files changed, 19 insertions, 1 deletions
diff --git a/app/src/main/java/org/terst/feedreader/ui/MainActivity.kt b/app/src/main/java/org/terst/feedreader/ui/MainActivity.kt
index e1300f0..95ef71e 100644
--- a/app/src/main/java/org/terst/feedreader/ui/MainActivity.kt
+++ b/app/src/main/java/org/terst/feedreader/ui/MainActivity.kt
@@ -81,7 +81,25 @@ fun FeedReaderApp() {
val articleId = decodeNavArg(backStackEntry.arguments?.getString("articleId") ?: "")
// feedId here is the list the article was opened from (Unread/Saved/a specific
// feed) -- ReaderScreen uses it to build the swipe queue of sibling articles.
- ReaderScreen(feedId = feedId, initialArticleId = articleId, onBack = { navController.popBackStack() })
+ ReaderScreen(
+ feedId = feedId,
+ initialArticleId = articleId,
+ onBack = { navController.popBackStack() },
+ onOpenLink = { url -> navController.navigate("linkReader/${encodeNavArg(url)}") }
+ )
+ }
+ composable(
+ "linkReader/{url}",
+ arguments = listOf(navArgument("url") { type = NavType.StringType })
+ ) { backStackEntry ->
+ val url = decodeNavArg(backStackEntry.arguments?.getString("url") ?: "")
+ // Recursive: a link tapped inside this screen pushes another linkReader route,
+ // so following a chain of links stays inside the reader pipeline all the way down.
+ LinkReaderScreen(
+ url = url,
+ onBack = { navController.popBackStack() },
+ onOpenLink = { nextUrl -> navController.navigate("linkReader/${encodeNavArg(nextUrl)}") }
+ )
}
composable("addFeed") {
AddFeedScreen(onDone = { navController.popBackStack() })