diff --git a/vibn-frontend/_onboarding/onboarding-primitives.tsx b/vibn-frontend/_onboarding/onboarding-primitives.tsx index b60e9bcb..a6a6132b 100644 --- a/vibn-frontend/_onboarding/onboarding-primitives.tsx +++ b/vibn-frontend/_onboarding/onboarding-primitives.tsx @@ -71,7 +71,7 @@ export function WizardTop({ }} > VIBN diff --git a/vibn-frontend/app/layout.tsx b/vibn-frontend/app/layout.tsx index b5b7aab6..42258ef5 100644 --- a/vibn-frontend/app/layout.tsx +++ b/vibn-frontend/app/layout.tsx @@ -48,7 +48,7 @@ export default function RootLayout({ - + VIBN @@ -233,7 +233,7 @@ export function VIBNSidebar({ workspace, tabs, activeTab }: VIBNSidebarProps) { }} > VIBN diff --git a/vibn-frontend/components/vibn-chat/chat-panel.tsx b/vibn-frontend/components/vibn-chat/chat-panel.tsx index dd5507a7..decfe7ff 100644 --- a/vibn-frontend/components/vibn-chat/chat-panel.tsx +++ b/vibn-frontend/components/vibn-chat/chat-panel.tsx @@ -518,23 +518,30 @@ const MessageBubble = React.memo(function MessageBubble({ {!isUser && (
- Vibn AI + + V. +
)}
; @@ -1195,6 +1203,13 @@ export function ChatPanel({ }>; }) => { if (m.role !== "assistant") return m as unknown as Message; + + // If the backend provided a perfectly ordered timeline (from our new Postgres schema), use it directly! + if (Array.isArray(m.timeline) && m.timeline.length > 0) { + return { ...m, content: "" } as unknown as Message; + } + + // Fallback for very old messages in the database before the timeline was tracked const segs: string[] = Array.isArray(m.textSegments) ? m.textSegments : []; @@ -1203,12 +1218,7 @@ export function ChatPanel({ kind: "text", text: t, })); - // We don't have round-level interleaving for tool calls in - // the persisted shape (the schema flattens them), so we drop - // the toolCalls into the timeline at the end. The streamed - // shape preserves true ordering; this is just a reload - // approximation. Good enough — what the user really cares - // about is the text segments not run-on'ing into one blob. + if (Array.isArray(m.toolCalls)) { for (const tc of m.toolCalls) { timeline.push({ kind: "tool", name: tc.name, status: "done" }); @@ -2426,7 +2436,7 @@ export function ChatPanel({ style={{ flexShrink: 0, display: "flex" }} > VIBN