diff --git a/apps/web/src/components/thread-item.tsx b/apps/web/src/components/thread-item.tsx index 1392a402..7b0c19df 100644 --- a/apps/web/src/components/thread-item.tsx +++ b/apps/web/src/components/thread-item.tsx @@ -7,6 +7,7 @@ import { cn } from "@/lib/utils"; import { StatusIndicator } from "@/components/status-indicator"; import { Skeleton } from "@/components/ui/skeleton"; import { GitHubSVG } from "./icons/github"; +import { useQueryState } from "nuqs"; interface ThreadItemProps { thread: ThreadWithTasks; @@ -21,6 +22,8 @@ export function ThreadItem({ variant = "dashboard", className, }: ThreadItemProps) { + const [threadId] = useQueryState("threadId"); + const isSelected = thread.thread_id === threadId; const isSidebar = variant === "sidebar"; const displayDate = new Date(thread.created_at).toLocaleDateString("en-US", { @@ -72,9 +75,14 @@ export function ThreadItem({
onClick(thread)} + onClick={() => { + if (!isSelected) { + onClick(thread); + } + }} >