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
fix(onboarding): make the card the only way through setup
Louis Beaumontb94df4824e2e
diff --git a/apps/screenpipe-app-tauri/components/onboarding/plan-selection-step.test.tsx b/apps/screenpipe-app-tauri/components/onboarding/plan-selection-step.test.tsxindex 76e5e7b6d..0f6673034 100644--- a/apps/screenpipe-app-tauri/components/onboarding/plan-selection-step.test.tsx+++ b/apps/screenpipe-app-tauri/components/onboarding/plan-selection-step.test.tsx@@ -121,15 +121,33 @@ describe("onboarding card capture", () => {});});- it("reveals the cardless trial path after six seconds and activates it", async () => {- vi.useFakeTimers();+ // The cardless escape used to appear on a 6s timer and took 33% of this+ // slide. There is no longer any standing way past the card.+ it("never offers a cardless path while checkout is healthy", async () => {+ render(<PlanSelectionStep handleNextSlide={vi.fn()} />);+ await waitFor(() => expect(mocks.fetch).toHaveBeenCalledOnce());++ await new Promise((resolve) => setTimeout(resolve, 20));+ expect(screen.queryByTestId("onboarding-plan-free")).not.toBeInTheDocument();+ expect(+ screen.getByTestId("onboarding-plan-reassurance").textContent,+ ).toMatch(/nothing is charged until your trial ends/i);+ });++ // Still the last slide: if our own checkout cannot load, a hard gate would+ // strand the user in setup with no app behind it.+ it("offers a way out only when checkout fails, and activates the trial", async () => {+ mocks.fetch.mockImplementation(async (input: RequestInfo | URL) =>+ String(input).endsWith("/api/subscription/onboarding-trial")+ ? { ok: true, json: async () => ({ activated: true }) }+ : { ok: false, status: 500, json: async () => ({ error: "boom" }) },+ );const next = vi.fn();render(<PlanSelectionStep handleNextSlide={next} />);- expect(screen.queryByTestId("onboarding-plan-free")).not.toBeInTheDocument();- act(() => vi.advanceTimersByTime(5_999));- expect(screen.queryByTestId("onboarding-plan-free")).not.toBeInTheDocument();- act(() => vi.advanceTimersByTime(1));+ await waitFor(() =>+ expect(screen.getByTestId("onboarding-plan-free")).toBeInTheDocument(),+ );await act(async () => {fireEvent.click(screen.getByTestId("onboarding-plan-free"));});@@ -142,6 +160,5 @@ describe("onboarding card capture", () => {body: JSON.stringify({ token: "token-1" }),}),);- vi.useRealTimers();});});diff --git a/apps/screenpipe-app-tauri/components/onboarding/plan-selection-step.tsx b/apps/screenpipe-app-tauri/components/onboarding/plan-selection-step.tsxindex 5151b3e99..5cceffb68 100644--- a/apps/screenpipe-app-tauri/components/onboarding/plan-selection-step.tsx+++ b/apps/screenpipe-app-tauri/components/onboarding/plan-selection-step.tsx@@ -37,7 +37,6 @@ export default function PlanSelectionStep({const [busy, setBusy] = useState(true);const [completing, setCompleting] = useState(false);const [error, setError] = useState<string | null>(null);- const [showFree, setShowFree] = useState(false);const [startingCardlessTrial, setStartingCardlessTrial] = useState(false);const iframeRef = useRef<HTMLIFrameElement>(null);const requestRef = useRef(0);@@ -46,11 +45,6 @@ export default function PlanSelectionStep({const userToken = user?.token;loadUserRef.current = loadUser;- useEffect(() => {- const timer = setTimeout(() => setShowFree(true), 6_000);- return () => clearTimeout(timer);- }, []);-useEffect(() => {if (!userToken) {setBusy(false);@@ -274,17 +268,32 @@ export default function PlanSelectionStep({)}</div>- {showFree && (+ {/* The old standing "continue with limited free plan" link took 33% of+ this slide (156 of 479 people over Aug 11-13) straight past the card,+ and a cardless grant converts at ~0.2%. The card is now the only way+ forward, so the reassurance that used to be implied by that link has+ to be stated here instead: the reason people hesitate at a card field+ is fear of being locked in, not the price. */}+ <p+ className="mx-auto mt-4 max-w-sm text-center font-mono text-[10px] leading-relaxed text-muted-foreground"+ data-testid="onboarding-plan-reassurance"+ >+ nothing is charged until your trial ends. cancel in one click, or switch+ to the free plan or a cheaper one whenever you want, from settings.+ </p>++ {/* Error-state only, never a standing choice. This is the last slide, so+ if our own checkout cannot load there has to be a way out or the user+ is stranded in setup with no app behind it. */}+ {error && (<buttontype="button"onClick={() => void continueWithoutCard()}disabled={startingCardlessTrial}- className="mx-auto mt-4 block font-mono text-[10px] text-muted-foreground/40 underline decoration-muted-foreground/20 underline-offset-4 transition-opacity hover:text-muted-foreground focus:text-muted-foreground"+ className="mx-auto mt-3 block font-mono text-[10px] text-muted-foreground underline decoration-muted-foreground/40 underline-offset-4"data-testid="onboarding-plan-free">- {startingCardlessTrial- ? "starting trial"- : "continue with limited free plan"}+ {startingCardlessTrial ? "continuing" : "continue without a card"}</button>)}</div>