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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
chore: small ui improvements
Louis Beaumontdde2e2979993
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.ymlindex dac9a04b1..e1e9e7050 100644--- a/.github/workflows/release-app.yml+++ b/.github/workflows/release-app.yml@@ -176,10 +176,6 @@ jobs:with:vcpkgGitCommitId: "5b1214315250939257ef5d62ecdcbca18cf4fb1c"- # - name: Install ONNX Runtime- # if: matrix.platform == 'windows-latest'- # run: vcpkg install onnxruntime:x64-windows-- name: Set up MSVCif: matrix.platform == 'windows-latest'uses: ilammy/msvc-dev-cmd@v1@@ -207,13 +203,7 @@ jobs:APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}# https://tauri.app/v1/guides/distribution/sign-macosCI: true- # RUSTFLAGS: "-C link-arg=-Wl,--allow-multiple-definition"with:- tagName: app-v__VERSION__ # the action automatically replaces __VERSION__ with the app version.- releaseName: "App v__VERSION__"- releaseBody: "What's new? 🎉📣"- releaseDraft: true- prerelease: trueargs: ${{ matrix.args }}projectPath: "./screenpipe-app-tauri"tauriScript: bunx tauri -v@@ -224,18 +214,3 @@ jobs:command: release upload ${{ secrets.CN_APP_SLUG }} --framework tauriapi-key: ${{ secrets.CN_API_KEY }}path: ./screenpipe-app-tauri/src-tauri-- # basically wait for macos manual add sset- #publish:- # needs: publish-tauri-- # runs-on: ubuntu-latest-- # steps:- # - uses: actions/checkout@v4-- # - name: publish release- # uses: crabnebula-dev/[email protected]- # with:- # command: release publish ${{ secrets.CN_APP_SLUG }} --framework tauri- # api-key: ${{ secrets.CN_API_KEY }}diff --git a/screenpipe-app-tauri/app/layout.tsx b/screenpipe-app-tauri/app/layout.tsxindex 2ed22d68d..c4d9d874d 100644--- a/screenpipe-app-tauri/app/layout.tsx+++ b/screenpipe-app-tauri/app/layout.tsx@@ -1,7 +1,6 @@import type { Metadata } from "next";import { Inter } from "next/font/google";import "./globals.css";-import HealthStatus from "@/components/screenpipe-status";import { PHProvider } from "./providers";import { Toaster } from "@/components/ui/toaster";@@ -17,6 +16,8 @@ export default function RootLayout({}: Readonly<{children: React.ReactNode;}>) {++return (<html lang="en"><PHProvider>diff --git a/screenpipe-app-tauri/app/page.tsx b/screenpipe-app-tauri/app/page.tsxindex 41fa81175..46644a21a 100644--- a/screenpipe-app-tauri/app/page.tsx+++ b/screenpipe-app-tauri/app/page.tsx@@ -24,12 +24,11 @@ import { useToast } from "@/components/ui/use-toast";import { DevSettings } from "@/components/dev-dialog";import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";import { SearchChat } from "@/components/search-chat";-+import { Separator } from "@/components/ui/separator";export default function Home() {const { settings } = useSettings();const posthog = usePostHog();const { toast } = useToast();- const [activeTab, setActiveTab] = useState("search");useEffect(() => {checkForAppUpdates({ toast });@@ -42,11 +41,12 @@ export default function Home() {}, [settings.userId, posthog]);return (- <main className="flex min-h-screen flex-col items-center p-8">+ <main className="flex min-h-screen flex-col items-center"><NotificationHandler />{/* <UpdateNotification checkIntervalHours={3} /> */}{/* <ScreenpipeInstanceChecker /> */}<Header />+ <div className="my-4" />{settings.isLoading ? (<div className="flex flex-col items-center justify-center h-full space-y-4"><Skeleton className="w-[200px] h-[24px] rounded-full" />@@ -63,32 +63,12 @@ export default function Home() {</div>) : settings.aiUrl ? (<>- <h1 className="text-2xl font-bold mb-8 text-center mb-12">+ <h1 className="text-2xl font-bold text-center mb-12">where pixels become magic</h1><SearchChat /></>) : (- // <Tabs- // value={activeTab}- // onValueChange={setActiveTab}- // className="w-full max-w-4xl"- // >- // <TabsList className="grid w-full grid-cols-2">- // <TabsTrigger value="chat">chat</TabsTrigger>- // <TabsTrigger value="search">search</TabsTrigger>- // </TabsList>- // <TabsContent value="chat">- // <ChatList- // apiKey={settings.openaiApiKey}- // useOllama={settings.useOllama}- // ollamaUrl={settings.ollamaUrl}- // />- // </TabsContent>- // <TabsContent value="search">- // <SearchPanel />- // </TabsContent>- // </Tabs><div className="flex flex-col items-center justify-center h-[calc(80vh-200px)]"><Card className="w-[600px]"><CardHeader>diff --git a/screenpipe-app-tauri/components/example-search-cards.tsx b/screenpipe-app-tauri/components/example-search-cards.tsxnew file mode 100644index 000000000..07c770d7e--- /dev/null+++ b/screenpipe-app-tauri/components/example-search-cards.tsx@@ -0,0 +1,93 @@+import React from "react";+import { Card, CardContent } from "@/components/ui/card";+import { Search, Mail, Clock } from "lucide-react";+import { Badge } from "./ui/badge";++export interface ExampleSearch {+ title: string;+ windowName?: string;+ appName?: string;+ limit: number;+ minLength: number;+ contentType: string;+ startDate: Date;+}++interface ExampleSearchCardsProps {+ onSelect: (example: ExampleSearch) => void;+}++const exampleSearches: ExampleSearch[] = [+ {+ title: "summarize last hour meeting",+ contentType: "audio",+ limit: 120,+ minLength: 10,+ startDate: new Date(Date.now() - 60 * 60 * 1000), // 1 hour ago+ },+ {+ title: "summarize my mails",+ contentType: "ocr",+ windowName: "gmail",+ limit: 30,+ minLength: 50,+ startDate: new Date(new Date().setHours(0, 0, 0, 0)), // since midnight local time+ },+ {+ title: "time spent last hour",+ contentType: "ocr",+ limit: 25,+ minLength: 50,+ startDate: new Date(Date.now() - 60 * 60 * 1000), // 1 hour ago+ },+];++export function ExampleSearchCards({ onSelect }: ExampleSearchCardsProps) {+ const getIcon = (title: string) => {+ switch (title) {+ case "summarize last hour meeting":+ return <Search className="mr-2 h-4 w-4" />;+ case "summarize by mail":+ return <Mail className="mr-2 h-4 w-4" />;+ case "time spent on apps last hour":+ return <Clock className="mr-2 h-4 w-4" />;+ default:+ return null;+ }+ };++ return (+ <div className="grid grid-cols-1 md:grid-cols-3 gap-4 mt-4">+ {exampleSearches.map((example, index) => (+ <div key={index} className="relative group h-[150px]">+ <div className="absolute inset-0 rounded-lg transition-all duration-300 ease-out group-hover:before:opacity-100 group-hover:before:scale-100 before:absolute before:inset-0 before:rounded-lg before:border-2 before:border-black dark:before:border-white before:opacity-0 before:scale-95 group-hover:before:opacity-100 group-hover:before:scale-100 before:transition-all before:duration-300 before:ease-out" />+ <Card+ className="cursor-pointer relative bg-white dark:bg-gray-800 z-10 h-full transition-transform duration-300 ease-out group-hover:scale-[0.98]"+ onClick={() => onSelect(example)}+ >+ <CardContent className="p-3 flex flex-col h-full">+ <div className="flex items-center mb-1">+ {getIcon(example.title)}+ <h3 className="text-sm font-semibold">{example.title}</h3>+ </div>+ <div className="flex flex-wrap gap-2 mt-2">+ {example.contentType && <Badge>{example.contentType}</Badge>}+ {example.windowName && (+ <Badge>window: {example.windowName}</Badge>+ )}+ {example.appName && <Badge>app: {example.appName}</Badge>}+ {example.limit && <Badge>limit: {example.limit}</Badge>}+ {example.minLength && (+ <Badge>min: {example.minLength}</Badge>+ )}+ {example.startDate && (+ <Badge>start: {example.startDate.toLocaleString()}</Badge>+ )}+ </div>+ </CardContent>+ </Card>+ </div>+ ))}+ </div>+ );+}diff --git a/screenpipe-app-tauri/components/header.tsx b/screenpipe-app-tauri/components/header.tsxindex e5b641d91..d0408b968 100644--- a/screenpipe-app-tauri/components/header.tsx+++ b/screenpipe-app-tauri/components/header.tsx@@ -35,7 +35,7 @@ function IconNewChat() {export default function Header() {return (<div>- <div className="absolute left-8 top-8">+ <div className="absolute left-8 top-4"><TooltipProvider><Tooltip><TooltipTrigger asChild>@@ -54,7 +54,7 @@ export default function Header() {</Tooltip></TooltipProvider></div>- <div className="mb-16 relative z-[-1] flex flex-col items-center">+ <div className="relative z-[-1] flex flex-col items-center"><div className="relative flex flex-col items-center before:absolute before:h-[300px] before:w-full before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-full after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 sm:before:w-[480px] sm:after:w-[240px] before:lg:h-[360px] gap-4">{/* <ImageclassName="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"@@ -70,7 +70,7 @@ export default function Header() {</p> */}</div></div>- <div className="mt-4 flex space-x-4 absolute top-4 right-4">+ <div className="flex space-x-4 absolute top-4 right-4">{" "}{/* Added margin-top for spacing */}<HealthStatus className="mt-3" />diff --git a/screenpipe-app-tauri/components/search-chat.tsx b/screenpipe-app-tauri/components/search-chat.tsxindex 6bc09b71e..e4bc8c04d 100644--- a/screenpipe-app-tauri/components/search-chat.tsx+++ b/screenpipe-app-tauri/components/search-chat.tsx@@ -72,6 +72,7 @@ import { IconCode } from "@/components/ui/icons";import { CodeBlock } from "./ui/codeblock";import { SqlAutocompleteInput } from "./sql-autocomplete-input";import { encode } from "@/lib/utils";+import { ExampleSearch, ExampleSearchCards } from "./example-search-cards";export function SearchChat() {// Search state@@ -124,6 +125,41 @@ export function SearchChat() {const [isStreaming, setIsStreaming] = useState(false);const abortControllerRef = useRef<AbortController | null>(null);+ const [selectAll, setSelectAll] = useState(true);++ const [showExamples, setShowExamples] = useState(true);++ const [hasSearched, setHasSearched] = useState(false);++ const handleExampleSelect = async (example: ExampleSearch) => {+ posthog.capture("example_search", { example: example.title });++ const newWindowName = example.windowName || "";+ const newAppName = example.appName || "";+ const newLimit = example.limit || limit;+ const newMinLength = example.minLength || minLength;+ const newContentType =+ (example.contentType as "all" | "ocr" | "audio") || contentType;+ const newStartDate = example.startDate;++ setWindowName(newWindowName);+ setAppName(newAppName);+ setLimit(newLimit);+ setMinLength(newMinLength);+ setContentType(newContentType);+ setStartDate(newStartDate);+ setShowExamples(false);++ handleSearch(0, {+ windowName: newWindowName,+ appName: newAppName,+ limit: newLimit,+ minLength: newMinLength,+ contentType: newContentType,+ startDate: newStartDate,+ });+ };+const generateCurlCommand = () => {const baseUrl = "http://localhost:3030";const params = {@@ -151,6 +187,7 @@ export function SearchChat() {useEffect(() => {if (results.length > 0) {setSelectedResults(new Set(results.map((_, index) => index)));+ setSelectAll(true);}}, [results]);@@ -377,7 +414,8 @@ export function SearchChat() {}};- const handleSearch = async (newOffset = 0) => {+ const handleSearch = async (newOffset = 0, overrides: any = {}) => {+ setHasSearched(true);queryHistory.saveToHistory();appNameHistory.saveToHistory();windowNameHistory.saveToHistory();@@ -393,15 +431,16 @@ export function SearchChat() {try {const response = await queryScreenpipe({q: query || undefined,- content_type: contentType as "all" | "ocr" | "audio",- limit: limit,+ content_type: overrides.contentType || contentType,+ limit: overrides.limit || limit,offset: newOffset,- start_time: startDate.toISOString(), // Convert to UTC- end_time: endDate.toISOString(), // Convert to UTC- app_name: appName || undefined,- window_name: windowName || undefined,+ start_time:+ overrides.startDate?.toISOString() || startDate.toISOString(),+ end_time: endDate.toISOString(),+ app_name: overrides.appName || appName || undefined,+ window_name: overrides.windowName || windowName || undefined,include_frames: includeFrames,- min_length: minLength,+ min_length: overrides.minLength || minLength,max_length: maxLength,});@@ -445,6 +484,15 @@ export function SearchChat() {}};+ const handleSelectAll = (checked: boolean) => {+ setSelectAll(checked);+ if (checked) {+ setSelectedResults(new Set(results.map((_, index) => index)));+ } else {+ setSelectedResults(new Set());+ }+ };+const renderSearchResults = () => {if (isLoading) {return Array(3)@@ -461,8 +509,12 @@ export function SearchChat() {));}- if (results.length === 0) {- return <p className="text-center">No results found</p>;+ if (hasSearched && results.length === 0) {+ return <p className="text-center">no results found</p>;+ }++ if (!hasSearched || results.length === 0) {+ return null;}return results@@ -787,7 +839,9 @@ export function SearchChat() {<TooltipContent><p>select the number of results to display. usually ai cannot- ingest more than 30 results at a time.+ ingest more than 30 OCR results at a time+ <br />+ and 1000 audio results at a time.</p></TooltipContent></Tooltip>@@ -797,9 +851,9 @@ export function SearchChat() {id="limit-slider"value={[limit]}onValueChange={(value: number[]) => setLimit(value[0])}- min={1}- max={100}- step={1}+ min={10}+ max={150}+ step={5}/></div><div className="space-y-2">@@ -894,7 +948,7 @@ export function SearchChat() {<br /><span className="text-xs text-gray-500">note: you need to have `jq` installed to use the command.- </span>+ </span>{" "}</DialogDescription></DialogHeader><div className="overflow-x-auto">@@ -903,11 +957,24 @@ export function SearchChat() {</DialogContent></Dialog></div>+ {showExamples && results.length === 0 && (+ <ExampleSearchCards onSelect={handleExampleSelect} />+ )}{isLoading && (<div className="my-2"><Progress value={progress} className="w-full" /></div>)}+ {results.length > 0 && (+ <div className="flex items-center space-x-2 mb-4 my-8">+ <Checkbox+ id="select-all"+ checked={selectAll}+ onCheckedChange={handleSelectAll}+ />+ <Label htmlFor="select-all">select all results</Label>+ </div>+ )}<div className="space-y-4">{renderSearchResults()}{totalResults > 0 && (@@ -1015,7 +1082,7 @@ export function SearchChat() {<ChevronDown className="h-6 w-6" /></Button>)}- <div className="h-24" />+ {results.length > 0 && <div className="h-24" />}</div>);}diff --git a/screenpipe-app-tauri/package-lock.json b/screenpipe-app-tauri/package-lock.jsonindex c383d276c..13f265b92 100644--- a/screenpipe-app-tauri/package-lock.json+++ b/screenpipe-app-tauri/package-lock.json@@ -11,6 +11,7 @@"@radix-ui/react-accordion": "^1.2.0","@radix-ui/react-avatar": "^1.1.0","@radix-ui/react-checkbox": "^1.1.1",+ "@radix-ui/react-collapsible": "^1.1.0","@radix-ui/react-dialog": "^1.1.1","@radix-ui/react-dropdown-menu": "^2.1.1","@radix-ui/react-icons": "^1.3.0",@@ -38,11 +39,13 @@"@tauri-apps/plugin-store": "2.0.0-beta.7","@tauri-apps/plugin-updater": "2.0.0-beta.7","ai": "^3.3",+ "ansi-to-html": "^0.7.2","class-variance-authority": "^0.7.0","clsx": "^2.1.1","cmdk": "1.0.0","date-fns": "^3.6.0","framer-motion": "^11.5.4",+ "localforage": "^1.10.0","lodash": "^4.17.21","lucide-react": "^0.414.0","next": "14.2.4",@@ -4006,6 +4009,28 @@"url": "https://github.com/chalk/ansi-styles?sponsor=1"}},+ "node_modules/ansi-to-html": {+ "version": "0.7.2",+ "resolved": "https://registry.npmjs.org/ansi-to-html/-/ansi-to-html-0.7.2.tgz",+ "integrity": "sha512-v6MqmEpNlxF+POuyhKkidusCHWWkaLcGRURzivcU3I9tv7k4JVhFcnukrM5Rlk2rUywdZuzYAZ+kbZqWCnfN3g==",+ "dependencies": {+ "entities": "^2.2.0"+ },+ "bin": {+ "ansi-to-html": "bin/ansi-to-html"+ },+ "engines": {+ "node": ">=8.0.0"+ }+ },+ "node_modules/ansi-to-html/node_modules/entities": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",+ "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",+ "funding": {+ "url": "https://github.com/fb55/entities?sponsor=1"+ }+ },"node_modules/any-promise": {"version": "1.3.0","license": "MIT"@@ -6514,6 +6539,11 @@"node": ">= 4"}},+ "node_modules/immediate": {+ "version": "3.0.6",+ "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",+ "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ=="+ },"node_modules/import-fresh": {"version": "3.3.0","dev": true,@@ -7216,6 +7246,14 @@"node": ">= 0.8.0"}},+ "node_modules/lie": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz",+ "integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==",+ "dependencies": {+ "immediate": "~3.0.5"+ }+ },"node_modules/lilconfig": {"version": "2.1.0","license": "MIT",@@ -7235,6 +7273,14 @@"node": ">=6.11.5"}},+ "node_modules/localforage": {+ "version": "1.10.0",+ "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz",+ "integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==",+ "dependencies": {+ "lie": "3.1.1"+ }+ },"node_modules/locate-character": {"version": "3.0.0","resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.tomlindex b3aff618e..b2d0e1757 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.2.60"+version = "0.2.61"description = ""authors = ["you"]license = ""diff --git a/screenpipe-app-tauri/src-tauri/src/server.rs b/screenpipe-app-tauri/src-tauri/src/server.rsindex 7e3e3b51d..ccf40ae0a 100644--- a/screenpipe-app-tauri/src-tauri/src/server.rs+++ b/screenpipe-app-tauri/src-tauri/src/server.rs@@ -3,16 +3,16 @@ use axum::{http::{Method, StatusCode},Json, Router,};-use tower_http::cors::{CorsLayer, Any};-use tower_http::trace::{TraceLayer, DefaultMakeSpan};+use http::header::HeaderValue;use serde::{Deserialize, Serialize};use std::net::SocketAddr;use tauri::Emitter;#[allow(unused_imports)]use tauri_plugin_notification::NotificationExt;use tokio::sync::mpsc;+use tower_http::cors::{Any, CorsLayer};+use tower_http::trace::{DefaultMakeSpan, TraceLayer};use tracing::{error, info};-use http::header::HeaderValue;#[derive(Clone, serde::Serialize, serde::Deserialize)]struct LogEntry {@@ -53,8 +53,7 @@ pub async fn run_server(app_handle: tauri::AppHandle, port: u16) {.route("/log", axum::routing::post(log_message)).layer(cors).layer(- TraceLayer::new_for_http()- .make_span_with(DefaultMakeSpan::new().include_headers(true)),+ TraceLayer::new_for_http().make_span_with(DefaultMakeSpan::new().include_headers(true)),).with_state(state);diff --git a/screenpipe-app-tauri/src-tauri/tauri.conf.json b/screenpipe-app-tauri/src-tauri/tauri.conf.jsonindex cab2c5eec..8707d2653 100644--- a/screenpipe-app-tauri/src-tauri/tauri.conf.json+++ b/screenpipe-app-tauri/src-tauri/tauri.conf.json@@ -81,9 +81,9 @@{"title": "screenpipe","width": 1200,- "height": 800,+ "height": 850,"minWidth": 1200,- "minHeight": 800,+ "minHeight": 850,"resizable": true}],diff --git a/screenpipe-audio/src/stt.rs b/screenpipe-audio/src/stt.rsindex b0faaa749..b125ac381 100644--- a/screenpipe-audio/src/stt.rs+++ b/screenpipe-audio/src/stt.rs@@ -436,11 +436,11 @@ pub async fn create_whisper_channel(let (input_sender, input_receiver): (crossbeam::channel::Sender<AudioInput>,crossbeam::channel::Receiver<AudioInput>,- ) = crossbeam::channel::bounded(100);+ ) = crossbeam::channel::bounded(20);let (output_sender, output_receiver): (crossbeam::channel::Sender<TranscriptionResult>,crossbeam::channel::Receiver<TranscriptionResult>,- ) = crossbeam::channel::bounded(100);+ ) = crossbeam::channel::bounded(20);let mut vad_engine: Box<dyn VadEngine + Send> = match vad_engine {VadEngineEnum::WebRtc => Box::new(WebRtcVad::new()),VadEngineEnum::Silero => Box::new(SileroVad::new().await?),