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: vision capture by window, tauri types update

Louis Beaumont8d6fe51a86ab
diff --git a/Cargo.toml b/Cargo.toml
index c99cc6623..d7df4895b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,7 @@ exclude = ["apps/screenpipe-app-tauri/src-tauri"]
resolver = "2"
[workspace.package]
-version = "0.3.62"
+version = "0.3.63"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/screenpipe/screenpipe"
diff --git a/apps/screenpipe-app-tauri/lib/utils/tauri.ts b/apps/screenpipe-app-tauri/lib/utils/tauri.ts
index dfcc7fda7..0dc08dafe 100644
--- a/apps/screenpipe-app-tauri/lib/utils/tauri.ts
+++ b/apps/screenpipe-app-tauri/lib/utils/tauri.ts
@@ -135,6 +135,12 @@ async closeWindow(window: ShowRewindWindow) : Promise<Result<null, string>> {
else return { status: "error", error: e as any };
}
},
+/**
+ * Destroy the Main window/panel so it gets recreated fresh (e.g. after switching overlay mode)
+ */
+async resetMainWindow() : Promise<void> {
+ await TAURI_INVOKE("reset_main_window");
+},
async setWindowSize(window: ShowRewindWindow, width: number, height: number) : Promise<Result<null, string>> {
try {
return { status: "ok", data: await TAURI_INVOKE("set_window_size", { window, width, height }) };
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 2e52c1cfb..689e6e087 100755
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9007,7 +9007,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.0.268"
+version = "2.0.269"
dependencies = [
"anyhow",
"async-stream",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 458e51fb1..ec3b086a1 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.0.268"
+version = "2.0.269"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/crates/screenpipe-vision/src/capture_screenshot_by_window.rs b/crates/screenpipe-vision/src/capture_screenshot_by_window.rs
index 996f5a106..68c26cbfa 100644
--- a/crates/screenpipe-vision/src/capture_screenshot_by_window.rs
+++ b/crates/screenpipe-vision/src/capture_screenshot_by_window.rs
@@ -1002,4 +1002,52 @@ mod tests {
// Current implementation lowercases but doesn't trim
assert!(!filters.is_url_blocked("https://wellsfargo.com"));
}
+
+ // ==================== is_valid focus + overlay filtering tests ====================
+
+ #[test]
+ fn test_is_valid_focused_normal_window() {
+ let filters = WindowFilters::new(&[], &[], &[]);
+ // Normal focused window (not screenpipe, not skipped) should be valid
+ assert!(filters.is_valid("Arc", "GitHub"));
+ }
+
+ #[test]
+ fn test_is_valid_rejects_screenpipe_ui() {
+ let filters = WindowFilters::new(&[], &[], &[]);
+ assert!(!filters.is_valid("screenpipe", "Main Window"));
+ assert!(!filters.is_valid("Screenpipe App", "Settings"));
+ }
+
+ #[test]
+ fn test_is_valid_rejects_ignored_window() {
+ let filters = WindowFilters::new(
+ &["wispr flow".to_string()],
+ &[],
+ &[],
+ );
+ // "Wispr Flow" app should be rejected by ignore list (case-insensitive contains)
+ assert!(!filters.is_valid("Wispr Flow", "Status"));
+ assert!(!filters.is_valid("Wispr Flow", "Hub"));
+ // Other apps should still be valid
+ assert!(filters.is_valid("Arc", "GitHub"));
+ }
+
+ #[test]
+ fn test_is_valid_overlay_app_in_ignore_list() {
+ // Typical user config: ignoring overlay apps
+ let filters = WindowFilters::new(
+ &["wispr".to_string(), "bartender".to_string()],
+ &[],
+ &[],
+ );
+ assert!(!filters.is_valid("Wispr Flow", "Status"));
+ assert!(!filters.is_valid("Bartender 4", "Menu"));
+ assert!(filters.is_valid("Arc", "Gmail"));
+ }
+
+ // Note: The overlay_pids CGWindowLayer detection in capture_all_visible_windows
+ // is macOS-only and requires actual system calls, so it can only be tested
+ // as an integration test on macOS. The unit tests above verify the filter
+ // logic that works in conjunction with overlay detection.
}