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
Reorganize settings sidebar with grouped sections and embedded chat
Louis Beaumontfd33b6455d09
diff --git a/apps/screenpipe-app-tauri/app/settings/page.tsx b/apps/screenpipe-app-tauri/app/settings/page.tsxindex e23e3c192..bdb6eb1fa 100644--- a/apps/screenpipe-app-tauri/app/settings/page.tsx+++ b/apps/screenpipe-app-tauri/app/settings/page.tsx@@ -14,6 +14,8 @@ import {MessageSquare,Cloud,Workflow,+ Users,+ Home,} from "lucide-react";import { cn } from "@/lib/utils";import { AccountSection } from "@/components/settings/account-section";@@ -26,11 +28,14 @@ import { ConnectionsSection } from "@/components/settings/connections-section";import { FeedbackSection } from "@/components/settings/feedback-section";import { PipesSection } from "@/components/settings/pipes-section";import { SyncSettings } from "@/components/settings/sync-settings";+import { TeamSection } from "@/components/settings/team-section";+import { StandaloneChat } from "@/components/standalone-chat";import { useRouter } from "next/navigation";import { useQueryState } from "nuqs";import { listen } from "@tauri-apps/api/event";type SettingsSection =+ | "home"| "general"| "ai"| "shortcuts"@@ -40,17 +45,18 @@ type SettingsSection =| "connections"| "cloud-sync"| "pipes"+ | "team"| "feedback";function SettingsPageContent() {const router = useRouter();const [activeSection, setActiveSection] = useQueryState("section", {- defaultValue: "general" as SettingsSection,+ defaultValue: "home" as SettingsSection,parse: (value) => {- if (["general", "ai", "shortcuts", "recording", "account", "disk-usage", "connections", "cloud-sync", "pipes", "feedback"].includes(value)) {+ if (["home", "general", "ai", "shortcuts", "recording", "account", "disk-usage", "connections", "cloud-sync", "pipes", "team", "feedback"].includes(value)) {return value as SettingsSection;}- return "general" as SettingsSection;+ return "home" as SettingsSection;},serialize: (value) => value,});@@ -61,6 +67,8 @@ function SettingsPageContent() {const renderSection = () => {switch (activeSection) {+ case "home":+ return <StandaloneChat className="!h-full" />;case "general":return <GeneralSettings />;case "ai":@@ -77,6 +85,8 @@ function SettingsPageContent() {return <ConnectionsSection />;case "pipes":return <PipesSection />;+ case "team":+ return <TeamSection />;case "cloud-sync":return showCloudSync ? <SyncSettings /> : <GeneralSettings />;case "feedback":@@ -84,70 +94,102 @@ function SettingsPageContent() {}};- const settingsSections = [+ const settingsGroups = [{- id: "general",- label: "General",- icon: <SettingsIcon className="h-4 w-4" />,- description: "Basic app settings and preferences",+ label: null,+ sections: [+ {+ id: "home",+ label: "Home",+ icon: <Home className="h-4 w-4" />,+ description: "Chat with your screen data",+ },+ {+ id: "pipes",+ label: "Pipes",+ icon: <Workflow className="h-4 w-4" />,+ description: "Scheduled agents on your screen data",+ },+ {+ id: "account",+ label: "Account",+ icon: <User className="h-4 w-4" />,+ description: "User account and authentication",+ },+ {+ id: "recording",+ label: "Recording",+ icon: <Video className="h-4 w-4" />,+ description: "Screen and audio recording settings",+ },+ {+ id: "ai",+ label: "AI Settings",+ icon: <Brain className="h-4 w-4" />,+ description: "AI models and processing options",+ },+ ],},{- id: "account",- label: "Account",- icon: <User className="h-4 w-4" />,- description: "User account and authentication",+ label: "Collaboration",+ sections: [+ {+ id: "team",+ label: "Team",+ icon: <Users className="h-4 w-4" />,+ description: "Share pipe configs with your team",+ },+ ...(showCloudSync+ ? [+ {+ id: "cloud-sync",+ label: "Cloud Sync",+ icon: <Cloud className="h-4 w-4" />,+ description: "Sync your data across devices",+ },+ ]+ : []),+ ],},{- id: "recording",- label: "Recording",- icon: <Video className="h-4 w-4" />,- description: "Screen and audio recording settings",+ label: "Preferences",+ sections: [+ {+ id: "general",+ label: "General",+ icon: <SettingsIcon className="h-4 w-4" />,+ description: "Basic app settings and preferences",+ },+ {+ id: "shortcuts",+ label: "Shortcuts",+ icon: <Keyboard className="h-4 w-4" />,+ description: "Keyboard shortcuts and hotkeys",+ },+ {+ id: "connections",+ label: "Connections",+ icon: <Plug className="h-4 w-4" />,+ description: "Connect to AI assistants like Claude",+ },+ {+ id: "disk-usage",+ label: "Disk Usage",+ icon: <HardDrive className="h-4 w-4" />,+ description: "Monitor storage usage for Screenpipe data",+ },+ ],},{- id: "ai",- label: "AI Settings",- icon: <Brain className="h-4 w-4" />,- description: "AI models and processing options",- },- {- id: "shortcuts",- label: "Shortcuts",- icon: <Keyboard className="h-4 w-4" />,- description: "Keyboard shortcuts and hotkeys",- },- {- id: "disk-usage",- label: "Disk Usage",- icon: <HardDrive className="h-4 w-4" />,- description: "Monitor storage usage for Screenpipe data",- },- {- id: "connections",- label: "Connections",- icon: <Plug className="h-4 w-4" />,- description: "Connect to AI assistants like Claude",- },- {- id: "pipes",- label: "Pipes",- icon: <Workflow className="h-4 w-4" />,- description: "Scheduled agents on your screen data",- },- ...(showCloudSync- ? [- {- id: "cloud-sync",- label: "Cloud Sync",- icon: <Cloud className="h-4 w-4" />,- description: "Sync your data across devices",- },- ]- : []),- {- id: "feedback",- label: "Send Feedback",- icon: <MessageSquare className="h-4 w-4" />,- description: "Report issues or share suggestions",+ label: null,+ sections: [+ {+ id: "feedback",+ label: "Send Feedback",+ icon: <MessageSquare className="h-4 w-4" />,+ description: "Report issues or share suggestions",+ },+ ],},];@@ -156,7 +198,7 @@ function SettingsPageContent() {const unlisten = listen<{ url: string }>("navigate", (event) => {const url = new URL(event.payload.url, window.location.origin);const section = url.searchParams.get("section");- if (section && ["general", "ai", "shortcuts", "recording", "account", "disk-usage", "connections", "pipes", "feedback"].includes(section)) {+ if (section && ["home", "general", "ai", "shortcuts", "recording", "account", "disk-usage", "connections", "cloud-sync", "pipes", "team", "feedback"].includes(section)) {setActiveSection(section as SettingsSection);}});@@ -180,28 +222,41 @@ function SettingsPageContent() {</div>{/* Navigation */}- <div className="p-2 space-y-0.5 flex-1 overflow-y-auto">- {settingsSections.map((section) => (- <button- key={section.id}- onClick={() => setActiveSection(section.id as SettingsSection)}- className={cn(- "w-full flex items-center space-x-2.5 px-3 py-2 rounded-lg transition-all duration-200 text-left group",- activeSection === section.id- ? "bg-card shadow-sm border border-border text-foreground"- : "hover:bg-card/50 text-muted-foreground hover:text-foreground",+ <div className="p-2 space-y-1 flex-1 overflow-y-auto">+ {settingsGroups.map((group, gi) => (+ <div key={gi}>+ {group.label && (+ <div className="px-3 pt-3 pb-1">+ <span className="text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60">+ {group.label}+ </span>+ </div>)}- >- <div className={cn(- "transition-colors flex-shrink-0",- activeSection === section.id- ? "text-primary"- : "text-muted-foreground group-hover:text-foreground"- )}>- {section.icon}+ <div className="space-y-0.5">+ {group.sections.map((section) => (+ <button+ key={section.id}+ onClick={() => setActiveSection(section.id as SettingsSection)}+ className={cn(+ "w-full flex items-center space-x-2.5 px-3 py-2 rounded-lg transition-all duration-200 text-left group",+ activeSection === section.id+ ? "bg-card shadow-sm border border-border text-foreground"+ : "hover:bg-card/50 text-muted-foreground hover:text-foreground",+ )}+ >+ <div className={cn(+ "transition-colors flex-shrink-0",+ activeSection === section.id+ ? "text-primary"+ : "text-muted-foreground group-hover:text-foreground"+ )}>+ {section.icon}+ </div>+ <span className="font-medium text-sm truncate">{section.label}</span>+ </button>+ ))}</div>- <span className="font-medium text-sm truncate">{section.label}</span>- </button>+ </div>))}</div>@@ -215,11 +270,17 @@ function SettingsPageContent() {{/* Content */}<div className="flex-1 flex flex-col h-full bg-background min-h-0 rounded-tr-lg">- <div className="flex-1 overflow-y-auto overflow-x-hidden min-h-0">- <div className="p-6 pb-12 max-w-4xl mx-auto">+ {activeSection === "home" ? (+ <div className="flex-1 min-h-0 overflow-hidden">{renderSection()}</div>- </div>+ ) : (+ <div className="flex-1 overflow-y-auto overflow-x-hidden min-h-0">+ <div className="p-6 pb-12 max-w-4xl mx-auto">+ {renderSection()}+ </div>+ </div>+ )}</div></div></div>diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsxindex 879105b3d..15aaa11c0 100644--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx@@ -193,6 +193,7 @@ function GridDissolveLoader({ label = "analyzing..." }: { label?: string }) {});}, 120);return () => window.clearInterval(id);+ // eslint-disable-next-line react-hooks/exhaustive-deps}, []);return (@@ -484,7 +485,7 @@ function CollapsibleUserMessage({ label, fullContent }: { label: string; fullCon);}-export function StandaloneChat() {+export function StandaloneChat({ className }: { className?: string } = {}) {const { settings, updateSettings, isSettingsLoaded, reloadStore } = useSettings();const { isMac } = usePlatform();const { items: appItems } = useSqlAutocomplete("app");@@ -502,6 +503,7 @@ export function StandaloneChat() {// ignore corrupt data}}+ // eslint-disable-next-line react-hooks/exhaustive-deps}, [isSettingsLoaded]);const saveCustomTemplate = async (template: CustomTemplate) => {@@ -659,6 +661,7 @@ export function StandaloneChat() {saveConversation(messages);}prevIsLoadingRef.current = isLoading;+ // eslint-disable-next-line react-hooks/exhaustive-deps}, [isLoading, messages]);// Delete a conversation@@ -946,6 +949,7 @@ export function StandaloneChat() {}});return () => { unlisten.then((fn) => fn()); };+ // eslint-disable-next-line react-hooks/exhaustive-deps}, [settings.chatHistory?.conversations]);const appMentionSuggestions = React.useMemo(@@ -1184,6 +1188,7 @@ export function StandaloneChat() {model: activePreset.model || "",apiKey: ("apiKey" in activePreset ? (activePreset.apiKey as string) : null) || null,};+ // eslint-disable-next-line react-hooks/exhaustive-deps}, [activePreset?.provider, activePreset?.url, activePreset?.model, activePreset?.apiKey]);// Check Pi status on mount — Pi is auto-started at app boot by Rust@@ -1270,6 +1275,7 @@ export function StandaloneChat() {}};restartPi();+ // eslint-disable-next-line react-hooks/exhaustive-deps}, [activePreset?.provider, activePreset?.model, settings.user?.token]);// Listen for Pi events (all providers route through Pi)@@ -1714,6 +1720,7 @@ export function StandaloneChat() {unlistenTerminated?.();unlistenLog?.();};+ // eslint-disable-next-line react-hooks/exhaustive-deps}, []);// Generate follow-up suggestions using Apple Intelligence@@ -2061,7 +2068,7 @@ export function StandaloneChat() {};return (- <div className="flex flex-col h-screen bg-background">+ <div className={cn("flex flex-col h-screen bg-background", className)}>{/* Header - draggable */}{/* Add left padding on macOS to avoid traffic light overlap */}<div@@ -2431,6 +2438,7 @@ export function StandaloneChat() {{prefillFrameId && (<div className="flex-shrink-0"><div className="relative group">+ {/* eslint-disable-next-line @next/next/no-img-element */}<imgsrc={`http://localhost:3030/frames/${prefillFrameId}`}alt="Attached frame"@@ -2636,6 +2644,7 @@ export function StandaloneChat() {{pastedImage && (<div className="absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1"><div className="relative group">+ {/* eslint-disable-next-line @next/next/no-img-element */}<imgsrc={pastedImage}alt="Pasted"