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
make onboarding choice the general user goal
Louis Beaumont64cb15f392b5
diff --git a/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx b/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsxindex d0201d6d9..ad939f802 100644--- a/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx+++ b/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx@@ -7,8 +7,8 @@ import { act, fireEvent, render, screen } from "@testing-library/react";import { afterEach, describe, expect, it, vi } from "vitest";import { SummaryCards } from "./summary-cards";import {- HOME_FOCUS_STORAGE_KEY,- setHomeFocusCategory,+ USER_GOAL_STORAGE_KEY,+ setUserGoalCategory,} from "@/lib/live-views/onboarding-activation";const { captureMock } = vi.hoisted(() => ({ captureMock: vi.fn() }));@@ -20,11 +20,11 @@ vi.mock("posthog-js", () => ({describe("SummaryCards", () => {afterEach(() => {vi.clearAllMocks();- window.localStorage.removeItem(HOME_FOCUS_STORAGE_KEY);+ window.localStorage.removeItem(USER_GOAL_STORAGE_KEY);});it("prioritizes cards from the saved onboarding goal", () => {- setHomeFocusCategory("work_patterns");+ setUserGoalCategory("work_patterns");render(<SummaryCardsonSendMessage={vi.fn()}@@ -52,7 +52,7 @@ describe("SummaryCards", () => {});});- it("reorders an open Home view when the General Settings focus changes", () => {+ it("reorders an open Home view when the General Settings goal changes", () => {render(<SummaryCardsonSendMessage={vi.fn()}@@ -63,7 +63,7 @@ describe("SummaryCards", () => {/>,);- act(() => setHomeFocusCategory("meeting_follow_through"));+ act(() => setUserGoalCategory("meeting_follow_through"));const cards = screen.getAllByTestId(/^summary-card-/);expect(cards.slice(0, 4).map((card) => card.dataset.testid)).toEqual([diff --git a/apps/screenpipe-app-tauri/components/chat/summary-cards.tsx b/apps/screenpipe-app-tauri/components/chat/summary-cards.tsxindex 3fcacc0c5..58e5b6793 100644--- a/apps/screenpipe-app-tauri/components/chat/summary-cards.tsx+++ b/apps/screenpipe-app-tauri/components/chat/summary-cards.tsx@@ -29,10 +29,10 @@ import {} from "@/lib/chat/response-feedback";import type { ChatEntryCard, ChatEntrySource } from "@/lib/chat/types";import {- getHomeFocusCategory,- HOME_FOCUS_CHANGED_EVENT,- HOME_FOCUS_STORAGE_KEY,- type HomeFocusCategory,+ getUserGoalCategory,+ USER_GOAL_CHANGED_EVENT,+ USER_GOAL_STORAGE_KEY,+ type UserGoalCategory,} from "@/lib/live-views/onboarding-activation";import { CustomSummaryBuilder } from "./custom-summary-builder";@@ -59,7 +59,7 @@ export interface ConnectionSetupSuggestion {icon: string;}-const HOME_CARD_SLUGS_BY_FOCUS: Record<HomeFocusCategory, string[]> = {+const HOME_CARD_SLUGS_BY_GOAL: Record<UserGoalCategory, string[]> = {default: ["automate-my-work", "day-recap", "time-breakdown", "missed-todos"],process_automation: ["automate-my-work",@@ -82,8 +82,8 @@ const HOME_CARD_SLUGS_BY_FOCUS: Record<HomeFocusCategory, string[]> = {],};-export function homeCardSlugsForFocus(category: HomeFocusCategory): string[] {- return HOME_CARD_SLUGS_BY_FOCUS[category];+export function homeCardSlugsForGoal(category: UserGoalCategory): string[] {+ return HOME_CARD_SLUGS_BY_GOAL[category];}function HomeCardIcon({ slug, className }: { slug: string; className: string }) {@@ -109,19 +109,19 @@ export function SummaryCards({const [showAll, setShowAll] = useState(false);const [showBuilder, setShowBuilder] = useState(false);const [editingTemplate, setEditingTemplate] = useState<CustomTemplate | null>(null);- const [homeFocus, setHomeFocus] = useState<HomeFocusCategory>(() =>- getHomeFocusCategory(),+ const [userGoal, setUserGoal] = useState<UserGoalCategory>(() =>+ getUserGoalCategory(),);useEffect(() => {- const refresh = () => setHomeFocus(getHomeFocusCategory());+ const refresh = () => setUserGoal(getUserGoalCategory());const handleStorage = (event: StorageEvent) => {- if (event.key === HOME_FOCUS_STORAGE_KEY) refresh();+ if (event.key === USER_GOAL_STORAGE_KEY) refresh();};- window.addEventListener(HOME_FOCUS_CHANGED_EVENT, refresh);+ window.addEventListener(USER_GOAL_CHANGED_EVENT, refresh);window.addEventListener("storage", handleStorage);return () => {- window.removeEventListener(HOME_FOCUS_CHANGED_EVENT, refresh);+ window.removeEventListener(USER_GOAL_CHANGED_EVENT, refresh);window.removeEventListener("storage", handleStorage);};}, []);@@ -133,7 +133,7 @@ export function SummaryCards({// (install_builtin_pipes never overwrites an existing pipe.md). The discover// tier is intentionally removed — the metrics showed it earned ~9% of clicks// across 6 cards while doubling the visible surface.- const homeCardSlugs = homeCardSlugsForFocus(homeFocus);+ const homeCardSlugs = homeCardSlugsForGoal(userGoal);const byName = new Map<string, TemplatePipe>();for (const t of templatePipes) byName.set(t.name, t);for (const t of FALLBACK_TEMPLATES) byName.set(t.name, t);diff --git a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx b/apps/screenpipe-app-tauri/components/settings/general-settings.tsxindex 9f1f75783..de112d01b 100644--- a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx+++ b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx@@ -28,9 +28,9 @@ import { UpdateBanner } from "@/components/update-banner";import type { SettingsField } from "./settings-search";import { ONBOARDING_GOALS } from "@/lib/live-views/onboarding-goals";import {- getHomeFocusCategory,- setHomeFocusCategory,- type HomeFocusCategory,+ getUserGoalCategory,+ setUserGoalCategory,+ type UserGoalCategory,} from "@/lib/live-views/onboarding-activation";import posthog from "posthog-js";@@ -41,7 +41,7 @@ export const searchIndex: SettingsField[] = [{ label: "Check for updates", keywords: ["version"] },{ label: "Auto-Update Pipes" },{ label: "Reset Onboarding", keywords: ["setup"] },- { label: "Home focus", keywords: ["goal", "cards", "personalization"] },+ { label: "Your goal", keywords: ["onboarding", "purpose", "personalization"] },{ label: "Headless", keywords: ["low resource", "tray only", "memory", "webview"] },{ label: "Record only", keywords: ["headless", "pipes", "scheduler", "automation"] },];@@ -61,14 +61,14 @@ export default function GeneralSettings() {const [currentVersion, setCurrentVersion] = useState<string | null>(null);const [isCheckingForUpdate, setIsCheckingForUpdate] = useState(false);const [isResettingOnboarding, setIsResettingOnboarding] = useState(false);- const [homeFocus, setHomeFocus] = useState<HomeFocusCategory>(() =>- getHomeFocusCategory(),+ const [userGoal, setUserGoal] = useState<UserGoalCategory>(() =>+ getUserGoalCategory(),);- const handleHomeFocusChange = (category: HomeFocusCategory) => {- setHomeFocus(category);- setHomeFocusCategory(category);- posthog.capture("home_focus_changed", {+ const handleUserGoalChange = (category: UserGoalCategory) => {+ setUserGoal(category);+ setUserGoalCategory(category);+ posthog.capture("user_goal_changed", {goal_category: category,source: "general_settings",});@@ -384,23 +384,23 @@ export default function GeneralSettings() {<div className="flex items-center space-x-2.5"><Layers className="h-4 w-4 shrink-0 text-muted-foreground" /><div>- <h3 className="text-sm font-medium text-foreground">Home focus</h3>+ <h3 className="text-sm font-medium text-foreground">Your goal</h3><p className="text-xs text-muted-foreground">- Put the most useful chat action first+ What you want screenpipe to help you accomplish</p></div></div><Select- value={homeFocus}+ value={userGoal}onValueChange={(value) =>- handleHomeFocusChange(value as HomeFocusCategory)+ handleUserGoalChange(value as UserGoalCategory)}><SelectTrigger className="h-8 w-[230px] text-xs"><SelectValue /></SelectTrigger><SelectContent>- <SelectItem value="default">Default</SelectItem>+ <SelectItem value="default">No specific goal</SelectItem>{ONBOARDING_GOALS.map((goal) => (<SelectItem key={goal.category} value={goal.category}>{goal.title}diff --git a/apps/screenpipe-app-tauri/lib/live-views/__tests__/onboarding-activation.test.ts b/apps/screenpipe-app-tauri/lib/live-views/__tests__/onboarding-activation.test.tsindex 2f4d62f11..4b3fbb7fe 100644--- a/apps/screenpipe-app-tauri/lib/live-views/__tests__/onboarding-activation.test.ts+++ b/apps/screenpipe-app-tauri/lib/live-views/__tests__/onboarding-activation.test.ts@@ -7,15 +7,16 @@ import {completeOnboardingLiveViewActivation,consumeOnboardingBrainHandoff,getOnboardingLiveViewActivation,- getHomeFocusCategory,+ getUserGoalCategory,markOnboardingLiveViewFirstResult,markOnboardingLiveViewSetupNeedsRetry,markOnboardingLiveViewSetupReady,removeOnboardingLiveViewActivation,selectedLiveViewDashboardId,- setHomeFocusCategory,+ setUserGoalCategory,setOnboardingLiveViewGuideStep,startOnboardingLiveViewActivation,+ USER_GOAL_STORAGE_KEY,} from "../onboarding-activation";const localStorageMock = (() => {@@ -48,7 +49,7 @@ describe("onboarding Live View activation", () => {});expect(selectedLiveViewDashboardId()).toBe("first-dashboard-1");- expect(getHomeFocusCategory()).toBe("work_memory");+ expect(getUserGoalCategory()).toBe("work_memory");expect(consumeOnboardingBrainHandoff()).toBe("first-dashboard-1");expect(consumeOnboardingBrainHandoff()).toBeNull();expect(getOnboardingLiveViewActivation("first-dashboard-1")).toEqual(@@ -63,17 +64,27 @@ describe("onboarding Live View activation", () => {);});- it("lets General Settings override the onboarding focus", () => {+ it("lets General Settings override the onboarding goal", () => {startOnboardingLiveViewActivation("first-dashboard-4", "work_memory");- setHomeFocusCategory("process_automation");+ setUserGoalCategory("process_automation");- expect(getHomeFocusCategory()).toBe("process_automation");+ expect(getUserGoalCategory()).toBe("process_automation");});it("uses the default order for a custom onboarding goal", () => {startOnboardingLiveViewActivation("first-dashboard-5", "custom");- expect(getHomeFocusCategory()).toBe("default");+ expect(getUserGoalCategory()).toBe("default");+ });++ it("migrates the briefly shipped Home focus preference into the user goal", () => {+ window.localStorage.setItem("screenpipe.home.focus.v1", "work_patterns");++ expect(getUserGoalCategory()).toBe("work_patterns");+ expect(window.localStorage.getItem(USER_GOAL_STORAGE_KEY)).toBe(+ "work_patterns",+ );+ expect(window.localStorage.getItem("screenpipe.home.focus.v1")).toBeNull();});it("keeps setup recovery and guide progress on the same activation", () => {diff --git a/apps/screenpipe-app-tauri/lib/live-views/onboarding-activation.ts b/apps/screenpipe-app-tauri/lib/live-views/onboarding-activation.tsindex 951985eed..a656661f5 100644--- a/apps/screenpipe-app-tauri/lib/live-views/onboarding-activation.ts+++ b/apps/screenpipe-app-tauri/lib/live-views/onboarding-activation.ts@@ -13,15 +13,16 @@ const ACTIVATIONS_STORAGE_KEY ="screenpipe.live-view.onboarding-activations.v1";const BRAIN_HANDOFF_STORAGE_KEY ="screenpipe.live-view.onboarding-brain-handoff.v1";-export const HOME_FOCUS_STORAGE_KEY = "screenpipe.home.focus.v1";-export const HOME_FOCUS_CHANGED_EVENT = "screenpipe:home-focus-changed";+export const USER_GOAL_STORAGE_KEY = "screenpipe.user.goal-category.v1";+export const USER_GOAL_CHANGED_EVENT = "screenpipe:user-goal-changed";+const LEGACY_HOME_FOCUS_STORAGE_KEY = "screenpipe.home.focus.v1";const MAX_STORED_ACTIVATIONS = 12;-export type HomeFocusCategory =+export type UserGoalCategory =| Exclude<OnboardingGoalCategory, "custom">| "default";-const HOME_FOCUS_CATEGORIES = new Set<HomeFocusCategory>([+const USER_GOAL_CATEGORIES = new Set<UserGoalCategory>(["default","work_memory","meeting_follow_through",@@ -115,21 +116,30 @@ function writeActivations(activations: ActivationMap): void {}}-function normalizeHomeFocusCategory(value: unknown): HomeFocusCategory | null {+function normalizeUserGoalCategory(value: unknown): UserGoalCategory | null {return typeof value === "string" &&- HOME_FOCUS_CATEGORIES.has(value as HomeFocusCategory)- ? (value as HomeFocusCategory)+ USER_GOAL_CATEGORIES.has(value as UserGoalCategory)+ ? (value as UserGoalCategory): null;}-export function getHomeFocusCategory(): HomeFocusCategory {+export function getUserGoalCategory(): UserGoalCategory {if (typeof window === "undefined") return "default";try {- const stored = normalizeHomeFocusCategory(- window.localStorage.getItem(HOME_FOCUS_STORAGE_KEY),+ const stored = normalizeUserGoalCategory(+ window.localStorage.getItem(USER_GOAL_STORAGE_KEY),);if (stored) return stored;+ const legacy = normalizeUserGoalCategory(+ window.localStorage.getItem(LEGACY_HOME_FOCUS_STORAGE_KEY),+ );+ if (legacy) {+ window.localStorage.setItem(USER_GOAL_STORAGE_KEY, legacy);+ window.localStorage.removeItem(LEGACY_HOME_FOCUS_STORAGE_KEY);+ return legacy;+ }+// Migrate existing onboarding activations without reading the free-text goal.const latest = Object.values(readActivations()).sort((left, right) => Date.parse(right.createdAt) - Date.parse(left.createdAt),@@ -142,16 +152,17 @@ export function getHomeFocusCategory(): HomeFocusCategory {}}-export function setHomeFocusCategory(category: HomeFocusCategory): void {+export function setUserGoalCategory(category: UserGoalCategory): void {if (typeof window === "undefined") return;- const normalized = normalizeHomeFocusCategory(category) ?? "default";+ const normalized = normalizeUserGoalCategory(category) ?? "default";try {- window.localStorage.setItem(HOME_FOCUS_STORAGE_KEY, normalized);+ window.localStorage.setItem(USER_GOAL_STORAGE_KEY, normalized);+ window.localStorage.removeItem(LEGACY_HOME_FOCUS_STORAGE_KEY);} catch {// Personalization is optional; the default card order remains usable.}window.dispatchEvent(- new CustomEvent<HomeFocusCategory>(HOME_FOCUS_CHANGED_EVENT, {+ new CustomEvent<UserGoalCategory>(USER_GOAL_CHANGED_EVENT, {detail: normalized,}),);@@ -210,7 +221,7 @@ export function startOnboardingLiveViewActivation(};activations[viewId] = activation;writeActivations(activations);- setHomeFocusCategory(+ setUserGoalCategory(goalCategory === "custom" ? "default" : goalCategory,);rememberSelectedLiveViewDashboard(viewId);