STATUS: news-digest × button + cross-device hidden tray landed

New section documenting the architecture change (news-digest-web
moved from nginx:alpine to a FastAPI app on uvicorn built from the
worker's same Dockerfile), the three new endpoints
(GET /api/hidden, POST /api/hide, POST /api/restore), the item-id
scheme (12-char sha1 of reddit:<post_id> or miniflux:<entry_id>
so hide-once = hide-forever-for-that-article), and the playbook
changes (dropped DOCKER_BUILDKIT=0 now that ana-docker is on
docker-ce 29, added round-trip API verify steps).
This commit is contained in:
2026-04-26 15:07:59 -07:00
parent f692b7ec7a
commit 0f03c6c9f6
+34
View File
@@ -424,6 +424,40 @@ Verified post-recreate: seahub log shows `Seahub is started ... Done.`
without traceback; traefik `seafile@docker` dropped to 0 502s in
the next 20s window.
## news-digest — per-item × button + cross-device hidden tray (2026-04-24)
Daily Digest pages now have a small × on each item that hides it
from the page. State persists server-side at `/output/hidden.json`,
so the same hidden set follows the user across devices (home, ipad,
laptop, work). A "Hidden (N)" tray at the bottom of each page lists
items hidden FROM THE CURRENT PAGE with a restore button per row;
older hidden ids that aren't on this page sit silently in
`hidden.json` and continue to filter future editions that include
the same article.
Architecture change: `news-digest-web` swapped from `nginx:alpine`
to a FastAPI app on uvicorn, built from the **same Dockerfile** as
the worker. One image, two containers — the worker's cron-driven
ENTRYPOINT runs in `news-digest-worker`, while compose overrides
entrypoint+command to launch `uvicorn web:app` in `news-digest-web`.
Drops one image dep, adds three endpoints:
- `GET /api/hidden` — JSON array of hidden item ids
- `POST /api/hide` — `{id}` → adds to hidden.json
- `POST /api/restore` — `{id}` → removes from hidden.json
Item ids are stable 12-char sha1 prefixes (`reddit:<post_id>` /
`miniflux:<entry_id>`) computed in `digest.py` at render time so
hide-once means hide-forever-for-that-article. Storage: single
JSON array, atomic writes via tempfile+rename, threading.Lock
inside the single uvicorn worker. No auth — same trust boundary
as the digest itself (LAN-only on port 8181).
The deploy playbook also dropped its `DOCKER_BUILDKIT=0` fallback
(no longer needed post docker-ce 29 migration) and gained three
verify steps: `/api/hidden` returns a JSON array, `app.js` is
reachable, and a synthetic `smoke-<ts>` id round-trips through
hide → list → restore → list.
## Session milestones — 2026-04-24 (the "tooling day" + housekeeping pm)
Morning / early afternoon — the original tooling day: