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
test(e2e): cover Windows notification bell UX
Louis Beaumont26c6f178b65a
diff --git a/apps/screenpipe-app-tauri/components/notification-bell.tsx b/apps/screenpipe-app-tauri/components/notification-bell.tsxindex 70cc6ea53..806c45d2a 100644--- a/apps/screenpipe-app-tauri/components/notification-bell.tsx+++ b/apps/screenpipe-app-tauri/components/notification-bell.tsx@@ -18,6 +18,7 @@ import {} from "@/components/ui/popover";import { useRouter } from "next/navigation";import { showChatWithPrefill } from "@/lib/chat-utils";+import { localFetch } from "@/lib/api";interface NotificationEntry {id: string;@@ -29,8 +30,6 @@ interface NotificationEntry {read: boolean;}-const API_BASE = "http://localhost:11435";-async function openNotificationLink(href: string) {const raw = href.trim();if (!raw) return;@@ -82,7 +81,7 @@ export function NotificationBell() {const loadHistory = useCallback(async () => {try {- const res = await fetch(`${API_BASE}/notifications`);+ const res = await localFetch("/notifications");if (res.ok) {const entries: NotificationEntry[] = await res.json();setHistory(entries);@@ -103,7 +102,7 @@ export function NotificationBell() {const markAllRead = async () => {setHistory((prev) => prev.map((n) => ({ ...n, read: true })));try {- await fetch(`${API_BASE}/notifications`, { method: "POST" });+ await localFetch("/notifications", { method: "POST" });} catch {}};@@ -111,7 +110,7 @@ export function NotificationBell() {posthog.capture("notification_bell_clear_all", { count: history.length });setHistory([]);try {- await fetch(`${API_BASE}/notifications`, { method: "DELETE" });+ await localFetch("/notifications", { method: "DELETE" });} catch {}};@@ -124,7 +123,7 @@ export function NotificationBell() {setHistory((prev) => prev.filter((n) => n.id !== id));if (expandedId === id) setExpandedId(null);try {- await fetch(`${API_BASE}/notifications/${encodeURIComponent(id)}`, { method: "DELETE" });+ await localFetch(`/notifications/${encodeURIComponent(id)}`, { method: "DELETE" });} catch {}};@@ -153,7 +152,11 @@ export function NotificationBell() {}}><PopoverTrigger asChild>- <button className="relative p-1.5 rounded-md hover:bg-muted/60 transition-colors">+ <button+ aria-label="notifications"+ data-testid="notification-bell-trigger"+ className="relative p-1.5 rounded-md hover:bg-muted/60 transition-colors"+ ><Bell className="h-3.5 w-3.5 text-muted-foreground" />{unreadCount > 0 && (<span className="absolute -top-0.5 -right-0.5 min-w-[14px] h-[14px] flex items-center justify-center rounded-full bg-foreground text-background text-[9px] font-medium px-1">@@ -163,6 +166,7 @@ export function NotificationBell() {</button></PopoverTrigger><PopoverContent+ data-testid="notification-bell-popover"className="w-[320px] p-0 border-border"align="end"sideOffset={4}@@ -174,6 +178,7 @@ export function NotificationBell() {</span>{history.length > 0 && (<button+ data-testid="notification-bell-clear-all"onClick={clearAll}className="text-[10px] text-muted-foreground hover:text-foreground transition-colors">@@ -185,7 +190,10 @@ export function NotificationBell() {{/* List */}<div className="max-h-[360px] overflow-y-auto">{history.length === 0 ? (- <div className="px-3 py-6 text-center text-xs text-muted-foreground">+ <div+ data-testid="notification-bell-empty"+ className="px-3 py-6 text-center text-xs text-muted-foreground"+ >no notifications yet</div>) : (@@ -194,6 +202,8 @@ export function NotificationBell() {return (<divkey={entry.id}+ data-testid={`notification-bell-item-${entry.id}`}+ data-notification-id={entry.id}className="border-b border-border/50 last:border-0"><div@@ -261,6 +271,7 @@ export function NotificationBell() {{formatTime(entry.timestamp)}</span><button+ data-testid={`notification-bell-dismiss-${entry.id}`}onClick={(e) => {e.stopPropagation();dismissOne(entry.id);@@ -274,7 +285,10 @@ export function NotificationBell() {</div></div>{isExpanded && (- <div className="px-3 pb-2 pl-7">+ <div+ data-testid={`notification-bell-expanded-${entry.id}`}+ className="px-3 pb-2 pl-7"+ >{entry.body && (<div className="text-[10px] text-muted-foreground leading-relaxed mb-2 [&_p]:mb-1 [&_p:last-child]:mb-0 [&_strong]:text-foreground [&_code]:bg-muted [&_code]:px-1 [&_code]:text-[9px] [&_ul]:pl-4 [&_ul]:my-0.5 [&_li]:my-0"><ReactMarkdown@@ -309,6 +323,7 @@ export function NotificationBell() {</span>)}<button+ data-testid={`notification-bell-ask-ai-${entry.id}`}onClick={(e) => {e.stopPropagation();posthog.capture("notification_bell_ask_ai", {@@ -341,6 +356,7 @@ export function NotificationBell() {{/* Footer */}<div className="px-3 py-1.5 border-t border-border"><button+ data-testid="notification-bell-manage-settings"onClick={() => {setOpen(false);router.push("/settings?section=notifications");diff --git a/apps/screenpipe-app-tauri/components/settings/notifications-settings.tsx b/apps/screenpipe-app-tauri/components/settings/notifications-settings.tsxindex 45094409c..4f39782ea 100644--- a/apps/screenpipe-app-tauri/components/settings/notifications-settings.tsx+++ b/apps/screenpipe-app-tauri/components/settings/notifications-settings.tsx@@ -58,6 +58,7 @@ export function NotificationsSettings() {</p></div><Switch+ data-testid="notification-pref-capture-stalls"checked={prefs.captureStalls ?? true}onCheckedChange={(v) => {updateSettings({@@ -77,6 +78,7 @@ export function NotificationsSettings() {</p></div><Switch+ data-testid="notification-pref-app-updates"checked={prefs.appUpdates ?? true}onCheckedChange={(v) => updatePref("appUpdates", v)}/>@@ -120,6 +122,7 @@ export function NotificationsSettings() {</SelectContent></Select><Switch+ data-testid="notification-pref-pipe-suggestions"checked={settings.pipeSuggestionsEnabled !== false}onCheckedChange={(checked) => {updateSettings({@@ -146,6 +149,7 @@ export function NotificationsSettings() {</p></div><Switch+ data-testid="notification-pref-pipe-notifications"checked={prefs.pipeNotifications ?? true}onCheckedChange={(v) => updatePref("pipeNotifications", v)}/>@@ -160,6 +164,7 @@ export function NotificationsSettings() {</p></div><Switch+ data-testid="notification-pref-display-changes"checked={prefs.displayChanges ?? true}onCheckedChange={(v) => updatePref("displayChanges", v)}/>@@ -174,6 +179,7 @@ export function NotificationsSettings() {</p></div><Switch+ data-testid="notification-pref-meeting-live-notes"checked={prefs.meetingLiveNotes ?? true}onCheckedChange={(v) => updatePref("meetingLiveNotes", v)}/>@@ -188,6 +194,7 @@ export function NotificationsSettings() {</p></div><Switch+ data-testid="notification-pref-audio-capture-stalled"checked={prefs.audioCaptureStalled ?? true}onCheckedChange={(v) => updatePref("audioCaptureStalled", v)}/>@@ -202,6 +209,7 @@ export function NotificationsSettings() {</p></div><Switch+ data-testid="notification-pref-live-transcript-stalled"checked={prefs.liveTranscriptStalled ?? true}onCheckedChange={(v) => updatePref("liveTranscriptStalled", v)}/>diff --git a/apps/screenpipe-app-tauri/e2e/README.md b/apps/screenpipe-app-tauri/e2e/README.mdindex 9da4f78bd..7329a1226 100644--- a/apps/screenpipe-app-tauri/e2e/README.md+++ b/apps/screenpipe-app-tauri/e2e/README.md@@ -162,7 +162,7 @@ Saves to `e2e/videos/`.| `timeline.spec.ts` | Navigates to Timeline; seeds a capture event; verifies at least one frame renders || `windows-core-recording.spec.ts` | Windows opt-in. Enables real vision recording and requires API auth, health/load, audio/device, vision, and search endpoints to stay responsive. In CI it uses `SCREENPIPE_E2E_SEED=onboarding,no-audio` so hosted runners exercise OCR without booting Whisper. When the runner exposes usable desktop frames, it also shows a foreground marker window and verifies OCR indexing/query search plus Timeline frame metadata, visible scrubber clicks, and arrow-key frame stepping; hosted runners without frames self-skip those capture-dependent assertions. || `windows-system-integration.spec.ts` | Windows-only. Verifies isolated data dir, native DLL/WebView2 runtime, display/DPI topology, localhost-only API binding, process health, Defender visibility, audio service/device health, concurrent local API load, focus churn, rapid Home-window routing, Home close/reopen backend survival, and absence of Windows crash-report events during the suite |-| `windows-user-journey.spec.ts` | Windows-only. Drives Home search button -> floating Search input -> Timeline -> Home, opens Recording settings to reveal Windows audio troubleshooting controls, starts/stops a manual Meeting note through the visible UI, opens the Shortcuts editor and cancels an open-search hotkey capture, toggles the Display shortcut-reminder overlay and verifies the visible reminder controls, previews the Storage retention safety confirmation without applying destructive cleanup, and verifies the Privacy API-auth restart warning without restarting |+| `windows-user-journey.spec.ts` | Windows-only. Drives Home search button -> floating Search input -> Timeline -> Home, opens Recording settings to reveal Windows audio troubleshooting controls, starts/stops a manual Meeting note through the visible UI, opens the Shortcuts editor and cancels an open-search hotkey capture, toggles the Display shortcut-reminder overlay and verifies the visible reminder controls, opens notification history from the bell and manages notification preferences, previews the Storage retention safety confirmation without applying destructive cleanup, and verifies the Privacy API-auth restart warning without restarting || `hd-recording-pipeline.spec.ts` | macOS opt-in. Starts an HD timer session via `/capture/hd/start`; asserts the controller goes active, a non-empty `hd_*.mp4` chunk is written, and OCR keeps indexing during HD (high-fps + indexing decouple, #3699/#3707) || `settings-sections.spec.ts` | Navigates General → Recording → AI → Speakers settings; verifies content and no crash || `audio-fallback.spec.ts` | macOS opt-in spec for the Screenpipe Cloud → local Whisper fallback alert and `/notify` history |diff --git a/apps/screenpipe-app-tauri/e2e/specs/windows-user-journey.spec.ts b/apps/screenpipe-app-tauri/e2e/specs/windows-user-journey.spec.tsindex 48dc81834..a1929fd6d 100644--- a/apps/screenpipe-app-tauri/e2e/specs/windows-user-journey.spec.ts+++ b/apps/screenpipe-app-tauri/e2e/specs/windows-user-journey.spec.ts@@ -19,6 +19,63 @@ const isWindows = process.platform === "win32";const SEARCH_QUERY = "screenpipe windows ux journey";const SEARCH_INPUT_SELECTOR = 'input[placeholder*="search memory"]';+interface LocalApiConfig {+ key: string | null;+ port: number;+ auth_enabled: boolean;+}++async function localApiRequest(+ path: string,+ options: { method?: string; headers?: Record<string, string>; body?: string } = {},+): Promise<{ ok: boolean; status: number; text: string }> {+ const config = await invokeOrThrow<LocalApiConfig>("get_local_api_config");+ const headers = { ...(options.headers ?? {}) };+ if (config.auth_enabled && config.key && !headers.Authorization) {+ headers.Authorization = `Bearer ${config.key}`;+ }++ return (await browser.executeAsync(+ (+ url: string,+ request: { method?: string; headers?: Record<string, string>; body?: string },+ done: (r: { ok: boolean; status: number; text: string }) => void,+ ) => {+ void fetch(url, request)+ .then(async (response) =>+ done({ ok: response.ok, status: response.status, text: await response.text() }),+ )+ .catch((error) =>+ done({+ ok: false,+ status: 0,+ text: error instanceof Error ? error.message : String(error),+ }),+ );+ },+ `http://127.0.0.1:${config.port}${path}`,+ { ...options, headers },+ )) as { ok: boolean; status: number; text: string };+}++async function postNotification(id: string, title: string, body: string): Promise<void> {+ const response = await localApiRequest("/notify", {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({+ id,+ title,+ body,+ type: "pipe",+ autoDismissMs: 2_000,+ }),+ });++ if (!response.ok) {+ throw new Error(`/notify failed: ${response.status} ${response.text}`);+ }+}+async function clickFirstDisplayed(selector: string, timeoutMs = t(15_000)): Promise<void> {const deadline = Date.now() + timeoutMs;@@ -149,6 +206,8 @@ async function switchIsChecked(selector: string): Promise<boolean> {async function setSwitchChecked(selector: string, checked: boolean): Promise<void> {const toggle = await $(selector);+ await toggle.waitForExist({ timeout: t(15_000) });+ await toggle.scrollIntoView();await toggle.waitForDisplayed({ timeout: t(15_000) });if ((await switchIsChecked(selector)) !== checked) {@@ -228,6 +287,20 @@ async function expectShortcutReminderVisible(expected: boolean, timeoutMs = t(15);}+async function expectCurrentSettingsSection(section: string, timeoutMs = t(15_000)): Promise<void> {+ await browser.waitUntil(+ async () => {+ const url = new URL(await browser.getUrl());+ return url.pathname === "/settings" && url.searchParams.get("section") === section;+ },+ {+ timeout: timeoutMs,+ interval: 250,+ timeoutMsg: `Settings URL did not become /settings?section=${section}`,+ },+ );+}+describe("Windows user journey", function () {this.timeout(180_000);@@ -512,6 +585,69 @@ describe("Windows user journey", function () {}});+ it("opens a notification from the bell and manages notification preferences", async function () {+ if (!isWindows) this.skip();++ await openHomeWindow();++ const notificationId = `windows-e2e-bell-${Date.now()}`;+ const notificationTitle = "Windows UX notification";+ const notificationBody = "Notification body visible from the bell history.";+ const displayChangesSelector = '[data-testid="notification-pref-display-changes"]';+ let initialDisplayChanges: boolean | null = null;++ try {+ await postNotification(notificationId, notificationTitle, notificationBody);+ if ((await browser.getWindowHandles()).includes("home")) {+ await browser.switchToWindow("home").catch(() => {});+ }++ const bell = await $('[data-testid="notification-bell-trigger"]');+ await bell.waitForDisplayed({ timeout: t(20_000) });+ await bell.click();++ const item = await $(`[data-testid="notification-bell-item-${notificationId}"]`);+ await item.waitForDisplayed({ timeout: t(20_000) });+ await item.click();++ const expanded = await $(`[data-testid="notification-bell-expanded-${notificationId}"]`);+ await expanded.waitForDisplayed({ timeout: t(10_000) });+ const expandedText = (await expanded.getText()).toLowerCase();+ expect(expandedText).toContain(notificationBody.toLowerCase());++ const bellScreenshot = await saveScreenshot("windows-user-journey-notification-bell");+ expect(existsSync(bellScreenshot)).toBe(true);++ const manageSettings = await $('[data-testid="notification-bell-manage-settings"]');+ await manageSettings.waitForDisplayed({ timeout: t(10_000) });+ await manageSettings.click();++ await expectCurrentSettingsSection("notifications", t(20_000));+ await waitForBodyText(+ (bodyText) =>+ bodyText.includes("control which notifications screenpipe sends you") &&+ bodyText.includes("display changes") &&+ bodyText.includes("meeting live notes"),+ "Notification settings did not open from the bell footer",+ );++ initialDisplayChanges = await switchIsChecked(displayChangesSelector);+ await setSwitchChecked(displayChangesSelector, !initialDisplayChanges);+ expect(await switchIsChecked(displayChangesSelector)).toBe(!initialDisplayChanges);+ await setSwitchChecked(displayChangesSelector, initialDisplayChanges);++ const settingsScreenshot = await saveScreenshot("windows-user-journey-notification-settings");+ expect(existsSync(settingsScreenshot)).toBe(true);+ } finally {+ if (initialDisplayChanges !== null) {+ await setSwitchChecked(displayChangesSelector, initialDisplayChanges).catch(() => {});+ }+ await localApiRequest(`/notifications/${encodeURIComponent(notificationId)}`, {+ method: "DELETE",+ }).catch(() => {});+ }+ });+it("opens Storage settings and previews local retention before cancelling", async function () {if (!isWindows) this.skip();