From 014da0171e4d47c84577126d8f57e9d78578290e Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Sat, 17 Jan 2026 03:25:54 +1000 Subject: [PATCH] fix: link collections to public URLs on agent page - Add slug and owner username to collection data in API response - Make collection items clickable links to /@username/collections/slug --- .../app/(profile)/[username]/agents/[uid]/page.tsx | 12 ++++++++++-- .../public/users/[username]/agents/[uid]/route.ts | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/(profile)/[username]/agents/[uid]/page.tsx b/apps/web/src/app/(profile)/[username]/agents/[uid]/page.tsx index 9c5f4a2..f876f1a 100644 --- a/apps/web/src/app/(profile)/[username]/agents/[uid]/page.tsx +++ b/apps/web/src/app/(profile)/[username]/agents/[uid]/page.tsx @@ -33,9 +33,13 @@ interface AgentCollection { collectionId: string; collection: { id: string; + slug: string; name: string; description: string | null; toolCount: number; + user: { + username: string; + }; }; } @@ -345,7 +349,11 @@ export default function PrettyAgentDetailPage(): React.ReactElement {

Collections

{agent.collections.map((ac) => ( -
+

{ac.collection.name}

{ac.collection.description && (

@@ -355,7 +363,7 @@ export default function PrettyAgentDetailPage(): React.ReactElement { {ac.collection.toolCount} tools -

+ ))}
diff --git a/apps/web/src/app/api/public/users/[username]/agents/[uid]/route.ts b/apps/web/src/app/api/public/users/[username]/agents/[uid]/route.ts index a74a059..7c9c4ce 100644 --- a/apps/web/src/app/api/public/users/[username]/agents/[uid]/route.ts +++ b/apps/web/src/app/api/public/users/[username]/agents/[uid]/route.ts @@ -62,8 +62,12 @@ export async function GET(_request: NextRequest, context: RouteContext) { collection: { select: { id: true, + slug: true, name: true, description: true, + user: { + select: { username: true }, + }, _count: { select: { tools: true } }, }, }, @@ -128,9 +132,11 @@ export async function GET(_request: NextRequest, context: RouteContext) { collectionId: ac.collectionId, collection: { id: ac.collection.id, + slug: ac.collection.slug, name: ac.collection.name, description: ac.collection.description, toolCount: ac.collection._count.tools, + user: ac.collection.user, }, })), forkedFromId: agent.forkedFromId,