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

fix: restore search highlight, bottom nav, and navigation accuracy for standalone search

Louis Beaumont4ac00ec302ee
diff --git a/apps/screenpipe-app-tauri/app/search/page.tsx b/apps/screenpipe-app-tauri/app/search/page.tsx
index b355c473c..c09ea721f 100644
--- a/apps/screenpipe-app-tauri/app/search/page.tsx
+++ b/apps/screenpipe-app-tauri/app/search/page.tsx
@@ -10,9 +10,9 @@ import { invoke } from "@tauri-apps/api/core";
import { commands } from "@/lib/utils/tauri";
export default function SearchPage() {
- const handleNavigate = useCallback(async (timestamp: string, frameId?: number) => {
+ const handleNavigate = useCallback(async (timestamp: string, frameId?: number, searchTerms?: string[]) => {
// Rust command: shows Main, emits navigation event from app handle, closes Search
- invoke("search_navigate_to_timeline", { timestamp, frameId }).catch(console.error);
+ invoke("search_navigate_to_timeline", { timestamp, frameId, searchTerms }).catch(console.error);
}, []);
const handleClose = useCallback(async () => {
diff --git a/apps/screenpipe-app-tauri/components/rewind/search-modal.tsx b/apps/screenpipe-app-tauri/components/rewind/search-modal.tsx
index 60c8a9055..754490e1d 100644
--- a/apps/screenpipe-app-tauri/components/rewind/search-modal.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/search-modal.tsx
@@ -40,7 +40,7 @@ interface TaggedFrame {
interface SearchModalProps {
isOpen: boolean;
onClose: () => void;
- onNavigateToTimestamp: (timestamp: string, frameId?: number) => void;
+ onNavigateToTimestamp: (timestamp: string, frameId?: number, searchTerms?: string[]) => void;
embedded?: boolean;
/** When true, this is rendered in its own Tauri window (no backdrop, always open) */
standalone?: boolean;
@@ -1045,7 +1045,7 @@ export function SearchModal({ isOpen, onClose, onNavigateToTimestamp, embedded =
// Track which result was selected so timeline arrow keys can cycle from here
const idx = searchResults.findIndex((r) => r.frame_id === result.frame_id);
if (idx >= 0) setCurrentResultIndex(idx);
- onNavigateToTimestamp(result.timestamp, result.frame_id);
+ onNavigateToTimestamp(result.timestamp, result.frame_id, queryTokens);
onClose();
}, [onNavigateToTimestamp, onClose, queryTokens, setHighlight, searchResults, setCurrentResultIndex]);
@@ -1378,7 +1378,7 @@ export function SearchModal({ isOpen, onClose, onNavigateToTimestamp, embedded =
<div
key={frame.frame_id}
onClick={() => {
- onNavigateToTimestamp(frame.timestamp, frame.frame_id);
+ onNavigateToTimestamp(frame.timestamp, frame.frame_id, queryTokens);
if (!embedded) onClose();
}}
className="cursor-pointer rounded overflow-hidden border border-border hover:border-foreground/50 transition-all duration-150"
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
index ec3f67379..0084ffa16 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -910,20 +910,45 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
// a fresh fetch and uses pendingNavigationRef to jump once frames arrive.
useEffect(() => {
let lastHandledTs = "";
- const unlisten = listen<{ timestamp: string; frame_id?: number }>("search-navigate-to-timestamp", (event) => {
+ const unlisten = listen<{ timestamp: string; frame_id?: number; search_terms?: string[] }>("search-navigate-to-timestamp", (event) => {
const timestamp = event.payload.timestamp;
const frameId = event.payload.frame_id;
+ const searchTerms = event.payload.search_terms;
// Deduplicate — Rust emits multiple times to survive mount race
if (timestamp === lastHandledTs) return;
lastHandledTs = timestamp;
+
+ // Set highlight in Main window's store (fixes yellow highlight for standalone search)
+ if (searchTerms && searchTerms.length > 0 && frameId) {
+ setHighlight(searchTerms, frameId);
+ // Kick off a background search to populate Main's keyword search store
+ // (enables bottom nav bar for cycling through results)
+ const query = searchTerms.join(" ");
+ useKeywordSearchStore.getState().searchKeywords(query);
+ }
+
const targetDate = new Date(timestamp);
lastSearchNavRef.current = Date.now();
setSeekingTimestamp(timestamp);
setSearchNavFrame(true);
+
+ // Same-day optimization: use jumpToTime for instant navigation
+ if (isSameDay(targetDate, currentDate)) {
+ pendingNavigationRef.current = targetDate;
+ const hasTargetDayFrames = frames.some(f =>
+ isSameDay(new Date(f.timestamp), targetDate)
+ );
+ if (hasTargetDayFrames) {
+ jumpToTime(targetDate, frameId);
+ pendingNavigationRef.current = null;
+ setSeekingTimestamp(null);
+ return;
+ }
+ }
navigateDirectToDate(targetDate, frameId);
});
return () => { unlisten.then(fn => fn()); };
- }, [navigateDirectToDate]);
+ }, [navigateDirectToDate, currentDate, frames, jumpToTime, setHighlight]);
// The same Timeline component is used in both overlay and window mode.
// The window sizing/decoration is handled by Rust (window_api.rs).
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 3ef750e26..26480f2ed 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9299,7 +9299,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.2.110"
+version = "2.2.111"
dependencies = [
"anyhow",
"arboard",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index c6a3c840a..1632e1089 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.2.111"
+version = "2.2.112"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
index b5a3b69e5..edd113f42 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
@@ -543,6 +543,7 @@ pub async fn search_navigate_to_timeline(
app_handle: tauri::AppHandle,
timestamp: String,
frame_id: Option<i64>,
+ search_terms: Option<Vec<String>>,
) -> Result<(), String> {
// Show the Main timeline
ShowRewindWindow::Main.show(&app_handle).map_err(|e| e.to_string())?;
@@ -554,7 +555,11 @@ pub async fn search_navigate_to_timeline(
tokio::spawn(async move {
for i in 0..5 {
tokio::time::sleep(tokio::time::Duration::from_millis(if i == 0 { 200 } else { 200 })).await;
- let _ = app.emit("search-navigate-to-timestamp", serde_json::json!({ "timestamp": timestamp, "frame_id": frame_id }));
+ let _ = app.emit("search-navigate-to-timestamp", serde_json::json!({
+ "timestamp": timestamp,
+ "frame_id": frame_id,
+ "search_terms": search_terms,
+ }));
}
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
let _ = ShowRewindWindow::Search { query: None }.close(&app);