Skip to content

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

Push all local changes from parallel agents

Louis Beaumontf17076da6870
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
index 1de2d2a8d..c751763c6 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -28,6 +28,7 @@ import { useSearchHighlight } from "@/lib/hooks/use-search-highlight";
import { usePlatform } from "@/lib/hooks/use-platform";
import { useAudioPlayback } from "@/lib/hooks/use-audio-playback";
import { useHealthCheck } from "@/lib/hooks/use-health-check";
+import { usePipes, type TemplatePipe } from "@/lib/hooks/use-pipes";
import posthog from "posthog-js";
import { toast } from "@/components/ui/use-toast";
@@ -178,6 +179,7 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
// Get timeline selection for chat context
const { selectionRange, loadTagsForFrames } = useTimelineSelection();
+ const { promptPipes } = usePipes();
// Load tags when a selection is made (lazy-load)
useEffect(() => {
@@ -718,8 +720,8 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
};
}, [showSearchModal]);
- // Send timeline selection context to chat
- const sendSelectionToChat = useCallback(async () => {
+ // Send timeline selection context to chat (optionally with a specific pipe)
+ const sendSelectionToChat = useCallback(async (pipe?: TemplatePipe) => {
if (!selectionRange) return;
const startTime = selectionRange.start.toLocaleString();
@@ -787,17 +789,30 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
// Open chat window first, then emit context
await commands.showWindow("Chat");
setTimeout(() => {
- emit("chat-prefill", {
- context,
- prompt: `Based on my activity from ${startTime} to ${endTime}, `,
- source: "timeline",
- });
+ if (pipe) {
+ emit("chat-prefill", {
+ context,
+ prompt: pipe.prompt,
+ autoSend: true,
+ });
+ } else {
+ emit("chat-prefill", {
+ context,
+ prompt: `Based on my activity from ${startTime} to ${endTime}, `,
+ source: "timeline",
+ });
+ }
}, 200);
posthog.capture("timeline_selection_to_chat", {
selection_duration_ms: selectionRange.end.getTime() - selectionRange.start.getTime(),
frames_in_selection: selectedFrames.length,
+ pipe_name: pipe?.name,
});
+
+ if (pipe) {
+ toast({ title: `${pipe.icon} ${pipe.title}`, description: "running pipe with selection context" });
+ }
}, [selectionRange, frames]);
// Pass selection context to chat when chat shortcut is pressed with a selection
@@ -1789,7 +1804,9 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
zoomLevel={zoomLevel}
targetZoom={targetZoom}
setTargetZoom={setTargetZoom}
- onAskAI={sendSelectionToChat}
+ onAskAI={() => sendSelectionToChat()}
+ onRunPipe={(pipe) => sendSelectionToChat(pipe)}
+ templatePipes={promptPipes}
isPlaying={isPlaying}
onTogglePlayPause={togglePlayPause}
selectedDeviceId={selectedDeviceId}
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline/app-context-popover.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline/app-context-popover.tsx
index f5b046348..ada6140cd 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline/app-context-popover.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline/app-context-popover.tsx
@@ -96,24 +96,34 @@ export function AppContextPopover({
}, [timeRange]);
const formattedUiEvents = useMemo(() => {
+ const seen = new Set<string>();
return uiEvents
+ .filter((ev) => {
+ const key = `${ev.event_type}:${ev.timestamp}:${ev.text_content}`;
+ if (seen.has(key)) return false;
+ seen.add(key);
+ return true;
+ })
.map((ev) => ({ ...formatUiEvent(ev), time: ev.timestamp }))
.filter((e): e is { icon: string; label: string; time: string } => e.icon != null);
}, [uiEvents]);
// extract audio transcripts from already-loaded frames (no fetch)
+ // deduplicate by audio_chunk_id to avoid repeating the same chunk across frames
const audioTranscripts = useMemo(() => {
const transcripts: { text: string; time: Date; speaker?: string }[] = [];
+ const seenChunks = new Set<number>();
for (const frame of frames) {
for (const device of frame.devices) {
for (const audio of device.audio || []) {
- if (audio.transcription?.trim()) {
- transcripts.push({
- text: audio.transcription.trim(),
- time: new Date(frame.timestamp),
- speaker: audio.speaker_name || undefined,
- });
- }
+ if (!audio.transcription?.trim()) continue;
+ if (seenChunks.has(audio.audio_chunk_id)) continue;
+ seenChunks.add(audio.audio_chunk_id);
+ transcripts.push({
+ text: audio.transcription.trim(),
+ time: new Date(frame.timestamp),
+ speaker: audio.speaker_name || undefined,
+ });
}
}
}
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline/favicon-utils.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline/favicon-utils.tsx
index 627a87173..21b57de91 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline/favicon-utils.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline/favicon-utils.tsx
@@ -20,10 +20,10 @@ export function extractDomain(url: string): string | null {
}
/**
- * Google Favicon API URL (same pattern as recording-settings.tsx).
+ * Google Favicon API URL — uses gstatic directly to avoid 301 redirect.
*/
export function getFaviconUrl(domain: string, size = 32): string {
- return `https://www.google.com/s2/favicons?domain=${encodeURIComponent(domain)}&sz=${size}`;
+ return `https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://${encodeURIComponent(domain)}&size=${size}`;
}
interface FaviconImgProps {
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline/timeline-tag-toolbar.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline/timeline-tag-toolbar.tsx
index d13f5bfb8..66386ddab 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline/timeline-tag-toolbar.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline/timeline-tag-toolbar.tsx
@@ -4,7 +4,7 @@
import { useTimelineSelection } from "@/lib/hooks/use-timeline-selection";
import { cn } from "@/lib/utils";
import { format } from "date-fns";
-import { Tag, Plus, MessageSquare, Trash2, RefreshCw, Loader2 } from "lucide-react";
+import { Tag, Plus, Trash2, RefreshCw, Loader2 } from "lucide-react";
import { useState, useRef, useMemo, useCallback, useEffect } from "react";
import { createPortal } from "react-dom";
import { toast } from "@/components/ui/use-toast";
@@ -21,9 +21,29 @@ import {
AlertDialogTitle,
} from "@/components/ui/alert-dialog";
import posthog from "posthog-js";
+import { PipeAIIcon } from "@/components/pipe-ai-icon";
+import { type TemplatePipe } from "@/lib/hooks/use-pipes";
+import { AnimatePresence, motion } from "framer-motion";
const DEFAULT_TAGS = ["deep work", "meeting", "admin", "break"];
+// Muted hues for pipe circles
+const PIPE_COLORS = [
+ "hsl(220, 25%, 55%)", // slate blue
+ "hsl(340, 20%, 52%)", // muted rose
+ "hsl(160, 20%, 48%)", // sage
+ "hsl(30, 25%, 52%)", // warm gray
+ "hsl(270, 18%, 55%)", // lavender
+ "hsl(50, 20%, 50%)", // khaki
+];
+
+function pipeInitials(name: string): string {
+ // "meeting-summary" → "MS", "day-recap" → "DR", "ai-habits" → "AH"
+ const parts = name.split(/[-_\s]+/).filter(Boolean);
+ if (parts.length >= 2) return (parts[0][0] + parts[1][0]).toUpperCase();
+ return name.slice(0, 2).toUpperCase();
+}
+
interface FrequentTag {
name: string;
count: number;
@@ -34,11 +54,18 @@ interface TimelineTagToolbarProps {
anchorRect: { x: number; y: number; width: number } | null;
/** Called when user clicks "ask AI" — parent handles building context and opening chat */
onAskAI?: () => void;
+ /** Called when user clicks a pipe in the radial menu */
+ onRunPipe?: (pipe: TemplatePipe) => void;
+ /** Available template pipes for the radial menu */
+ templatePipes?: TemplatePipe[];
}
-export function TimelineTagToolbar({ anchorRect, onAskAI }: TimelineTagToolbarProps) {
+export function TimelineTagToolbar({ anchorRect, onAskAI, onRunPipe, templatePipes }: TimelineTagToolbarProps) {
const { selectionRange, tagFrames, setSelectionRange, tags } = useTimelineSelection();
const [customTag, setCustomTag] = useState("");
+ const [radialOpen, setRadialOpen] = useState(false);
+ const radialTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
+ const [hoveredPipeIndex, setHoveredPipeIndex] = useState<number | null>(null);
const [isApplying, setIsApplying] = useState(false);
const [frequentTags, setFrequentTags] = useState<FrequentTag[]>([]);
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
@@ -71,37 +98,39 @@ export function TimelineTagToolbar({ anchorRect, onAskAI }: TimelineTagToolbarPr
return () => { cancelled = true; };
}, []);
- // Quick tags: user's frequent tags first, then fill with defaults (deduplicated)
+ // Collect existing tags on selected frames — must be called before quickTags
+ const existingTags = useMemo(() => {
+ const tagSet = new Set<string>();
+ for (const id of frameIds) {
+ const frameTags = tags[id] || [];
+ frameTags.forEach((t) => tagSet.add(t));
+ }
+ return [...tagSet];
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [frameIds, tags]);
+
+ // Quick tags: user's frequent tags first, then fill with defaults (deduplicated),
+ // excluding tags already applied to the selected frames
const quickTags = useMemo(() => {
+ const existingSet = new Set(existingTags);
const seen = new Set<string>();
const result: string[] = [];
- // User's frequent tags first
+ // User's frequent tags first (skip already-applied)
for (const ft of frequentTags) {
- if (!seen.has(ft.name)) {
+ if (!seen.has(ft.name) && !existingSet.has(ft.name)) {
seen.add(ft.name);
result.push(ft.name);
}
}
// Fill with defaults up to 8 total
for (const dt of DEFAULT_TAGS) {
- if (!seen.has(dt) && result.length < 8) {
+ if (!seen.has(dt) && !existingSet.has(dt) && result.length < 8) {
seen.add(dt);
result.push(dt);
}
}
return result;
- }, [frequentTags]);
-
- // Collect existing tags on selected frames — must be called before any early return
- const existingTags = useMemo(() => {
- const tagSet = new Set<string>();
- for (const id of frameIds) {
- const frameTags = tags[id] || [];
- frameTags.forEach((t) => tagSet.add(t));
- }
- return [...tagSet];
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [frameIds, tags]);
+ }, [frequentTags, existingTags]);
const handleApplyTag = useCallback(async (tag: string) => {
if (!tag.trim() || isApplying || frameIds.length === 0) return;
@@ -262,13 +291,149 @@ export function TimelineTagToolbar({ anchorRect, onAskAI }: TimelineTagToolbarPr
</div>
<div className="flex items-stretch gap-1 flex-shrink-0">
{onAskAI && (
- <button
- onClick={onAskAI}
- className="flex items-center gap-1 text-xs px-2 py-1 rounded-md bg-foreground text-background hover:bg-foreground/90 transition-colors font-medium flex-shrink-0"
+ <div
+ className="relative"
+ onMouseEnter={() => {
+ if (radialTimeoutRef.current) clearTimeout(radialTimeoutRef.current);
+ if (templatePipes && templatePipes.length > 0) setRadialOpen(true);
+ }}
+ onMouseLeave={() => {
+ radialTimeoutRef.current = setTimeout(() => {
+ setRadialOpen(false);
+ setHoveredPipeIndex(null);
+ }, 300);
+ }}
>
- <MessageSquare className="w-3 h-3" />
- ask ai
- </button>
+ <button
+ onClick={onAskAI}
+ className="flex items-center gap-1.5 text-xs px-2 py-1 rounded-md bg-foreground text-background hover:bg-foreground/90 transition-colors font-medium flex-shrink-0 cursor-pointer"
+ title="ask ai"
+ >
+ <span className="pointer-events-none">
+ <PipeAIIcon size={14} animated={radialOpen} />
+ </span>
+ ask ai
+ </button>
+ <AnimatePresence>
+ {radialOpen && templatePipes && templatePipes.length > 0 && (() => {
+ const maxVisible = 6;
+ const visible = templatePipes.slice(0, maxVisible);
+ const overflow = templatePipes.length - maxVisible;
+ const count = visible.length + (overflow > 0 ? 1 : 0);
+ const radius = 60;
+ const containerSize = radius * 2 + 40;
+ return (
+ <div
+ className="absolute left-1/2 pointer-events-auto"
+ style={{
+ bottom: "100%",
+ transform: "translateX(-50%)",
+ width: containerSize,
+ height: radius + 24,
+ marginBottom: 6,
+ }}
+ >
+ {visible.map((pipe, i) => {
+ const startAngle = (-160 * Math.PI) / 180;
+ const endAngle = (-20 * Math.PI) / 180;
+ const angle = count === 1
+ ? (-90 * Math.PI) / 180
+ : startAngle + (i / (count - 1)) * (endAngle - startAngle);
+ const x = Math.cos(angle) * radius;
+ const y = Math.sin(angle) * radius;
+ const color = PIPE_COLORS[i % PIPE_COLORS.length];
+ const label = pipe.icon || pipeInitials(pipe.name);
+ return (
+ <motion.div
+ key={pipe.name}
+ initial={{ scale: 0, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ exit={{ scale: 0, opacity: 0 }}
+ transition={{ delay: i * 0.04, duration: 0.15 }}
+ className="absolute"
+ style={{
+ left: containerSize / 2 + x,
+ bottom: -y,
+ width: 32,
+ height: 32,
+ marginLeft: -16,
+ marginBottom: -16,
+ }}
+ >
+ <button
+ className="w-full h-full rounded-full border-2 shadow-md flex items-center justify-center text-[10px] font-bold cursor-pointer transition-all hover:scale-125 hover:shadow-lg"
+ style={{
+ borderColor: color,
+ backgroundColor: `color-mix(in srgb, ${color} 15%, var(--popover))`,
+ color: color,
+ }}
+ title={pipe.title}
+ onMouseEnter={() => setHoveredPipeIndex(i)}
+ onMouseLeave={() => setHoveredPipeIndex(null)}
+ onClick={(e) => {
+ e.stopPropagation();
+ setRadialOpen(false);
+ onRunPipe?.(pipe);
+ }}
+ >
+ {label}
+ </button>
+ </motion.div>
+ );
+ })}
+ {overflow > 0 && (
+ <motion.div
+ initial={{ scale: 0, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ exit={{ scale: 0, opacity: 0 }}
+ transition={{ delay: visible.length * 0.04, duration: 0.15 }}
+ className="absolute"
+ style={{
+ left: containerSize / 2 + Math.cos((-20 * Math.PI) / 180) * radius,
+ bottom: -Math.sin((-20 * Math.PI) / 180) * radius,
+ width: 32,
+ height: 32,
+ marginLeft: -16,
+ marginBottom: -16,
+ }}
+ >
+ <button
+ className="w-full h-full rounded-full bg-muted border border-border shadow-md flex items-center justify-center text-[10px] font-medium text-muted-foreground cursor-pointer hover:scale-110 transition-all"
+ title={`${overflow} more pipes`}
+ onMouseEnter={() => setHoveredPipeIndex(maxVisible)}
+ onMouseLeave={() => setHoveredPipeIndex(null)}
+ onClick={(e) => {
+ e.stopPropagation();
+ onAskAI?.();
+ setRadialOpen(false);
+ }}
+ >
+ +{overflow}
+ </button>
+ </motion.div>
+ )}
+ <AnimatePresence>
+ {hoveredPipeIndex !== null && (
+ <motion.div
+ key={hoveredPipeIndex}
+ initial={{ opacity: 0, y: 4 }}
+ animate={{ opacity: 1, y: 0 }}
+ exit={{ opacity: 0 }}
+ transition={{ duration: 0.1 }}
+ className="absolute left-1/2 -translate-x-1/2 px-2 py-0.5 rounded bg-foreground text-background text-[10px] whitespace-nowrap pointer-events-none shadow z-10"
+ style={{ top: -4 }}
+ >
+ {hoveredPipeIndex < visible.length
+ ? visible[hoveredPipeIndex].title
+ : `${overflow} more pipes`}
+ </motion.div>
+ )}
+ </AnimatePresence>
+ </div>
+ );
+ })()}
+ </AnimatePresence>
+ </div>
)}
<button
onClick={() => setShowRetranscribe(!showRetranscribe)}
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx
index f8b531754..3e8095755 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx
@@ -14,6 +14,7 @@ import { cn } from "@/lib/utils";
import { commands } from "@/lib/utils/tauri";
import { emit } from "@tauri-apps/api/event";
import { PipeAIIcon } from "@/components/pipe-ai-icon";
+import { type TemplatePipe } from "@/lib/hooks/use-pipes";
import { AppContextPopover } from "./app-context-popover";
import { TimelineTagToolbar } from "./timeline-tag-toolbar";
import { extractDomain, FaviconImg } from "./favicon-utils";
@@ -61,6 +62,8 @@ interface TimelineSliderProps {
targetZoom: number;
setTargetZoom: (fn: (prev: number) => number) => void;
onAskAI?: () => void;
+ onRunPipe?: (pipe: TemplatePipe) => void;
+ templatePipes?: TemplatePipe[];
isPlaying?: boolean; // Whether audio playback is active
onTogglePlayPause?: () => void; // Toggle audio playback (Space key)
selectedDeviceId?: string; // "all" or a specific device_id — dims non-matching bars
@@ -203,6 +206,8 @@ export const TimelineSlider = ({
targetZoom,
setTargetZoom,
onAskAI,
+ onRunPipe,
+ templatePipes,
isPlaying = false,
onTogglePlayPause,
selectedDeviceId = "all",
@@ -411,11 +416,60 @@ export const TimelineSlider = ({
const appGroups = useMemo(() => {
if (!visibleFrames || visibleFrames.length === 0) return [];
+ // Pre-compute per-frame browser URL with bidirectional carry-forward.
+ // Only ~1% of browser frames have browser_url set, so we fill gaps by
+ // propagating the nearest known URL in both directions within consecutive
+ // browser-app runs (including "Unknown" frames which get folded into the
+ // previous app during grouping). This is O(n) over visibleFrames.
+ const frameBrowserUrls = new Array<string>(visibleFrames.length).fill("");
+ {
+ // Pass 1: forward (in iteration order, which is newest→oldest for descending frames)
+ let carry = "";
+ let lastBrowserApp = "";
+ for (let i = 0; i < visibleFrames.length; i++) {
+ const frame = visibleFrames[i];
+ const app = getFrameAppName(frame);
+ const isBrowser = getAppCategory(app) === 'browser';
+ const isUnknown = app === 'Unknown';
+ // "Unknown" frames get folded into the previous app during grouping,
+ // so treat them as continuation of the current browser run
+ if (!isBrowser && !isUnknown) { carry = ""; lastBrowserApp = ""; continue; }
+ if (isBrowser && app !== lastBrowserApp) { carry = ""; lastBrowserApp = app; }
+ // If Unknown but no active browser run, skip
+ if (isUnknown && !lastBrowserApp) continue;
+ let url = "";
+ for (const d of frame.devices) {
+ if (d.metadata?.browser_url?.trim()) { url = d.metadata.browser_url; break; }
+ }
+ if (url) carry = url;
+ if (carry) frameBrowserUrls[i] = carry;
+ }
+ // Pass 2: backward (fills newer frames that precede the first URL occurrence)
+ carry = "";
+ lastBrowserApp = "";
+ for (let i = visibleFrames.length - 1; i >= 0; i--) {
+ const frame = visibleFrames[i];
+ const app = getFrameAppName(frame);
+ const isBrowser = getAppCategory(app) === 'browser';
+ const isUnknown = app === 'Unknown';
+ if (!isBrowser && !isUnknown) { carry = ""; lastBrowserApp = ""; continue; }
+ if (isBrowser && app !== lastBrowserApp) { carry = ""; lastBrowserApp = app; }
+ if (isUnknown && !lastBrowserApp) continue;
+ let url = "";
+ for (const d of frame.devices) {
+ if (d.metadata?.browser_url?.trim()) { url = d.metadata.browser_url; break; }
+ }
+ if (url) carry = url;
+ if (carry && !frameBrowserUrls[i]) frameBrowserUrls[i] = carry;
+ }
+ }
+
const groups: AppGroup[] = [];
let currentApp = "";
let currentGroup: StreamTimeSeriesResponse[] = [];
let currentGroupAllApps = new Set<string>();
let currentDayKey = "";
+ let currentGroupDomainCounts = new Map<string, number>();
const flushGroup = () => {
if (currentGroup.length > 0) {
@@ -423,25 +477,11 @@ export const TimelineSlider = ({
// Compute top domains for browser groups
let topDomains: string[] | undefined;
const isBrowser = getAppCategory(currentApp) === 'browser';
- if (isBrowser) {
- const domainCounts = new Map<string, number>();
- for (const f of currentGroup) {
- for (const d of f.devices) {
- const url = d.metadata?.browser_url;
- if (url) {
- const domain = extractDomain(url);
- if (domain) {
- domainCounts.set(domain, (domainCounts.get(domain) || 0) + 1);
- }
- }
- }
- }
- if (domainCounts.size > 0) {
- topDomains = [...domainCounts.entries()]
- .sort((a, b) => b[1] - a[1])
- .slice(0, 2)
- .map(([domain]) => domain);
- }
+ if (isBrowser && currentGroupDomainCounts.size > 0) {
+ topDomains = [...currentGroupDomainCounts.entries()]
+ .sort((a, b) => b[1] - a[1])
+ .slice(0, 2)
+ .map(([domain]) => domain);
}
groups.push({
appName: currentApp,
@@ -454,7 +494,7 @@ export const TimelineSlider = ({
}
};
- visibleFrames.forEach((frame) => {
+ visibleFrames.forEach((frame, visIdx) => {
let appName = getFrameAppName(frame);
const allAppsInFrame = getFrameAppNames(frame);
const frameDate = new Date(frame.timestamp);
@@ -465,6 +505,8 @@ export const TimelineSlider = ({
appName = currentApp;
}
+ const frameUrl = frameBrowserUrls[visIdx];
+
// Break group at day boundary OR app change
if ((currentDayKey && dayKey !== currentDayKey) || appName !== currentApp) {
flushGroup();
@@ -473,10 +515,23 @@ export const TimelineSlider = ({
currentGroupAllApps = new Set(allAppsInFrame.filter(n => n !== "Unknown"));
if (currentApp !== "Unknown") currentGroupAllApps.add(currentApp);
currentDayKey = dayKey;
+ // Reset domain counts for new group
+ currentGroupDomainCounts = new Map<string, number>();
+ if (frameUrl) {
+ const domain = extractDomain(frameUrl);
+ if (domain) currentGroupDomainCounts.set(domain, 1);
+ }
} else {
currentGroup.push(frame);
allAppsInFrame.filter(n => n !== "Unknown").forEach(app => currentGroupAllApps.add(app));
if (!currentDayKey) currentDayKey = dayKey;
+ // Accumulate domain counts
+ if (frameUrl) {
+ const domain = extractDomain(frameUrl);
+ if (domain) {
+ currentGroupDomainCounts.set(domain, (currentGroupDomainCounts.get(domain) || 0) + 1);
+ }
+ }
}
});
@@ -1072,8 +1127,9 @@ export const TimelineSlider = ({
>
<div className="flex items-center gap-2 mb-1">
{(() => {
+ // Use frame's own browser_url, or fall back to group's top domain
const browserUrl = frame.devices?.find(d => d.metadata?.browser_url)?.metadata?.browser_url;
- const domain = browserUrl ? extractDomain(browserUrl) : null;
+ const domain = browserUrl ? extractDomain(browserUrl) : group.topDomains?.[0] ?? null;
if (domain) {
return <FaviconImg domain={domain} fallbackAppName={group.appName} size={16} className="w-4 h-4 rounded" />;
}
@@ -1089,7 +1145,7 @@ export const TimelineSlider = ({
<p className="font-medium text-popover-foreground">
{(() => {
const browserUrl = frame.devices?.find(d => d.metadata?.browser_url)?.metadata?.browser_url;
- const domain = browserUrl ? extractDomain(browserUrl) : null;
+ const domain = browserUrl ? extractDomain(browserUrl) : group.topDomains?.[0] ?? null;
return domain || getFrameAppName(frame);
})()}
</p>
@@ -1160,7 +1216,7 @@ export const TimelineSlider = ({
{/* Tag toolbar — floating above selection */}
{selectedIndices.size > 1 && selectionRange && (
- <TimelineTagToolbar anchorRect={selectionRect} onAskAI={onAskAI} />
+ <TimelineTagToolbar anchorRect={selectionRect} onAskAI={onAskAI} onRunPipe={onRunPipe} templatePipes={templatePipes} />
)}
{/* App filter dot tooltip */}
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-pipes.ts b/apps/screenpipe-app-tauri/lib/hooks/use-pipes.ts
index 0344edb7a..2a4d1b323 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-pipes.ts
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-pipes.ts
@@ -29,6 +29,7 @@ interface PipeStatus {
export function usePipes() {
const [pipes, setPipes] = useState<PipeStatus[]>([]);
const [templatePipes, setTemplatePipes] = useState<TemplatePipe[]>([]);
+ const [promptPipes, setPromptPipes] = useState<TemplatePipe[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
@@ -42,17 +43,25 @@ export function usePipes() {
const allPipes: PipeStatus[] = json.data || [];
setPipes(allPipes);
- const templates: TemplatePipe[] = allPipes
+ const toTemplatePipe = (p: PipeStatus): TemplatePipe => ({
+ name: p.config.name,
+ title: (p.config.config?.title as string) || p.config.name,
+ description: (p.config.config?.description as string) || "",
+ icon: (p.config.config?.icon as string) || "📄",
+ featured: (p.config.config?.featured as boolean) || false,
+ prompt: p.prompt_body || "",
+ });
+
+ const templates = allPipes
.filter((p) => p.config.config?.template === true)
- .map((p) => ({
- name: p.config.name,
- title: (p.config.config?.title as string) || p.config.name,
- description: (p.config.config?.description as string) || "",
- icon: (p.config.config?.icon as string) || "📄",
- featured: (p.config.config?.featured as boolean) || false,
- prompt: p.prompt_body || "",
- }));
+ .map(toTemplatePipe);
setTemplatePipes(templates);
+
+ // All enabled pipes with a prompt (for radial pipe selector)
+ const withPrompt = allPipes
+ .filter((p) => p.config.enabled && p.prompt_body?.trim())
+ .map(toTemplatePipe);
+ setPromptPipes(withPrompt);
} catch (e) {
setError(e instanceof Error ? e.message : "failed to fetch pipes");
} finally {
@@ -64,5 +73,5 @@ export function usePipes() {
fetchPipes();
}, [fetchPipes]);
- return { pipes, templatePipes, loading, error, refetch: fetchPipes };
+ return { pipes, templatePipes, promptPipes, loading, error, refetch: fetchPipes };
}