Rework history: opened + replaced only, with per-item removal
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) <noreply@anthropic.com>
This commit is contained in:
@@ -67,3 +67,6 @@ def test_history_and_import(client):
|
||||
tc.post("/api/import", json={"seen": [3], "saved": [1, 999]})
|
||||
assert {a["id"] for a in tc.get("/api/history").json()["items"]} == {1, 2, 3}
|
||||
assert tc.get("/api/saved/ids").json() == [1]
|
||||
# granular removal from history
|
||||
tc.delete("/api/history/2")
|
||||
assert {a["id"] for a in tc.get("/api/history").json()["items"]} == {1, 3}
|
||||
|
||||
Reference in New Issue
Block a user