Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function AgentDetailsHeader({ agent, isLoading, onRequestDelete }: AgentD
<h1 className="text-text-strong text-[18px] font-medium leading-6 tracking-tight">{agent.name}</h1>
{agent.devBridgeActive ? (
<Badge variant="lighter" color="orange" size="sm">
DEV
LOCAL
</Badge>
) : null}
</div>
Expand Down
33 changes: 26 additions & 7 deletions apps/dashboard/src/components/agents/agent-sidebar-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { AgentResponse, UpdateAgentBody } from '@/api/agents';
import { getAgentDetailQueryKey, updateAgent } from '@/api/agents';
import { NovuApiError } from '@/api/api.client';
import { AnimatedBadgeDot, Badge } from '@/components/primitives/badge';
import { HelpTooltipIndicator } from '@/components/primitives/help-tooltip-indicator';
import { Input } from '@/components/primitives/input';
import { showErrorToast, showSuccessToast } from '@/components/primitives/sonner-helpers';
import { Switch } from '@/components/primitives/switch';
Expand Down Expand Up @@ -36,10 +37,18 @@ function formatLongDate(dateStr: string): string {
return formatted;
}

function SidebarRow({ label, children, className }: { label: string; children: React.ReactNode; className?: string }) {
function SidebarRow({
label,
children,
className,
}: {
label: React.ReactNode;
children: React.ReactNode;
className?: string;
}) {
return (
<div className={cn('flex h-8 items-center justify-between px-1.5', className)}>
<span className="text-text-soft text-label-xs font-medium">{label}</span>
<span className="text-text-soft text-label-xs flex items-center gap-1 font-medium">{label}</span>
<div className="flex items-center gap-1.5">{children}</div>
</div>
);
Expand Down Expand Up @@ -72,17 +81,17 @@ type BridgeUrlSectionProps = {
};

function BridgeUrlSection({ agent, canWrite, isUpdatePending, onUpdate }: BridgeUrlSectionProps) {
const isDevOverrideActive = Boolean(agent.devBridgeActive && agent.devBridgeUrl);
const activeBridgeUrl = isDevOverrideActive ? agent.devBridgeUrl : agent.bridgeUrl;
const isLocalTunnelActive = Boolean(agent.devBridgeActive && agent.devBridgeUrl);
const activeBridgeUrl = isLocalTunnelActive ? agent.devBridgeUrl : agent.bridgeUrl;

return (
<>
<SidebarRow label="Bridge URL">
{activeBridgeUrl ? (
<div className="flex items-center gap-1">
{isDevOverrideActive ? (
{isLocalTunnelActive ? (
<Badge variant="lighter" color="orange" size="sm">
DEV
LOCAL
</Badge>
) : null}
<TruncatedUrl url={activeBridgeUrl} />
Expand All @@ -92,7 +101,17 @@ function BridgeUrlSection({ agent, canWrite, isUpdatePending, onUpdate }: Bridge
)}
</SidebarRow>
{agent.devBridgeUrl ? (
<SidebarRow label="Dev override">
<SidebarRow
label={
<>
Local tunnel connection
<HelpTooltipIndicator
size="3"
text="When enabled, the agent forwards traffic to your local tunnel URL instead of the deployed agent endpoint. Use this to test changes locally without redeploying."
/>
</>
}
>
<Switch
checked={agent.devBridgeActive ?? false}
disabled={!canWrite || isUpdatePending}
Expand Down
Loading