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: replace compact overlay with window mode
Louis Beaumonte80602403724
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsxindex f44e51c83..84eb7bb96 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, Maximize2 } from "lucide-react";+import { Loader2, RotateCcw, AlertCircle, X, Sparkles } 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,7 +16,6 @@ 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 {@@ -64,11 +63,6 @@ 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);@@ -478,50 +472,17 @@ 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.+ // Handle Escape: close search modal if open, otherwise close the windowuseEffect(() => {const unlisten = listen("escape-pressed", () => {if (showSearchModal) {- // Let the search modal handle its own closesetShowSearchModal(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);- }+ commands.closeWindow("Main");});return () => { unlisten.then((fn) => fn()); };- }, [isCompactDefault]);+ }, [showSearchModal]);useEffect(() => {const getStartDateAndSet = async () => {@@ -869,146 +830,8 @@ export default function Timeline() {requestAnimationFrame(animate);};- // Compact mode: thin bottom bar with timeline + thumbnail- const isCompact = isCompactDefault && !isExpanded;- const COMPACT_BAR_HEIGHT = 80;-- // Resize the actual window when toggling compact ↔ expanded- useEffect(() => {- if (!isCompactDefault) return; // fullscreen mode — don't touch window size- commands.setOverlayCompact(isCompact, COMPACT_BAR_HEIGHT);- }, [isCompact, isCompactDefault]);-- 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="flex flex-col text-foreground bg-card"- style={{- height: `${COMPACT_BAR_HEIGHT}px`,- WebkitUserSelect: "none",- userSelect: "none",- }}- >- {/* Compact bottom bar — fills the entire small window */}- <div className="flex items-center gap-3 px-4 h-full border-t border-border">- {/* 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>-- {/* 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)- // =====================================================================+ // The same Timeline component is used in both overlay and window mode.+ // The window sizing/decoration is handled by Rust (window_api.rs).return (<TimelineProvider><divdiff --git a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx b/apps/screenpipe-app-tauri/components/settings/general-settings.tsxindex 291565ba9..e23b299b1 100644--- a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx+++ b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx@@ -9,7 +9,7 @@ import { Separator } from "@/components/ui/separator";import { Rocket, Moon, Sun, Monitor, FlaskConical, Shield, ExternalLink, Layers, RefreshCw } from "lucide-react";import { useToast } from "@/components/ui/use-toast";import { Button } from "@/components/ui/button";-import { Settings, OverlayMode } from "@/lib/hooks/use-settings";+import { Settings } from "@/lib/hooks/use-settings";import { open } from "@tauri-apps/plugin-shell";import { UpdateBanner } from "@/components/update-banner";@@ -201,15 +201,14 @@ export default function GeneralSettings() {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.+ Choose how the timeline appears when activated. Requires reopening the timeline to take effect.</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" },+ { value: "fullscreen", label: "Overlay", desc: "Full-screen floating panel" },+ { value: "window", label: "Window", desc: "Normal resizable window" },]).map((option) => {const isActive = (settings?.overlayMode ?? "fullscreen") === option.value;return (diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsxindex 3a9437864..d31ef610c 100644--- a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx+++ b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx@@ -76,8 +76,6 @@ 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;@@ -86,8 +84,6 @@ 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:diff --git a/apps/screenpipe-app-tauri/lib/utils/tauri.ts b/apps/screenpipe-app-tauri/lib/utils/tauri.tsindex 2b10c8ee0..dfcc7fda7 100644--- a/apps/screenpipe-app-tauri/lib/utils/tauri.ts+++ b/apps/screenpipe-app-tauri/lib/utils/tauri.ts@@ -231,19 +231,6 @@ async unregisterWindowShortcuts() : Promise<Result<null, string>> {else return { status: "error", error: e as any };}},-/**- * Resize the main overlay panel to a compact bottom bar or back to fullscreen.- * `compact = true` → thin strip at bottom of current screen.- * `compact = false` → full screen (same as initial overlay).- */-async setOverlayCompact(compact: boolean, barHeight: number) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("set_overlay_compact", { compact, barHeight }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},async setTrayUnhealthIcon() : Promise<void> {await TAURI_INVOKE("set_tray_unhealth_icon");},@@ -619,7 +606,12 @@ enableUiEvents?: boolean;* Auto-install updates and restart when a new version is available.* When disabled, users must click "update now" in the tray menu.*/-autoUpdate?: boolean }+autoUpdate?: boolean;+/**+ * Timeline overlay mode: "fullscreen" (floating panel above everything) or+ * "window" (normal resizable window with title bar).+ */+overlayMode?: string }export type ShowRewindWindow = "Main" | { Settings: { page: string | null } } | { Search: { query: string | null } } | "Onboarding" | "Chat" | "PermissionRecovery"/*** Sync configuration.diff --git a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs b/apps/screenpipe-app-tauri/src-tauri/src/commands.rsindex 26c5b36a6..7f1aacc8b 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs@@ -127,85 +127,6 @@ pub fn is_overlay_click_through(_app_handle: tauri::AppHandle) -> bool {false}-/// Resize the main overlay panel to a compact bottom bar or back to fullscreen.-/// `compact = true` → thin strip at bottom of current screen.-/// `compact = false` → full screen (same as initial overlay).-#[tauri::command]-#[specta::specta]-pub fn set_overlay_compact(app_handle: tauri::AppHandle, compact: bool, bar_height: f64) -> Result<(), String> {- #[cfg(target_os = "macos")]- {- use tauri_nspanel::ManagerExt;- use tauri_nspanel::cocoa::appkit::{NSEvent, NSScreen};- use tauri_nspanel::cocoa::base::{id, nil};- use tauri_nspanel::cocoa::foundation::{NSArray, NSPoint, NSRect};- use objc::{msg_send, sel, sel_impl};-- let label = crate::window_api::RewindWindowId::Main.label();- let panel = app_handle.get_webview_panel(label)- .map_err(|e| format!("no panel: {:?}", e))?;-- app_handle.run_on_main_thread(move || {- unsafe {- let mouse_location: NSPoint = NSEvent::mouseLocation(nil);- let screens: id = NSScreen::screens(nil);- let count: u64 = NSArray::count(screens);-- for i in 0..count {- let screen: id = NSArray::objectAtIndex(screens, i);- let frame: NSRect = NSScreen::frame(screen);- if mouse_location.x >= frame.origin.x- && mouse_location.x < frame.origin.x + frame.size.width- && mouse_location.y >= frame.origin.y- && mouse_location.y < frame.origin.y + frame.size.height- {- let new_frame = if compact {- // Bottom strip: same x, y=screen origin, full width, bar_height- NSRect::new(- NSPoint::new(frame.origin.x, frame.origin.y),- tauri_nspanel::cocoa::foundation::NSSize::new(frame.size.width, bar_height),- )- } else {- // Full screen- frame- };- let _: () = msg_send![&*panel, setFrame:new_frame display:true animate:true];- break;- }- }- }- }).map_err(|e| format!("main thread: {:?}", e))?;- }-- #[cfg(not(target_os = "macos"))]- {- // On Windows/Linux, use Tauri window API- if let Some(window) = app_handle.get_webview_window("main") {- if let Ok(Some(monitor)) = window.current_monitor() {- let scale = monitor.scale_factor();- let size = monitor.size();- let pos = monitor.position();- let logical_w = size.width as f64 / scale;- let logical_h = size.height as f64 / scale;- if compact {- let _ = window.set_size(tauri::LogicalSize::new(logical_w, bar_height));- let _ = window.set_position(tauri::LogicalPosition::new(- pos.x as f64 / scale,- pos.y as f64 / scale + logical_h - bar_height,- ));- } else {- let _ = window.set_size(tauri::LogicalSize::new(logical_w, logical_h));- let _ = window.set_position(tauri::LogicalPosition::new(- pos.x as f64 / scale,- pos.y as f64 / scale,- ));- }- }- }- }-- Ok(())-}#[cfg(target_os = "windows")]const DEFAULT_SHORTCUT: &str = "Alt+S";diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rsindex db573e36b..247b2b7ab 100755--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs@@ -959,7 +959,6 @@ async fn main() {// Window-specific shortcut commands (dynamic registration)commands::register_window_shortcuts,commands::unregister_window_shortcuts,- commands::set_overlay_compact,// Commands from tray.rsset_tray_unhealth_icon,set_tray_health_icon,@@ -1101,11 +1100,10 @@ async fn main() {// Window-specific shortcut commands (dynamic registration)commands::register_window_shortcuts,commands::unregister_window_shortcuts,- // Overlay commands+ // Overlay commands (Windows)commands::enable_overlay_click_through,commands::disable_overlay_click_through,commands::is_overlay_click_through,- commands::set_overlay_compact,get_log_files,get_media_file,upload_file_to_s3,diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rsindex 79412266a..ccd9da08c 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs@@ -207,6 +207,10 @@ pub struct SettingsStore {/// When disabled, users must click "update now" in the tray menu.#[serde(rename = "autoUpdate", default = "default_true")]pub auto_update: bool,+ /// Timeline overlay mode: "fullscreen" (floating panel above everything) or+ /// "window" (normal resizable window with title bar).+ #[serde(rename = "overlayMode", default = "default_overlay_mode")]+ pub overlay_mode: String,}fn generate_device_id() -> String {@@ -217,6 +221,10 @@ fn default_true() -> bool {true}+fn default_overlay_mode() -> String {+ "fullscreen".to_string()+}+#[derive(Serialize, Deserialize, Type,Clone,Default)]pub enum AIProviderType {#[default]@@ -488,6 +496,7 @@ impl Default for SettingsStore {adaptive_fps: false,enable_ui_events: false,auto_update: true,+ overlay_mode: "fullscreen".to_string(),}}}diff --git a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rsindex 129066c2f..f935f2b03 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs@@ -10,7 +10,7 @@ use tracing::{error, info};use tauri_nspanel::WebviewWindowExt;-use crate::{store::OnboardingStore, ServerState};+use crate::{store::{OnboardingStore, SettingsStore}, ServerState};/// Reset activation policy to Regular so dock icon and tray are visible.#[cfg(target_os = "macos")]@@ -469,6 +469,39 @@ impl ShowRewindWindow {return ShowRewindWindow::Onboarding.show(app);}+ // Read overlay mode from settings: "fullscreen" (panel) or "window" (normal)+ let overlay_mode = SettingsStore::get(app)+ .unwrap_or_default()+ .unwrap_or_default()+ .overlay_mode;+ let use_window_mode = overlay_mode == "window";++ if use_window_mode {+ // ============================================================+ // Window mode: normal resizable window with title bar+ // ============================================================+ let builder = self.window_builder(app, "/")+ .title("screenpipe")+ .inner_size(1200.0, 800.0)+ .min_inner_size(800.0, 600.0)+ .decorations(true)+ .visible(true)+ .focused(true)+ .transparent(false);+ #[cfg(target_os = "macos")]+ let builder = builder.hidden_title(false);+ let window = builder.build()?;++ // Emit window-focused so timeline data loads+ let _ = app.emit("window-focused", true);++ return Ok(window);+ }++ // ============================================================+ // Fullscreen overlay mode (default): transparent panel+ // ============================================================+// macOS uses fullscreen transparent panel overlay#[cfg(target_os = "macos")]let window = {