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(ui): keep timeline open when opening chat from search

Louis Beaumont4518f0320df5
diff --git a/screenpipe-app-tauri/components/rewind/search-modal.tsx b/screenpipe-app-tauri/components/rewind/search-modal.tsx
index 8b6343ca2..5538e5337 100644
--- a/screenpipe-app-tauri/components/rewind/search-modal.tsx
+++ b/screenpipe-app-tauri/components/rewind/search-modal.tsx
@@ -105,9 +105,17 @@ export function SearchModal({ isOpen, onClose, onNavigateToTimestamp }: SearchMo
const context = `Context from search result:\n${result.app_name} - ${result.window_name}\nTime: ${format(new Date(result.timestamp), "PPpp")}\n\nText:\n${result.text || ""}`;
+ // Close search modal first
+ onClose();
+
+ // Show chat window (it will overlay on top of timeline, not close it)
await commands.showWindow("Chat");
+
+ // Small delay to ensure chat window's React components are mounted and listening
+ await new Promise(resolve => setTimeout(resolve, 150));
+
+ // Emit prefill event with context and frame image
await emit("chat-prefill", { context, frameId: result.frame_id });
- onClose();
}, [searchResults, selectedIndex, onClose]);
// Keyboard navigation
diff --git a/screenpipe-app-tauri/src-tauri/src/commands.rs b/screenpipe-app-tauri/src-tauri/src/commands.rs
index 763a9e0ca..3950ee29a 100644
--- a/screenpipe-app-tauri/src-tauri/src/commands.rs
+++ b/screenpipe-app-tauri/src-tauri/src/commands.rs
@@ -291,9 +291,12 @@ pub async fn show_window(
app_handle: tauri::AppHandle,
window: ShowRewindWindow,
) -> Result<(), String> {
-
- if window.id().label() != ShowRewindWindow::Main.id().label() {
- ShowRewindWindow::Main.close(&app_handle).map_err(|e| e.to_string())?;
+ // Close Main window when opening other windows, EXCEPT for Chat
+ // Chat is designed to overlay on top of Main (level 1002 vs 1001)
+ if window.id().label() != ShowRewindWindow::Main.id().label()
+ && window.id().label() != ShowRewindWindow::Chat.id().label()
+ {
+ ShowRewindWindow::Main.close(&app_handle).map_err(|e| e.to_string())?;
}
window.show(&app_handle).map_err(|e| e.to_string())?;