Sharing page gets a "Now playing" section: off / show on profile /
show on profile and post, as a single choice matching the settings
column - generalised sharing.js's visibility-only radio-group handling
to a small RADIO_GROUPS list so now_playing_mode reuses the same fill/
save logic rather than adding a second special case.
Public profile API and profile.html gain a live "now playing" field,
sourced from the same actors.now_playing_text() the actor document
uses and gated the same way (now_playing_mode off means never showing
it, whatever's actually playing).
Refactored actors.py along the way: now_playing_field() takes settings
directly and does its own off-mode gating, rather than build_document()
doing it externally - one place decides whether the field is shown,
reused by the actor document, the push Update, and now the public
profile API.
Verified by hand in a real browser: settings round-trip through the
Sharing page's new radio group, the public profile page shows "Now
playing: Reckoner by Radiohead" once now_playing_mode is on, and the
raw actor document (curl, Accept: application/activity+json) carries
the same PropertyValue attachment.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
/api/v1/federation gains:
- GET /posts, DELETE /posts/{id}: manage your own posts from the UI.
- GET /preview/weekly: what the weekly summary would say right now, for
the week still in progress - never posted or stored. Backed by a new
weekly.preview() and schedule.current_week_start().
- GET /profiles/{username}/posts/{post_uuid} (public, unauthenticated):
backs the UI's post page, which can't itself speak ActivityPub.
Settings gain timezone/post_weekly_summary/post_milestones, already
present in sharing.EDITABLE since phase 3 step 2 but never added to
SharingSettingsSchema, so the API was silently dropping them from
responses. timezone validates against the same is_valid_timezone() the
service layer uses, with a dedicated marshmallow validator.
Fixed a real gap found while wiring the post page: ids.post_page_url()
took a username but never put it in the URL, so post.html would have
had no way to know whose post to look up. It's now ?u=<username>&id=<uuid>.
Sharing page gets a "What to post" section (weekly summary and
milestones toggles, a timezone field with a browser-supplied IANA
datalist where Intl.supportedValuesOf exists, and a live preview).
New posts.html lists a user's posts with delete (mirroring followers.js's
confirm-before-destructive-action pattern); new post.html is the public
landing page for a post's `url`, reached by browsers redirected from the
raw ActivityPub endpoint.
Verified by hand against a local dev server and a real browser: sign in,
enable sharing, preview and publish, list and delete a post, and follow
the ActivityPub redirect through to the public post page and its 404
after deletion - fixed one bug found this way (the preview box was
collapsing the summary's line breaks).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
- /api/v1/federation: list followers and requests, approve (Accept),
decline or remove (Reject), block (Block, and future follows are
refused), list and remove blocks; settings report follower counts
- The actor now reflects the user's real follow-approval setting and
the followers collection its accepted count
- Turning sharing off sends every follower a Reject and forgets them;
while those are being delivered the actor stays fetchable with just
its key (no name or bio) so other servers can verify them, and
WebFinger already says not found
- Web UI: a Followers page (requests with Approve/Decline, followers
with Remove/Block behind a confirm step, blocked accounts with
Unblock; remote names shown as plain text only), follower counts on
the Sharing page, and a confirmation before turning sharing off
when that would remove followers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
- sharing.html: switch sharing on/off, see the handle (with the
"permanent once followed" warning and a note that following comes
later), choose who sees posts (followers only by default; help text
on why approval matters), follower approval, directory and search
opt-ins, display name and bio; save status shown by the button
- profile.html?u=<name>: the public page browsers land on from an actor
URL: name, handle (with copy), bio and how to follow; never asks the
visitor to sign in
- "Sharing" appears in the nav only when the server federates
(remembered per tab)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
- New Import page: upload an export (with upload progress) or, when the
server has a Last.fm API key, import straight from a Last.fm username;
jobs list with live progress, counts, errors and cancelling
- docker compose runs the import worker from the API image; the API
image no longer sets PROMETHEUS_MULTIPROC_DIR (gunicorn.conf.py does,
and other commands must not inherit multiprocess mode)
- Prometheus scrapes the worker; Usage dashboard gains an Imports row;
ImportWorkerDown and ImportJobsWaiting alerts
- README and .env.example document imports and LASTFM_API_KEY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
- API image (uv multi-stage, non-root, gunicorn, migrations on start,
health check) and UI image (nginx, CSP, config.js rendered from
API_BASE_URL); /healthz documented in OpenAPI
- docker compose runs db, api and ui; the "monitoring" profile adds
Prometheus, postgres-exporter and Grafana, all provisioned from files
- Grafana dashboards: API overview (RED), Last.fm API, Usage, Database
- Prometheus alert rules: API down, error rate, latency, auth failure
spike, ignored scrobbles, DB pool saturation, Postgres down
- Pool checkout gauge counts events (the pool's own counters lag the
checkin event); error ratios show 0 instead of "No data"
- Tests check dashboards and alerts only use metrics that exist
- scripts/generate_traffic.py drives realistic traffic for demos
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
- Plain HTML + vanilla JS modules, no build step; talks to /api/v1 with
a bearer token and only ever inserts server data as text
- Overview: now-playing dot-matrix display with live progress, totals,
30-day plays meter, top artists/tracks by period, recent plays
- History (paged, grouped by day), Apps (create/delete, reveal/copy
keys, player setup details), Sessions (revoke), sign-in approval page
for the Last.fm desktop auth flow, sign in and registration
- Light and dark themes, responsive to phone widths, vendored fonts
(SIL OFL) so the UI has no third-party requests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW