From 99d0d6a9cffe7fb96a596cef1867e386f79fbe43 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Wed, 7 Jan 2026 22:31:33 +1000 Subject: [PATCH] feat: add public visibility toggle to agent edit page - Add isPublic field to form state and save handler - Add Switch toggle in edit mode to control visibility - Display public/private status in view mode with icon --- .../src/app/dashboard/agents/[id]/page.tsx | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/apps/web/src/app/dashboard/agents/[id]/page.tsx b/apps/web/src/app/dashboard/agents/[id]/page.tsx index 8c6c1da..55d9169 100644 --- a/apps/web/src/app/dashboard/agents/[id]/page.tsx +++ b/apps/web/src/app/dashboard/agents/[id]/page.tsx @@ -5,6 +5,7 @@ import { PROVIDER_MODELS, SUPPORTED_PROVIDERS } from '@tpmjs/types/agent'; import { Button } from '@tpmjs/ui/Button/Button'; import { CodeBlock } from '@tpmjs/ui/CodeBlock/CodeBlock'; import { Icon } from '@tpmjs/ui/Icon/Icon'; +import { Switch } from '@tpmjs/ui/Switch/Switch'; import { Table, TableBody, @@ -293,6 +294,7 @@ export default function AgentDetailPage(): React.ReactElement { temperature: 0.7, maxToolCallsPerTurn: 20, maxMessagesInContext: 10, + isPublic: true, }); const fetchAgent = useCallback(async () => { @@ -312,6 +314,7 @@ export default function AgentDetailPage(): React.ReactElement { temperature: data.data.temperature, maxToolCallsPerTurn: data.data.maxToolCallsPerTurn, maxMessagesInContext: data.data.maxMessagesInContext, + isPublic: data.data.isPublic, }); } else { if (response.status === 401) { @@ -584,6 +587,7 @@ export default function AgentDetailPage(): React.ReactElement { maxMessagesInContext: Number.parseInt(formData.maxMessagesInContext.toString(), 10), description: formData.description || null, systemPrompt: formData.systemPrompt || null, + isPublic: formData.isPublic, }), }); @@ -846,6 +850,19 @@ export default function AgentDetailPage(): React.ReactElement { +
+
+

Public Visibility

+

+ Make this agent visible on the public agents page +

+
+ setFormData((prev) => ({ ...prev, isPublic: checked }))} + /> +
+
+
+
Visibility
+
+ + {agent.isPublic ? 'Public' : 'Private'} +
+
System Prompt