From 3a462ee146deb60f388ebb3967f1dfa65a59b09e Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 26 Oct 2026 11:42:54 -0400 Subject: [PATCH] Remove the seriouscritter notifications section Reverts 6537c34 and its syntax fix 4bdfae1. The section only regrouped a user's own notifications from that account (duplicating them in the list), and the actorId filter it added to listNotifications was never used. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FQFD3mtUWSZpeLbKzkCohh --- apps/api/src/services/notifications.ts | 22 +++---------- apps/web/src/app/notifications/page.tsx | 43 ++----------------------- 2 files changed, 8 insertions(+), 57 deletions(-) diff --git a/apps/api/src/services/notifications.ts b/apps/api/src/services/notifications.ts index 985ae7a..30b075a 100644 --- a/apps/api/src/services/notifications.ts +++ b/apps/api/src/services/notifications.ts @@ -103,27 +103,15 @@ export async function toNotificationDTOs(rows: Row[]): Promise { +export async function listNotifications(userId: string, cursor: string | null) { const n = schema.notifications; const before = cursor ? new Date(cursor) : null; - const query = db + const rows = await db .select() .from(n) - .where(and( - eq(n.userId, userId), - before && !isNaN(before.getTime()) ? lt(n.createdAt, before) : undefined, - actorId ? eq(n.actorId, actorId) : undefined // Apply actor filter if provided - )); - - const rows = await query.orderBy(desc(n.createdAt)).limit(31); + .where(and(eq(n.userId, userId), before && !isNaN(before.getTime()) ? lt(n.createdAt, before) : undefined)) + .orderBy(desc(n.createdAt)) + .limit(31); const page = rows.slice(0, 30); return { notifications: await toNotificationDTOs(page), diff --git a/apps/web/src/app/notifications/page.tsx b/apps/web/src/app/notifications/page.tsx index 1d81e85..d19fcad 100644 --- a/apps/web/src/app/notifications/page.tsx +++ b/apps/web/src/app/notifications/page.tsx @@ -8,68 +8,32 @@ import { notificationPath, notificationText, timeAgo, type NotificationListDTO } import { Avatar } from '@/components/Avatar'; import { client, useMe } from '@/lib/api'; -const ADMIN_ACTOR_USERNAME = 'seriouscritter'; - /** Reactions, comments, new followers and songs sent to you, newest first. Opening it marks them read. */ export default function NotificationsPage() { const { me, loggedOut } = useMe(); const { mutate } = useSWRConfig(); - - // Fetch all notifications for the user const { data, size, setSize, isLoading } = useSWRInfinite( (i, prev: NotificationListDTO | null) => (!me || (i > 0 && !prev?.nextCursor) ? null : ['notifications', prev?.nextCursor ?? null]), ([, cursor]: [string, string | null]) => client.notifications(cursor), { revalidateOnFocus: false }, ); - - const allItems = data?.flatMap((p) => p.notifications) ?? []; + const items = data?.flatMap((p) => p.notifications) ?? []; const unread = data?.[0]?.unread ?? 0; - // Filter messages specifically from seriouscritter - const seriousCritterMessages = allItems.filter(n => n.actor?.username === ADMIN_ACTOR_USERNAME); - // Seen once you've looked: clear the bell (rows stay highlighted until you come back). useEffect(() => { if (unread) client.markNotificationsRead().then(() => mutate('/notifications'), () => {}); }, [unread, mutate]); if (loggedOut) return

Log in to see your notifications.

; - return (

Notifications

- - {/* Dedicated section for seriouscritter's messages */} - {seriousCritterMessages.length > 0 && ( -
-

From {ADMIN_ACTOR_USERNAME}

-
    - {seriousCritterMessages.map((n) => { - const { title, body } = notificationText(n); - return ( -
  • - - - - {title} - {body} - {timeAgo(n.createdAt)} - - {n.track?.artworkUrl && } - -
  • - ); - })} -
-
- )} - - {/* General notifications list */} - {allItems.length === 0 && !isLoading && ( + {items.length === 0 && !isLoading && (

Nothing yet. Reactions, new followers and songs sent to you show up here.

)}
    - {allItems.map((n) => { + {items.map((n) => { const { title, body } = notificationText(n); return (
  • @@ -86,7 +50,6 @@ export default function NotificationsPage() { ); })}
- {data?.at(-1)?.nextCursor && (