YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat(ui): add animated Pipe AI icon for chat interface
Louis Beaumont37c005e315b4
diff --git a/screenpipe-app-tauri/components/global-chat.tsx b/screenpipe-app-tauri/components/global-chat.tsxindex 3600cf11f..460ab86dd 100644--- a/screenpipe-app-tauri/components/global-chat.tsx+++ b/screenpipe-app-tauri/components/global-chat.tsx@@ -10,7 +10,9 @@ import { Button } from "@/components/ui/button";import { CustomDialogContent } from "@/components/rewind/custom-dialog-content";import { useSettings } from "@/lib/hooks/use-settings";import { cn } from "@/lib/utils";-import { Loader2, Send, Square, Bot, User, X, Sparkles, Settings, ExternalLink } from "lucide-react";+import { Loader2, Send, Square, User, X, Settings, ExternalLink } from "lucide-react";+import { motion, AnimatePresence } from "framer-motion";+import { PipeAIIcon } from "@/components/pipe-ai-icon";import { MemoizedReactMarkdown } from "@/components/markdown";import { VideoComponent } from "@/components/rewind/video";import { AIPresetsSelector } from "@/components/rewind/ai-presets-selector";@@ -590,15 +592,20 @@ Always use these exact start_time and end_time values when searching, unless thereturn (<>{/* Floating indicator when dialog is closed - only on timeline */}+ <AnimatePresence>{!open && isOnTimeline && (- <button+ <motion.button+ initial={{ opacity: 0, scale: 0.9 }}+ animate={{ opacity: 1, scale: 1 }}+ exit={{ opacity: 0, scale: 0.9 }}onClick={() => setOpen(true)}className="fixed bottom-4 right-4 z-50 flex items-center gap-1.5 px-2.5 py-1.5 rounded-full bg-background/80 backdrop-blur-sm border border-border/50 text-xs text-muted-foreground hover:text-foreground hover:bg-background transition-colors shadow-sm">- <Sparkles className="h-3 w-3" />+ <PipeAIIcon size={12} animated={false} /><span>{isMac ? "⌘L" : "Ctrl+L"}</span>- </button>+ </motion.button>)}+ </AnimatePresence><Dialog open={open} onOpenChange={setOpen}><DialogTitle className="sr-only">AI Chat</DialogTitle><CustomDialogContent@@ -607,7 +614,7 @@ Always use these exact start_time and end_time values when searching, unless the>{/* Header */}<div className="flex items-center gap-2 p-3 pr-10 border-b">- <Sparkles className="h-5 w-5 text-primary" />+ <PipeAIIcon size={20} animated={false} className="text-primary" /><span className="font-medium">Ask about your screen activity</span><span className="text-xs text-muted-foreground ml-auto">{isMac ? "⌘L" : "Ctrl+L"} to toggle</span></div>@@ -621,7 +628,7 @@ Always use these exact start_time and end_time values when searching, unless theneedsLogin ? "bg-muted" : "bg-destructive/10")}>{needsLogin ? (- <Sparkles className="h-8 w-8 text-muted-foreground" />+ <PipeAIIcon size={32} animated={false} className="text-muted-foreground" />) : (<Settings className="h-8 w-8 text-destructive" />)}@@ -666,7 +673,9 @@ Always use these exact start_time and end_time values when searching, unless the)}{messages.length === 0 && canChat && (<div className="text-center text-muted-foreground py-12">- <Sparkles className="h-8 w-8 mx-auto mb-3 opacity-50" />+ <div className="mx-auto mb-3 w-fit opacity-60">+ <PipeAIIcon size={32} thinking={false} />+ </div>{selectionRange ? (<><p className="text-sm mb-1">@@ -703,9 +712,14 @@ Always use these exact start_time and end_time values when searching, unless the)}</div>)}- {messages.map((message) => (- <div+ <AnimatePresence mode="popLayout">+ {messages.map((message, index) => (+ <motion.divkey={message.id}+ initial={{ opacity: 0, y: 10 }}+ animate={{ opacity: 1, y: 0 }}+ exit={{ opacity: 0, y: -10 }}+ transition={{ duration: 0.2, delay: index === messages.length - 1 ? 0 : 0 }}className={cn("flex gap-3",message.role === "user" ? "flex-row-reverse" : "flex-row"@@ -722,7 +736,7 @@ Always use these exact start_time and end_time values when searching, unless the{message.role === "user" ? (<User className="h-4 w-4" />) : (- <Bot className="h-4 w-4" />+ <PipeAIIcon size={16} animated={false} />)}</div><div@@ -773,13 +787,18 @@ Always use these exact start_time and end_time values when searching, unless the{message.content}</MemoizedReactMarkdown></div>- </div>+ </motion.div>))}+ </AnimatePresence>{isLoading && !messages.find(m => m.content.includes("Searching")) && (- <div className="flex items-center gap-2 text-muted-foreground">- <Loader2 className="h-4 w-4 animate-spin" />+ <motion.div+ initial={{ opacity: 0 }}+ animate={{ opacity: 1 }}+ className="flex items-center gap-2 text-muted-foreground"+ >+ <PipeAIIcon size={16} thinking={true} /><span className="text-sm">Thinking...</span>- </div>+ </motion.div>)}<div ref={messagesEndRef} /></div>diff --git a/screenpipe-app-tauri/components/pipe-ai-icon.tsx b/screenpipe-app-tauri/components/pipe-ai-icon.tsxnew file mode 100644index 000000000..d64114ee7--- /dev/null+++ b/screenpipe-app-tauri/components/pipe-ai-icon.tsx@@ -0,0 +1,152 @@+"use client";++import { motion } from "framer-motion";+import { cn } from "@/lib/utils";++interface PipeAIIconProps {+ className?: string;+ size?: number;+ animated?: boolean;+ thinking?: boolean;+}++/**+ * Animated Pipe AI Icon+ * Geometric, Escher-inspired design with flowing data animation+ */+export function PipeAIIcon({+ className,+ size = 24,+ animated = true,+ thinking = false,+}: PipeAIIconProps) {+ // Data flow particles+ const particles = [0, 1, 2];++ return (+ <motion.svg+ width={size}+ height={size}+ viewBox="0 0 24 24"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ className={cn("text-current", className)}+ initial={{ opacity: 0, scale: 0.8 }}+ animate={{ opacity: 1, scale: 1 }}+ transition={{ duration: 0.3 }}+ >+ {/* Main pipe structure - L-shaped */}+ <motion.path+ d="M4 4h6v2H6v12h12v-6h2v8H4V4z"+ fill="currentColor"+ initial={{ pathLength: 0 }}+ animate={{ pathLength: 1 }}+ transition={{ duration: 0.6, ease: "easeOut" }}+ />++ {/* Inner pipe hollow */}+ <motion.path+ d="M8 8h2v8h8v2H8V8z"+ fill="currentColor"+ fillOpacity={0.3}+ initial={{ opacity: 0 }}+ animate={{ opacity: 0.3 }}+ transition={{ delay: 0.3, duration: 0.3 }}+ />++ {/* Pipe opening top */}+ <motion.rect+ x="4"+ y="2"+ width="8"+ height="2"+ fill="currentColor"+ initial={{ scaleX: 0 }}+ animate={{ scaleX: 1 }}+ transition={{ delay: 0.2, duration: 0.3 }}+ style={{ transformOrigin: "left" }}+ />++ {/* Pipe opening right */}+ <motion.rect+ x="20"+ y="14"+ width="2"+ height="8"+ fill="currentColor"+ initial={{ scaleY: 0 }}+ animate={{ scaleY: 1 }}+ transition={{ delay: 0.2, duration: 0.3 }}+ style={{ transformOrigin: "bottom" }}+ />++ {/* Flowing data particles */}+ {animated && particles.map((i) => (+ <motion.circle+ key={i}+ r={1.5}+ fill="currentColor"+ initial={{ cx: 7, cy: 3, opacity: 0 }}+ animate={+ thinking+ ? {+ cx: [7, 7, 11, 11, 21],+ cy: [3, 11, 11, 19, 19],+ opacity: [0, 1, 1, 1, 0],+ }+ : {+ cx: [7, 7, 11, 11, 21],+ cy: [3, 11, 11, 19, 19],+ opacity: [0, 0.8, 0.8, 0.8, 0],+ }+ }+ transition={{+ duration: thinking ? 1.2 : 2,+ repeat: Infinity,+ delay: i * (thinking ? 0.3 : 0.5),+ ease: "easeInOut",+ }}+ />+ ))}++ {/* Corner accent - geometric detail */}+ <motion.path+ d="M14 6l2 2-2 2-2-2 2-2z"+ fill="currentColor"+ fillOpacity={0.6}+ initial={{ scale: 0, rotate: 45 }}+ animate={{ scale: 1, rotate: 0 }}+ transition={{ delay: 0.5, duration: 0.3, type: "spring" }}+ style={{ transformOrigin: "14px 8px" }}+ />+ </motion.svg>+ );+}++/**+ * Static version for non-animated contexts+ */+export function PipeAIIconStatic({+ className,+ size = 24,+}: {+ className?: string;+ size?: number;+}) {+ return (+ <svg+ width={size}+ height={size}+ viewBox="0 0 24 24"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ className={cn("text-current", className)}+ >+ <path d="M4 4h6v2H6v12h12v-6h2v8H4V4z" fill="currentColor" />+ <path d="M8 8h2v8h8v2H8V8z" fill="currentColor" fillOpacity={0.3} />+ <rect x="4" y="2" width="8" height="2" fill="currentColor" />+ <rect x="20" y="14" width="2" height="8" fill="currentColor" />+ <path d="M14 6l2 2-2 2-2-2 2-2z" fill="currentColor" fillOpacity={0.6} />+ </svg>+ );+}