fix: VRL chat persistence and review tab scroll#100
Conversation
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.
Greptile SummaryThis PR fixes three related UX bugs in the AI-assisted VRL editor and pipeline review dialog. The changes are surgical and well-scoped.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Route as vrl-chat/route.ts
participant DB as Prisma / PostgreSQL
Note over Client,DB: BEFORE fix — "New Chat" click
Client->>Route: POST {conversationId: undefined}
Route->>DB: aiConversation.findFirst(pipelineId + componentKey)
DB-->>Route: existing conversation (with stale history)
Route->>DB: aiMessage.findMany(existingId) ← old messages injected into LLM
Route-->>Client: response reusing old context ❌
Note over Client,DB: AFTER fix — "New Chat" click
Client->>Route: POST {conversationId: undefined}
Route->>DB: aiConversation.create(pipelineId, componentKey, userId)
DB-->>Route: fresh conversation id
Route->>DB: aiMessage.findMany(newId) ← empty history
Route-->>Client: response with clean context ✅
Note over Client,DB: Continuing an existing conversation (unchanged)
Client->>Route: POST {conversationId: "abc123"}
Route->>DB: aiConversation.findUnique("abc123") — ownership check
DB-->>Route: verified record
Route->>DB: aiMessage.findMany("abc123")
Route-->>Client: streaming response with correct history ✅
Last reviewed commit: 01613b5 |
Summary
conversationIdwas null, causing old messages to persist in LLM context after clicking New Chat. Fixed by always creating a new conversation (matching pipeline route behavior).ScrollAreain the pipeline review tab lackedh-0height constraint, causing content to overflow the flex container. This broke scrolling and pushed the "New Conversation" button out of the visible dialog area.targetCodefrom reused conversations didn't match current editor code.Test plan