Comments on plays

- Anyone who can see a play can read its comments; the player and the people they follow can write.
  The author, the player and admins can delete; comments can be reported (admins see the text).
- Notifications: "commented on" for the player, "replied on" for earlier commenters, each with its
  own setting. Reaction and comment notifications now open the play.
- A 💬 chip with the count next to reactions on the feed and recent plays, opening the thread on
  the app (/play/[id]) and the website. Threads refresh every few seconds while open.
- Blocking removes comments between the two people. Plays with comments survive history trimming.
- Privacy page updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Y2iUsKEWDuRGjK5FPmcUP
This commit is contained in:
2026-10-15 13:32:14 -04:00
co-authored by Claude Opus 5.5
parent 31aed8dec4
commit 4402171f46
33 changed files with 2850 additions and 36 deletions
+11
View File
@@ -1,6 +1,8 @@
import type {
AdminReportDTO,
AdminStatsDTO,
CommentDTO,
CommentThreadDTO,
ConnectionDTO,
FollowListDTO,
ReactionDTO,
@@ -17,6 +19,7 @@ import type { AppUpdateDTO } from './updates';
import type {
ChangeEmailInput,
ChangePasswordInput,
CommentInput,
LoginInput,
RegisterInput,
ReportReason,
@@ -136,6 +139,14 @@ export function createApiClient({ baseUrl, getToken, credentials }: ApiClientOpt
react: (listenId: string, emoji: string) => request<ReactionDTO[]>(`/listens/${q(listenId)}/reaction`, { method: 'PUT', body: { emoji } }),
unreact: (listenId: string) => request<ReactionDTO[]>(`/listens/${q(listenId)}/reaction`, { method: 'DELETE' }),
/** A play with its comments. */
comments: (listenId: string) => request<CommentThreadDTO>(`/listens/${q(listenId)}/comments`),
addComment: (listenId: string, input: CommentInput) =>
request<CommentDTO>(`/listens/${q(listenId)}/comments`, { method: 'POST', body: input }),
deleteComment: (id: string) => request<{ ok: true }>(`/comments/${q(id)}`, { method: 'DELETE' }),
reportComment: (id: string, input: { reason: ReportReason; note?: string | null }) =>
request<{ ok: true }>(`/comments/${q(id)}/report`, { body: input }),
searchTracks: (query: string) => request<TrackSearchResultDTO[]>(`/tracks/search?q=${q(query)}`),
/** Null when no lyrics were found for the song. */
lyrics: (trackId: string) => request<LyricsDTO | null>(`/tracks/${q(trackId)}/lyrics`),