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

release-app: fix search by app showing blank menu

Louis Beaumontcc3bb3b47ba3
diff --git a/screenpipe-app-tauri/lib/hooks/use-sql-autocomplete.tsx b/screenpipe-app-tauri/lib/hooks/use-sql-autocomplete.tsx
index 7db3de855..754546d69 100644
--- a/screenpipe-app-tauri/lib/hooks/use-sql-autocomplete.tsx
+++ b/screenpipe-app-tauri/lib/hooks/use-sql-autocomplete.tsx
@@ -23,12 +23,14 @@ export function useSqlAutocomplete(type: "app" | "window") {
} else {
const query = `
SELECT ${
- type === "app" ? "ocr.app_name" : "ocr.window_name"
+ type === "app" ? "f.app_name" : "f.window_name"
} as name, COUNT(*) as count
FROM ocr_text ocr
JOIN frames f ON ocr.frame_id = f.id
WHERE f.timestamp > datetime('now', '-7 days')
- GROUP BY ${type === "app" ? "ocr.app_name" : "ocr.window_name"}
+ AND ${type === "app" ? "f.app_name" : "f.window_name"} IS NOT NULL
+ AND ${type === "app" ? "f.app_name" : "f.window_name"} != ''
+ GROUP BY ${type === "app" ? "f.app_name" : "f.window_name"}
ORDER BY count DESC
LIMIT 100
`;