diff --git a/ui/desktop/src/components/SplashPills.tsx b/ui/desktop/src/components/SplashPills.tsx index 821c59ef..38230670 100644 --- a/ui/desktop/src/components/SplashPills.tsx +++ b/ui/desktop/src/components/SplashPills.tsx @@ -5,7 +5,13 @@ function truncateText(text: string, maxLength: number = 100): string { return text.slice(0, maxLength) + '...'; } -function SplashPill({ content, append, className = '', longForm = '' }) { +interface SplashPillProps { + content: string; + append: (text: string) => void; + className?: string; +} + +function SplashPill({ content, append, className = '' }: SplashPillProps) { const displayText = truncateText(content); return ( @@ -13,7 +19,7 @@ function SplashPill({ content, append, className = '', longForm = '' }) { className={`px-4 py-2 text-sm text-center text-textStandard cursor-pointer border border-borderSubtle hover:bg-bgSubtle rounded-full transition-all duration-150 ${className}`} onClick={async () => { // Always use the full text (longForm or original content) when clicked - await append(longForm || content); + await append(content); }} title={content.length > 100 ? content : undefined} // Show full text on hover if truncated > @@ -22,9 +28,29 @@ function SplashPill({ content, append, className = '', longForm = '' }) { ); } -export default function SplashPills({ append, activities = null }) { +interface ContextBlockProps { + content: string; +} + +function ContextBlock({ content }: ContextBlockProps) { + // Remove the "message:" prefix and trim whitespace + const displayText = content.replace(/^message:/i, '').trim(); + + return ( +