From ba801d90f65d2c965a8837e6e3036e820ee28f77 Mon Sep 17 00:00:00 2001 From: jay Date: Sun, 31 May 2026 01:36:53 +0000 Subject: [PATCH] Make paywalls systemic + fix ArticleCard reactivity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ArticleCard: derive safeHref from article.url and reset image-failure state when the article changes, so in-place replacements re-evaluate correctly (clears the Svelte capture warning; build is warning-free again). - Downweight paywalled stories below readable ones (stable sort) when composing the daily five and in feed results — the brief now leads readable and rarely hands over a locked door. - review_sources gains a 'paywall-heavy' advisory flag (Nature, New Scientist flag at 100%); never auto-deactivates. - New Scientist/Nature kept active but no longer reach the daily five; they remain browsable with the label + Replace. - Tests: brief readability preference + paywall-heavy flag (79 total). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/lib/components/ArticleCard.svelte | 18 ++++++---- goodnews/api.py | 3 ++ goodnews/briefs.py | 6 ++++ goodnews/sources.py | 7 +++- ideas.md | 2 +- tests/test_brief_paywall.py | 36 +++++++++++++++++++ tests/test_review_paywall.py | 25 +++++++++++++ 7 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 tests/test_brief_paywall.py create mode 100644 tests/test_review_paywall.py diff --git a/frontend/src/lib/components/ArticleCard.svelte b/frontend/src/lib/components/ArticleCard.svelte index 976e81c..3803642 100644 --- a/frontend/src/lib/components/ArticleCard.svelte +++ b/frontend/src/lib/components/ArticleCard.svelte @@ -1,11 +1,17 @@