feat(artist): "new since last visit" badge + banner #58
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Per-artist "+N" accent pill on the artists directory and a "N new since last visit" banner inside
ArtistView. Counts new images (not posts) — multi-image posts increment correctly. The visit auto-marks onArtistViewopen; no manual "mark as read" button.artist_visit (artist_id PK, last_viewed_at NOT NULL). Seeds every existing artist withlast_viewed_at = NOW()so the badge starts at 0 across the board (no noisy "5000 unseen" on first deploy).last_viewed_at, counts images created since, then atomically UPSERTslast_viewed_at = NOW()via PostgresON CONFLICT DO UPDATE(no SELECT-then-INSERT race). Returnsunseen_count_at_visitin the response.unseen_countaggregate per card via LEFT JOIN + conditional COUNT. NULLlast_viewed_atdefensively counts as "never visited".ArtistCardrenders an accent pill in the preview-strip corner whenunseen_count > 0(capped at99+);ArtistViewshows a closable v-alert banner on initial load whenunseen_count_at_visit > 0, re-arms on slug change.Single-row-per-artist (no
user_id) — rule #47 multi-user ACL is currently aspirational; widens to(user_id, artist_id)PK when User lands, per rule #22.Test plan
tests/test_artist_visit.py— directory unseen_count math, NULL fallback, overview marks visit + returns count, repeat overview returns 0, find_or_create autoseedtests/test_api_artists_directory.py—unseen_countadded to pinned card-shape set3162cffacross all 6 jobsScribe plan #597 (done). Closes the "new since last visit" item in FC-4 (#490).