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 on ArtistView open; no manual "mark as read" button.
alembic 0034 — artist_visit (artist_id PK, last_viewed_at NOT NULL). Seeds every existing artist with last_viewed_at = NOW() so the badge starts at 0 across the board (no noisy "5000 unseen" on first deploy).
ArtistService.find_or_create autoseeds a visit row alongside new artists, so freshly imported content doesn't read as unseen.
ArtistService.overview reads pre-visit last_viewed_at, counts images created since, then atomically UPSERTs last_viewed_at = NOW() via Postgres ON CONFLICT DO UPDATE (no SELECT-then-INSERT race). Returns unseen_count_at_visit in the response.
ArtistDirectoryService.list_artists adds an unseen_count aggregate per card via LEFT JOIN + conditional COUNT. NULL last_viewed_at defensively counts as "never visited".
Frontend: ArtistCard renders an accent pill in the preview-strip corner when unseen_count > 0 (capped at 99+); ArtistView shows a closable v-alert banner on initial load when unseen_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.
tests/test_api_artists_directory.py — unseen_count added to pinned card-shape set
CI run 372 green on 3162cff across all 6 jobs
Operator UI: fresh deploy → badges start at 0. Wait for download → badge appears. Click artist → banner shows; badge clears.
Scribe plan #597 (done). Closes the "new since last visit" item in FC-4 (#490).
## 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 on `ArtistView` open; no manual "mark as read" button.
- **alembic 0034** — `artist_visit (artist_id PK, last_viewed_at NOT NULL)`. Seeds every existing artist with `last_viewed_at = NOW()` so the badge starts at 0 across the board (no noisy "5000 unseen" on first deploy).
- **ArtistService.find_or_create** autoseeds a visit row alongside new artists, so freshly imported content doesn't read as unseen.
- **ArtistService.overview** reads pre-visit `last_viewed_at`, counts images created since, then atomically UPSERTs `last_viewed_at = NOW()` via Postgres `ON CONFLICT DO UPDATE` (no SELECT-then-INSERT race). Returns `unseen_count_at_visit` in the response.
- **ArtistDirectoryService.list_artists** adds an `unseen_count` aggregate per card via LEFT JOIN + conditional COUNT. NULL `last_viewed_at` defensively counts as "never visited".
- **Frontend**: `ArtistCard` renders an accent pill in the preview-strip corner when `unseen_count > 0` (capped at `99+`); `ArtistView` shows a closable v-alert banner on initial load when `unseen_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
- [x] `tests/test_artist_visit.py` — directory unseen_count math, NULL fallback, overview marks visit + returns count, repeat overview returns 0, find_or_create autoseed
- [x] `tests/test_api_artists_directory.py` — `unseen_count` added to pinned card-shape set
- [x] CI run 372 green on `3162cff` across all 6 jobs
- [ ] Operator UI: fresh deploy → badges start at 0. Wait for download → badge appears. Click artist → banner shows; badge clears.
Scribe plan #597 (done). Closes the "new since last visit" item in FC-4 (#490).
Per-artist "+N" accent pill on the artists directory and a "N new since
last visit" banner inside ArtistView. Counts new IMAGES (not posts) so
multi-image posts increment correctly.
- alembic 0034: artist_visit (artist_id PK, last_viewed_at NOT NULL).
Seeds every existing artist with last_viewed_at=NOW() so the badge
starts at 0 across the board — no noisy "5000 unseen images" on
first deploy.
- ArtistService.find_or_create autoseeds a visit row alongside new
artists, so freshly imported content doesn't read as unseen.
- ArtistService.overview reads pre-visit last_viewed_at, counts images
created since, then atomically UPSERTs last_viewed_at=NOW() via
postgres ON CONFLICT DO UPDATE (no SELECT-then-INSERT race per
reference_scalar_one_or_none_duplicates). Returns the pre-update
count as `unseen_count_at_visit` so the banner has data.
- ArtistDirectoryService.list_artists adds an `unseen_count` aggregate
to each card via LEFT JOIN artist_visit + conditional COUNT. NULL
last_viewed_at (artist created before this code shipped) defensively
counts as "never visited" → all images unseen.
- Frontend: ArtistCard renders an accent pill in the preview-strip
corner when unseen_count > 0 (capped at 99+); ArtistView shows a
closable v-alert banner on initial load when
unseen_count_at_visit > 0, re-arms on slug change.
Single-row-per-artist (no user_id) — rule #47 multi-user ACL is
aspirational; widens to (user_id, artist_id) PK when User lands, per
rule #22.
Scribe plan #597.
Two CI bounces on b65e956:
1. ruff UP017 — Python 3.14's preferred form is `datetime.UTC`, not
`timezone.utc`. Switch the test's two TZ literals.
2. test_directory_card_shape pinned the card key set to the pre-feature
shape; `unseen_count` was added to the API payload but the pin
wasn't updated. Same shape as the recurring 'plan-grep-pinned-tests'
trap — should have grepped tests/ for card.keys() before pushing.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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).