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-app fix settings not updating

Louis Beaumontf8d68a5ca6e3
diff --git a/screenpipe-app-tauri/components/dev-mode-settings.tsx b/screenpipe-app-tauri/components/dev-mode-settings.tsx
index e779c0192..a1c1a4617 100644
--- a/screenpipe-app-tauri/components/dev-mode-settings.tsx
+++ b/screenpipe-app-tauri/components/dev-mode-settings.tsx
@@ -63,18 +63,12 @@ const getDebuggingCommands = (os: string | null, dataDir: string) => {
# Example: screenpipe --fps 1 `;
const logPath =
- os === "windows"
- ? `${dataDir}\\screenpipe.${
- new Date().toISOString().split("T")[0]
- }.log`
- : `${dataDir}/screenpipe.${
- new Date().toISOString().split("T")[0]
- }.log`;
+ os === "windows"
+ ? `${dataDir}\\screenpipe.${new Date().toISOString().split("T")[0]}.log`
+ : `${dataDir}/screenpipe.${new Date().toISOString().split("T")[0]}.log`;
const dbPath =
- os === "windows"
- ? `${dataDir}\\db.sqlite`
- : `${dataDir}/db.sqlite`;
+ os === "windows" ? `${dataDir}\\db.sqlite` : `${dataDir}/db.sqlite`;
const baseCommand =
baseInstructions +
@@ -89,13 +83,13 @@ const getDebuggingCommands = (os: string | null, dataDir: string) => {
baseCommand +
`# Stream the log:
type "${logPath}"
-
+
# Scroll the logs:
more "${logPath}"
-
+
# View last 10 frames:
sqlite3 "${dbPath}" "SELECT * FROM frames ORDER BY timestamp DESC LIMIT 10;"
-
+
# View last 10 audio transcriptions:
sqlite3 "${dbPath}" "SELECT * FROM audio_transcriptions ORDER BY timestamp DESC LIMIT 10;"`
);
@@ -104,13 +98,13 @@ const getDebuggingCommands = (os: string | null, dataDir: string) => {
baseCommand +
`# Stream the log:
tail -f "${logPath}"
-
+
# Scroll the logs:
less "${logPath}"
-
+
# View last 10 frames:
sqlite3 "${dbPath}" "SELECT * FROM frames ORDER BY timestamp DESC LIMIT 10;"
-
+
# View last 10 audio transcriptions:
sqlite3 "${dbPath}" "SELECT * FROM audio_transcriptions ORDER BY timestamp DESC LIMIT 10;"`
);
@@ -125,12 +119,19 @@ export const DevModeSettings = ({ localDataDir }: { localDataDir: string }) => {
const handleDevModeToggle = async (checked: boolean) => {
try {
await updateSettings({ devMode: checked });
- setLocalSettings({ ...localSettings, devMode: checked });
+ setLocalSettings((prev) => ({ ...prev, devMode: checked }));
} catch (error) {
- console.error("Failed to update dev mode:", error);
- // Add error handling, e.g., show a toast notification
+ console.error("failed to update dev mode:", error);
+ toast({
+ title: "error",
+ description: "failed to save dev mode setting",
+ variant: "destructive",
+ });
}
};
+ console.log("settings:", settings);
+ console.log("localSettings:", localSettings);
+
const [isLoading, setIsLoading] = useState(false);
const { toast } = useToast();
@@ -231,7 +232,6 @@ export const DevModeSettings = ({ localDataDir }: { localDataDir: string }) => {
</Card>
<div className="relative">
-
<Card className="p-8">
<CardContent>
<div className="flex items-center space-x-2">
@@ -295,7 +295,10 @@ export const DevModeSettings = ({ localDataDir }: { localDataDir: string }) => {
did you run screenpipe backend? either click start on the right, or
thru CLI 👇
</p>
- <CodeBlock language="bash" value={getDebuggingCommands(platform(), localDataDir)} />
+ <CodeBlock
+ language="bash"
+ value={getDebuggingCommands(platform(), localDataDir)}
+ />
<div className="mt-4 text-sm text-gray-500">
<p>or, for more advanced queries:</p>
diff --git a/screenpipe-app-tauri/components/screenpipe-status.tsx b/screenpipe-app-tauri/components/screenpipe-status.tsx
index fe4c3559f..9f65cb03c 100644
--- a/screenpipe-app-tauri/components/screenpipe-status.tsx
+++ b/screenpipe-app-tauri/components/screenpipe-status.tsx
@@ -61,23 +61,17 @@ type PermissionsStatus = {
};
const HealthStatus = ({ className }: { className?: string }) => {
- const {
- health,
- isServerDown,
- isLoading: healthCheckLoading,
- debouncedFetchHealth,
- } = useHealthCheck();
+ const { health, debouncedFetchHealth } = useHealthCheck();
const [isDialogOpen, setIsDialogOpen] = useState(false);
const [isMac, setIsMac] = useState(false);
const { settings, getDataDir } = useSettings();
const [localDataDir, setLocalDataDir] = useState("");
const [isLogOpen, setIsLogOpen] = useState(false);
const [isFixingSetup, setIsFixingSetup] = useState(false);
- const [isTroubleshootOpen, setIsTroubleshootOpen] = useState(false);
const [currentStep, setCurrentStep] = useState(0);
const [isDialogLoading, setIsDialogLoading] = useState(false);
const [permissions, setPermissions] = useState<PermissionsStatus | null>(
- null
+ null,
);
useEffect(() => {
@@ -115,27 +109,6 @@ const HealthStatus = ({ className }: { className?: string }) => {
checkPermissions();
}, []);
- const openScreenPermissions = async () => {
- const toastId = toast({
- title: "opening permissions",
- description: "please wait...",
- duration: Infinity,
- });
-
- try {
- await invoke("open_screen_capture_preferences");
- } catch (error) {
- console.error("failed to open screen permissions:", error);
- toastId.update({
- id: toastId.id,
- title: "error",
- description: "failed to open screen permissions.",
- variant: "destructive",
- duration: 3000,
- });
- }
- };
-
const handleOpenDataDir = async () => {
try {
const dataDir = await getDataDir();
@@ -157,7 +130,7 @@ const HealthStatus = ({ className }: { className?: string }) => {
audioStatus: string,
uiStatus: string,
audioDisabled: boolean,
- uiMonitoringEnabled: boolean
+ uiMonitoringEnabled: boolean,
) => {
if (status === "loading") return "bg-yellow-500";
const isVisionOk = frameStatus === "ok" || frameStatus === "disabled";
@@ -174,7 +147,7 @@ const HealthStatus = ({ className }: { className?: string }) => {
audioStatus: string,
uiStatus: string,
audioDisabled: boolean,
- uiMonitoringEnabled: boolean
+ uiMonitoringEnabled: boolean,
) => {
if (status === "loading")
return "screenpipe is starting up. this may take a few minutes...";
@@ -191,211 +164,6 @@ const HealthStatus = ({ className }: { className?: string }) => {
return `there might be an issue with ${issues.join(" and ")}`;
};
- const handleFixSetup = async () => {
- setIsFixingSetup(true);
- const toastId = toast({
- title: "fixing setup permissions",
- description: "this may take a few minutes...",
- duration: Infinity,
- });
-
- try {
- const args = ["setup"];
- if (settings.enableBeta) {
- args.push("--enable-beta");
- }
- console.log("args", args);
- const command = Command.sidecar("screenpipe", args);
- const child = await command.spawn();
-
- const outputPromise = new Promise<string>((resolve, reject) => {
- command.on("close", (data) => {
- if (data.code !== 0) {
- reject(new Error(`Command failed with code ${data.code}`));
- }
- });
- command.on("error", (error) => reject(new Error(error)));
- command.stdout.on("data", (line) => {
- console.log(line);
- if (line.includes("screenpipe setup complete")) {
- resolve("ok");
- }
- });
- });
-
- const timeoutPromise = new Promise(
- (_, reject) =>
- setTimeout(() => reject(new Error("Setup timed out")), 900000) // 15 minutes
- );
-
- const result = await Promise.race([outputPromise, timeoutPromise]);
-
- if (result === "ok") {
- toastId.update({
- id: toastId.id,
- title: "setup fixed",
- description: "screenpipe setup permissions have been fixed.",
- duration: 5000,
- });
- } else {
- throw new Error("setup failed or timed out");
- }
- } catch (error) {
- console.error("error fixing setup:", error);
- toastId.update({
- id: toastId.id,
- title: "error",
- description: "please try again or check the logs for more info.",
- variant: "destructive",
- duration: 3000,
- });
- } finally {
- setIsFixingSetup(false);
- toastId.dismiss();
- }
- };
-
- const troubleshootingSteps = [
- {
- title: "try fixing setup",
- description: "attempt to automatically fix common setup issues",
- action: (
- <div className="flex flex-col items-center">
- <Button
- variant="outline"
- onClick={handleFixSetup}
- disabled={isFixingSetup}
- >
- <Wrench className="mr-2 h-4 w-4" />
- {isFixingSetup ? "fixing..." : "fix setup"}
- </Button>
- <p className="text-xs mt-2 text-gray-500">
- this will download AI models, check permissions, and dependencies
- </p>
- </div>
- ),
- },
- {
- title: "restart screenpipe recording",
- description: "click stop and start again",
- action: (
- <div className="flex flex-col items-center">
- <Button
- variant="outline"
- onClick={async () => {
- const toastId = toast({
- title: "restarting screenpipe",
- description: "please wait...",
- duration: Infinity,
- });
- try {
- await invoke("kill_all_sreenpipes");
- await new Promise((resolve) => setTimeout(resolve, 2000));
- toastId.dismiss();
- toastId.update({
- id: toastId.id,
- title: "screenpipe stopped",
- description: "screenpipe is now stopped.",
- duration: 3000,
- });
- await invoke("spawn_screenpipe");
-
- toastId.dismiss();
- toastId.update({
- id: toastId.id,
- title: "screenpipe started",
- description: "screenpipe is now started.",
- duration: 3000,
- });
- } catch (error) {
- console.error("failed to stop screenpipe:", error);
- toastId.update({
- id: toastId.id,
- title: "error",
- description: "failed to stop screenpipe.",
- variant: "destructive",
- duration: 3000,
- });
- } finally {
- await new Promise((resolve) => setTimeout(resolve, 2000));
- toastId.dismiss();
- }
- }}
- >
- <RefreshCw className="mr-2 h-4 w-4" />
- restart recording
- </Button>
- <p className="text-xs mt-2 text-gray-500">
- this will stop and start the recording process
- </p>
- </div>
- ),
- },
- {
- title: "check permissions",
- description: "ensure screen and audio recording permissions are granted",
- action: isMac ? (
- <div className="flex flex-col items-center">
- <Button variant="outline" onClick={openScreenPermissions}>
- <Lock className="mr-2 h-4 w-4" />
- open screen permissions
- </Button>
- <p className="text-xs mt-2 text-gray-500">
- opens system preferences for screen recording
- </p>
- </div>
- ) : null,
- },
- {
- title: "contact support",
- description: "if the issue persists, reach out to our support team",
- action: (
- <div className="flex flex-col space-y-2 items-center">
- <div className="flex items-center space-x-2 justify-center">
- <p className="text-sm">please share your logs with support:</p>
- <LogFileButton />
- </div>
- <div className="flex flex-col items-center">
- <Button
- variant="outline"
- onClick={() => open("mailto:[email protected]")}
- >
- <FileText className="mr-2 h-4 w-4" />
- email founders
- </Button>
- <p className="text-xs mt-2 text-gray-500">
- we&apos;ll respond within 24 hours
- </p>
- </div>
- <div className="flex flex-col items-center">
- <Button
- variant="outline"
- onClick={() => open("https://cal.com/louis030195/screenpipe")}
- >
- <Activity className="mr-2 h-4 w-4" />
- book a call w founders
- </Button>
- <p className="text-xs mt-2 text-gray-500">
- schedule a 15-minute troubleshooting call
- </p>
- </div>
- <div className="flex flex-col items-center">
- <Button
- variant="outline"
- onClick={() => open("https://discord.gg/dU9EBuw7Uq")}
- >
- <HelpCircle className="mr-2 h-4 w-4" />
- join our discord
- </Button>
- <p className="text-xs mt-2 text-gray-500">
- we&apos;re more responsive on discord (or the community)
- </p>
- </div>
- </div>
- ),
- },
- ];
-
if (!health) {
return (
<Badge
@@ -419,7 +187,7 @@ const HealthStatus = ({ className }: { className?: string }) => {
health.audio_status,
health.ui_status,
settings.disableAudio,
- settings.enableUiMonitoring
+ settings.enableUiMonitoring,
);
const statusMessage = getStatusMessage(
health.status,
@@ -427,7 +195,7 @@ const HealthStatus = ({ className }: { className?: string }) => {
health.audio_status,
health.ui_status,
settings.disableAudio,
- settings.enableUiMonitoring
+ settings.enableUiMonitoring,
);
const handleOpenStatusDialog = async () => {
@@ -452,7 +220,7 @@ const HealthStatus = ({ className }: { className?: string }) => {
};
const handlePermissionButton = async (
- type: "screen" | "audio" | "accessibility"
+ type: "screen" | "audio" | "accessibility",
) => {
const toastId = toast({
title: `checking ${type} permissions`,
@@ -465,8 +233,8 @@ const HealthStatus = ({ className }: { className?: string }) => {
type === "screen"
? "screenRecording"
: type === "audio"
- ? "microphone"
- : "accessibility";
+ ? "microphone"
+ : "accessibility";
await invoke("request_permission", {
permission: permissionType,
@@ -486,8 +254,8 @@ const HealthStatus = ({ className }: { className?: string }) => {
type === "screen"
? perms.screenRecording === "Granted"
: type === "audio"
- ? perms.microphone === "Granted"
- : perms.accessibility === "Granted";
+ ? perms.microphone === "Granted"
+ : perms.accessibility === "Granted";
toastId.update({
id: toastId.id,
@@ -515,7 +283,7 @@ const HealthStatus = ({ className }: { className?: string }) => {
variant="outline"
className={cn(
"cursor-pointer bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground",
- isDialogLoading && "opacity-50 pointer-events-none"
+ isDialogLoading && "opacity-50 pointer-events-none",
)}
onClick={handleOpenStatusDialog}
>
@@ -547,14 +315,6 @@ const HealthStatus = ({ className }: { className?: string }) => {
<Folder className="h-4 w-4 mr-2" />
view saved data
</Button>
- {/* TODO: too buggy */}
- {/* <Button
- variant="outline"
- onClick={() => setIsTroubleshootOpen(true)}
- >
- <Wrench className="h-4 w-4 mr-2" />
- troubleshoot
- </Button> */}
</div>
</DialogHeader>
<div className="flex-grow overflow-auto">
@@ -605,8 +365,8 @@ const HealthStatus = ({ className }: { className?: string }) => {
settings.disableAudio
? "bg-gray-400"
: health.audio_status === "ok"
- ? "bg-green-500"
- : "bg-red-500"
+ ? "bg-green-500"
+ : "bg-red-500"
}`}
/>
<span className="text-sm">audio recording</span>
@@ -705,55 +465,6 @@ const HealthStatus = ({ className }: { className?: string }) => {
</div>
</DialogContent>
</Dialog>
-
- <Dialog open={isTroubleshootOpen} onOpenChange={setIsTroubleshootOpen}>
- <DialogContent className="max-w-2xl">
- <DialogHeader>
- <DialogTitle className="text-center">
- troubleshooting guide
- </DialogTitle>
- </DialogHeader>
- <div className="mt-6">
- <div className="mb-16">
- <h3 className="text-2xl font-bold mb-4 text-center">
- {troubleshootingSteps[currentStep].title}
- </h3>
- <p className="text-xl text-center mb-4">
- {troubleshootingSteps[currentStep].description}
- </p>
- {troubleshootingSteps[currentStep].action && (
- <div className="flex justify-center">
- {troubleshootingSteps[currentStep].action}
- </div>
- )}
- </div>
- <div className="flex justify-between items-center">
- <Button
- variant="outline"
- onClick={() => setCurrentStep((prev) => Math.max(0, prev - 1))}
- disabled={currentStep === 0}
- >
- <ChevronLeft className="mr-2 h-4 w-4" />
- previous
- </Button>
- <span className="text-sm text-gray-500">
- {currentStep + 1} / {troubleshootingSteps.length}
- </span>
- <Button
- onClick={() =>
- setCurrentStep((prev) =>
- Math.min(troubleshootingSteps.length - 1, prev + 1)
- )
- }
- disabled={currentStep === troubleshootingSteps.length - 1}
- >
- next
- <ChevronRight className="ml-2 h-4 w-4" />
- </Button>
- </div>
- </div>
- </DialogContent>
- </Dialog>
</>
);
};
diff --git a/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index 694a0ae63..e5482080f 100644
--- a/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -221,21 +221,18 @@ export function useSettings() {
const updatedSettings = { ...settings, ...newSettings };
setSettings(updatedSettings);
- // update the store for the fields that were changed
+ // Update all changed fields regardless of their values
for (const key in newSettings) {
- if (newSettings[key as keyof Settings]) {
+ if (Object.prototype.hasOwnProperty.call(newSettings, key)) {
console.log(
`Setting ${key}:`,
updatedSettings[key as keyof Settings]
- ); // Add this line
+ );
await store!.set(key, updatedSettings[key as keyof Settings]);
}
}
- await store!.save();
- // no need to call save() as we're using autoSave: true
} catch (error) {
console.error("failed to update settings:", error);
- // revert local state if store update fails
setSettings(settings);
}
};
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lock
index 9d4ab556e..6a64d4e25 100755
--- a/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -4713,7 +4713,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "0.14.35"
+version = "0.14.37"
dependencies = [
"anyhow",
"axum",
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index 1ce3214a7..160d7c2cb 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.14.36"
+version = "0.15.0"
description = ""
authors = ["you"]
license = ""