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): add login as first step to capture user emails

Louis Beaumontf01b47d7ce7d
diff --git a/screenpipe-app-tauri/app/onboarding/page.tsx b/screenpipe-app-tauri/app/onboarding/page.tsx
index a882aaa47..03b3d4ca5 100644
--- a/screenpipe-app-tauri/app/onboarding/page.tsx
+++ b/screenpipe-app-tauri/app/onboarding/page.tsx
@@ -5,22 +5,26 @@ import { useToast } from "@/components/ui/use-toast";
import OnboardingStatus from "@/components/onboarding/status";
import OnboardingIntro from "@/components/onboarding/introduction";
import OnboardingSelection from "@/components/onboarding/usecases-selection";
+import OnboardingLogin from "@/components/onboarding/login";
import { useOnboarding } from "@/lib/hooks/use-onboarding";
import posthog from "posthog-js";
import { commands } from "@/lib/utils/tauri";
-type SlideKey = "intro" | "usecases" | "status";
+type SlideKey = "login" | "intro" | "usecases" | "status";
// Window size configurations for each slide - consistent size to avoid resizing issues
const SLIDE_WINDOW_SIZES: Record<SlideKey, { width: number; height: number }> = {
+ login: { width: 900, height: 800 },
intro: { width: 900, height: 800 },
usecases: { width: 900, height: 800 },
status: { width: 900, height: 800 },
};
-// 3-step flow: intro → usecases → status → done
+// 4-step flow: login → intro → usecases → status → done
const getNextSlide = (currentSlide: SlideKey): SlideKey | null => {
switch (currentSlide) {
+ case "login":
+ return "intro";
case "intro":
return "usecases";
case "usecases":
@@ -34,8 +38,10 @@ const getNextSlide = (currentSlide: SlideKey): SlideKey | null => {
const getPrevSlide = (currentSlide: SlideKey): SlideKey | null => {
switch (currentSlide) {
- case "intro":
+ case "login":
return null;
+ case "intro":
+ return "login";
case "usecases":
return "intro";
case "status":
@@ -70,11 +76,11 @@ const setWindowSizeForSlide = async (slide: SlideKey) => {
export default function OnboardingPage() {
const { toast } = useToast();
- const [currentSlide, setCurrentSlide] = useState<SlideKey>("intro");
+ const [currentSlide, setCurrentSlide] = useState<SlideKey>("login");
const [error, setError] = useState<string | null>(null);
const [isVisible, setIsVisible] = useState(false);
const [isTransitioning, setIsTransitioning] = useState(false);
- const [completedSteps, setCompletedSteps] = useState<SlideKey[]>(["intro"]);
+ const [completedSteps, setCompletedSteps] = useState<SlideKey[]>(["login"]);
const [selectedUsecase, setSelectedUsecase] = useState<string | null>(null);
const {
onboardingData,
@@ -252,6 +258,14 @@ export default function OnboardingPage() {
{/* Main content container */}
<div className="flex-1 flex items-center justify-center p-6 overflow-auto">
<div className="w-full max-w-2xl mx-auto">
+ {currentSlide === "login" && (
+ <OnboardingLogin
+ className={`transition-opacity duration-300 w-full
+ ${isVisible ? "opacity-100 ease-out" : "opacity-0 ease-in"}`}
+ handlePrevSlide={handlePrevSlide}
+ handleNextSlide={handleNextSlide}
+ />
+ )}
{currentSlide === "intro" && (
<OnboardingIntro
className={`transition-opacity duration-300 w-full
diff --git a/screenpipe-app-tauri/components/onboarding/login.tsx b/screenpipe-app-tauri/components/onboarding/login.tsx
index db0bea003..efaf67b5c 100644
--- a/screenpipe-app-tauri/components/onboarding/login.tsx
+++ b/screenpipe-app-tauri/components/onboarding/login.tsx
@@ -1,10 +1,10 @@
import React from "react";
-import { ExternalLinkIcon, UserCog } from "lucide-react";
+import { ExternalLinkIcon, UserCog, CheckCircle2 } from "lucide-react";
import { open } from "@tauri-apps/plugin-shell";
import { Button } from "@/components/ui/button";
import { useSettings } from "@/lib/hooks/use-settings";
import { toast } from "@/components/ui/use-toast";
-import OnboardingNavigation from "./navigation";
+import posthog from "posthog-js";
interface OnboardingLoginProps {
className?: string;
@@ -18,78 +18,99 @@ const OnboardingLogin: React.FC<OnboardingLoginProps> = ({
handleNextSlide,
}) => {
const { settings, updateSettings } = useSettings();
+ const isLoggedIn = !!settings?.user?.token;
+
+ const handleSkip = () => {
+ posthog.capture("onboarding_login_skipped");
+ handleNextSlide();
+ };
+
+ const handleContinue = () => {
+ posthog.capture("onboarding_login_completed", {
+ email: settings?.user?.email,
+ });
+ handleNextSlide();
+ };
return (
- <div className="w-full h-full flex flex-col items-center justify-center space-y-6 py-4">
+ <div className={`w-full h-full flex flex-col items-center justify-center space-y-6 py-4 ${className}`}>
<div className="w-full max-w-md space-y-6">
<div className="text-center space-y-2 mb-8">
- <h1 className="text-3xl font-bold text-text-primary">login to screenpipe</h1>
- <p className="text-sm text-text-secondary">
- connect your account to unlock all features
+ <h1 className="text-3xl font-bold tracking-tight">welcome to screenpipe</h1>
+ <p className="text-sm text-muted-foreground">
+ sign in to get the most out of your experience
</p>
</div>
- <div className="p-6 border border-border rounded-lg bg-card">
- <div className="space-y-4">
- {settings?.user?.token ? (
- <p className="text-sm text-text-secondary flex items-center justify-center gap-2">
- <span className="inline-flex h-2 w-2 rounded-full bg-success" />
- logged in as {settings?.user?.email}
- </p>
- ) : (
- <p className="text-sm text-text-secondary flex items-center justify-center gap-2">
- <span className="inline-flex h-2 w-2 rounded-full bg-warning" />
- not logged in - some features will be limited
- </p>
- )}
-
- <div className="flex flex-col gap-2">
- {settings?.user?.token ? (
- <>
- <Button
- variant="outline"
- size="sm"
- onClick={() => open("https://accounts.screenpi.pe/user")}
- className="w-full hover:bg-secondary/80"
- >
- manage account <UserCog className="w-4 h-4 ml-2" />
- </Button>
- <Button
- variant="outline"
- size="sm"
- onClick={() => {
- updateSettings({ user: undefined });
- toast({
- title: "logged out",
- description: "you have been logged out",
- });
- }}
- className="w-full hover:bg-secondary/80"
- >
- logout <ExternalLinkIcon className="w-4 h-4 ml-2" />
- </Button>
- </>
- ) : (
+ <div className="p-6 border border-border rounded-lg bg-card space-y-4">
+ {isLoggedIn ? (
+ <>
+ <div className="flex items-center justify-center gap-2 text-sm text-green-600">
+ <CheckCircle2 className="w-4 h-4" />
+ signed in as {settings?.user?.email}
+ </div>
+ <div className="flex flex-col gap-2">
<Button
- variant="outline"
+ variant="default"
+ onClick={handleContinue}
+ className="w-full"
+ >
+ continue
+ </Button>
+ <Button
+ variant="ghost"
size="sm"
+ onClick={() => open("https://accounts.screenpi.pe/user")}
+ className="w-full text-muted-foreground"
+ >
+ manage account <UserCog className="w-4 h-4 ml-2" />
+ </Button>
+ </div>
+ </>
+ ) : (
+ <>
+ <div className="space-y-3 text-sm text-muted-foreground">
+ <p className="font-medium text-foreground">why sign in?</p>
+ <ul className="space-y-2 ml-4">
+ <li className="flex items-start gap-2">
+ <span className="text-primary">-</span>
+ <span>get help faster if something breaks</span>
+ </li>
+ <li className="flex items-start gap-2">
+ <span className="text-primary">-</span>
+ <span>access cloud AI features</span>
+ </li>
+ <li className="flex items-start gap-2">
+ <span className="text-primary">-</span>
+ <span>sync settings across devices</span>
+ </li>
+ </ul>
+ </div>
+
+ <div className="flex flex-col gap-2 pt-2">
+ <Button
+ variant="default"
onClick={() => open("https://screenpi.pe/login")}
- className="w-full hover:bg-secondary/80"
+ className="w-full"
+ >
+ sign in <ExternalLinkIcon className="w-4 h-4 ml-2" />
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={handleSkip}
+ className="w-full text-muted-foreground"
>
- login <ExternalLinkIcon className="w-4 h-4 ml-2" />
+ skip for now
</Button>
- )}
- </div>
- </div>
+ </div>
+ </>
+ )}
</div>
- <OnboardingNavigation
- className="mt-6"
- handlePrevSlide={handlePrevSlide}
- handleNextSlide={handleNextSlide}
- prevBtnText="previous"
- nextBtnText="next"
- />
+ <p className="text-xs text-center text-muted-foreground">
+ your data stays on your device. signing in is optional.
+ </p>
</div>
</div>
);