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(onboarding): improve usecase poll with single-select and free-form input

Louis Beaumontc6b17e2e6f12
diff --git a/.claude/agents/posthog.md b/.claude/agents/posthog.md
index fac2bb924..113b5156d 100644
--- a/.claude/agents/posthog.md
+++ b/.claude/agents/posthog.md
@@ -13,20 +13,35 @@ Query and manage PostHog product analytics for Screenpipe applications.
**Host:** `https://eu.i.posthog.com`
**SDK Project Key (public):** `phc_Bt8GoTBPgkCpDrbaIZzJIEYt0CrJjhBiuLaBck1clce`
-**Personal API Key:** Required for API operations. Read from `POSTHOG_API_KEY` environment variable.
+**Personal API Key:** Stored in `.env.local` at the repo root. Always source it before running queries.
-### Getting a Personal API Key
+### Loading the API Key
+
+**IMPORTANT:** Before running ANY PostHog query, always source the `.env.local` file first:
+
+```bash
+source /Users/louisbeaumont/Documents/screenpipe/.env.local
+```
+
+Or inline with commands:
+```bash
+export $(cat /Users/louisbeaumont/Documents/screenpipe/.env.local | xargs) && curl ...
+```
+
+### Getting a Personal API Key (if needed)
1. Go to https://eu.posthog.com/settings/user-api-keys
2. Click "Create personal API key"
3. Name it (e.g., "claude-code")
4. Select scopes: `insight:read`, `insight:write`, `dashboard:read`, `dashboard:write`, `query:read`
-5. Set env var: `export POSTHOG_API_KEY=phx_xxx...`
+5. Add to `.env.local`: `POSTHOG_API_KEY=phx_xxx...`
---
## Bash Queries (macOS/Linux)
+**Note:** All commands below assume you have sourced `.env.local` first.
+
### Get Project ID
Run this first to get your project ID:
diff --git a/.gitignore b/.gitignore
index 2a98e64ce..6372a0148 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@ onnxruntime-win-x64-gpu*/
# ignore environment variables
.env
+.env.local
# JavaScript stuff
node_modules/
diff --git a/screenpipe-app-tauri/app/onboarding/page.tsx b/screenpipe-app-tauri/app/onboarding/page.tsx
index 3e1be5865..a882aaa47 100644
--- a/screenpipe-app-tauri/app/onboarding/page.tsx
+++ b/screenpipe-app-tauri/app/onboarding/page.tsx
@@ -75,7 +75,7 @@ export default function OnboardingPage() {
const [isVisible, setIsVisible] = useState(false);
const [isTransitioning, setIsTransitioning] = useState(false);
const [completedSteps, setCompletedSteps] = useState<SlideKey[]>(["intro"]);
- const [selectedUsecases, setSelectedUsecases] = useState<string[]>([]);
+ const [selectedUsecase, setSelectedUsecase] = useState<string | null>(null);
const {
onboardingData,
completeOnboarding,
@@ -83,12 +83,8 @@ export default function OnboardingPage() {
} = useOnboarding();
const handleUsecaseClick = (option: string) => {
- setSelectedUsecases((prev) => {
- if (prev.includes(option)) {
- return prev.filter((o) => o !== option);
- }
- return [...prev, option];
- });
+ // Single-select: clicking the same option deselects it, otherwise select the new one
+ setSelectedUsecase((prev) => prev === option ? null : option);
};
// Load onboarding status on mount
@@ -267,7 +263,7 @@ export default function OnboardingPage() {
<OnboardingSelection
className={`transition-opacity duration-300 w-full
${isVisible ? "opacity-100 ease-out" : "opacity-0 ease-in"}`}
- selectedOptions={selectedUsecases}
+ selectedOption={selectedUsecase}
handleOptionClick={handleUsecaseClick}
handlePrevSlide={handlePrevSlide}
handleNextSlide={handleNextSlide}
diff --git a/screenpipe-app-tauri/components/onboarding/navigation.tsx b/screenpipe-app-tauri/components/onboarding/navigation.tsx
index dd1497593..173a27dec 100644
--- a/screenpipe-app-tauri/components/onboarding/navigation.tsx
+++ b/screenpipe-app-tauri/components/onboarding/navigation.tsx
@@ -7,21 +7,23 @@ interface OnboardingNavigationProps {
nextBtnText?: string,
className?: string,
isLoading?: boolean;
+ nextDisabled?: boolean;
handlePrevSlide: () => void;
handleNextSlide: () => void;
}
-const OnboardingNavigation: React.FC<OnboardingNavigationProps> = ({
+const OnboardingNavigation: React.FC<OnboardingNavigationProps> = ({
nextBtnText = "",
prevBtnText = "",
className = "",
isLoading,
+ nextDisabled,
handlePrevSlide,
handleNextSlide,
}) => {
return (
<div className={`flex justify-between items-center mx-auto ${className} w-full p-4 bg-transparent max-w-screen-lg`}>
- <Button
+ <Button
className="flex items-center w-fit min-w-32 disabled:!cursor-not-allowed disabled:!pointer-events-auto"
variant={"outline"}
onClick={handlePrevSlide}
@@ -30,10 +32,10 @@ const OnboardingNavigation: React.FC<OnboardingNavigationProps> = ({
<ArrowLeft className="mr-2" /> {/* Icon with margin */}
{prevBtnText}
</Button>
- <Button
- className="flex items-center w-fit min-w-32 disabled:!cursor-not-allowed disabled:!pointer-events-auto"
+ <Button
+ className="flex items-center w-fit min-w-32 disabled:!cursor-not-allowed disabled:!pointer-events-auto"
onClick={handleNextSlide}
- disabled={isLoading}
+ disabled={isLoading || nextDisabled}
>
{nextBtnText}
<ArrowRight className="ml-2" /> {/* Icon with margin */}
diff --git a/screenpipe-app-tauri/components/onboarding/usecases-selection.tsx b/screenpipe-app-tauri/components/onboarding/usecases-selection.tsx
index a7de16e50..1130e73aa 100644
--- a/screenpipe-app-tauri/components/onboarding/usecases-selection.tsx
+++ b/screenpipe-app-tauri/components/onboarding/usecases-selection.tsx
@@ -1,4 +1,4 @@
-import React from "react";
+import React, { useState } from "react";
import {
Brain,
CircleCheck,
@@ -7,14 +7,16 @@ import {
Code,
Shield,
Sparkles,
+ MessageSquare,
} from "lucide-react";
import OnboardingNavigation from "@/components/onboarding/navigation";
import posthog from "posthog-js";
-import { motion } from "framer-motion";
+import { motion, AnimatePresence } from "framer-motion";
+import { Input } from "@/components/ui/input";
interface OnboardingSelectionProps {
className?: string;
- selectedOptions: string[] | null;
+ selectedOption: string | null;
handleOptionClick: (option: string) => void;
handleNextSlide: () => void;
handlePrevSlide: () => void;
@@ -24,57 +26,64 @@ const OPTIONS = [
{
key: "memory",
icon: Brain,
- label: "personal memory",
- description: "i forget things and want to search my past screen activity",
+ label: "find something i saw",
+ description: "i saw something on my screen but can't remember where or when",
},
{
key: "meetings",
icon: Calendar,
- label: "meeting summaries",
- description: "i need help remembering what was discussed in meetings",
+ label: "remember conversations",
+ description: "i want to recall what was said in meetings or calls",
},
{
key: "productivity",
icon: Search,
- label: "productivity tracking",
- description: "i want to understand how i spend my time on my computer",
+ label: "track my time",
+ description: "i want to see how i actually spend time on my computer",
},
{
key: "developer",
icon: Code,
- label: "building/developing",
- description: "i'm a developer and want to build on top of screenpipe",
+ label: "build with my data",
+ description: "i'm a developer and want to build automations on my screen data",
},
{
key: "privacy",
icon: Shield,
- label: "privacy-focused alternative",
- description: "i want a local/private alternative to cloud services",
+ label: "local ai alternative",
+ description: "i want a private, local alternative to cloud ai tools",
},
{
key: "curious",
icon: Sparkles,
- label: "just curious",
- description: "trying it out to see what it does",
+ label: "just exploring",
+ description: "i heard about screenpipe and want to see what it does",
+ },
+ {
+ key: "other",
+ icon: MessageSquare,
+ label: "something else",
+ description: "tell us in your own words",
},
];
const SelectionItem: React.FC<{
option: (typeof OPTIONS)[number];
- isSelected: boolean | undefined;
+ isSelected: boolean;
onClick: () => void;
index: number;
-}> = ({ option, isSelected, onClick, index }) => {
+ children?: React.ReactNode;
+}> = ({ option, isSelected, onClick, index, children }) => {
const { icon: Icon, label, description } = option;
return (
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
- transition={{ delay: index * 0.1 }}
+ transition={{ delay: index * 0.08 }}
className={`w-full flex flex-col border rounded-xl p-4 hover:shadow-lg cursor-pointer transition-all duration-300
${
isSelected
- ? "bg-primary text-primary-foreground border-primary shadow-lg transform scale-105"
+ ? "bg-primary text-primary-foreground border-primary shadow-lg"
: "bg-card hover:bg-accent"
}`}
onClick={onClick}
@@ -90,24 +99,31 @@ const SelectionItem: React.FC<{
<p className={`text-sm ${isSelected ? 'text-primary-foreground/90' : 'text-muted-foreground'}`}>
{description}
</p>
+
+ {children}
</motion.div>
);
};
const OnboardingSelection: React.FC<OnboardingSelectionProps> = ({
className,
- selectedOptions,
+ selectedOption,
handleOptionClick,
handleNextSlide,
handlePrevSlide,
}) => {
+ const [otherText, setOtherText] = useState("");
+
+ const isOtherSelected = selectedOption === "other";
+ const canContinue = selectedOption !== null && (selectedOption !== "other" || otherText.trim().length > 0);
+
const handleNext = () => {
- // Track selected options in Posthog
+ // Track selected option in Posthog
posthog.capture("onboarding_usecases_selected", {
- selected_options: selectedOptions,
+ selected_option: selectedOption,
+ other_text: isOtherSelected ? otherText.trim() : null,
});
- // Call the original handleNextSlide function
handleNextSlide();
};
@@ -123,10 +139,10 @@ const OnboardingSelection: React.FC<OnboardingSelectionProps> = ({
transition={{ duration: 0.5 }}
/>
<h2 className="text-center text-2xl font-bold">
- what brought you to screenpipe?
+ what&apos;s your #1 goal with screenpipe?
</h2>
<p className="text-center text-muted-foreground mt-2">
- help us understand what you&apos;re looking for (select all that apply)
+ pick the one that matters most to you
</p>
</div>
@@ -136,22 +152,47 @@ const OnboardingSelection: React.FC<OnboardingSelectionProps> = ({
<SelectionItem
key={option.key}
option={option}
- isSelected={selectedOptions?.includes(option.key)}
+ isSelected={selectedOption === option.key}
onClick={() => handleOptionClick(option.key)}
index={index}
- />
+ >
+ {option.key === "other" && selectedOption === "other" && (
+ <AnimatePresence>
+ <motion.div
+ initial={{ opacity: 0, height: 0 }}
+ animate={{ opacity: 1, height: "auto" }}
+ exit={{ opacity: 0, height: 0 }}
+ transition={{ duration: 0.2 }}
+ className="mt-3"
+ onClick={(e) => e.stopPropagation()}
+ >
+ <Input
+ type="text"
+ placeholder="what are you trying to do?"
+ value={otherText}
+ onChange={(e) => setOtherText(e.target.value)}
+ className="bg-background text-foreground border-primary-foreground/30 placeholder:text-primary-foreground/50"
+ autoFocus
+ />
+ </motion.div>
+ </AnimatePresence>
+ )}
+ </SelectionItem>
))}
</div>
- {selectedOptions && selectedOptions.length > 0 && (
- <motion.div
- initial={{ opacity: 0, y: 10 }}
- animate={{ opacity: 1, y: 0 }}
- className="mt-4 text-center text-sm text-muted-foreground"
- >
- Thanks! This helps us improve Screenpipe for you.
- </motion.div>
- )}
+ <AnimatePresence>
+ {!selectedOption && (
+ <motion.p
+ initial={{ opacity: 0 }}
+ animate={{ opacity: 1 }}
+ exit={{ opacity: 0 }}
+ className="mt-4 text-center text-sm text-muted-foreground"
+ >
+ this helps us build the right features for you
+ </motion.p>
+ )}
+ </AnimatePresence>
</div>
<OnboardingNavigation
@@ -159,6 +200,7 @@ const OnboardingSelection: React.FC<OnboardingSelectionProps> = ({
handleNextSlide={handleNext}
prevBtnText="Back"
nextBtnText="Continue"
+ nextDisabled={!canContinue}
/>
</div>
);