From 52d7877fccd60a1dae33d877ba6aa765dc098a52 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 22 Jul 2026 16:26:45 +0000 Subject: First round of testing feedback: images, unread landing, dark, delete - Fix OPML import status message reporting the raw pre-dedup count (144) instead of the actual unique feed count after Room's upsert collapses duplicates (108) -- cosmetic bug, the DB was already correct. - Article thumbnails: extract media:thumbnail/enclosure or the first in feed content, show via Coil in the article list. - App now lands on Unread instead of the feed list; a top-bar icon gets from there to the feed list (forward nav, not back-stack pop, since Unread is now the root). - Dark color scheme by default. - Delete-feed action (with confirmation) on each feed row -- was entirely missing. Deletes its non-saved articles too, so they don't linger as orphaned rows in the cross-feed Unread view; saved articles are kept regardless. - Room migration 1->2 for the new imageUrl column (real migration, not destructive fallback, since there's now real on-device subscription data from testing). Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL --- app/src/main/java/org/terst/feedreader/ui/AddFeedScreen.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/org/terst/feedreader/ui/AddFeedScreen.kt') diff --git a/app/src/main/java/org/terst/feedreader/ui/AddFeedScreen.kt b/app/src/main/java/org/terst/feedreader/ui/AddFeedScreen.kt index 1e053af..5d19c90 100644 --- a/app/src/main/java/org/terst/feedreader/ui/AddFeedScreen.kt +++ b/app/src/main/java/org/terst/feedreader/ui/AddFeedScreen.kt @@ -57,11 +57,16 @@ fun AddFeedScreen(onDone: () -> Unit) { val imported = withContext(Dispatchers.IO) { context.contentResolver.openInputStream(uri)?.use { stream -> Opml.parse(stream) } ?: emptyList() } - for (feed in imported) { + // A feed cross-listed under multiple OPML category folders (common when + // exported from a reader with folders/labels) appears once per folder here -- + // dedupe by feed URL before reporting a count, or "108 feeds" would be reported + // as some larger number even though upsert already collapses them to one row each. + val uniqueFeeds = imported.distinctBy { it.xmlUrl } + for (feed in uniqueFeeds) { db.feedDao().upsert(FeedEntity(id = feed.xmlUrl, title = feed.title, siteUrl = feed.htmlUrl)) } FeedFetchWorker.fetchNow(context) - status = "Imported ${imported.size} feed(s)" + status = "Imported ${uniqueFeeds.size} feed(s)" isBusy = false } } -- cgit v1.2.3