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

chore: small ui improvements

Louis Beaumont78a8db7b21c7
diff --git a/screenpipe-app-tauri/components/cli-command-dialog.tsx b/screenpipe-app-tauri/components/cli-command-dialog.tsx
new file mode 100644
index 000000000..a260020aa
--- /dev/null
+++ b/screenpipe-app-tauri/components/cli-command-dialog.tsx
@@ -0,0 +1,131 @@
+import React, { useState } from "react";
+import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from "./ui/dialog";
+import { CodeBlock } from "./ui/codeblock";
+import { useCopyToClipboard } from "@/lib/hooks/use-copy-to-clipboard";
+import { useToast } from "@/components/ui/use-toast";
+import { IconCode } from "./ui/icons";
+import { Settings } from "@/lib/hooks/use-settings";
+import { getCliPath } from "@/lib/utils";
+
+interface CliCommandDialogProps {
+ localSettings: Settings;
+}
+
+export function CliCommandDialog({ localSettings }: CliCommandDialogProps) {
+ const [isOpen, setIsOpen] = useState(false);
+ const { copyToClipboard } = useCopyToClipboard({ timeout: 2000 });
+ const { toast } = useToast();
+
+ const generateCliCommand = () => {
+ const cliPath = getCliPath();
+ let args = [];
+
+ if (localSettings.audioTranscriptionEngine !== "default") {
+ args.push(
+ `--audio-transcription-engine ${localSettings.audioTranscriptionEngine}`
+ );
+ }
+ if (localSettings.ocrEngine !== "default") {
+ args.push(`--ocr-engine ${localSettings.ocrEngine}`);
+ }
+ if (
+ localSettings.monitorIds.length > 0 &&
+ localSettings.monitorIds[0] !== "default"
+ ) {
+ localSettings.monitorIds.forEach((id) => args.push(`--monitor-id ${id}`));
+ }
+ if (localSettings.languages.length > 0) {
+ localSettings.languages.forEach((id) => args.push(`--language ${id}`));
+ }
+ if (
+ localSettings.audioDevices.length > 0 &&
+ localSettings.audioDevices[0] !== "default"
+ ) {
+ localSettings.audioDevices.forEach((device) =>
+ args.push(`--audio-device "${device}"`)
+ );
+ }
+ if (localSettings.usePiiRemoval) {
+ args.push("--use-pii-removal");
+ }
+ if (localSettings.restartInterval > 0) {
+ args.push(`--restart-interval ${localSettings.restartInterval}`);
+ }
+ if (localSettings.disableAudio) {
+ args.push("--disable-audio");
+ }
+ localSettings.ignoredWindows.forEach((window) =>
+ args.push(`--ignored-windows "${window}"`)
+ );
+ localSettings.includedWindows.forEach((window) =>
+ args.push(`--included-windows "${window}"`)
+ );
+ if (
+ localSettings.deepgramApiKey &&
+ localSettings.deepgramApiKey !== "default"
+ ) {
+ args.push(`--deepgram-api-key "${localSettings.deepgramApiKey}"`);
+ }
+ if (localSettings.fps !== 0.2) {
+ args.push(`--fps ${localSettings.fps}`);
+ }
+ if (localSettings.vadSensitivity !== "high") {
+ args.push(`--vad-sensitivity ${localSettings.vadSensitivity}`);
+ }
+
+ if (!localSettings.analyticsEnabled) {
+ args.push("--disable-telemetry");
+ }
+ if (localSettings.audioChunkDuration !== 30) {
+ args.push(`--audio-chunk-duration ${localSettings.audioChunkDuration}`);
+ }
+
+ if (localSettings.languages.length > 0) {
+ localSettings.languages.forEach((id) => args.push(`--language ${id}`));
+ }
+
+ return `${cliPath} ${args.join(" ")}`;
+ };
+
+ const handleCopyCliCommand = () => {
+ const command = generateCliCommand();
+ copyToClipboard(command);
+ toast({
+ title: "CLI command copied",
+ description: "The CLI command has been copied to your clipboard.",
+ });
+ };
+
+ return (
+ <>
+ <Button variant="outline" size="icon" onClick={() => setIsOpen(true)}>
+ <IconCode className="h-4 w-4" />
+ </Button>
+ <Dialog open={isOpen} onOpenChange={setIsOpen}>
+ <DialogContent className="max-w-2xl">
+ <DialogHeader>
+ <DialogTitle>CLI command</DialogTitle>
+ <DialogDescription>
+ you can use this CLI command to start screenpipe with the current
+ settings.
+ </DialogDescription>
+ </DialogHeader>
+ <div className="overflow-x-auto">
+ <CodeBlock language="bash" value={generateCliCommand()} />
+ </div>
+ <DialogFooter>
+ <Button onClick={handleCopyCliCommand}>Copy to Clipboard</Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ </>
+ );
+}
diff --git a/screenpipe-app-tauri/components/recording-settings.tsx b/screenpipe-app-tauri/components/recording-settings.tsx
index ea057f570..725fa79fe 100644
--- a/screenpipe-app-tauri/components/recording-settings.tsx
+++ b/screenpipe-app-tauri/components/recording-settings.tsx
@@ -66,6 +66,7 @@ import { trace } from "@opentelemetry/api";
import { initOpenTelemetry } from "@/lib/opentelemetry";
import { Language } from "@/lib/language";
import { Command as ShellCommand } from "@tauri-apps/plugin-shell";
+import { CliCommandDialog } from "./cli-command-dialog";
interface AudioDevice {
name: string;
@@ -102,8 +103,6 @@ export function RecordingSettings({
const [isUpdating, setIsUpdating] = useState(false);
const { health } = useHealthCheck();
const isDisabled = health?.status_code === 500;
- const [isCopyDialogOpen, setIsCopyDialogOpen] = useState(false);
- const { copyToClipboard } = useCopyToClipboard({ timeout: 2000 });
const [isMacOS, setIsMacOS] = useState(false);
const [isSetupRunning, setIsSetupRunning] = useState(false);
@@ -377,86 +376,6 @@ export function RecordingSettings({
setLocalSettings({ ...localSettings, audioChunkDuration: value[0] });
};
- const generateCliCommand = () => {
- const cliPath = getCliPath();
- let args = [];
-
- if (localSettings.audioTranscriptionEngine !== "default") {
- args.push(
- `--audio-transcription-engine ${localSettings.audioTranscriptionEngine}`
- );
- }
- if (localSettings.ocrEngine !== "default") {
- args.push(`--ocr-engine ${localSettings.ocrEngine}`);
- }
- if (
- localSettings.monitorIds.length > 0 &&
- localSettings.monitorIds[0] !== "default"
- ) {
- localSettings.monitorIds.forEach((id) => args.push(`--monitor-id ${id}`));
- }
- if (localSettings.languages.length > 0) {
- localSettings.languages.forEach((id) => args.push(`--language ${id}`));
- }
- if (
- localSettings.audioDevices.length > 0 &&
- localSettings.audioDevices[0] !== "default"
- ) {
- localSettings.audioDevices.forEach((device) =>
- args.push(`--audio-device "${device}"`)
- );
- }
- if (localSettings.usePiiRemoval) {
- args.push("--use-pii-removal");
- }
- if (localSettings.restartInterval > 0) {
- args.push(`--restart-interval ${localSettings.restartInterval}`);
- }
- if (localSettings.disableAudio) {
- args.push("--disable-audio");
- }
- localSettings.ignoredWindows.forEach((window) =>
- args.push(`--ignored-windows "${window}"`)
- );
- localSettings.includedWindows.forEach((window) =>
- args.push(`--included-windows "${window}"`)
- );
- if (
- localSettings.deepgramApiKey &&
- localSettings.deepgramApiKey !== "default"
- ) {
- args.push(`--deepgram-api-key "${localSettings.deepgramApiKey}"`);
- }
- if (localSettings.fps !== 0.2) {
- args.push(`--fps ${localSettings.fps}`);
- }
- if (localSettings.vadSensitivity !== "high") {
- args.push(`--vad-sensitivity ${localSettings.vadSensitivity}`);
- }
-
- if (!localSettings.analyticsEnabled) {
- args.push("--disable-telemetry");
- }
- if (localSettings.audioChunkDuration !== 30) {
- args.push(`--audio-chunk-duration ${localSettings.audioChunkDuration}`);
- }
-
- if (localSettings.languages.length > 0) {
- localSettings.languages.forEach((id) => args.push(`--language ${id}`));
- }
-
- return `${cliPath} ${args.join(" ")}`;
- };
-
- const handleCopyCliCommand = () => {
- const command = generateCliCommand();
- copyToClipboard(command);
- toast({
- title: "CLI command copied",
- description: "The CLI command has been copied to your clipboard.",
- });
- };
-
const renderOcrEngineOptions = () => {
const currentPlatform = platform();
return (
@@ -622,7 +541,7 @@ export function RecordingSettings({
<CardHeader>
<div className="flex justify-between items-center">
<CardTitle className="text-center">recording settings</CardTitle>
- <div className="flex space-x-2">
+ <div className="flex space-x-2">
<div className="flex flex-col space-y-2">
<Button
onClick={handleUpdate}
@@ -641,13 +560,7 @@ export function RecordingSettings({
</span>
)}
</div>
- <Button
- variant="outline"
- size="icon"
- onClick={() => setIsCopyDialogOpen(true)}
- >
- <IconCode className="h-4 w-4" />
- </Button>
+ <CliCommandDialog localSettings={localSettings} />
</div>
</div>
</CardHeader>
@@ -1388,23 +1301,6 @@ export function RecordingSettings({
</CardContent>
</Card>
</div>
- <Dialog open={isCopyDialogOpen} onOpenChange={setIsCopyDialogOpen}>
- <DialogContent className="max-w-2xl">
- <DialogHeader>
- <DialogTitle>CLI command</DialogTitle>
- <DialogDescription>
- you can use this CLI command to start screenpipe with the current
- settings.
- </DialogDescription>
- </DialogHeader>
- <div className="overflow-x-auto">
- <CodeBlock language="bash" value={generateCliCommand()} />
- </div>
- <DialogFooter>
- <Button onClick={handleCopyCliCommand}>Copy to Clipboard</Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
</>
);
}
diff --git a/screenpipe-app-tauri/components/screenpipe-status.tsx b/screenpipe-app-tauri/components/screenpipe-status.tsx
index b4088fac4..e16a3100b 100644
--- a/screenpipe-app-tauri/components/screenpipe-status.tsx
+++ b/screenpipe-app-tauri/components/screenpipe-status.tsx
@@ -35,6 +35,7 @@ import {
CollapsibleTrigger,
} from "@/components/ui/collapsible";
import { Command } from "@tauri-apps/plugin-shell";
+import { CliCommandDialog } from "./cli-command-dialog";
const getDebuggingCommands = (os: string | null) => {
let cliInstructions = "";
@@ -204,17 +205,22 @@ const DevModeSettings = () => {
return (
<>
<div className="w-full my-4">
- <div className="flex justify-around">
- <Card className="p-4 ">
+ <div className="flex justify-around">
+ <Card className="p-4 relative">
<CardContent>
<div className="flex flex-col space-y-2">
- <div className="flex items-center space-x-2">
- <Label htmlFor="dev-mode">enable dev mode</Label>
- <Switch
- id="dev-mode"
- checked={localSettings.devMode}
- onCheckedChange={handleDevModeToggle}
- />
+ <div className="flex items-center justify-between">
+ <div className="flex items-center space-x-2">
+ <Label htmlFor="dev-mode">enable dev mode</Label>
+ <Switch
+ id="dev-mode"
+ checked={localSettings.devMode}
+ onCheckedChange={handleDevModeToggle}
+ />
+ </div>
+ <div className="absolute top-2 right-2">
+ <CliCommandDialog localSettings={localSettings} />
+ </div>
</div>
<p className="text-sm text-muted-foreground mb-4">
on = use CLI for more control
@@ -346,7 +352,7 @@ const HealthStatus = ({ className }: { className?: string }) => {
setIsMac(platform() === "macos");
}, []);
- const handleResetScreenPermissions = async () => {
+ const openScreenPermissions = async () => {
const toastId = toast({
title: "opening permissions",
description: "please wait...",
@@ -394,13 +400,29 @@ const HealthStatus = ({ className }: { className?: string }) => {
audioDisabled: boolean
) => {
if (status === "loading") return "bg-yellow-500";
-
const isVisionOk = frameStatus === "ok" || frameStatus === "disabled";
const isAudioOk =
audioStatus === "ok" || audioStatus === "disabled" || audioDisabled;
+ return isVisionOk && isAudioOk ? "bg-green-500" : "bg-red-500";
+ };
- if (isVisionOk && isAudioOk) return "bg-green-500";
- return "bg-red-500";
+ const getStatusMessage = (
+ status: string,
+ frameStatus: string,
+ audioStatus: string,
+ audioDisabled: boolean
+ ) => {
+ if (status === "loading")
+ return "screenpipe is starting up. this may take a few minutes...";
+
+ let issues = [];
+ if (frameStatus !== "ok" && frameStatus !== "disabled")
+ issues.push("screen recording");
+ if (!audioDisabled && audioStatus !== "ok" && audioStatus !== "disabled")
+ issues.push("audio recording");
+
+ if (issues.length === 0) return "screenpipe is running smoothly";
+ return `there might be an issue with ${issues.join(" and ")}`;
};
const handleFixSetup = async () => {
@@ -484,28 +506,6 @@ const HealthStatus = ({ className }: { className?: string }) => {
return timestamp ? new Date(timestamp).toLocaleString() : "n/a";
};
- const getStatusMessage = (
- status: string,
- frameStatus: string,
- audioStatus: string,
- audioDisabled: boolean
- ) => {
- if (status === "loading")
- return "the application is still initializing. please wait...";
-
- let unhealthySystems = [];
- if (frameStatus !== "ok" && frameStatus !== "disabled")
- unhealthySystems.push("vision");
- if (!audioDisabled && audioStatus !== "ok" && audioStatus !== "disabled")
- unhealthySystems.push("audio");
-
- if (unhealthySystems.length === 0)
- return "all systems are functioning normally";
- return `some systems are not functioning properly: ${unhealthySystems.join(
- ", "
- )}`;
- };
-
const statusColor = getStatusColor(
health.status,
health.frame_status,
@@ -540,88 +540,104 @@ const HealthStatus = ({ className }: { className?: string }) => {
aria-describedby="status-dialog-description"
>
<DialogHeader className="flex flex-row items-center justify-between">
- <DialogTitle>{health.status} status</DialogTitle>
-
- <Button
- variant="outline"
- onClick={handleOpenDataDir}
- className="flex-shrink-0"
- >
- <Folder className="h-4 w-4 mr-2" />
- open data dir
- </Button>
- </DialogHeader>
- <div className="flex-grow overflow-auto">
- <p className="text-sm mb-2">
- {statusMessage}
- {health.status === "loading" && (
- <span className="ml-1 text-xs">(up to 3m)</span>
- )}
- </p>
- <p className="text-xs mb-1">frame: {health.frame_status}</p>
- <p className="text-xs mb-1">
- audio: {settings.disableAudio ? "disabled" : health.audio_status}
- </p>
- <p className="text-xs mb-1">
- last frame: {formatTimestamp(health.last_frame_timestamp)}
- </p>
- <p className="text-xs mb-1">
- last audio:{" "}
- {settings.disableAudio
- ? "n/a"
- : formatTimestamp(health.last_audio_timestamp)}
- </p>
- <div className="text-xs mt-2 relative">
- <p className="font-bold mb-1">troubleshooting instructions:</p>
- <MarkdownWithExternalLinks className="prose prose-sm">
- {`if you're experiencing issues, please try the following steps:
-1. restart screenpipe
-2. reset your screenpipe OS audio/screen recording permissions
-3. if the problem persists, please contact support at [[email protected]](mailto:[email protected]) or @louis030195 on Discord, X, or LinkedIn
-4. last, here are some [FAQ](https://github.com/mediar-ai/screenpipe/blob/main/content/docs/NOTES.md) with visuals to help you troubleshoot`}
- </MarkdownWithExternalLinks>
- <div className="absolute top-[6.5em] right-0 flex flex-col space-y-2">
- {isMac && (
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="outline"
- onClick={handleResetScreenPermissions}
- className="flex-shrink-0"
- >
- <Lock className="h-4 w-4 mr-2" />
- open permissions
- </Button>
- </TooltipTrigger>
- <TooltipContent>
- <p>open screen capture permissions</p>
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- )}
+ <DialogTitle>screenpipe status</DialogTitle>
+ <div className="flex space-x-2">
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ variant="outline"
+ size="icon"
+ onClick={handleFixSetup}
+ disabled={isFixingSetup}
+ >
+ <Wrench className="h-4 w-4" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>try fixing setup</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ {isMac && (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="outline"
- onClick={handleFixSetup}
- className="flex-shrink-0"
- disabled={isFixingSetup}
+ size="icon"
+ onClick={openScreenPermissions}
>
- <Wrench className="h-4 w-4 mr-2" />
- {isFixingSetup ? "fixing..." : "screenpipe autofix"}
+ <Lock className="h-4 w-4" />
</Button>
</TooltipTrigger>
<TooltipContent>
- <p>
- this will try to request permissions, download models,
- etc.
- </p>
+ <p>open screen permissions</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
- </div>
+ )}
+ <Button
+ variant="outline"
+ onClick={handleOpenDataDir}
+ className="flex-shrink-0"
+ >
+ <Folder className="h-4 w-4 mr-2" />
+ view saved data
+ </Button>
+ </div>
+ </DialogHeader>
+ <div className="flex-grow overflow-auto">
+ <p className="text-sm mb-2 font-semibold">{statusMessage}</p>
+ <div className="text-xs mb-4">
+ <p>screen recording: {health.frame_status}</p>
+ <p>
+ audio recording:{" "}
+ {settings.disableAudio ? "turned off" : health.audio_status}
+ </p>
+ <p>
+ last screen capture:{" "}
+ {formatTimestamp(health.last_frame_timestamp)}
+ </p>
+ <p>
+ last audio capture:{" "}
+ {settings.disableAudio
+ ? "n/a"
+ : formatTimestamp(health.last_audio_timestamp)}
+ </p>
+ </div>
+ <div className="text-sm mt-4">
+ <p className="font-semibold mb-2">
+ if you&apos;re having issues:
+ </p>
+ <ol className="list-decimal list-inside space-y-1">
+ <li>try restarting screenpipe</li>
+ <li>
+ check your computer&apos;s screen and audio recording
+ permissions
+ </li>
+ <li>
+ if problems continue, contact support at{" "}
+ <a
+ href="mailto:[email protected]"
+ className="hover:underline"
+ >
+ </a>
+ </li>
+ <li>
+ view our{" "}
+ <a
+ href="https://github.com/mediar-ai/screenpipe/blob/main/content/docs/NOTES.md"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="hover:underline"
+ >
+ FAQ page
+ </a>{" "}
+ for more help
+ </li>
+ </ol>
</div>
<Separator className="my-4" />
<DevModeSettings />
diff --git a/screenpipe-app-tauri/src-tauri/src/sidecar.rs b/screenpipe-app-tauri/src-tauri/src/sidecar.rs
index da1ee3cb0..2d4465575 100644
--- a/screenpipe-app-tauri/src-tauri/src/sidecar.rs
+++ b/screenpipe-app-tauri/src-tauri/src/sidecar.rs
@@ -264,23 +264,7 @@ fn spawn_sidecar(app: &tauri::AppHandle) -> Result<CommandChild, String> {
args.push("--enable-beta");
}
- // args.push("--debug");
-
- // macos /Applications/screenpipe.app/Contents/MacOS/
- // linux /usr/local/bin
- // windows %LOCALAPPDATA%\\screenpipe
- let screenpipe_path = app
- .path()
- .local_data_dir()
- .unwrap_or_default()
- .join("screenpipe");
- let path_to_sidecars = if cfg!(windows) {
- screenpipe_path.to_str().unwrap_or_default()
- } else if cfg!(target_os = "macos") {
- "/Applications/screenpipe.app/Contents/MacOS/"
- } else {
- "/usr/local/bin"
- };
+
if cfg!(windows) {
let exe_dir = env::current_exe()
@@ -299,9 +283,7 @@ fn spawn_sidecar(app: &tauri::AppHandle) -> Result<CommandChild, String> {
c = c.env("HF_ENDPOINT", "https://hf-mirror.com");
}
- // let current_path = env::var("PATH").unwrap_or_default();
- // let new_path = format!("{};{}", path_to_sidecars, current_path);
- // c = c.env("PATH", new_path);
+
let c = c.args(&args);
@@ -321,10 +303,6 @@ fn spawn_sidecar(app: &tauri::AppHandle) -> Result<CommandChild, String> {
command = command.env("HF_ENDPOINT", "https://hf-mirror.com");
}
- // let current_path = env::var("PATH").unwrap_or_default();
- // let new_path = format!("{}:{}", path_to_sidecars, current_path);
- // command = command.env("PATH", new_path);
-
let command = command.args(&args);
let result = command.spawn();