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

feat: add ignored windows (#545)

tribhuwane201a05cf64c
diff --git a/screenpipe-app-tauri/components/recording-settings.tsx b/screenpipe-app-tauri/components/recording-settings.tsx
index 725fa79fe..d344b9927 100644
--- a/screenpipe-app-tauri/components/recording-settings.tsx
+++ b/screenpipe-app-tauri/components/recording-settings.tsx
@@ -11,6 +11,7 @@ import {
} from "./ui/select";
import { Button } from "@/components/ui/button";
import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
+import { SqlAutocompleteInput } from "./sql-autocomplete-input";
import {
Check,
ChevronsUpDown,
@@ -19,6 +20,7 @@ import {
Languages,
Mic,
Monitor,
+ AppWindowMac,
X,
} from "lucide-react";
import { cn, getCliPath } from "@/lib/utils";
@@ -92,6 +94,8 @@ export function RecordingSettings({
const [openAudioDevices, setOpenAudioDevices] = React.useState(false);
const [openMonitors, setOpenMonitors] = React.useState(false);
const [openLanguages, setOpenLanguages] = React.useState(false);
+ const [windowsForIgnore, setWindowsForIgnore] = useState("");
+ const [windowsForInclude, setWindowsForInclude] = useState("");
const [availableMonitors, setAvailableMonitors] = useState<MonitorDevice[]>(
[]
@@ -272,10 +276,12 @@ export function RecordingSettings({
};
const handleAddIgnoredWindow = (value: string) => {
- if (value && !localSettings.ignoredWindows.includes(value)) {
+ const lowerCaseValue = value.toLowerCase();
+ if (value && !localSettings.ignoredWindows.map(w => w.toLowerCase()).includes(lowerCaseValue)) {
setLocalSettings({
...localSettings,
ignoredWindows: [...localSettings.ignoredWindows, value],
+ includedWindows: localSettings.includedWindows.filter(w => w.toLowerCase() !== lowerCaseValue),
});
}
};
@@ -288,10 +294,12 @@ export function RecordingSettings({
};
const handleAddIncludedWindow = (value: string) => {
- if (value && !localSettings.includedWindows.includes(value)) {
+ const lowerCaseValue = value.toLowerCase();
+ if (value && !localSettings.includedWindows.map(w => w.toLowerCase()).includes(lowerCaseValue)) {
setLocalSettings({
...localSettings,
includedWindows: [...localSettings.includedWindows, value],
+ ignoredWindows: localSettings.ignoredWindows.filter(w => w.toLowerCase() !== lowerCaseValue),
});
}
};
@@ -961,23 +969,26 @@ export function RecordingSettings({
))}
</div>
<div className="flex gap-2">
- <Input
+ <SqlAutocompleteInput
id="ignoredWindows"
- placeholder="add window to ignore"
- onKeyPress={(e) => {
+ type="window"
+ icon={<AppWindowMac className="h-4 w-4" />}
+ value={windowsForIgnore}
+ onChange={(value) => setWindowsForIgnore(value)}
+ placeholder="add windows to ignore"
+ className="flex-grow"
+ onKeyDown={(e) => {
if (e.key === "Enter") {
- handleAddIgnoredWindow(e.currentTarget.value);
- e.currentTarget.value = "";
+ e.preventDefault();
+ handleAddIgnoredWindow(windowsForIgnore);
+ setWindowsForIgnore("");
}
}}
/>
<Button
onClick={() => {
- const input = document.getElementById(
- "ignoredWindows"
- ) as HTMLInputElement;
- handleAddIgnoredWindow(input.value);
- input.value = "";
+ handleAddIgnoredWindow(windowsForIgnore);
+ setWindowsForIgnore("");
}}
>
add
@@ -1026,23 +1037,26 @@ export function RecordingSettings({
))}
</div>
<div className="flex gap-2">
- <Input
+ <SqlAutocompleteInput
id="includedWindows"
+ type="window"
+ icon={<AppWindowMac className="h-4 w-4" />}
+ value={windowsForInclude}
+ onChange={(value) => setWindowsForInclude(value)}
placeholder="add window to include"
- onKeyPress={(e) => {
+ className="flex-grow"
+ onKeyDown={(e) => {
if (e.key === "Enter") {
- handleAddIncludedWindow(e.currentTarget.value);
- e.currentTarget.value = "";
+ e.preventDefault();
+ handleAddIncludedWindow(windowsForInclude);
+ setWindowsForInclude("");
}
}}
/>
<Button
onClick={() => {
- const input = document.getElementById(
- "includedWindows"
- ) as HTMLInputElement;
- handleAddIncludedWindow(input.value);
- input.value = "";
+ handleAddIncludedWindow(windowsForInclude);
+ setWindowsForInclude("");
}}
>
add
diff --git a/screenpipe-app-tauri/components/sql-autocomplete-input.tsx b/screenpipe-app-tauri/components/sql-autocomplete-input.tsx
index dbed0f9e7..0d38561b6 100644
--- a/screenpipe-app-tauri/components/sql-autocomplete-input.tsx
+++ b/screenpipe-app-tauri/components/sql-autocomplete-input.tsx
@@ -13,6 +13,7 @@ interface SqlAutocompleteInputProps {
type: "app" | "window";
icon: React.ReactNode;
className?: string;
+ onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
}
export function SqlAutocompleteInput({
@@ -23,6 +24,7 @@ export function SqlAutocompleteInput({
type,
icon,
className,
+ onKeyDown,
}: SqlAutocompleteInputProps) {
const { items, isLoading } = useSqlAutocomplete(type);
const [open, setOpen] = useState(false);
@@ -91,6 +93,8 @@ export function SqlAutocompleteInput({
onFocus={() => setOpen(true)}
className="pl-10 pr-8 w-full"
autoCorrect="off"
+ aria-autocomplete="none"
+ onKeyDown={onKeyDown}
/>
{inputValue && (
<button
diff --git a/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index 453e66db4..e2e2fdcaa 100644
--- a/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -189,21 +189,48 @@ export function useSettings() {
(await store!.get<Language[]>("languages")) || [];
const currentPlatform = await platform();
+ const ignoredWindowsInAllOS = [
+ "bit",
+ "VPN",
+ "Trash",
+ "Private",
+ "Incognito",
+ "Wallpaper",
+ "Settings",
+ "Keepass",
+ "Recorder",
+ "Vaults",
+ "OBS Studio",
+ ];
const defaultIgnoredWindows =
- currentPlatform === "macos" // TODO: windows and linux
+ currentPlatform === "macos"
+ ? [
+ ...ignoredWindowsInAllOS,
+ ".env",
+ "Item-0",
+ "App Icon Window",
+ "Battery",
+ "Shortcuts",
+ "WiFi",
+ "BentoBox",
+ "Clock",
+ "Dock",
+ "DeepL",
+ ]
+ : currentPlatform === "windows"
+ ? [
+ ...ignoredWindowsInAllOS,
+ "Nvidia",
+ "Control Panel",
+ "System Properties",
+ ]
+ : currentPlatform === "linux"
? [
- "bit",
- ".env",
- "Item-0",
- "App Icon Window",
- "Battery",
- "Shortcuts",
- "WiFi",
- "BentoBox",
- "Clock",
- "Dock",
- "DeepL",
- ]
+ ...ignoredWindowsInAllOS,
+ "Info center",
+ "Discover",
+ "Parted",
+ ]
: [];
const savedIgnoredWindows = await store!.get<string[]>(