From 20e98c68ff543996664dd5807f14ee8ac522dfca Mon Sep 17 00:00:00 2001 From: TerrifiedBug Date: Wed, 11 Mar 2026 16:46:47 +0000 Subject: [PATCH 1/3] fix: VRL chat persisting old conversations and review tab scroll broken Two bugs fixed: - VRL chat route was reusing existing conversations when conversationId was null (New Chat), causing old context to persist. Now always creates a new conversation, matching the pipeline route behavior. - Review tab ScrollArea lacked height constraint in flex layout, causing content to overflow and hiding the New Conversation button. Added h-0 to establish proper scroll containment. --- src/app/api/ai/vrl-chat/route.ts | 25 +++++++--------------- src/components/flow/ai-pipeline-dialog.tsx | 2 +- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/app/api/ai/vrl-chat/route.ts b/src/app/api/ai/vrl-chat/route.ts index 165d59d..19ce91a 100644 --- a/src/app/api/ai/vrl-chat/route.ts +++ b/src/app/api/ai/vrl-chat/route.ts @@ -84,24 +84,15 @@ export async function POST(request: Request) { let priorMessages: Array<{ role: "user" | "assistant"; content: string }> = []; if (!conversationId) { - // Reuse existing conversation for this pipeline + component if one exists - const existing = await prisma.aiConversation.findFirst({ - where: { pipelineId: body.pipelineId, componentKey: body.componentKey }, - orderBy: { createdAt: "desc" }, - select: { id: true }, + // Always create a new conversation — the client loads existing ones via TRPC query + const conversation = await prisma.aiConversation.create({ + data: { + pipelineId: body.pipelineId, + componentKey: body.componentKey, + createdById: session.user.id, + }, }); - if (existing) { - conversationId = existing.id; - } else { - const conversation = await prisma.aiConversation.create({ - data: { - pipelineId: body.pipelineId, - componentKey: body.componentKey, - createdById: session.user.id, - }, - }); - conversationId = conversation.id; - } + conversationId = conversation.id; } else { // Verify conversationId belongs to this pipeline + component const existing = await prisma.aiConversation.findUnique({ diff --git a/src/components/flow/ai-pipeline-dialog.tsx b/src/components/flow/ai-pipeline-dialog.tsx index 252c5bc..31a827f 100644 --- a/src/components/flow/ai-pipeline-dialog.tsx +++ b/src/components/flow/ai-pipeline-dialog.tsx @@ -400,7 +400,7 @@ export function AiPipelineDialog({ ) : ( <> {/* Message thread */} - +
{conversation.messages.length === 0 && !conversation.isStreaming && (

From 45590190789005657d7d841799b82da8542066af Mon Sep 17 00:00:00 2001 From: TerrifiedBug Date: Wed, 11 Mar 2026 16:50:59 +0000 Subject: [PATCH 2/3] fix: match sample dropdown text size to toolbar buttons --- src/components/vrl-editor/vrl-editor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/vrl-editor/vrl-editor.tsx b/src/components/vrl-editor/vrl-editor.tsx index 84a675a..89e5b8d 100644 --- a/src/components/vrl-editor/vrl-editor.tsx +++ b/src/components/vrl-editor/vrl-editor.tsx @@ -615,7 +615,7 @@ export function VrlEditor({ value, onChange, sourceTypes, pipelineId, componentK {pipelineId && upstreamSourceKeys && upstreamSourceKeys.length > 0 && ( <>