From 1aa250ca67455fcff1c79eeb73e8c648d768141a Mon Sep 17 00:00:00 2001 From: jay Date: Wed, 3 Jun 2026 13:27:39 +0000 Subject: [PATCH] Rework history: opened + replaced only, with per-item removal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit History was logging every article merely displayed, which made it noise. Split the two concepts cleanly: - "displayed" (seenIds) still tracks everything shown, but only to stop Replace recycling stories — it no longer feeds history. - "history" now records only deliberate events: articles the user OPENED (card click) or ones they REPLACED away (recoverable accidental swaps). Also: per-item removal (× in the History panel; DELETE /api/history/{id}), and when signed in the panel shows the account (cross-device) history. First-sign-in import now folds the meaningful history (not everything shown). Copy updated. 115 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/lib/components/ArticleCard.svelte | 6 +- frontend/src/routes/+page.svelte | 108 ++++++++++++------ goodnews/api.py | 11 ++ tests/test_saved_api.py | 3 + 4 files changed, 88 insertions(+), 40 deletions(-) diff --git a/frontend/src/lib/components/ArticleCard.svelte b/frontend/src/lib/components/ArticleCard.svelte index 68f7d34..a0233b6 100644 --- a/frontend/src/lib/components/ArticleCard.svelte +++ b/frontend/src/lib/components/ArticleCard.svelte @@ -1,7 +1,7 @@