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(search): listen for Rust open-search event for Cmd+K

Louis Beaumont43b29a23beec
diff --git a/screenpipe-app-tauri/components/global-chat.tsx b/screenpipe-app-tauri/components/global-chat.tsx
index 8ffc33d92..02ae43116 100644
--- a/screenpipe-app-tauri/components/global-chat.tsx
+++ b/screenpipe-app-tauri/components/global-chat.tsx
@@ -31,6 +31,10 @@ import { UpgradeDialog } from "@/components/upgrade-dialog";
const SCREENPIPE_API = "http://localhost:3030";
+// Default chat shortcut - matches store.rs defaults
+const DEFAULT_CHAT_SHORTCUT_MAC = "Control+Super+L";
+const DEFAULT_CHAT_SHORTCUT_OTHER = "Alt+L";
+
// ============================================================================
// SHORTCUT FORMATTING - Consistent modifier ordering (⌘ → ⌃ → ⌥ → ⇧ → key)
// ============================================================================
diff --git a/screenpipe-app-tauri/components/rewind/timeline.tsx b/screenpipe-app-tauri/components/rewind/timeline.tsx
index e09de9cf4..c4ffe2ee5 100644
--- a/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -258,15 +258,26 @@ export default function Timeline() {
posthog.capture("timeline_opened");
}, []);
- // Keyboard shortcut for search modal (/ or Cmd+K)
+ // Listen for open-search event from Rust (Cmd+K global shortcut)
+ useEffect(() => {
+ const unlisten = listen("open-search", () => {
+ if (!showSearchModal) {
+ setShowSearchModal(true);
+ }
+ });
+
+ return () => {
+ unlisten.then((fn) => fn());
+ };
+ }, [showSearchModal]);
+
+ // Also listen for "/" key (not intercepted by Rust)
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
- // Don't trigger if already in an input or modal is open
if (showSearchModal) return;
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
- // / key or Cmd+K - open search modal
- if (e.key === "/" || (e.key === "k" && (e.metaKey || e.ctrlKey))) {
+ if (e.key === "/") {
e.preventDefault();
setShowSearchModal(true);
}