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
fix(connections): find Gmail with Google searches (#6368)
Louis Beaumont67f8cc7ceb74
diff --git a/apps/screenpipe-app-tauri/components/settings/connections-section.tsx b/apps/screenpipe-app-tauri/components/settings/connections-section.tsxindex 98194a2d8..63150dba4 100644--- a/apps/screenpipe-app-tauri/components/settings/connections-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/connections-section.tsx@@ -30,6 +30,7 @@ import {CONNECTION_CATEGORY_BY_ID,CONNECTION_HARDCODED_DESCRIPTIONS,compareConnectionTiles,+ connectionMatchesSearch,getSuggestedConnectionsForDevice,normalizeConnectionCategory,type ConnectionSuggestionTile,@@ -4049,7 +4050,7 @@ export function ConnectionsSection({}const q = search.toLowerCase().trim();if (q) {- tiles = tiles.filter(t => t.name.toLowerCase().includes(q));+ tiles = tiles.filter((tile) => connectionMatchesSearch(tile, q));}return [...tiles].sort(compareConnectionTiles);}, [allTiles, categoryFilter, search]);diff --git a/apps/screenpipe-app-tauri/lib/constants/__tests__/connections-suggestions.test.ts b/apps/screenpipe-app-tauri/lib/constants/__tests__/connections-suggestions.test.tsindex b8aff5c96..033f3a026 100644--- a/apps/screenpipe-app-tauri/lib/constants/__tests__/connections-suggestions.test.ts+++ b/apps/screenpipe-app-tauri/lib/constants/__tests__/connections-suggestions.test.ts@@ -7,6 +7,7 @@ import {getSuggestedConnectionsForDevice,isSuggestedForThisDevice,compareConnectionTiles,+ connectionMatchesSearch,type ConnectionSuggestionTile,} from "../connections";@@ -84,3 +85,21 @@ describe("connection suggestions", () => {expect(group.map((t) => t.id)).toEqual(["github", "linear"]);});});++describe("connection search", () => {+ const gmail = tile("gmail", {+ name: "Gmail",+ description: "Read your Gmail inbox",+ });++ it.each(["gmail", "google", "google mail", "email", "mail"])(+ "finds Gmail with %s",+ (query) => {+ expect(connectionMatchesSearch(gmail, query)).toBe(true);+ },+ );++ it("does not match unrelated searches", () => {+ expect(connectionMatchesSearch(gmail, "calendar")).toBe(false);+ });+});diff --git a/apps/screenpipe-app-tauri/lib/constants/connections.ts b/apps/screenpipe-app-tauri/lib/constants/connections.tsindex 843e6b28d..2b4115c0d 100644--- a/apps/screenpipe-app-tauri/lib/constants/connections.ts+++ b/apps/screenpipe-app-tauri/lib/constants/connections.ts@@ -152,6 +152,25 @@ export interface ConnectionSuggestionTile {description?: string;}+const CONNECTION_SEARCH_ALIASES_BY_ID: Record<string, readonly string[]> = {+ gmail: ["google", "google mail", "email", "mail"],+};++export function connectionMatchesSearch(+ tile: ConnectionSuggestionTile,+ query: string,+): boolean {+ const normalizedQuery = query.trim().toLowerCase();+ if (!normalizedQuery) return true;++ return [+ tile.name,+ tile.id,+ tile.description ?? "",+ ...(CONNECTION_SEARCH_ALIASES_BY_ID[tile.id] ?? []),+ ].some((term) => term.toLowerCase().includes(normalizedQuery));+}+export const CONNECTION_HARDCODED_DESCRIPTIONS: Record<string, string> = {"claude": "Search your screen & audio from Claude Desktop via MCP","cursor": "Give Cursor AI access to your screen history via MCP",