diff --git a/ui/desktop/src/components/SplashPills.tsx b/ui/desktop/src/components/SplashPills.tsx index 382306707f..83bd9bf177 100644 --- a/ui/desktop/src/components/SplashPills.tsx +++ b/ui/desktop/src/components/SplashPills.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import MarkdownContent from './MarkdownContent'; function truncateText(text: string, maxLength: number = 100): string { if (text.length <= maxLength) return text; @@ -38,7 +39,7 @@ function ContextBlock({ content }: ContextBlockProps) { return (
-
{displayText}
+
); } @@ -60,16 +61,19 @@ export default function SplashPills({ append, activities = null }: SplashPillsPr const pills = activities || defaultPills; - // Check if the first pill starts with "message:" - const hasContextPill = pills.length > 0 && pills[0].toLowerCase().startsWith('message:'); + // Find any pill that starts with "message:" + const messagePillIndex = pills.findIndex((pill) => pill.toLowerCase().startsWith('message:')); - // Extract the context pill and the remaining pills - const contextPill = hasContextPill ? pills[0] : null; - const remainingPills = hasContextPill ? pills.slice(1) : pills; + // Extract the message pill and the remaining pills + const messagePill = messagePillIndex >= 0 ? pills[messagePillIndex] : null; + const remainingPills = + messagePillIndex >= 0 + ? [...pills.slice(0, messagePillIndex), ...pills.slice(messagePillIndex + 1)] + : pills; return (
- {contextPill && } + {messagePill && }
{remainingPills.map((content, index) => (