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: header, unit test compilaton

Louis Beaumont373c768a95a9
diff --git a/screenpipe-app-tauri/components/header.tsx b/screenpipe-app-tauri/components/header.tsx
index 97309a6fd..74a070228 100644
--- a/screenpipe-app-tauri/components/header.tsx
+++ b/screenpipe-app-tauri/components/header.tsx
@@ -154,43 +154,7 @@ export default function Header() {
</div>
<div className="flex space-x-4 absolute top-4 right-4">
<HealthStatus className="mt-3 cursor-pointer" />
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <div>
- <Button
- variant="ghost"
- size="sm"
- className="cursor-pointer"
- onClick={handleShowTimeline}
- disabled={
- !settings.enableFrameCache ||
- !health ||
- health.status === "error"
- }
- >
- <Clock className="mr-2 h-4 w-4" />
- timeline
- </Button>
- </div>
- </TooltipTrigger>
- {!settings.enableFrameCache && (
- <TooltipContent>
- <p>enable timeline in settings first</p>
- </TooltipContent>
- )}
- </Tooltip>
- </TooltipProvider>
- <Button
- variant="ghost"
- size="sm"
- onClick={handleShowMeetingHistory}
- className="cursor-pointer"
- >
- <Calendar className="mr-2 h-4 w-4" />
- <span>meetings</span>
- </Button>
- <Settings />
+
<Button
variant="ghost"
size="icon"
diff --git a/screenpipe-server/tests/endpoint_test.rs b/screenpipe-server/tests/endpoint_test.rs
index c2a24425d..813ef6608 100644
--- a/screenpipe-server/tests/endpoint_test.rs
+++ b/screenpipe-server/tests/endpoint_test.rs
@@ -29,7 +29,6 @@ mod tests {
error: String,
}
async fn setup_test_app() -> (Router, Arc<AppState>) {
-
let db = Arc::new(DatabaseManager::new("sqlite::memory:").await.unwrap());
let app_state = Arc::new(AppState {
@@ -223,14 +222,34 @@ mod tests {
// Test counting all results
let count = db
- .count_search_results("test*", ContentType::All, None, None, None, None, None, None)
+ .count_search_results(
+ "test*",
+ ContentType::All,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ )
.await
.unwrap();
assert_eq!(count, 3);
// Test counting only OCR results
let count = db
- .count_search_results("OCR", ContentType::OCR, None, None, None, None, None, None)
+ .count_search_results(
+ "OCR",
+ ContentType::OCR,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ )
.await
.unwrap();
assert_eq!(count, 2);
@@ -246,6 +265,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -262,6 +282,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -278,6 +299,7 @@ mod tests {
Some("TestWindow2"),
None,
None,
+ None,
)
.await
.unwrap();
@@ -294,6 +316,7 @@ mod tests {
None,
Some(30),
None,
+ None,
)
.await
.unwrap();
@@ -310,6 +333,7 @@ mod tests {
None,
None,
Some(25),
+ None,
)
.await
.unwrap();
@@ -387,6 +411,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -404,6 +429,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -422,6 +448,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -444,6 +471,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -465,6 +493,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -480,6 +509,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -497,11 +527,17 @@ mod tests {
let recent_timestamp = now - Duration::seconds(15);
// Insert old data
- let _ = db.insert_video_chunk("old_video.mp4", "test_device").await.unwrap();
+ let _ = db
+ .insert_video_chunk("old_video.mp4", "test_device")
+ .await
+ .unwrap();
let old_frame_id = db.insert_frame("test_device", None).await.unwrap();
-
+
// Insert recent data
- let _ = db.insert_video_chunk("recent_video.mp4", "test_device").await.unwrap();
+ let _ = db
+ .insert_video_chunk("recent_video.mp4", "test_device")
+ .await
+ .unwrap();
let recent_frame_id = db.insert_frame("test_device", None).await.unwrap();
// Insert OCR data with different timestamps
@@ -558,6 +594,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -584,6 +621,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -599,7 +637,7 @@ mod tests {
// Get home directory safely
let home = std::env::var("HOME").expect("HOME environment variable not set");
let db_path = format!("{}/.screenpipe/db.sqlite", home);
-
+
// Open database in read-only mode for safety
let db = Arc::new(
DatabaseManager::new(&format!("sqlite:{}?mode=ro", db_path))
@@ -615,7 +653,7 @@ mod tests {
// Search for recent content (last 30 seconds)
let recent_results = db
.search(
- "", // empty query to get all content
+ "", // empty query to get all content
ContentType::OCR,
100,
0,
@@ -625,12 +663,13 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
println!("found {} recent results", recent_results.len());
-
+
// Search for older content (around 4 hours ago)
let old_results = db
.search(
@@ -644,6 +683,7 @@ mod tests {
None,
None,
None,
+ None,
)
.await
.unwrap();
@@ -655,9 +695,12 @@ mod tests {
if let SearchResult::OCR(ocr) = result {
println!("recent: {} ({})", ocr.ocr_text, ocr.timestamp);
// Verify timestamp is actually recent
- assert!(ocr.timestamp >= thirty_seconds_ago,
- "found old data in recent results: {} at {}",
- ocr.ocr_text, ocr.timestamp);
+ assert!(
+ ocr.timestamp >= thirty_seconds_ago,
+ "found old data in recent results: {} at {}",
+ ocr.ocr_text,
+ ocr.timestamp
+ );
}
}