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

Default unchanged user goals to work memory

Louis Beaumontdfa878246e7e
diff --git a/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx b/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx
index ad939f802..dd6cca324 100644
--- a/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx
@@ -76,6 +76,7 @@ describe("SummaryCards", () => {
it("gives Automate My Work the installed pipe inventory instead of the static fallback prompt", () => {
const onSendMessage = vi.fn();
+ setUserGoalCategory("default");
render(
<SummaryCards
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.ts
index 4b3fbb7fe..d07a56df0 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
@@ -71,6 +71,19 @@ describe("onboarding Live View activation", () => {
expect(getUserGoalCategory()).toBe("process_automation");
});
+ it("defaults an untouched existing user to work memory", () => {
+ expect(getUserGoalCategory()).toBe("work_memory");
+ expect(window.localStorage.getItem(USER_GOAL_STORAGE_KEY)).toBe(
+ "work_memory",
+ );
+ });
+
+ it("preserves an explicit No specific goal choice", () => {
+ setUserGoalCategory("default");
+
+ expect(getUserGoalCategory()).toBe("default");
+ });
+
it("uses the default order for a custom onboarding goal", () => {
startOnboardingLiveViewActivation("first-dashboard-5", "custom");
diff --git a/apps/screenpipe-app-tauri/lib/live-views/onboarding-activation.ts b/apps/screenpipe-app-tauri/lib/live-views/onboarding-activation.ts
index a656661f5..8e7def0ad 100644
--- a/apps/screenpipe-app-tauri/lib/live-views/onboarding-activation.ts
+++ b/apps/screenpipe-app-tauri/lib/live-views/onboarding-activation.ts
@@ -30,6 +30,8 @@ const USER_GOAL_CATEGORIES = new Set<UserGoalCategory>([
"process_automation",
]);
+const DEFAULT_USER_GOAL_CATEGORY: UserGoalCategory = "work_memory";
+
export type OnboardingLiveViewActivation = {
viewId: string;
goalCategory: OnboardingGoalCategory;
@@ -124,7 +126,7 @@ function normalizeUserGoalCategory(value: unknown): UserGoalCategory | null {
}
export function getUserGoalCategory(): UserGoalCategory {
- if (typeof window === "undefined") return "default";
+ if (typeof window === "undefined") return DEFAULT_USER_GOAL_CATEGORY;
try {
const stored = normalizeUserGoalCategory(
window.localStorage.getItem(USER_GOAL_STORAGE_KEY),
@@ -144,11 +146,15 @@ export function getUserGoalCategory(): UserGoalCategory {
const latest = Object.values(readActivations()).sort(
(left, right) => Date.parse(right.createdAt) - Date.parse(left.createdAt),
)[0];
- return latest && latest.goalCategory !== "custom"
- ? latest.goalCategory
- : "default";
+ const migratedGoal = latest
+ ? latest.goalCategory === "custom"
+ ? "default"
+ : latest.goalCategory
+ : DEFAULT_USER_GOAL_CATEGORY;
+ window.localStorage.setItem(USER_GOAL_STORAGE_KEY, migratedGoal);
+ return migratedGoal;
} catch {
- return "default";
+ return DEFAULT_USER_GOAL_CATEGORY;
}
}