From 2568c32cf40fb8b4887a3b36d8c74916caf59ca2 Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Tue, 23 Jun 2026 06:17:58 +0200 Subject: [PATCH] feat: notification polling 30s->10s, video thumbnails, @-mentions - NotificationBell: refetchInterval 30000->10000, refetchOnWindowFocus, i18n label - ProfileTabs: Mux thumbnail for VIDEO posts in grid, play icon overlay - parse-caption: add mention segment type for @word parsing - MentionTextarea: new component with @-autocomplete via search.pets - PostCard: render @mentions as blue links to /search - CommentSheet: parse comment bodies for mentions, use MentionTextarea - PhotoPostForm: use MentionTextarea for caption input --- src/components/feed/CommentSheet.tsx | 20 ++- src/components/feed/PostCard.tsx | 8 + .../notifications/NotificationBell.tsx | 10 +- .../post-creation/PhotoPostForm.tsx | 28 ++-- src/components/profile/ProfileTabs.tsx | 17 +- src/components/ui/mention-textarea.tsx | 152 ++++++++++++++++++ src/lib/parse-caption.ts | 7 +- 7 files changed, 212 insertions(+), 30 deletions(-) create mode 100644 src/components/ui/mention-textarea.tsx diff --git a/src/components/feed/CommentSheet.tsx b/src/components/feed/CommentSheet.tsx index 344c79c..7a28b2e 100644 --- a/src/components/feed/CommentSheet.tsx +++ b/src/components/feed/CommentSheet.tsx @@ -5,8 +5,9 @@ import { Trash2, Loader2 } from "lucide-react"; import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; import { toast } from "sonner"; import { useTRPC } from "@/trpc/client"; +import Link from "next/link"; import { Avatar, AvatarFallback } from "@/components/ui/avatar"; -import { Textarea } from "@/components/ui/textarea"; +import { MentionTextarea } from "@/components/ui/mention-textarea"; import { Button } from "@/components/ui/button"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Separator } from "@/components/ui/separator"; @@ -17,6 +18,7 @@ import { SheetTitle, } from "@/components/ui/sheet"; import { getAvatarUrl } from "@/lib/avatar-url"; +import { parseCaption } from "@/lib/parse-caption"; import { useTranslations } from "next-intl"; interface CommentSheetProps { @@ -144,7 +146,17 @@ export function CommentSheet({ postId, petId, open, onOpenChange }: CommentSheet {formatRelativeTime(comment.createdAt)} -

{comment.body}

+

+ {parseCaption(comment.body).map((seg, i) => + seg.type === "hashtag" ? ( + #{seg.tag} + ) : seg.type === "mention" ? ( + @{seg.name} + ) : ( + {seg.text} + ) + )} +

{isOwn && (