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: live text in embedded timeline, settings close button, timeline crash

Louis Beaumont1e522227e422
diff --git a/Cargo.lock b/Cargo.lock
index ef20fd3de..7461c5e69 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6456,7 +6456,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"anyhow",
"audiopipe",
@@ -6513,7 +6513,7 @@ dependencies = [
[[package]]
name = "screenpipe-connect"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"anyhow",
"async-trait",
@@ -6539,7 +6539,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -6582,7 +6582,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"anyhow",
"chrono",
@@ -6607,7 +6607,7 @@ dependencies = [
[[package]]
name = "screenpipe-engine"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"anyhow",
"async-trait",
@@ -6672,7 +6672,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"anyhow",
"chrono",
@@ -6690,7 +6690,7 @@ dependencies = [
[[package]]
name = "screenpipe-screen"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"accessibility-sys",
"anyhow",
diff --git a/apps/screenpipe-app-tauri/app/settings/page.tsx b/apps/screenpipe-app-tauri/app/settings/page.tsx
index 0756bdff3..261fb397d 100644
--- a/apps/screenpipe-app-tauri/app/settings/page.tsx
+++ b/apps/screenpipe-app-tauri/app/settings/page.tsx
@@ -18,6 +18,7 @@ import {
Users,
Home,
Clock,
+ X,
Gift,
HelpCircle,
UserPlus,
@@ -298,8 +299,14 @@ function SettingsPageContent() {
return (
<div className="min-h-screen bg-background">
- {/* Transparent titlebar area */}
- <div className="h-8 bg-transparent" data-tauri-drag-region></div>
+ {/* Transparent titlebar area with close button */}
+ <div className="h-8 bg-transparent flex items-center" data-tauri-drag-region>
+ <button
+ onClick={() => commands.closeWindow({ Settings: { page: null } })}
+ className="ml-2 w-3 h-3 rounded-full bg-[#ff5f57] hover:bg-[#ff5f57]/80 transition-colors flex-shrink-0"
+ title="close"
+ />
+ </div>
<div className="px-4">
<div className="flex h-[calc(100vh-2rem)] min-h-0">
@@ -572,7 +579,7 @@ function SettingsPageContent() {
{/* Settings modal overlay */}
{settingsModalOpen && (
- <div className="absolute inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm">
+ <div className="absolute inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm" onClick={closeModal}>
<div
className="bg-background border border-border flex w-[960px] max-w-[calc(100%-2rem)] h-[calc(100%-2rem)] overflow-hidden"
onClick={(e) => e.stopPropagation()}
@@ -687,10 +694,16 @@ function SettingsPageContent() {
{/* Modal content */}
<div className="flex-1 flex flex-col min-w-0">
{/* Modal header */}
- <div className="flex items-center px-6 py-3 border-b border-border flex-shrink-0">
+ <div className="flex items-center justify-between px-6 py-3 border-b border-border flex-shrink-0">
<h2 className="text-sm font-medium text-foreground">
{settingsModalSections.find(s => s.id === modalSection)?.label}
</h2>
+ <button
+ onClick={closeModal}
+ className="text-muted-foreground hover:text-foreground transition-colors"
+ >
+ <X className="h-4 w-4" />
+ </button>
</div>
{/* Modal body */}
diff --git a/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
index 4d9caa46e..65b64dd34 100644
--- a/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
@@ -44,6 +44,8 @@ interface CurrentFrameTimelineProps {
adjacentFrames?: StreamTimeSeriesResponse[];
/** Whether the search modal is open — hides native Live Text overlay to avoid blocking input */
isSearchModalOpen?: boolean;
+ /** Whether the timeline is embedded in the settings window */
+ embedded?: boolean;
}
@@ -77,6 +79,7 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
isArrowNav,
adjacentFrames,
isSearchModalOpen,
+ embedded,
}) => {
const { isMac } = usePlatform();
const { settings } = useSettings();
@@ -143,13 +146,14 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
const textPositions = useMemo(() => {
if (ocrTextPositions.length > 0) return ocrTextPositions;
if (!frameContext || contextLoading) return [];
- return frameContext.nodes
- .filter((n) => n.text.trim().length > 0 && n.bounds && n.bounds.width > 0 && n.bounds.height > 0)
- .map((n) => ({
- text: n.text,
- confidence: 1.0,
- bounds: n.bounds!,
- }));
+ const result: typeof ocrTextPositions = [];
+ for (const n of frameContext.nodes) {
+ if (!n.text?.trim() || !n.bounds) continue;
+ const b = n.bounds;
+ if (!b.width || !b.height) continue;
+ result.push({ text: n.text, confidence: 1.0, bounds: b });
+ }
+ return result;
}, [ocrTextPositions, frameContext, contextLoading]);
// URL detection: prefer context URLs, fall back to OCR-extracted URLs
@@ -245,6 +249,14 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
}, [frameContext?.text, textPositions]);
// --- Live Text hook (native macOS VisionKit overlay) ---
+ // Determine which Tauri window/panel to attach Live Text overlay to:
+ // - embedded timeline lives in the "settings" window
+ // - overlay/fullscreen mode uses "main" NSPanel
+ // - window mode uses "main-window" NSPanel
+ const liveTextWindowLabel = embedded
+ ? "settings"
+ : settings?.overlayMode === "window" ? "main-window" : "main";
+
const { nativeLiveTextActive } = useLiveText({
debouncedFrame,
renderedImageInfo,
@@ -256,6 +268,7 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
containerRef,
useVideoMode,
videoRef,
+ windowLabel: liveTextWindowLabel,
});
if (!frameId) {
diff --git a/apps/screenpipe-app-tauri/components/rewind/hooks/use-live-text.ts b/apps/screenpipe-app-tauri/components/rewind/hooks/use-live-text.ts
index 6141e8634..742a95526 100644
--- a/apps/screenpipe-app-tauri/components/rewind/hooks/use-live-text.ts
+++ b/apps/screenpipe-app-tauri/components/rewind/hooks/use-live-text.ts
@@ -16,6 +16,7 @@ export function useLiveText(opts: {
containerRef: React.RefObject<HTMLDivElement | null>;
useVideoMode: boolean;
videoRef: React.RefObject<HTMLVideoElement | null>;
+ windowLabel?: string;
}) {
const {
debouncedFrame,
@@ -25,6 +26,7 @@ export function useLiveText(opts: {
highlightTerms,
highlightDismissed,
isMac,
+ windowLabel: windowLabelProp,
} = opts;
// Native macOS Live Text overlay (VisionKit ImageAnalysisOverlayView)
@@ -38,18 +40,26 @@ export function useLiveText(opts: {
const analyzeFailCountRef = useRef(0);
- // Initialize Live Text overlay once on mount (macOS only)
+ const windowLabel = windowLabelProp ?? "main";
+
+ // Re-initialize Live Text when window label changes (different window/panel)
+ const prevLabelRef = useRef(windowLabel);
+
+ // Initialize Live Text overlay once on mount (macOS only), and re-init on mode change
useEffect(() => {
- if (!isMac || liveTextInitRef.current) return;
+ if (!isMac) return;
+ // If label changed, we need to re-init on the new panel
+ if (liveTextInitRef.current && prevLabelRef.current === windowLabel) return;
+ prevLabelRef.current = windowLabel;
+
let cancelled = false;
(async () => {
try {
const available = await invoke<boolean>("livetext_is_available");
console.log("[livetext] is_available:", available);
if (cancelled || !available) return;
- // Use "main" panel label — the NSPanel the timeline renders in
- await invoke("livetext_init", { windowLabel: "main" });
- console.log("[livetext] init succeeded, native overlay active");
+ await invoke("livetext_init", { windowLabel });
+ console.log("[livetext] init succeeded on panel:", windowLabel);
if (!cancelled) {
liveTextInitRef.current = true;
setNativeLiveTextActive(true);
@@ -59,7 +69,7 @@ export function useLiveText(opts: {
}
})();
return () => { cancelled = true; };
- }, [isMac]);
+ }, [isMac, windowLabel]);
// Analyze frame when frameId changes. Decoupled from renderedImageInfo —
// we start analysis immediately and update position separately when layout is ready.
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
index df497b7de..9b306440d 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -880,6 +880,7 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
<CurrentFrameTimeline
currentFrame={currentFrame}
allDeviceIds={allDeviceIds}
+ embedded={embedded}
searchNavFrame={searchNavFrame}
onSearchNavComplete={() => setSearchNavFrame(false)}
isArrowNav={isArrowNav}
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 527e8acb1..c85ad7a10 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -77,7 +77,7 @@ dependencies = [
"bytestring",
"derive_more 2.1.1",
"encoding_rs",
- "foldhash",
+ "foldhash 0.1.5",
"futures-core",
"http 0.2.12",
"httparse",
@@ -172,7 +172,7 @@ dependencies = [
"cfg-if 1.0.4",
"derive_more 2.1.1",
"encoding_rs",
- "foldhash",
+ "foldhash 0.1.5",
"futures-core",
"futures-util",
"impl-more",
@@ -3438,6 +3438,12 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
+[[package]]
+name = "foldhash"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
+
[[package]]
name = "fontconfig-parser"
version = "0.5.8"
@@ -4224,9 +4230,7 @@ version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
- "allocator-api2",
- "equivalent",
- "foldhash",
+ "foldhash 0.1.5",
]
[[package]]
@@ -4234,6 +4238,11 @@ name = "hashbrown"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
+dependencies = [
+ "allocator-api2",
+ "equivalent",
+ "foldhash 0.2.0",
+]
[[package]]
name = "hashlink"
@@ -5692,11 +5701,11 @@ dependencies = [
[[package]]
name = "lru"
-version = "0.13.0"
+version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "227748d55f2f0ab4735d87fd623798cb6b664512fe979705f829c9f81c934465"
+checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593"
dependencies = [
- "hashbrown 0.15.5",
+ "hashbrown 0.16.1",
]
[[package]]
@@ -9153,7 +9162,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.2.72"
+version = "2.2.74"
dependencies = [
"anyhow",
"arboard",
@@ -9253,7 +9262,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"anyhow",
"audiopipe",
@@ -9305,7 +9314,7 @@ dependencies = [
[[package]]
name = "screenpipe-connect"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"anyhow",
"async-trait",
@@ -9331,7 +9340,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -9373,7 +9382,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"anyhow",
"chrono",
@@ -9398,7 +9407,7 @@ dependencies = [
[[package]]
name = "screenpipe-engine"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"anyhow",
"async-trait",
@@ -9458,7 +9467,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"anyhow",
"chrono",
@@ -9474,7 +9483,7 @@ dependencies = [
[[package]]
name = "screenpipe-screen"
-version = "0.3.176"
+version = "0.3.178"
dependencies = [
"accessibility-sys",
"anyhow",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 08b603414..26b75fbed 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.73"
+version = "2.2.74"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/livetext.rs b/apps/screenpipe-app-tauri/src-tauri/src/livetext.rs
index 9556ddcab..554a90978 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/livetext.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/livetext.rs
@@ -11,6 +11,9 @@ use std::ffi::{CStr, CString};
#[cfg(target_os = "macos")]
use tauri_nspanel::ManagerExt;
+#[cfg(target_os = "macos")]
+use tauri::Manager;
+
use tracing::info;
// ---------- helpers (macOS only) ----------
@@ -58,11 +61,17 @@ pub async fn livetext_init(app: tauri::AppHandle, window_label: String) -> Resul
info!("livetext_init called for window '{}'", window_label);
crate::window_api::run_on_main_thread_safe(&app, move || {
let result = (|| -> Result<(), String> {
- let panel = app_clone
- .get_webview_panel(&window_label)
- .map_err(|e| format!("failed to get panel '{}': {:?}", window_label, e))?;
- // &*panel dereferences to the NSPanel/NSWindow object
- let ns_window_ptr = &*panel as *const _ as *mut std::ffi::c_void as u64;
+ // Try NSPanel first (overlay/window timeline), fall back to regular WebviewWindow (settings)
+ let ns_window_ptr: u64 = if let Ok(panel) = app_clone.get_webview_panel(&window_label) {
+ &*panel as *const _ as *mut std::ffi::c_void as u64
+ } else if let Some(window) = app_clone.get_webview_window(&window_label) {
+ let raw: *mut std::ffi::c_void = window.ns_window()
+ .map_err(|e| format!("failed to get ns_window for '{}': {:?}", window_label, e))?;
+ raw as u64
+ } else {
+ return Err(format!("no panel or window found for '{}'", window_label));
+ };
+
let status = unsafe { livetext_ffi::lt_init(ns_window_ptr) };
if status != 0 {
return Err(format!("lt_init returned error code: {}", status));
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
index 31eaf3af2..59ebba049 100755
--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
@@ -1386,6 +1386,7 @@ async fn main() {
// Settings window on macOS: prevent close but do NOT hide.
// macOS sends spurious CloseRequested during workspace swipes
// and hiding the window makes it disappear when swiping back.
+ // The frontend handles closing via the hide_settings_window command.
#[cfg(target_os = "macos")]
if window.label() == "settings" {
api.prevent_close();