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: compact overlay mode — minimal bottom bar alternative to fullscreen
Louis Beaumont255362b6c0b0
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsxindex 5af1f7e51..35bb8e20f 100644--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx@@ -1,6 +1,6 @@"use client";import { useEffect, useState, useRef, useMemo, useCallback } from "react";-import { Loader2, RotateCcw, AlertCircle, X, Sparkles } from "lucide-react";+import { Loader2, RotateCcw, AlertCircle, X, Sparkles, Maximize2 } from "lucide-react";import { SearchModal } from "@/components/rewind/search-modal";import { commands } from "@/lib/utils/tauri";import { listen, emit } from "@tauri-apps/api/event";@@ -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 { useSettings } from "@/lib/hooks/use-settings";import posthog from "posthog-js";export interface StreamTimeSeriesResponse {@@ -63,6 +64,11 @@ const easeOutCubic = (x: number): number => {};export default function Timeline() {+ const { settings } = useSettings();+ const isCompactDefault = settings.overlayMode === "compact";+ // In compact mode, start collapsed. In fullscreen mode, always expanded.+ const [isExpanded, setIsExpanded] = useState(!isCompactDefault);+const [currentIndex, setCurrentIndex] = useState(0);const [showAudioTranscript, setShowAudioTranscript] = useState(true);const [showSearchModal, setShowSearchModal] = useState(false);@@ -472,6 +478,51 @@ export default function Timeline() {return () => window.removeEventListener("keydown", handleKeyDown);}, [showSearchModal]);+ // Handle Escape: in compact mode, Esc collapses expanded → compact → close.+ // In fullscreen mode (or when already compact), Esc closes the window.+ useEffect(() => {+ const unlisten = listen("escape-pressed", () => {+ if (showSearchModal) {+ // Let the search modal handle its own close+ setShowSearchModal(false);+ return;+ }+ if (isCompactDefault && isExpanded) {+ // Collapse back to compact bar+ setIsExpanded(false);+ } else {+ // Close the window (same as before)+ commands.closeWindow("Main");+ }+ });+ return () => { unlisten.then((fn) => fn()); };+ }, [isCompactDefault, isExpanded, showSearchModal]);++ // In compact mode, Enter or ArrowUp expands the view+ useEffect(() => {+ if (!isCompactDefault || isExpanded) return;+ const handleKeyDown = (e: KeyboardEvent) => {+ if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;+ if (e.key === "Enter" || e.key === "ArrowUp") {+ e.preventDefault();+ setIsExpanded(true);+ }+ };+ window.addEventListener("keydown", handleKeyDown);+ return () => window.removeEventListener("keydown", handleKeyDown);+ }, [isCompactDefault, isExpanded]);++ // Reset to compact when overlay is re-shown (window-focused)+ useEffect(() => {+ if (!isCompactDefault) return;+ const unlisten = listen<boolean>("window-focused", (event) => {+ if (event.payload) {+ setIsExpanded(false);+ }+ });+ return () => { unlisten.then((fn) => fn()); };+ }, [isCompactDefault]);+useEffect(() => {const getStartDateAndSet = async () => {const data = await getStartDate();@@ -818,6 +869,147 @@ export default function Timeline() {requestAnimationFrame(animate);};+ // Compact mode: thin bottom bar with timeline + thumbnail+ const isCompact = isCompactDefault && !isExpanded;++ const compactThumbnailUrl = currentFrame?.devices?.[0]?.frame_id+ ? `http://localhost:3030/frames/${currentFrame.devices[0].frame_id}`+ : null;++ const compactTimestamp = currentFrame?.timestamp+ ? new Date(currentFrame.timestamp).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })+ : "--:--";++ if (isCompact) {+ return (+ <TimelineProvider>+ <div+ ref={containerRef}+ className="inset-0 flex flex-col relative"+ style={{+ height: "100vh",+ WebkitUserSelect: "none",+ userSelect: "none",+ }}+ >+ {/* Transparent area — click to dismiss */}+ <div+ className="flex-1"+ onClick={() => commands.closeWindow("Main")}+ />++ {/* Compact bottom bar */}+ <div className="relative z-40 bg-card/95 backdrop-blur-xl border-t border-border shadow-2xl">+ <div className="flex items-center gap-3 px-4 py-2 h-[72px]">+ {/* Thumbnail */}+ <button+ onClick={() => setIsExpanded(true)}+ className="relative flex-shrink-0 w-[88px] h-[52px] rounded-md overflow-hidden border border-border/50 hover:border-primary/50 transition-colors group cursor-pointer bg-muted"+ title="Expand (Enter)"+ >+ {compactThumbnailUrl ? (+ <img+ src={compactThumbnailUrl}+ alt="Current frame"+ className="w-full h-full object-cover"+ />+ ) : (+ <div className="w-full h-full flex items-center justify-center">+ <Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />+ </div>+ )}+ <div className="absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-center justify-center">+ <Maximize2 className="w-4 h-4 text-white opacity-0 group-hover:opacity-100 transition-opacity" />+ </div>+ </button>++ {/* Timestamp */}+ <span className="text-xs font-mono text-muted-foreground flex-shrink-0 w-12 text-center">+ {compactTimestamp}+ </span>++ {/* Timeline slider — fills remaining space */}+ <div className="flex-1 min-w-0">+ {frames.length > 0 ? (+ <TimelineSlider+ frames={frames}+ currentIndex={currentIndex}+ onFrameChange={(index) => {+ setCurrentIndex(index);+ if (frames[index]) {+ setCurrentFrame(frames[index]);+ }+ }}+ fetchNextDayData={fetchNextDayData}+ currentDate={currentDate}+ startAndEndDates={startAndEndDates}+ newFramesCount={newFramesCount}+ lastFlushTimestamp={lastFlushTimestamp}+ isSearchModalOpen={showSearchModal}+ />+ ) : (+ <div className="text-xs text-muted-foreground text-center">+ {isLoading ? "Loading..." : "No frames"}+ </div>+ )}+ </div>++ {/* Action buttons */}+ <div className="flex items-center gap-1 flex-shrink-0">+ <button+ onClick={() => setShowSearchModal(true)}+ className="p-2 hover:bg-muted rounded-md transition-colors"+ title="Search (/)"+ >+ <svg className="w-4 h-4 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />+ </svg>+ </button>+ <button+ onClick={() => setIsExpanded(true)}+ className="p-2 hover:bg-muted rounded-md transition-colors"+ title="Expand (Enter)"+ >+ <Maximize2 className="w-4 h-4 text-muted-foreground" />+ </button>+ <button+ onClick={() => commands.closeWindow("Main")}+ className="p-2 hover:bg-muted rounded-md transition-colors"+ title="Close (Esc)"+ >+ <X className="w-4 h-4 text-muted-foreground" />+ </button>+ </div>+ </div>+ </div>++ {/* Search Modal */}+ <SearchModal+ isOpen={showSearchModal}+ onClose={() => setShowSearchModal(false)}+ onNavigateToTimestamp={(timestamp) => {+ const targetDate = new Date(timestamp);+ setSeekingTimestamp(timestamp);+ // Expand to show the result+ setIsExpanded(true);+ if (!isSameDay(targetDate, currentDate)) {+ pendingNavigationRef.current = targetDate;+ handleDateChange(targetDate);+ } else {+ pendingNavigationRef.current = null;+ jumpToTime(targetDate);+ setSeekingTimestamp(null);+ }+ }}+ />+ </div>+ </TimelineProvider>+ );+ }++ // =====================================================================+ // Expanded / Fullscreen mode (original layout)+ // =====================================================================return (<TimelineProvider><divdiff --git a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx b/apps/screenpipe-app-tauri/components/settings/general-settings.tsxindex 9608075ea..551623788 100644--- a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx+++ b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx@@ -6,10 +6,10 @@ import { useTheme } from "@/components/theme-provider";import { Switch } from "@/components/ui/switch";import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";import { Separator } from "@/components/ui/separator";-import { Rocket, Moon, Sun, Monitor, FlaskConical, Shield, ExternalLink } from "lucide-react";+import { Rocket, Moon, Sun, Monitor, FlaskConical, Shield, ExternalLink, Layers } from "lucide-react";import { useToast } from "@/components/ui/use-toast";import { Button } from "@/components/ui/button";-import { Settings } from "@/lib/hooks/use-settings";+import { Settings, OverlayMode } from "@/lib/hooks/use-settings";import { open } from "@tauri-apps/plugin-shell";import { UpdateBanner } from "@/components/update-banner";@@ -160,6 +160,49 @@ export default function GeneralSettings() {</CardContent></Card>+ <Card className="border-border bg-card shadow-sm">+ <CardContent className="p-6">+ <div className="space-y-4">+ <div className="flex items-start space-x-4">+ <div className="p-2 bg-primary/10 rounded-lg">+ <Layers className="h-5 w-5 text-primary" />+ </div>+ <div className="space-y-1 flex-1">+ <h3 className="text-lg font-semibold text-foreground">+ Timeline Overlay Mode+ </h3>+ <p className="text-sm text-muted-foreground leading-relaxed">+ Choose how the timeline appears when activated. Compact mode shows a+ minimal bar at the bottom — press Enter to expand.+ </p>+ </div>+ </div>+ <div className="flex gap-3 ml-[52px]">+ {([+ { value: "fullscreen" as OverlayMode, label: "Fullscreen", desc: "Full-screen overlay with screenshot" },+ { value: "compact" as OverlayMode, label: "Compact", desc: "Bottom bar with timeline" },+ ]).map((option) => {+ const isActive = (settings?.overlayMode ?? "fullscreen") === option.value;+ return (+ <button+ key={option.value}+ onClick={() => handleSettingsChange({ overlayMode: option.value })}+ className={`flex-1 p-3 rounded-lg border-2 transition-all text-left ${+ isActive+ ? "border-primary bg-primary/5"+ : "border-border hover:border-muted-foreground/30"+ }`}+ >+ <div className="font-medium text-sm text-foreground">{option.label}</div>+ <div className="text-xs text-muted-foreground mt-0.5">{option.desc}</div>+ </button>+ );+ })}+ </div>+ </div>+ </CardContent>+ </Card>+<Card className="border-border bg-card shadow-sm"><CardContent className="p-6"><div className="flex items-center justify-between">diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsxindex 4c262705a..3a9437864 100644--- a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx+++ b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx@@ -76,6 +76,8 @@ export interface ChatHistoryStore {}// Extend SettingsStore with fields added before Rust types are regenerated+export type OverlayMode = "fullscreen" | "compact";+export type Settings = SettingsStore & {deviceId?: string;updateChannel?: UpdateChannel;@@ -84,6 +86,8 @@ export type Settings = SettingsStore & {searchShortcut?: string;adaptiveFps?: boolean;enableUiEvents?: boolean;+ /** Timeline overlay mode: "fullscreen" (default) or "compact" (bottom bar) */+ overlayMode?: OverlayMode;}export const DEFAULT_PROMPT = `Rules:@@ -229,6 +233,7 @@ let DEFAULT_SETTINGS: Settings = {historyEnabled: true,},enableUiEvents: false,+ overlayMode: "fullscreen",};export function createDefaultSettingsObject(): Settings {diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lockindex 5231c3c37..547e59f27 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.261"+version = "2.0.262"dependencies = ["anyhow","async-stream",@@ -9089,7 +9089,7 @@ dependencies = [[[package]]name = "screenpipe-audio"-version = "0.3.55"+version = "0.3.56"dependencies = ["anyhow","bytemuck",@@ -9137,7 +9137,7 @@ dependencies = [[[package]]name = "screenpipe-core"-version = "0.3.55"+version = "0.3.56"dependencies = ["accessibility","accessibility-sys",@@ -9188,7 +9188,7 @@ dependencies = [[[package]]name = "screenpipe-db"-version = "0.3.55"+version = "0.3.56"dependencies = ["anyhow","chrono",@@ -9212,7 +9212,7 @@ dependencies = [[[package]]name = "screenpipe-events"-version = "0.3.55"+version = "0.3.56"dependencies = ["anyhow","chrono",@@ -9228,7 +9228,7 @@ dependencies = [[[package]]name = "screenpipe-integrations"-version = "0.3.55"+version = "0.3.56"dependencies = ["anyhow","image 0.25.9",@@ -9243,7 +9243,7 @@ dependencies = [[[package]]name = "screenpipe-server"-version = "0.3.55"+version = "0.3.56"dependencies = ["anyhow","async-trait",@@ -9307,7 +9307,7 @@ dependencies = [[[package]]name = "screenpipe-vision"-version = "0.3.55"+version = "0.3.56"dependencies = ["accessibility-sys","anyhow",diff --git a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs b/apps/screenpipe-app-tauri/src-tauri/src/commands.rsindex b7297de58..7eb7b4bed 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs@@ -324,6 +324,17 @@ pub async fn close_window() -> Result<(), String> {// Emit window-hidden event so React components can clean uplet _ = app_handle.emit("window-hidden", ());++ // If closing the main window, also unregister window-specific shortcuts+ // (Escape, search shortcut) so they don't interfere with other apps+ if matches!(window, ShowRewindWindow::Main) {+ let app_clone = app_handle.clone();+ std::thread::spawn(move || {+ std::thread::sleep(std::time::Duration::from_millis(10));+ let _ = unregister_window_shortcuts(app_clone);+ });+ }+window.close(&app_handle).map_err(|e| e.to_string())?;Ok(())}@@ -593,12 +604,13 @@ pub fn register_window_shortcuts(app_handle: tauri::AppHandle) -> Result<(), Strlet global_shortcut = app_handle.global_shortcut();- // Register Escape shortcut to hide the main timeline window+ // Register Escape shortcut — emits event so frontend can decide+ // whether to collapse compact mode or fully close the windowlet escape_shortcut = Shortcut::new(None, Code::Escape);if let Err(e) = global_shortcut.on_shortcut(escape_shortcut, |app, _, event| {if matches!(event.state, ShortcutState::Pressed) {- info!("Escape pressed, hiding main window");- hide_main_window(app);+ info!("Escape pressed, emitting escape-pressed event");+ let _ = app.emit("escape-pressed", ());}}) {// Ignore "already registered" errors - shortcut may already be active