summaryrefslogtreecommitdiff
path: root/app/src/main/java/org/terst/feedreader/readability
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-23 07:38:28 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-23 07:38:28 +0000
commitecdb45778e274126737aa87e27ed1b1c00cda01c (patch)
treeb632e53bc91475ba49094539e04b51e7a5eaa41c /app/src/main/java/org/terst/feedreader/readability
parent3bec692d9613b9b3e688441e5945424bd0fe20f0 (diff)
Rebrand to FeeDreader; overflow-menu cleanup; deferred read-marking; folder-organized feed list
- Rename app to FeeDreader with an owl launcher icon and a paywall-avoidance note in Settings - Move Open original/Save to Stash into the reader's overflow menu; add Mark unread there too - Only mark an article read when navigating away via Previous/Next, not on open or on back - Saved list no longer crosses out read items; its count includes them - Back from Unread (the root screen) now opens the feed list instead of exiting the app - Feed list: clearer separator above the per-feed list, folder grouping (from OPML categories) with case-insensitive sort, and a virtual "Last fetch failed" section at the top - Reader extraction: cap unsized decorative SVG icons (fixes Ars Technica's giant section-badge icon), force native loading="lazy" images to load eagerly in the hidden extraction WebView, and drop a lightbox's duplicate caption only when a real figcaption sibling exists - Backlog notes on swipe-to-next research, extraction test coverage, and an async-rendered-gallery race confirmed live on Ars Technica Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL
Diffstat (limited to 'app/src/main/java/org/terst/feedreader/readability')
-rw-r--r--app/src/main/java/org/terst/feedreader/readability/ReaderExtractor.kt32
1 files changed, 32 insertions, 0 deletions
diff --git a/app/src/main/java/org/terst/feedreader/readability/ReaderExtractor.kt b/app/src/main/java/org/terst/feedreader/readability/ReaderExtractor.kt
index 3eaa158..c41bbfb 100644
--- a/app/src/main/java/org/terst/feedreader/readability/ReaderExtractor.kt
+++ b/app/src/main/java/org/terst/feedreader/readability/ReaderExtractor.kt
@@ -136,6 +136,15 @@ object ReaderExtractor {
// correctly from the (now-resolved) image's real dimensions.
img.removeAttribute('width');
img.removeAttribute('height');
+ // The browser's native loading="lazy" only fetches an image
+ // once it's near the (real, on-screen) viewport -- meaningless
+ // in this hidden, off-screen extraction WebView, where whether
+ // that ever counts as "near enough" is inconsistent run to run.
+ // Confirmed live: the same Ars Technica article's gallery photos
+ // came through in one extraction pass and were silently missing
+ // in another. Force every image to load immediately instead of
+ // leaving it to viewport-intersection timing that doesn't apply.
+ img.removeAttribute('loading');
}
var sources = document.querySelectorAll('source');
for (var i = 0; i < sources.length; i++) {
@@ -143,6 +152,29 @@ object ReaderExtractor {
if (lazySrcset) sources[i].setAttribute('srcset', lazySrcset);
}
+ // A lightbox (PhotoSwipe, and others like it) commonly keeps its own
+ // copy of an image's caption text in a separate div meant to only
+ // ever be shown inside the lightbox overlay -- confirmed live on Ars
+ // Technica: a ".pswp-caption-content" div sits right next to a real,
+ // normally-visible <figcaption> with the exact same text, inside the
+ // same <figure>. Readability's hidden-element skip only catches
+ // display:none/visibility:hidden, not however that div is actually
+ // kept offscreen until the lightbox opens, so it was coming through
+ // as a genuine second copy. Only remove it when that real figcaption
+ // sibling actually exists -- some of Ars's own gallery images use
+ // this same div as their ONLY caption (no figcaption at all), and
+ // removing those unconditionally just deleted their caption outright
+ // (confirmed live: two gallery photos lost their captions entirely
+ // rather than losing a duplicate).
+ var pswpCaptions = document.querySelectorAll('.pswp-caption-content');
+ for (var i = 0; i < pswpCaptions.length; i++) {
+ var pc = pswpCaptions[i];
+ var figure = pc.closest('figure');
+ if (figure && figure.querySelector('figcaption')) {
+ pc.parentNode.removeChild(pc);
+ }
+ }
+
// Readability's default hidden-element skip (treating display:none /
// visibility:hidden nodes as boilerplate) is correct for the vast
// majority of sites -- it's what keeps collapsed nav/footer/sidebar