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 timeline ui

Louis Beaumont041ac02f2325
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 319c82225..93d5b84e2 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -61,7 +61,7 @@ jobs:
args: "--features mkl" # TODO CUDA
tauri-args: ""
- platform: "windows-latest" # Windows x86_64
- args: "--target x86_64-pc-windows-msvc --features mkl" # TODO CUDA --features "openblas"
+ args: "--target x86_64-pc-windows-msvc" # TODO CUDA --features mkl --features "openblas"
pre-build-args: "" # --openblas
tauri-args: "--target x86_64-pc-windows-msvc"
@@ -140,10 +140,10 @@ jobs:
run: |
brew install ffmpeg pkg-config
- - name: Install MKL
- if: matrix.platform == 'windows-latest'
- run: |
- pip install mkl mkl-devel mkl-static
+ # - name: Install MKL
+ # if: matrix.platform == 'windows-latest'
+ # run: |
+ # pip install mkl mkl-devel mkl-static
- name: Install MKL in Linux
if: matrix.platform == 'ubuntu-22.04'
diff --git a/screenpipe-actions/Cargo.toml b/screenpipe-actions/Cargo.toml
index 43c237099..b486870cf 100644
--- a/screenpipe-actions/Cargo.toml
+++ b/screenpipe-actions/Cargo.toml
@@ -22,7 +22,6 @@ serde_json = "1.0"
tokio = { version = "1.26", features = ["full"] }
rdev = "0.5.3"
enigo = "0.1.3"
-tempfile = "3.2"
serde = { version = "1.0", features = ["derive"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
\ No newline at end of file
diff --git a/screenpipe-app-tauri/app/timeline/page.tsx b/screenpipe-app-tauri/app/timeline/page.tsx
index 69f5cded4..1a2f8d9a8 100644
--- a/screenpipe-app-tauri/app/timeline/page.tsx
+++ b/screenpipe-app-tauri/app/timeline/page.tsx
@@ -1,5 +1,5 @@
"use client";
-import { useEffect, useState, useRef, WheelEvent } from "react";
+import { useEffect, useState, useRef } from "react";
interface StreamFramesResponse {
frame: string;
@@ -95,6 +95,13 @@ export default function Timeline() {
useEffect(() => {
setupEventSource();
+ // Update the type annotation to use the DOM's WheelEvent
+ const preventScroll = (e: globalThis.WheelEvent) => {
+ e.preventDefault();
+ };
+
+ document.addEventListener("wheel", preventScroll, { passive: false });
+
return () => {
if (eventSourceRef.current) {
eventSourceRef.current.close();
@@ -102,10 +109,11 @@ export default function Timeline() {
if (retryTimeoutRef.current) {
clearTimeout(retryTimeoutRef.current);
}
+ document.removeEventListener("wheel", preventScroll);
};
}, []);
- const handleScroll = (e: WheelEvent) => {
+ const handleScroll = (e: React.WheelEvent<HTMLDivElement>) => {
e.preventDefault();
e.stopPropagation();
@@ -125,7 +133,10 @@ export default function Timeline() {
<div
className="fixed inset-0 flex flex-col bg-black text-white overflow-hidden font-['Press_Start_2P'] relative"
onWheel={handleScroll}
- style={{ height: "100vh" }}
+ style={{
+ height: "100vh",
+ overscrollBehavior: "none", // Prevent bounce/overscroll effects
+ }}
>
{/* Scanline effect overlay */}
<div
diff --git a/screenpipe-app-tauri/components/recording-settings.tsx b/screenpipe-app-tauri/components/recording-settings.tsx
index 4a2504ed6..3eca31315 100644
--- a/screenpipe-app-tauri/components/recording-settings.tsx
+++ b/screenpipe-app-tauri/components/recording-settings.tsx
@@ -260,14 +260,14 @@ export function RecordingSettings({
await new Promise((resolve) => setTimeout(resolve, 2000));
toast({
- title: "Settings updated successfully",
- description: "Screenpipe has been restarted with new settings.",
+ title: "settings updated successfully",
+ description: "screenpipe has been restarted with new settings.",
});
} catch (error) {
- console.error("Failed to update settings:", error);
+ console.error("failed to update settings:", error);
toast({
- title: "Error updating settings",
- description: "Please try again or check the logs for more information.",
+ title: "error updating settings",
+ description: "please try again or check the logs for more information.",
variant: "destructive",
});
} finally {
@@ -546,6 +546,17 @@ export function RecordingSettings({
}
};
+ const handleFrameCacheToggle = (checked: boolean) => {
+ setLocalSettings({
+ ...localSettings,
+ enableFrameCache: checked,
+ });
+ };
+
+ const handleShowTimeline = async () => {
+ await invoke("show_timeline");
+ };
+
return (
<>
<div className="relative">
@@ -1334,6 +1345,48 @@ export function RecordingSettings({
</Label>
</div>
)}
+ <div className="flex flex-col space-y-2">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center space-x-2">
+ <Switch
+ id="frame-cache-toggle"
+ checked={localSettings.enableFrameCache}
+ onCheckedChange={handleFrameCacheToggle}
+ />
+ <Label
+ htmlFor="frame-cache-toggle"
+ className="flex items-center space-x-2"
+ >
+ <span>enable timeline UI</span>
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger>
+ <HelpCircle className="h-4 w-4 cursor-default" />
+ </TooltipTrigger>
+ <TooltipContent side="right">
+ <p>
+ experimental feature that provides a timeline UI
+ (like rewind.ai).
+ <br />
+ may increase CPU usage and memory consumption.
+ </p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </Label>
+ </div>
+ {localSettings.enableFrameCache && (
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={handleShowTimeline}
+ className="ml-2"
+ >
+ show timeline
+ </Button>
+ )}
+ </div>
+ </div>
</CardContent>
</Card>
</div>
diff --git a/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index 6222f91a3..66f72d9d6 100644
--- a/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -54,6 +54,7 @@ export interface Settings {
enableBeta: boolean;
showScreenpipeShortcut: string;
isFirstTimeUser: boolean;
+ enableFrameCache: boolean; // Add this line
}
const defaultSettings: Settings = {
@@ -99,6 +100,7 @@ const defaultSettings: Settings = {
enableBeta: false,
showScreenpipeShortcut: "Super+Alt+S",
isFirstTimeUser: true,
+ enableFrameCache: false, // Add this line
};
let store: Awaited<ReturnType<typeof createStore>> | null = null;
@@ -282,6 +284,9 @@ export function useSettings() {
const savedAiProviderType =
(await store!.get<AIProviderType>("aiProviderType")) || "openai";
+ const savedEnableFrameCache =
+ (await store!.get<boolean>("enableFrameCache")) || false;
+
setSettings({
openaiApiKey: savedKey,
deepgramApiKey: savedDeepgramKey,
@@ -315,6 +320,7 @@ export function useSettings() {
enableBeta: savedEnableBeta,
showScreenpipeShortcut: savedShowScreenpipeShortcut,
isFirstTimeUser: savedIsFirstTimeUser,
+ enableFrameCache: savedEnableFrameCache,
});
} catch (error) {
console.error("failed to load settings:", error);
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index 6ae6a2023..9b04d5257 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "0.7.8"
+version = "0.7.9"
description = ""
authors = ["you"]
license = ""
diff --git a/screenpipe-app-tauri/src-tauri/src/commands.rs b/screenpipe-app-tauri/src-tauri/src/commands.rs
index cdf1646a0..22a8276ee 100644
--- a/screenpipe-app-tauri/src-tauri/src/commands.rs
+++ b/screenpipe-app-tauri/src-tauri/src/commands.rs
@@ -127,7 +127,7 @@ pub fn show_main_window(app_handle: &tauri::AppHandle<tauri::Wry>, overlay: bool
}
#[tauri::command]
-pub fn show_quick_capture(app_handle: &tauri::AppHandle<tauri::Wry>) {
+pub fn show_timeline(app_handle: tauri::AppHandle<tauri::Wry>) {
if let Some(window) = app_handle.get_webview_window("timeline") {
#[cfg(target_os = "macos")]
let _ = app_handle.set_activation_policy(tauri::ActivationPolicy::Accessory);
@@ -138,11 +138,11 @@ pub fn show_quick_capture(app_handle: &tauri::AppHandle<tauri::Wry>) {
let _ = window.set_focus();
} else {
let _window = tauri::WebviewWindowBuilder::new(
- app_handle,
+ &app_handle,
"timeline",
tauri::WebviewUrl::App("timeline.html".into()),
)
- .title("Timeline")
+ .title("timeline")
.decorations(false)
.transparent(true)
.always_on_top(true)
@@ -210,16 +210,6 @@ pub fn update_show_screenpipe_shortcut(
return Err("failed to set shortcut, reverted to default".to_string());
}
- // Register the new shortcut for quick capture window
- let quick_capture_shortcut = "Super+Alt+Q".parse::<Shortcut>().unwrap();
- if let Err(e) = app_handle.global_shortcut().on_shortcut(
- quick_capture_shortcut,
- move |app_handle, _event, _shortcut| {
- show_quick_capture(app_handle);
- },
- ) {
- info!("failed to register quick capture shortcut: {}", e);
- }
Ok(())
}
diff --git a/screenpipe-app-tauri/src-tauri/src/main.rs b/screenpipe-app-tauri/src-tauri/src/main.rs
index 16329c97f..593c3df8d 100755
--- a/screenpipe-app-tauri/src-tauri/src/main.rs
+++ b/screenpipe-app-tauri/src-tauri/src/main.rs
@@ -115,6 +115,7 @@ async fn main() {
llm_sidecar::start_ollama_sidecar,
llm_sidecar::stop_ollama_sidecar,
commands::update_show_screenpipe_shortcut,
+ commands::show_timeline,
])
.setup(|app| {
// Logging setup
diff --git a/screenpipe-app-tauri/src-tauri/src/sidecar.rs b/screenpipe-app-tauri/src-tauri/src/sidecar.rs
index 0a1887079..eed3116dc 100644
--- a/screenpipe-app-tauri/src-tauri/src/sidecar.rs
+++ b/screenpipe-app-tauri/src-tauri/src/sidecar.rs
@@ -171,6 +171,11 @@ fn spawn_sidecar(app: &tauri::AppHandle) -> Result<CommandChild, String> {
.and_then(|v| v.as_bool())
.unwrap_or(false);
+ let enable_frame_cache = store
+ .get("enableFrameCache")
+ .and_then(|v| v.as_bool())
+ .unwrap_or(false);
+
println!("audio_chunk_duration: {}", audio_chunk_duration);
let port_str = port.to_string();
@@ -268,7 +273,9 @@ fn spawn_sidecar(app: &tauri::AppHandle) -> Result<CommandChild, String> {
args.push("--enable-beta");
}
-
+ if enable_frame_cache {
+ args.push("--enable-frame-cache");
+ }
if cfg!(windows) {
let exe_dir = env::current_exe()
diff --git a/screenpipe-app-tauri/src-tauri/tauri.conf.json b/screenpipe-app-tauri/src-tauri/tauri.conf.json
index fe3f153fc..45d11fe11 100644
--- a/screenpipe-app-tauri/src-tauri/tauri.conf.json
+++ b/screenpipe-app-tauri/src-tauri/tauri.conf.json
@@ -71,10 +71,10 @@
"height": 600,
"minWidth": 1400,
"minHeight": 600,
- "visible": true,
+ "visible": false,
"decorations": true,
"transparent": true,
- "alwaysOnTop": false,
+ "alwaysOnTop": true,
"label": "timeline"
}
],
diff --git a/screenpipe-server/Cargo.toml b/screenpipe-server/Cargo.toml
index dabc217cc..3b2a78ccd 100644
--- a/screenpipe-server/Cargo.toml
+++ b/screenpipe-server/Cargo.toml
@@ -92,9 +92,7 @@ uuid = "1.5.0"
tempfile = "3.3.0"
# video cache
-regex = "1.11.0"
glob = "0.3.1"
-lazy_static = "1.4.0"
lru = "0.12.5"
url = { version = "2.2.0", optional = true }
diff --git a/screenpipe-server/src/bin/screenpipe-server.rs b/screenpipe-server/src/bin/screenpipe-server.rs
index 312535d4e..b0bb64bf3 100644
--- a/screenpipe-server/src/bin/screenpipe-server.rs
+++ b/screenpipe-server/src/bin/screenpipe-server.rs
@@ -414,11 +414,6 @@ async fn main() -> anyhow::Result<()> {
pipe_manager.clone(),
cli.disable_vision,
cli.disable_audio,
- #[cfg(feature = "llm")]
- cli.enable_llm,
- #[cfg(feature = "llm")]
- llm,
-
);
let pipe_futures = Arc::new(tokio::sync::Mutex::new(FuturesUnordered::new()));
@@ -657,7 +652,7 @@ async fn main() -> anyhow::Result<()> {
}
}
- let server_future = server.start(devices_status, api_plugin);
+ let server_future = server.start(devices_status, api_plugin, cli.enable_frame_cache);
pin_mut!(server_future);
let pipes_future = async {
diff --git a/screenpipe-server/src/cli.rs b/screenpipe-server/src/cli.rs
index 020aa6c6c..036a4e5e4 100644
--- a/screenpipe-server/src/cli.rs
+++ b/screenpipe-server/src/cli.rs
@@ -235,6 +235,10 @@ pub struct Cli {
#[arg(long, default_value_t = false)]
pub enable_beta: bool,
+ /// Enable experimental video frame cache (may increase CPU usage) - makes timeline UI available, frame streaming, etc.
+ #[arg(long, default_value_t = false)]
+ pub enable_frame_cache: bool,
+
#[command(subcommand)]
pub command: Option<Command>,
diff --git a/screenpipe-server/src/server.rs b/screenpipe-server/src/server.rs
index d456eccf7..355d96fb6 100644
--- a/screenpipe-server/src/server.rs
+++ b/screenpipe-server/src/server.rs
@@ -59,7 +59,7 @@ pub struct AppState {
pub pipe_manager: Arc<PipeManager>,
pub vision_disabled: bool,
pub audio_disabled: bool,
- pub frame_cache: Arc<FrameCache>,
+ pub frame_cache: Option<Arc<FrameCache>>,
}
// Update the SearchQuery struct
@@ -736,6 +736,7 @@ impl Server {
self,
device_status: HashMap<AudioDevice, DeviceControl>,
api_plugin: F,
+ enable_frame_cache: bool,
) -> Result<(), std::io::Error>
where
F: Fn(&axum::http::Request<axum::body::Body>) + Clone + Send + Sync + 'static,
@@ -750,19 +751,23 @@ impl Server {
pipe_manager: self.pipe_manager,
vision_disabled: self.vision_disabled,
audio_disabled: self.audio_disabled,
- frame_cache: Arc::new(
- FrameCache::with_config(
- self.screenpipe_dir.clone().join("data"),
- None,
- FrameCacheConfig {
- prefetch_size: chrono::Duration::seconds(60),
- cleanup_interval: chrono::Duration::minutes(360),
- fps: 1.0,
- },
- )
- .await
- .unwrap(),
- ),
+ frame_cache: if enable_frame_cache {
+ Some(Arc::new(
+ FrameCache::with_config(
+ self.screenpipe_dir.clone().join("data"),
+ None,
+ FrameCacheConfig {
+ prefetch_size: chrono::Duration::seconds(60),
+ cleanup_interval: chrono::Duration::minutes(360),
+ fps: 1.0,
+ },
+ )
+ .await
+ .unwrap(),
+ ))
+ } else {
+ None
+ },
});
let app = create_router()
@@ -1217,15 +1222,17 @@ async fn stream_frames_handler(
);
let (frame_tx, mut frame_rx) = tokio::sync::mpsc::channel(100);
- let cache = state.frame_cache.clone();
+ let cache = state.frame_cache.as_ref().unwrap().clone();
// Spawn frame extraction task
- tokio::spawn(async move {
- if let Err(e) = cache
- .extract_frames_range(&request.start_time, &request.end_time, frame_tx)
- .await
- {
- error!("frame extraction failed: {}", e);
+ tokio::spawn({
+ async move {
+ if let Err(e) = cache
+ .extract_frames_range(&request.start_time, &request.end_time, frame_tx)
+ .await
+ {
+ error!("frame extraction failed: {}", e);
+ }
}
});