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
release-app fix settings in tray menu
Louis Beaumont754fa8dda3f3
diff --git a/screenpipe-app-tauri/app/page.tsx b/screenpipe-app-tauri/app/page.tsxindex 6e202e325..97d2f629c 100644--- a/screenpipe-app-tauri/app/page.tsx+++ b/screenpipe-app-tauri/app/page.tsx@@ -13,6 +13,7 @@ import { ChangelogDialog } from "@/components/changelog-dialog";import { BreakingChangesInstructionsDialog } from "@/components/breaking-changes-instructions-dialog";import { useChangelogDialog } from "@/lib/hooks/use-changelog-dialog";import { useStatusDialog } from "@/lib/hooks/use-status-dialog";+import { useSettingsDialog } from "@/lib/hooks/use-settings-dialog";import { platform } from "@tauri-apps/plugin-os";import { PipeStore } from "@/components/pipe-store";@@ -32,6 +33,7 @@ export default function Home() {const { showOnboarding, setShowOnboarding } = useOnboarding();const { setShowChangelogDialog } = useChangelogDialog();const { open: openStatusDialog } = useStatusDialog();+ const { setIsOpen: setSettingsOpen } = useSettingsDialog();const isProcessingRef = React.useRef(false);useEffect(() => {@@ -59,24 +61,20 @@ export default function Home() {}}- console.log("parsedUrl", parsedUrl);-- const path = parsedUrl.hostname;-- // Handle UI navigation- switch (path) {- case "/settings":- document.getElementById("settings-trigger")?.click();- break;- case "/changelog":- setShowChangelogDialog(true);- break;- case "/onboarding":- setShowOnboarding(true);- break;- case "/status":- openStatusDialog();- break;+ if (url.includes("settings")) {+ setSettingsOpen(true);+ }++ if (url.includes("changelog")) {+ setShowChangelogDialog(true);+ }++ if (url.includes("onboarding")) {+ setShowOnboarding(true);+ }++ if (url.includes("status")) {+ openStatusDialog();}}});@@ -197,7 +195,7 @@ export default function Home() {});if (deepLinkUnsubscribe) deepLinkUnsubscribe();};- }, []);+ }, [setSettingsOpen]);useEffect(() => {if (settings.userId) {diff --git a/screenpipe-app-tauri/components/header.tsx b/screenpipe-app-tauri/components/header.tsxindex 80f973b0f..25fe01499 100644--- a/screenpipe-app-tauri/components/header.tsx+++ b/screenpipe-app-tauri/components/header.tsx@@ -21,7 +21,6 @@ import {Folder,Book,User,- Fingerprint,Settings2,} from "lucide-react";import { open } from "@tauri-apps/plugin-shell";@@ -35,7 +34,7 @@ import { useOnboarding } from "@/lib/hooks/use-onboarding";import { listen } from "@tauri-apps/api/event";import localforage from "localforage";import { useChangelogDialog } from "@/lib/hooks/use-changelog-dialog";-import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";+import { useSettingsDialog } from "@/lib/hooks/use-settings-dialog";export default function Header() {const [showInbox, setShowInbox] = useState(false);@@ -104,6 +103,7 @@ export default function Header() {const { setShowOnboarding } = useOnboarding();const { setShowChangelogDialog } = useChangelogDialog();+ const { setIsOpen: setSettingsOpen } = useSettingsDialog();return (<div>@@ -114,6 +114,7 @@ export default function Header() {</div><div className="flex space-x-4 absolute top-4 right-4"><HealthStatus className="mt-3 cursor-pointer" />+ <Settings /><Buttonvariant="ghost"@@ -139,25 +140,16 @@ export default function Header() {<DropdownMenuLabel>account</DropdownMenuLabel><DropdownMenuSeparator /><DropdownMenuGroup>- <Dialog modal={true}>- <DialogTrigger asChild>- <DropdownMenuItem- id="settings-trigger"- onSelect={(e) => e.preventDefault()}- className="cursor-pointer p-1.5"- >- <Settings2 className="mr-2 h-4 w-4" />- <span>settings</span>- </DropdownMenuItem>- </DialogTrigger>-- <DialogContent- className="max-w-[80vw] w-full max-h-[80vh] h-full overflow-hidden p-0 [&>button]:hidden"- onClick={(e) => e.stopPropagation()}- >- <Settings />- </DialogContent>- </Dialog>+ <DropdownMenuItem+ onSelect={(e) => {+ e.preventDefault();+ setSettingsOpen(true);+ }}+ className="cursor-pointer p-1.5"+ >+ <Settings2 className="mr-2 h-4 w-4" />+ <span>settings</span>+ </DropdownMenuItem></DropdownMenuGroup><DropdownMenuSeparator /><DropdownMenuGroup>diff --git a/screenpipe-app-tauri/components/settings.tsx b/screenpipe-app-tauri/components/settings.tsxindex 7e160ec9e..e758d073d 100644--- a/screenpipe-app-tauri/components/settings.tsx+++ b/screenpipe-app-tauri/components/settings.tsx@@ -35,6 +35,8 @@ import { invoke } from "@tauri-apps/api/core";import { useProfiles } from "@/lib/hooks/use-profiles";import { toast } from "./ui/use-toast";import { DataImportSection } from "./settings/data-import-section";+import { Dialog, DialogContent } from "./ui/dialog";+import { useSettingsDialog } from "@/lib/hooks/use-settings-dialog";type SettingsSection =| "ai"@@ -45,7 +47,7 @@ type SettingsSection =| "dataImport";export function Settings() {- // const { settings, switchProfile, deleteProfile } = useSettings();+ const { isOpen, setIsOpen: setSettingsOpen } = useSettingsDialog();const {profiles,activeProfile,@@ -122,144 +124,155 @@ export function Settings() {}, [profiles]);return (- <div className="flex h-full">- {/* Sidebar */}- <div className="w-64 border-r bg-[#f3f3f3]">- <DialogHeader className="flex items-center gap-4 ml-6 mt-4">- <DialogTitle className="text-2xl font-bold">settings</DialogTitle>- </DialogHeader>+ <Dialog modal={true} open={isOpen} onOpenChange={setSettingsOpen}>+ <DialogContent+ className="max-w-[80vw] w-full max-h-[80vh] h-full overflow-hidden p-0 [&>button]:hidden"+ onClick={(e) => e.stopPropagation()}+ >+ <div className="flex h-full">+ {/* Sidebar */}+ <div className="w-64 border-r bg-[#f3f3f3]">+ <DialogHeader className="flex items-center gap-4 ml-6 mt-4">+ <DialogTitle className="text-2xl font-bold">settings</DialogTitle>+ </DialogHeader>- {/* Profile Selector */}- <div className="px-4 py-3 border-b">- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button- variant="outline"- className="w-full justify-between font-mono text-sm"- >- {activeProfile}- <ChevronDown className="h-4 w-4 opacity-50" />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent className="w-56">- {profiles?.map((profile) => (- <DropdownMenuItem- key={profile}- className="justify-between"- onSelect={() => handleSwitchProfile(profile)}- >- <span className="font-mono">{profile}</span>- {activeProfile === profile && <Check className="h-4 w-4" />}- {profile !== "default" && (- <Trash2- className="h-4 w-4 opacity-50 hover:opacity-100"- onClick={(e) => {- e.stopPropagation();- deleteProfile(profile);- }}- />- )}- </DropdownMenuItem>- ))}- <DropdownMenuSeparator />- {isCreatingProfile ? (- <div className="p-2">- <form- onSubmit={(e) => {- e.preventDefault();- handleCreateProfile();- }}- className="flex gap-2"+ {/* Profile Selector */}+ <div className="px-4 py-3 border-b">+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button+ variant="outline"+ className="w-full justify-between font-mono text-sm">- <Input- value={newProfileName}- onChange={(e) => setNewProfileName(e.target.value)}- placeholder="profile name"- className="h-8 font-mono"- autoFocus- />- <Button- type="submit"- size="sm"- disabled={!newProfileName.trim()}+ {activeProfile}+ <ChevronDown className="h-4 w-4 opacity-50" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent className="w-56">+ {profiles?.map((profile) => (+ <DropdownMenuItem+ key={profile}+ className="justify-between"+ onSelect={() => handleSwitchProfile(profile)}>- <Check className="h-4 w-4" />- </Button>- </form>- </div>- ) : (- <DropdownMenuItem- onSelect={(e) => {- e.preventDefault();- setIsCreatingProfile(true);- }}- className="gap-2"- >- <Plus className="h-4 w-4" />- <span>new profile</span>- </DropdownMenuItem>- )}- </DropdownMenuContent>- </DropdownMenu>- </div>+ <span className="font-mono">{profile}</span>+ {activeProfile === profile && (+ <Check className="h-4 w-4" />+ )}+ {profile !== "default" && (+ <Trash2+ className="h-4 w-4 opacity-50 hover:opacity-100"+ onClick={(e) => {+ e.stopPropagation();+ deleteProfile(profile);+ }}+ />+ )}+ </DropdownMenuItem>+ ))}+ <DropdownMenuSeparator />+ {isCreatingProfile ? (+ <div className="p-2">+ <form+ onSubmit={(e) => {+ e.preventDefault();+ handleCreateProfile();+ }}+ className="flex gap-2"+ >+ <Input+ value={newProfileName}+ onChange={(e) => setNewProfileName(e.target.value)}+ placeholder="profile name"+ className="h-8 font-mono"+ autoFocus+ />+ <Button+ type="submit"+ size="sm"+ disabled={!newProfileName.trim()}+ >+ <Check className="h-4 w-4" />+ </Button>+ </form>+ </div>+ ) : (+ <DropdownMenuItem+ onSelect={(e) => {+ e.preventDefault();+ setIsCreatingProfile(true);+ }}+ className="gap-2"+ >+ <Plus className="h-4 w-4" />+ <span>new profile</span>+ </DropdownMenuItem>+ )}+ </DropdownMenuContent>+ </DropdownMenu>+ </div>- {/* Existing Settings Navigation */}- <div className="flex flex-col space-y-1 p-4">- {[- {- id: "account",- label: "account",- icon: <User className="h-4 w-4" />,- },- {- id: "ai",- label: "ai settings",- icon: <Brain className="h-4 w-4" />,- },- {- id: "recording",- label: "recording",- icon: <Video className="h-4 w-4" />,- },- {- id: "shortcuts",- label: "shortcuts",- icon: <Keyboard className="h-4 w-4" />,- },- {- id: "diskUsage",- label: "disk usage",- icon: <HardDrive className="h-4 w-4" />,- },- {- id: "dataImport",- label: "data import",- icon: <FolderInput className="h-4 w-4" />,- },- ].map((section) => (- <button- key={section.id}- onClick={() => setActiveSection(section.id as SettingsSection)}- className={cn(- "flex items-center space-x-2 px-4 py-1.5 rounded-lg transition-colors",- activeSection === section.id- ? "bg-black/90 text-white"- : "hover:bg-black/10"- )}- >- {section.icon}- <span>{section.label}</span>- </button>- ))}- </div>- </div>+ {/* Existing Settings Navigation */}+ <div className="flex flex-col space-y-1 p-4">+ {[+ {+ id: "account",+ label: "account",+ icon: <User className="h-4 w-4" />,+ },+ {+ id: "ai",+ label: "ai settings",+ icon: <Brain className="h-4 w-4" />,+ },+ {+ id: "recording",+ label: "recording",+ icon: <Video className="h-4 w-4" />,+ },+ {+ id: "shortcuts",+ label: "shortcuts",+ icon: <Keyboard className="h-4 w-4" />,+ },+ {+ id: "diskUsage",+ label: "disk usage",+ icon: <HardDrive className="h-4 w-4" />,+ },+ {+ id: "dataImport",+ label: "data import",+ icon: <FolderInput className="h-4 w-4" />,+ },+ ].map((section) => (+ <button+ key={section.id}+ onClick={() =>+ setActiveSection(section.id as SettingsSection)+ }+ className={cn(+ "flex items-center space-x-2 px-4 py-1.5 rounded-lg transition-colors",+ activeSection === section.id+ ? "bg-black/90 text-white"+ : "hover:bg-black/10"+ )}+ >+ {section.icon}+ <span>{section.label}</span>+ </button>+ ))}+ </div>+ </div>- {/* Content */}- <div className="flex-1 flex flex-col h-full max-h-[80vh]">- <div className="flex-1 overflow-y-auto px-4">- <div className="max-h-full">{renderSection()}</div>+ {/* Content */}+ <div className="flex-1 flex flex-col h-full max-h-[80vh]">+ <div className="flex-1 overflow-y-auto px-4">+ <div className="max-h-full">{renderSection()}</div>+ </div>+ </div></div>- </div>- </div>+ </DialogContent>+ </Dialog>);}diff --git a/screenpipe-app-tauri/lib/hooks/use-settings-dialog.ts b/screenpipe-app-tauri/lib/hooks/use-settings-dialog.tsnew file mode 100644index 000000000..3fe4484eb--- /dev/null+++ b/screenpipe-app-tauri/lib/hooks/use-settings-dialog.ts@@ -0,0 +1,11 @@+import { create } from "zustand";++interface SettingsDialogStore {+ isOpen: boolean;+ setIsOpen: (open: boolean) => void;+}++export const useSettingsDialog = create<SettingsDialogStore>((set) => ({+ isOpen: false,+ setIsOpen: (open) => set({ isOpen: open }),+}));diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.tomlindex 9d8320d56..4202cb760 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.31.8"+version = "0.31.9"description = ""authors = ["you"]license = ""