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: improve shortcuts UI, chat window, and fix timeline navigation
Louis Beaumont02dd997b6141
diff --git a/screenpipe-app-tauri/app/search/page.tsx b/screenpipe-app-tauri/app/search/page.tsxindex f5ebb408d..925e6e1fa 100644--- a/screenpipe-app-tauri/app/search/page.tsx+++ b/screenpipe-app-tauri/app/search/page.tsx@@ -85,6 +85,7 @@ function SearchPage() {query,}));}}+ autoFocus/><DatePickerWithRangestart_time={querys.start_time}diff --git a/screenpipe-app-tauri/app/shortcut-reminder/layout.tsx b/screenpipe-app-tauri/app/shortcut-reminder/layout.tsxindex 81fd0c574..cd0700cbe 100644--- a/screenpipe-app-tauri/app/shortcut-reminder/layout.tsx+++ b/screenpipe-app-tauri/app/shortcut-reminder/layout.tsx@@ -9,6 +9,7 @@ export default function ShortcutReminderLayout({<html lang="en" style={{ background: "transparent" }}><head><style>{`+ @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap');*, *::before, *::after {box-sizing: border-box;}@@ -22,7 +23,7 @@ export default function ShortcutReminderLayout({width: 100%;}body {- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;+ font-family: "IBM Plex Mono", monospace;}`}</style></head>diff --git a/screenpipe-app-tauri/app/shortcut-reminder/page.tsx b/screenpipe-app-tauri/app/shortcut-reminder/page.tsxindex 63014fa6d..530163006 100644--- a/screenpipe-app-tauri/app/shortcut-reminder/page.tsx+++ b/screenpipe-app-tauri/app/shortcut-reminder/page.tsx@@ -9,45 +9,62 @@ import { getStore } from "@/lib/hooks/use-settings";export default function ShortcutReminderPage() {const { isMac, isLoading } = usePlatform();- const [shortcut, setShortcut] = useState<string | null>(null);- const [rawShortcut, setRawShortcut] = useState<string | null>(null);+ const [overlayShortcut, setOverlayShortcut] = useState<string | null>(null);+ const [chatShortcut, setChatShortcut] = useState<string | null>(null);- // Load shortcut from store on mount+ // Load shortcuts from store on mountuseEffect(() => {- const loadShortcutFromStore = async () => {+ const loadShortcutsFromStore = async () => {try {const store = await getStore();- const settings = await store.get<{ showScreenpipeShortcut?: string }>("settings");+ const settings = await store.get<{+ showScreenpipeShortcut?: string;+ showChatShortcut?: string;+ }>("settings");if (settings?.showScreenpipeShortcut) {- setRawShortcut(settings.showScreenpipeShortcut);+ setOverlayShortcut(formatShortcut(settings.showScreenpipeShortcut, isMac));+ }+ if (settings?.showChatShortcut) {+ setChatShortcut(formatShortcut(settings.showChatShortcut, isMac));}} catch (e) {- console.error("Failed to load shortcut from store:", e);+ console.error("Failed to load shortcuts from store:", e);}};- loadShortcutFromStore();- }, []);-- // Set default shortcut once platform is detected (fallback if store fails)- useEffect(() => {- if (!isLoading && shortcut === null && rawShortcut === null) {- // Default matches Super+Alt+S from settings- setShortcut(isMac ? "⌘⌥S" : "Win+Alt+S");+ if (!isLoading) {+ loadShortcutsFromStore();}- }, [isMac, isLoading, shortcut, rawShortcut]);+ }, [isLoading, isMac]);- // Re-format shortcut when platform is detected or rawShortcut changes+ // Set default shortcuts once platform is detected (fallback if store fails)useEffect(() => {- if (!isLoading && rawShortcut) {- setShortcut(formatShortcut(rawShortcut, isMac));+ if (!isLoading && overlayShortcut === null) {+ setOverlayShortcut(isMac ? "⌘⌥S" : "Win+Alt+S");+ }+ if (!isLoading && chatShortcut === null) {+ setChatShortcut(isMac ? "⌘⌥L" : "Win+Alt+L");}- }, [isMac, isLoading, rawShortcut]);+ }, [isMac, isLoading, overlayShortcut, chatShortcut]);useEffect(() => {- const unlistenShortcut = listen<string>("shortcut-reminder-update", (event) => {- setRawShortcut(event.payload);+ // Listen for shortcut updates and reload both from store+ const unlistenShortcut = listen<string>("shortcut-reminder-update", async () => {if (!isLoading) {- setShortcut(formatShortcut(event.payload, isMac));+ try {+ const store = await getStore();+ const settings = await store.get<{+ showScreenpipeShortcut?: string;+ showChatShortcut?: string;+ }>("settings");+ if (settings?.showScreenpipeShortcut) {+ setOverlayShortcut(formatShortcut(settings.showScreenpipeShortcut, isMac));+ }+ if (settings?.showChatShortcut) {+ setChatShortcut(formatShortcut(settings.showChatShortcut, isMac));+ }+ } catch (e) {+ console.error("Failed to reload shortcuts:", e);+ }}});@@ -59,7 +76,6 @@ export default function ShortcutReminderPage() {}, [isMac, isLoading]);// Use Tauri's native startDragging for window movement- // Note: This may cause Space switching on macOS fullscreen - fix needs to be at native levelconst handleMouseDown = useCallback(async (e: React.MouseEvent) => {if (e.button === 0) {try {@@ -80,26 +96,45 @@ export default function ShortcutReminderPage() {className="select-none"style={{ cursor: "grab" }}>- <div className="relative">- {/* Main pill */}- <div- className="relative flex items-center gap-1.5 py-1 px-2.5 bg-neutral-900 rounded-full border border-white/10 shadow-lg"- >- {/* Pulsing dot */}- <span className="relative flex h-1 w-1 flex-shrink-0">- <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-pink-400 opacity-75" />- <span className="relative inline-flex rounded-full h-1 w-1 bg-pink-500" />- </span>-- {/* Shortcut */}- <span- className="font-mono text-[10px] font-semibold text-white/90 tracking-wide"+ {/* Brand-aligned: black bg, white text, sharp corners, no shadows */}+ <div+ className="flex items-center gap-0 border border-white/20"+ style={{ background: "#000" }}+ >+ {/* Overlay shortcut */}+ <div className="flex items-center gap-1.5 px-2 py-1 border-r border-white/20">+ <svg+ width="10"+ height="10"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ className="text-white/60">- {shortcut ?? "..."}+ <rect x="3" y="3" width="18" height="18" />+ <line x1="3" y1="9" x2="21" y2="9" />+ </svg>+ <span className="font-mono text-[10px] font-medium text-white tracking-wider">+ {overlayShortcut ?? "..."}</span>+ </div>- <span className="text-[9px] text-white/50 whitespace-nowrap">- screenpipe+ {/* Chat shortcut */}+ <div className="flex items-center gap-1.5 px-2 py-1">+ <svg+ width="10"+ height="10"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ className="text-white/60"+ >+ <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" />+ </svg>+ <span className="font-mono text-[10px] font-medium text-white tracking-wider">+ {chatShortcut ?? "..."}</span></div></div>diff --git a/screenpipe-app-tauri/components/rewind/search-bar.tsx b/screenpipe-app-tauri/components/rewind/search-bar.tsxindex d6a0ddb2f..85de0c871 100644--- a/screenpipe-app-tauri/components/rewind/search-bar.tsx+++ b/screenpipe-app-tauri/components/rewind/search-bar.tsx@@ -1,18 +1,34 @@import { Search } from "lucide-react";import { Input } from "./ui/input";+import { useEffect, useRef } from "react";export const SearchBar = ({search,onSearchChange,disabled,+ autoFocus = false,}: {search: string | null;onSearchChange: (value: string) => void;disabled?: boolean;+ autoFocus?: boolean;}) => {+ const inputRef = useRef<HTMLInputElement>(null);++ useEffect(() => {+ if (autoFocus && inputRef.current) {+ // Small delay to ensure the component is mounted and visible+ const timer = setTimeout(() => {+ inputRef.current?.focus();+ }, 100);+ return () => clearTimeout(timer);+ }+ }, [autoFocus]);+return (<div className="relative w-full"><Input+ ref={inputRef}type="input"placeholder="Search..."className="pl-10 h-full bg-card border border-border rounded-lg shadow-sm transition-all duration-200 focus:shadow-md"@@ -21,6 +37,7 @@ export const SearchBar = ({onSearchChange(e.target.value);}}disabled={disabled}+ autoFocus={autoFocus}/><Search className="absolute left-3 top-1/2 transform -translate-y-1/2 text-neutral-400 w-5 h-5" /></div>diff --git a/screenpipe-app-tauri/components/rewind/timeline.tsx b/screenpipe-app-tauri/components/rewind/timeline.tsxindex fcd5d89a5..7e340983d 100644--- a/screenpipe-app-tauri/components/rewind/timeline.tsx+++ b/screenpipe-app-tauri/components/rewind/timeline.tsx@@ -280,8 +280,12 @@ export default function Timeline() {const checkIfThereAreFrames = async () => {const checkFramesForDate = await hasFramesForDate(currentDateEffect);console.log("checkFramesForDate", currentDateEffect, checkFramesForDate);- if (!checkFramesForDate) {+ // Only auto-navigate to previous day if NOT during intentional navigation+ // (e.g., user clicking day arrows). During navigation, handleDateChange+ // already handles finding dates with frames.+ if (!checkFramesForDate && !isNavigatingRef.current) {setCurrentDate(subDays(currentDateEffect, 1));+ return; // Don't fetch frames for a date we're leaving}const startTime = new Date(currentDateEffect);diff --git a/screenpipe-app-tauri/components/settings/shortcut-row.tsx b/screenpipe-app-tauri/components/settings/shortcut-row.tsxindex 04a7efac5..822e3ff72 100644--- a/screenpipe-app-tauri/components/settings/shortcut-row.tsx+++ b/screenpipe-app-tauri/components/settings/shortcut-row.tsx@@ -90,6 +90,7 @@ const ShortcutRow = ({stopRecordingShortcut: string;startAudioShortcut: string;stopAudioShortcut: string;+ showChatShortcut: string;}) => {console.log("syncing shortcuts:", {showShortcut: updatedShortcuts.showScreenpipeShortcut,@@ -97,9 +98,11 @@ const ShortcutRow = ({stopShortcut: updatedShortcuts.stopRecordingShortcut,startAudioShortcut: updatedShortcuts.startAudioShortcut,stopAudioShortcut: updatedShortcuts.stopAudioShortcut,+ showChatShortcut: updatedShortcuts.showChatShortcut,});- // wait 1 second+ // wait 1 second for settings to persistawait new Promise((resolve) => setTimeout(resolve, 1000));+ // updateGlobalShortcuts re-reads all shortcuts from store including showChatShortcutawait commands.updateGlobalShortcuts(updatedShortcuts.showScreenpipeShortcut,updatedShortcuts.startRecordingShortcut,@@ -136,13 +139,14 @@ const ShortcutRow = ({stopRecordingShortcut: shortcut === "stopRecordingShortcut" ? keys : settings.stopRecordingShortcut,startAudioShortcut: shortcut === "startAudioShortcut" ? keys : settings.startAudioShortcut,stopAudioShortcut: shortcut === "stopAudioShortcut" ? keys : settings.stopAudioShortcut,+ showChatShortcut: shortcut === "showChatShortcut" ? keys : settings.showChatShortcut,};await syncShortcuts(updatedShortcuts);- // Update the shortcut reminder overlay if this is the show shortcut- if (shortcut === "showScreenpipeShortcut") {+ // Update the shortcut reminder overlay if either show shortcut changed+ if (shortcut === "showScreenpipeShortcut" || shortcut === "showChatShortcut") {try {- await invoke("show_shortcut_reminder", { shortcut: keys });+ await invoke("show_shortcut_reminder", { shortcut: updatedShortcuts.showScreenpipeShortcut });} catch (e) {// Window may not exist, that's ok}@@ -179,6 +183,7 @@ const ShortcutRow = ({stopRecordingShortcut: settings.stopRecordingShortcut,startAudioShortcut: settings.startAudioShortcut,stopAudioShortcut: settings.stopAudioShortcut,+ showChatShortcut: settings.showChatShortcut,});};diff --git a/screenpipe-app-tauri/components/settings/shortcut-section.tsx b/screenpipe-app-tauri/components/settings/shortcut-section.tsxindex e6c307873..0d37ffabf 100644--- a/screenpipe-app-tauri/components/settings/shortcut-section.tsx+++ b/screenpipe-app-tauri/components/settings/shortcut-section.tsx@@ -61,6 +61,14 @@ const ShortcutSection = () => {value={settings.stopAudioShortcut}/>+ <ShortcutRow+ type="global"+ shortcut="showChatShortcut"+ title="toggle ai chat"+ description="global shortcut to show/hide the ai chat window"+ value={settings.showChatShortcut}+ />+<div className="flex items-center justify-between py-4 border-t"><div className="space-y-1"><Label htmlFor="shortcut-overlay" className="text-base font-medium">diff --git a/screenpipe-app-tauri/components/standalone-chat.tsx b/screenpipe-app-tauri/components/standalone-chat.tsxindex fb059d71d..d59e12082 100644--- a/screenpipe-app-tauri/components/standalone-chat.tsx+++ b/screenpipe-app-tauri/components/standalone-chat.tsx@@ -19,6 +19,7 @@ import remarkGfm from "remark-gfm";import OpenAI from "openai";import { ChatCompletionTool } from "openai/resources/chat/completions";import { open as openUrl } from "@tauri-apps/plugin-shell";+import { getCurrentWindow } from "@tauri-apps/api/window";import { usePlatform } from "@/lib/hooks/use-platform";import { useSqlAutocomplete } from "@/lib/hooks/use-sql-autocomplete";import { commands } from "@/lib/utils/tauri";@@ -694,8 +695,19 @@ export function StandaloneChat() {return (<div className="flex flex-col h-screen bg-background">- {/* Header */}- <div className="relative flex items-center gap-3 px-4 py-3 border-b border-border/50 bg-gradient-to-r from-background to-muted/30">+ {/* Header - draggable */}+ <div+ className="relative flex items-center gap-3 px-4 py-3 border-b border-border/50 bg-gradient-to-r from-background to-muted/30 cursor-grab active:cursor-grabbing"+ onMouseDown={async (e) => {+ if (e.button === 0) {+ try {+ await getCurrentWindow().startDragging();+ } catch {+ // Ignore drag errors+ }+ }+ }}+ ><div className="absolute top-0 left-0 w-8 h-8 border-l-2 border-t-2 border-foreground/10 rounded-tl-lg" /><div className="relative z-10 p-1.5 rounded-lg bg-foreground/5 border border-border/50"><PipeAIIcon size={18} animated={false} className="text-foreground" />diff --git a/screenpipe-app-tauri/lib/actions/has-frames-date.ts b/screenpipe-app-tauri/lib/actions/has-frames-date.tsindex b191903e3..e7a032d20 100644--- a/screenpipe-app-tauri/lib/actions/has-frames-date.ts+++ b/screenpipe-app-tauri/lib/actions/has-frames-date.ts@@ -1,6 +1,6 @@import { isSameDay } from "date-fns";-export async function hasFramesForDate(date: Date) {+export async function hasFramesForDate(date: Date): Promise<boolean> {try {// Set up start and end of the dayconst startOfDay = new Date(date);@@ -30,19 +30,17 @@ export async function hasFramesForDate(date: Date) {});if (!response.ok) {- return {- error: "Error occurred while checking frames",- details: await response.json(),- };+ console.error("Error checking frames for date:", await response.text());+ // Return false on error - let navigation proceed to try the date+ return false;}const result = await response.json();- console.log("result", result);+ console.log("hasFramesForDate result:", date.toISOString(), result);return result[0]?.frame_count > 0;} catch (e) {- return {- error: "Error occurred while checking frames",- details: e,- };+ console.error("Error checking frames for date:", e);+ // Return false on error - let navigation proceed to try the date+ return false;}}diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lockindex 62e3e5d44..b8bd45f58 100755--- a/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -5629,7 +5629,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"[[package]]name = "screenpipe-app"-version = "2.0.102"+version = "2.0.103"dependencies = ["anyhow","async-stream",diff --git a/screenpipe-app-tauri/src-tauri/src/commands.rs b/screenpipe-app-tauri/src-tauri/src/commands.rsindex 97924ba6e..863e25bc3 100644--- a/screenpipe-app-tauri/src-tauri/src/commands.rs+++ b/screenpipe-app-tauri/src-tauri/src/commands.rs@@ -432,9 +432,9 @@ pub async fn show_shortcut_reminder(let screen_size = monitor.size();let scale_factor = monitor.scale_factor();- // Compact window dimensions- let window_width = 180.0;- let window_height = 28.0;+ // Window dimensions for dual-shortcut display+ let window_width = 220.0;+ let window_height = 24.0;// Position at top center of screenlet x = ((screen_size.width as f64 / scale_factor) - window_width) / 2.0;@@ -534,7 +534,7 @@ pub async fn show_shortcut_reminder(if let Ok(Some(monitor)) = app_handle_clone.primary_monitor() {let screen_size = monitor.size();let scale_factor = monitor.scale_factor();- let new_x = ((screen_size.width as f64 / scale_factor) - 180.0) / 2.0;+ let new_x = ((screen_size.width as f64 / scale_factor) - 220.0) / 2.0;let new_y = 12.0;if let Some(window) = app_handle_clone.get_webview_window("shortcut-reminder") {diff --git a/screenpipe-app-tauri/src-tauri/src/window_api.rs b/screenpipe-app-tauri/src-tauri/src/window_api.rsindex 980f389fe..8881d787f 100644--- a/screenpipe-app-tauri/src-tauri/src/window_api.rs+++ b/screenpipe-app-tauri/src-tauri/src/window_api.rs@@ -394,7 +394,39 @@ impl ShowRewindWindow {return Ok(window);}-+ // Chat window needs panel behavior on macOS to show above fullscreen+ if id.label() == RewindWindowId::Chat.label() {+ #[cfg(target_os = "macos")]+ {+ let _ = app.set_activation_policy(tauri::ActivationPolicy::Accessory);++ let app_clone = app.clone();+ app.run_on_main_thread(move || {+ use tauri_nspanel::cocoa::appkit::NSWindowCollectionBehavior;+ use objc::{msg_send, sel, sel_impl};++ if let Ok(panel) = app_clone.get_webview_panel(RewindWindowId::Chat.label()) {+ panel.set_level(1001);+ // Enable dragging by clicking anywhere on the window background+ let _: () = unsafe { msg_send![&*panel, setMovableByWindowBackground: true] };+ panel.set_collection_behaviour(+ NSWindowCollectionBehavior::NSWindowCollectionBehaviorCanJoinAllSpaces |+ NSWindowCollectionBehavior::NSWindowCollectionBehaviorFullScreenAuxiliary+ );+ panel.order_front_regardless();+ }+ }).ok();++ return Ok(window);+ }++ #[cfg(not(target_os = "macos"))]+ {+ window.show().ok();+ return Ok(window);+ }+ }+info!("showing window: {:?}", id.label());window.show().ok();@@ -659,14 +691,60 @@ impl ShowRewindWindow {window}ShowRewindWindow::Chat => {- let builder = self.window_builder(app, "/chat")- .inner_size(500.0, 650.0)- .min_inner_size(400.0, 500.0)- .focused(true)- .always_on_top(true);+ // macOS: use NSPanel for fullscreen support#[cfg(target_os = "macos")]- let builder = builder.hidden_title(true);- let window = builder.build()?;+ let window = {+ // Set Accessory policy so panel can appear above fullscreen apps+ let _ = app.set_activation_policy(tauri::ActivationPolicy::Accessory);++ let builder = self.window_builder(app, "/chat")+ .inner_size(500.0, 650.0)+ .min_inner_size(400.0, 500.0)+ .focused(true)+ .always_on_top(true)+ .visible_on_all_workspaces(true)+ .hidden_title(true);+ let window = builder.build()?;++ // Convert to panel for fullscreen support+ if let Ok(_panel) = window.to_panel() {+ info!("Successfully converted chat window to panel");++ let window_clone = window.clone();+ app.run_on_main_thread(move || {+ use tauri_nspanel::cocoa::appkit::NSWindowCollectionBehavior;+ use objc::{msg_send, sel, sel_impl};++ if let Ok(panel) = window_clone.to_panel() {+ // Level 1001 = above CGShieldingWindowLevel, shows over fullscreen+ panel.set_level(1001);++ // Enable dragging by clicking anywhere on the window background+ let _: () = unsafe { msg_send![&*panel, setMovableByWindowBackground: true] };++ panel.set_collection_behaviour(+ NSWindowCollectionBehavior::NSWindowCollectionBehaviorCanJoinAllSpaces |+ NSWindowCollectionBehavior::NSWindowCollectionBehaviorFullScreenAuxiliary+ );++ panel.order_front_regardless();+ }+ }).ok();+ }++ window+ };++ #[cfg(not(target_os = "macos"))]+ let window = {+ let builder = self.window_builder(app, "/chat")+ .inner_size(500.0, 650.0)+ .min_inner_size(400.0, 500.0)+ .focused(true)+ .always_on_top(true);+ builder.build()?+ };+window}ShowRewindWindow::PermissionRecovery => {