diff --git a/src/app/projects/[projectId]/sessions/[sessionId]/components/conversationList/ConversationList.tsx b/src/app/projects/[projectId]/sessions/[sessionId]/components/conversationList/ConversationList.tsx index 5b870ac..b14e761 100644 --- a/src/app/projects/[projectId]/sessions/[sessionId]/components/conversationList/ConversationList.tsx +++ b/src/app/projects/[projectId]/sessions/[sessionId]/components/conversationList/ConversationList.tsx @@ -1,8 +1,16 @@ "use client"; -import type { FC } from "react"; +import { AlertTriangle, ChevronDown, ExternalLink } from "lucide-react"; +import { type FC, useMemo } from "react"; +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; +import { + Collapsible, + CollapsibleContent, + CollapsibleTrigger, +} from "@/components/ui/collapsible"; import type { Conversation } from "@/lib/conversation-schema"; import type { ToolResultContent } from "@/lib/conversation-schema/content/ToolResultContentSchema"; +import type { ErrorJsonl } from "../../../../../../../server/service/types"; import { useSidechain } from "../../hooks/useSidechain"; import { ConversationItem } from "./ConversationItem"; @@ -26,8 +34,66 @@ const getConversationKey = (conversation: Conversation) => { throw new Error(`Unknown conversation type: ${conversation}`); }; +const SchemaErrorDisplay: FC<{ errorLine: string }> = ({ errorLine }) => { + return ( +
  • +
    + + +
    +
    + + + Schema Error + +
    + +
    +
    + +
    +
    + + + + Schema Validation Error + + + This conversation entry failed to parse correctly. This + might indicate a format change or parsing issue.{" "} + + Report this issue + + + + +
    +
    + Raw Content: +
    +
    +                    {errorLine}
    +                  
    +
    +
    +
    +
    +
    +
    +
  • + ); +}; + type ConversationListProps = { - conversations: Conversation[]; + conversations: (Conversation | ErrorJsonl)[]; getToolResult: (toolUseId: string) => ToolResultContent | undefined; }; @@ -35,12 +101,26 @@ export const ConversationList: FC = ({ conversations, getToolResult, }) => { + const validConversations = useMemo( + () => + conversations.filter((conversation) => conversation.type !== "x-error"), + [conversations], + ); const { isRootSidechain, getSidechainConversations } = - useSidechain(conversations); + useSidechain(validConversations); return (