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

feat: text overlay, timeline and app context improvements

Louis Beaumont6353d5c49d93
diff --git a/Cargo.lock b/Cargo.lock
index f022b4455..3717426ac 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6626,7 +6626,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.67"
+version = "0.3.69"
dependencies = [
"anyhow",
"bytemuck",
@@ -6679,7 +6679,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.67"
+version = "0.3.69"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -6730,7 +6730,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.67"
+version = "0.3.69"
dependencies = [
"anyhow",
"chrono",
@@ -6754,7 +6754,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.67"
+version = "0.3.69"
dependencies = [
"anyhow",
"chrono",
@@ -6772,7 +6772,7 @@ dependencies = [
[[package]]
name = "screenpipe-integrations"
-version = "0.3.67"
+version = "0.3.69"
dependencies = [
"anyhow",
"image",
@@ -6787,7 +6787,7 @@ dependencies = [
[[package]]
name = "screenpipe-server"
-version = "0.3.67"
+version = "0.3.69"
dependencies = [
"anyhow",
"async-trait",
@@ -6856,7 +6856,7 @@ dependencies = [
[[package]]
name = "screenpipe-vision"
-version = "0.3.67"
+version = "0.3.69"
dependencies = [
"accessibility-sys",
"anyhow",
diff --git a/Cargo.toml b/Cargo.toml
index 85f619a02..9b095c5e8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,7 @@ exclude = ["apps/screenpipe-app-tauri/src-tauri"]
resolver = "2"
[workspace.package]
-version = "0.3.69"
+version = "0.3.70"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/screenpipe/screenpipe"
diff --git a/apps/screenpipe-app-tauri/components/__tests__/text-overlay.test.tsx b/apps/screenpipe-app-tauri/components/__tests__/text-overlay.test.tsx
index 47fb91e78..2b91e8bd0 100644
--- a/apps/screenpipe-app-tauri/components/__tests__/text-overlay.test.tsx
+++ b/apps/screenpipe-app-tauri/components/__tests__/text-overlay.test.tsx
@@ -206,10 +206,10 @@ describe("TextOverlay", () => {
expect(height).toBeGreaterThanOrEqual(24);
});
- it("should detect URLs with uncommon TLDs", () => {
+ it("should detect URLs with well-known TLDs", () => {
const positions = [
- createTextPosition("app.crisp.chat", 0.1, 0.1, 0.15, 0.02),
- createTextPosition("screenpi.pe", 0.1, 0.2, 0.1, 0.02),
+ createTextPosition("github.com", 0.1, 0.1, 0.15, 0.02),
+ createTextPosition("example.org", 0.1, 0.2, 0.1, 0.02),
];
const { container } = render(
<TextOverlay
@@ -268,10 +268,17 @@ describe("extractUrlsFromText", () => {
expect(urls[0].normalizedUrl).toBe("https://www.example.com");
});
- it("should extract domain URLs with known TLDs", () => {
+ it("should not extract bare domains (only https/www)", () => {
const urls = extractUrlsFromText(
"Check app.crisp.chat and screenpi.pe/demo"
);
+ expect(urls.length).toBe(0);
+ });
+
+ it("should extract explicit https domains", () => {
+ const urls = extractUrlsFromText(
+ "Visit https://github.com and https://screenpi.pe/demo"
+ );
expect(urls.length).toBe(2);
});
@@ -328,11 +335,18 @@ describe("isUrl", () => {
expect(isUrl("www.example.com")).toBe(true);
});
- it("should detect domain-like strings", () => {
+ it("should detect domain-like strings with well-known TLDs", () => {
expect(isUrl("example.com")).toBe(true);
expect(isUrl("example.io")).toBe(true);
- expect(isUrl("app.crisp.chat")).toBe(true);
- expect(isUrl("screenpi.pe")).toBe(true);
+ expect(isUrl("github.dev")).toBe(true);
+ });
+
+ it("should not match OCR garbled text or uncommon TLDs", () => {
+ expect(isUrl("ostnuo.co")).toBe(false);
+ expect(isUrl("10a2SV.Om")).toBe(false);
+ expect(isUrl("gaunvo.co")).toBe(false);
+ expect(isUrl("screenpi.pe")).toBe(false);
+ expect(isUrl("app.crisp.chat")).toBe(false);
});
it("should not detect regular text", () => {
diff --git a/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
index f0fb43a4d..f002d7153 100644
--- a/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
@@ -2,10 +2,14 @@ import { StreamTimeSeriesResponse } from "@/components/rewind/timeline";
import React, { FC, useState, useRef, useEffect, useCallback, useMemo } from "react";
import { useFrameOcrData } from "@/lib/hooks/use-frame-ocr-data";
import { TextOverlay, extractUrlsFromText, isUrl, normalizeUrl } from "@/components/text-overlay";
-import { open as shellOpen } from "@tauri-apps/plugin-shell";
-import { ImageOff, ChevronLeft, ChevronRight, Loader2, ExternalLink } from "lucide-react";
+import { ImageOff, ChevronLeft, ChevronRight, Loader2 } from "lucide-react";
import posthog from "posthog-js";
+export interface DetectedUrl {
+ normalized: string;
+ display: string;
+}
+
interface CurrentFrameTimelineProps {
currentFrame: StreamTimeSeriesResponse;
onNavigate?: (direction: "prev" | "next") => void;
@@ -13,6 +17,7 @@ interface CurrentFrameTimelineProps {
canNavigateNext?: boolean;
onFrameUnavailable?: () => void;
onFrameLoadError?: () => void;
+ onUrlsDetected?: (urls: DetectedUrl[]) => void;
}
export const SkeletonLoader: FC = () => {
@@ -40,6 +45,7 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
canNavigateNext = true,
onFrameUnavailable,
onFrameLoadError,
+ onUrlsDetected,
}) => {
const [isLoading, setIsLoading] = useState(true);
const [hasError, setHasError] = useState(false);
@@ -121,32 +127,52 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
// Fetch OCR text positions for text selection overlay
// Use debounced frame ID to avoid unnecessary fetches
- const { textPositions } = useFrameOcrData(
+ const { textPositions, isLoading: ocrLoading } = useFrameOcrData(
debouncedFrameId ? parseInt(debouncedFrameId, 10) : null
);
+ // Track which frame the OCR data is for — only show URLs when OCR matches displayed frame
+ const ocrFrameIdRef = useRef<string | null>(null);
+ useEffect(() => {
+ if (!ocrLoading && debouncedFrameId) {
+ ocrFrameIdRef.current = debouncedFrameId;
+ }
+ }, [ocrLoading, debouncedFrameId]);
+
// Extract all unique URLs from OCR text for the clickable URL bar
const detectedUrls = useMemo(() => {
+ // Don't show URLs while OCR is still loading (prevents stale data from previous frame)
+ if (ocrLoading) return [];
+
const urls = new Map<string, string>(); // normalizedUrl -> displayUrl
for (const pos of textPositions) {
+ const b = pos.bounds;
+ // Skip off-screen OCR blocks (multi-monitor artifacts)
+ if (b.left < 0 || b.top < 0 || b.left > 1 || b.top > 1) continue;
+
// Check whole block
if (isUrl(pos.text)) {
const norm = normalizeUrl(pos.text);
- if (!urls.has(norm)) urls.set(norm, pos.text);
+ // Skip very short URLs (OCR noise like "a.io")
+ if (norm.length >= 12 && !urls.has(norm)) urls.set(norm, pos.text);
continue;
}
- // Extract embedded URLs
+ // Extract embedded URLs (only https:// and www. prefixed)
for (const ext of extractUrlsFromText(pos.text)) {
- if (!urls.has(ext.normalizedUrl)) {
+ if (ext.normalizedUrl.length >= 12 && !urls.has(ext.normalizedUrl)) {
urls.set(ext.normalizedUrl, ext.url);
}
}
}
- return Array.from(urls.entries()).map(([normalized, display]) => ({
- normalized,
- display,
- }));
- }, [textPositions]);
+ return Array.from(urls.entries())
+ .map(([normalized, display]) => ({ normalized, display }))
+ .slice(0, 3);
+ }, [textPositions, ocrLoading]);
+
+ // Notify parent of detected URLs
+ useEffect(() => {
+ onUrlsDetected?.(detectedUrls);
+ }, [detectedUrls, onUrlsDetected]);
// Abort previous image load and start new one when debounced frame changes
useEffect(() => {
@@ -378,14 +404,13 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
}}
/>
)}
- {/* Text selection overlay for timeline view */}
- {/* Position overlay to match the actual rendered image (object-contain letterboxing) */}
- {!isLoading && !hasError && naturalDimensions && renderedImageInfo && textPositions.length > 0 && (
+ {/* In-frame clickable URL overlay — links in middle/bottom of frame are clickable
+ (top area blocked by z-40 controls, but pills bar handles those) */}
+ {!isLoading && !hasError && !ocrLoading && naturalDimensions && renderedImageInfo && textPositions.length > 0 && (
<div
className="absolute overflow-hidden"
style={{
zIndex: 2,
- // Clip to container bounds
top: 0,
left: 0,
right: 0,
@@ -394,8 +419,6 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
>
<div
style={{
- // Position the overlay to match where the image actually renders
- // For object-contain, offsets are positive when letterboxed
position: 'absolute',
left: renderedImageInfo.offsetX,
top: renderedImageInfo.offsetY,
@@ -414,32 +437,6 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
</div>
</div>
)}
- {/* Detected URLs bar - shows clickable links found in the frame */}
- {!isLoading && !hasError && detectedUrls.length > 0 && (
- <div
- className="absolute top-2 left-1/2 -translate-x-1/2 flex flex-wrap gap-1.5 max-w-[80%] justify-center"
- style={{ zIndex: 20, pointerEvents: "auto" }}
- >
- {detectedUrls.map((url) => (
- <button
- key={url.normalized}
- onClick={async (e) => {
- e.stopPropagation();
- try {
- await shellOpen(url.normalized);
- } catch {
- window.open(url.normalized, "_blank");
- }
- }}
- className="flex items-center gap-1 px-2 py-1 text-xs rounded-md bg-black/70 hover:bg-black/90 text-blue-300 hover:text-blue-200 border border-blue-500/30 hover:border-blue-400/50 backdrop-blur-sm transition-colors cursor-pointer truncate max-w-[300px]"
- title={url.normalized}
- >
- <ExternalLink className="w-3 h-3 shrink-0" />
- <span className="truncate">{url.display}</span>
- </button>
- ))}
- </div>
- )}
{/* When frame is unavailable, just show skeleton - skip happens silently */}
{hasError && !isLoading && (
<div className="absolute inset-0 z-10">
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
index 8fa4980fc..4ba336855 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -16,6 +16,7 @@ import { TimelineSlider } from "@/components/rewind/timeline/timeline";
import { useTimelineStore } from "@/lib/hooks/use-timeline-store";
import { hasFramesForDate } from "@/lib/actions/has-frames-date";
import { CurrentFrameTimeline } from "@/components/rewind/current-frame-timeline";
+
import posthog from "posthog-js";
export interface StreamTimeSeriesResponse {
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 4d147c765..d15f13192 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
@@ -132,8 +132,13 @@ export function AppContextPopover({
return (
<div
- className="absolute bottom-full left-1/2 -translate-x-1/2 mb-2 z-[60] w-72 bg-popover border border-border rounded-lg shadow-2xl text-xs"
- style={{ direction: "ltr" }}
+ className="fixed z-[200] w-72 bg-popover border border-border rounded-lg shadow-2xl text-xs"
+ style={{
+ direction: "ltr",
+ bottom: "140px",
+ left: "50%",
+ transform: "translateX(-50%)",
+ }}
onClick={(e) => e.stopPropagation()}
onMouseDown={(e) => e.stopPropagation()}
>
@@ -157,6 +162,13 @@ export function AppContextPopover({
</button>
</div>
+ {/* Debug */}
+ <div className="px-3 py-1 text-[9px] text-red-400 bg-red-950/30 break-all">
+ frames={frames.length} windows={data.topWindows.length} urls={data.topUrls.length}
+ {frames[0] && ` dev0keys=${Object.keys(frames[0].devices?.[0] || {}).join(",")}`}
+ {frames[0]?.devices?.[0]?.metadata && ` meta=${JSON.stringify(frames[0].devices[0].metadata).slice(0, 100)}`}
+ </div>
+
{/* Content */}
<div className="px-3 py-2 space-y-2 max-h-64 overflow-y-auto">
{/* Time summary */}
diff --git a/apps/screenpipe-app-tauri/components/text-overlay.tsx b/apps/screenpipe-app-tauri/components/text-overlay.tsx
index 4adfa4c93..a4fcc8b24 100644
--- a/apps/screenpipe-app-tauri/components/text-overlay.tsx
+++ b/apps/screenpipe-app-tauri/components/text-overlay.tsx
@@ -3,6 +3,7 @@
import { useCallback, useMemo, memo, useState } from "react";
import { cn } from "@/lib/utils";
import { open as shellOpen } from "@tauri-apps/plugin-shell";
+import { commands } from "@/lib/utils/tauri";
import type { TextPosition } from "@/lib/hooks/use-frame-ocr-data";
/**
@@ -27,9 +28,10 @@ export function isUrl(text: string): boolean {
return true;
}
- // Check for domain-like patterns with any 2-13 char alphabetic TLD
+ // Only match bare domains with well-known TLDs to avoid OCR false positives
+ // (garbled terminal text like "ostnuo.co" or "10a2SV.Om" must not match)
const domainPattern =
- /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\.[a-zA-Z]{2,13}(\/[^\s]*)?$/;
+ /^[a-zA-Z][a-zA-Z0-9-]{0,61}[a-zA-Z0-9](\.[a-zA-Z][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])*\.(com|org|net|io|dev|app|ai|edu|gov)(\/[^\s]*)?$/i;
return domainPattern.test(trimmed);
}
@@ -42,7 +44,7 @@ export function isUrl(text: string): boolean {
* - domain.tld/path (common TLDs only, to avoid false positives in prose)
*/
const URL_IN_TEXT_RE =
- /https?:\/\/[^\s]+|www\.[a-zA-Z0-9-]+\.[a-zA-Z]{2,13}[^\s]*|[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.(?:com|org|net|io|dev|app|co|ai|edu|gov|me|tv|pe|chat|xyz|live|news|pro|tech|cloud|page|link|site|store|blog)(?:\/[^\s]*)?|[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+\.(?:com|org|net|io|dev|app|co|ai|edu|gov|me|tv|pe|chat|xyz|live|news|pro|tech|cloud|page|link|site|store|blog)(?:\/[^\s]*)?/gi;
+ /https?:\/\/[^\s]+|www\.[a-zA-Z0-9-]+\.[a-zA-Z]{2,13}[^\s]*/gi;
/**
* Extract URLs from a text block and compute their approximate bounding boxes
@@ -224,15 +226,12 @@ export const TextOverlay = memo(function TextOverlay({
}, [textPositions, displayedWidth, displayedHeight, minConfidence]);
const handleUrlClick = useCallback(
- async (url: string, e: React.MouseEvent) => {
+ (url: string, e: React.MouseEvent) => {
e.preventDefault();
e.stopPropagation();
- try {
- await shellOpen(url);
- } catch (err) {
- console.error("failed to open URL:", url, err);
- window.open(url, "_blank", "noopener,noreferrer");
- }
+ // Close timeline and open URL in browser
+ commands.closeWindow("Main").catch(() => {});
+ shellOpen(url).catch(() => {});
},
[]
);
diff --git a/apps/screenpipe-app-tauri/lib/utils/tauri.ts b/apps/screenpipe-app-tauri/lib/utils/tauri.ts
index ed9b75ec7..52fa28a0f 100644
--- a/apps/screenpipe-app-tauri/lib/utils/tauri.ts
+++ b/apps/screenpipe-app-tauri/lib/utils/tauri.ts
@@ -536,7 +536,7 @@ async obsidianCancelSync() : Promise<Result<null, string>> {
/** user-defined types **/
export type AIPreset = { id: string; prompt: string; provider: AIProviderType; url?: string; model?: string; defaultPreset: boolean; apiKey: string | null; maxContextChars: number }
-export type AIProviderType = "openai" | "native-ollama" | "custom" | "pi"
+export type AIProviderType = "openai" | "native-ollama" | "custom" | "screenpipe-cloud" | "pi"
export type AudioDeviceInfo = { name: string; isDefault: boolean }
export type Credits = { amount: number }
export type EmbeddedLLM = { enabled: boolean; model: string; port: number }
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 9b4f9666f..2c5b17afc 100755
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9007,7 +9007,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.0.275"
+version = "2.0.276"
dependencies = [
"anyhow",
"async-stream",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 9920b2486..b6fc5fe0e 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.0.275"
+version = "2.0.276"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""