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: distinguish lifetime access from monthly Basic plan
louisfcb4d5d65a1d
diff --git a/apps/screenpipe-app-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsx b/apps/screenpipe-app-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsxindex 26c0d8cf3..1d87f2d85 100644--- a/apps/screenpipe-app-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsx+++ b/apps/screenpipe-app-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsx@@ -452,6 +452,10 @@ describe("AccountSection subscription/login gating", () => {expect(screen.queryByTestId(ACTIVE_CARD)).not.toBeInTheDocument();// Branch-3 named-plan badge still renders for the paying Basic user.expect(screen.getByText("active")).toBeInTheDocument();+ expect(screen.getByTestId("account-plan-standard")).toHaveAttribute(+ "data-current", "true",+ );+ expect(screen.queryByText(/one-time purchase/)).not.toBeInTheDocument();});it("sends existing Basic subscribers to billing even with a stale cloud flag", () => {@@ -515,6 +519,13 @@ describe("AccountSection subscription/login gating", () => {expect(screen.queryByTestId(ACTIVE_CARD)).not.toBeInTheDocument();expect(screen.getByText("Screenpipe Lifetime")).toBeInTheDocument();+ expect(screen.getByText("active")).toBeInTheDocument();+ expect(screen.getByText(/one-time purchase/)).toBeInTheDocument();+ expect(screen.getByText("optional subscriptions")).toBeInTheDocument();+ const plans = screen.getByTestId("account-plan-options");+ expect(within(plans).queryByText("current")).not.toBeInTheDocument();+ expect(within(plans).queryByText("your plan")).not.toBeInTheDocument();+ expect(plans.querySelector('[data-current="true"]')).toBeNull();fireEvent.click(screen.getByRole("button", { name: /upgrade to business/i }));await waitFor(() => expect(checkoutFetch).toHaveBeenCalledTimes(1));diff --git a/apps/screenpipe-app-tauri/components/settings/account-plan-options.test.ts b/apps/screenpipe-app-tauri/components/settings/account-plan-options.test.tsindex e01adee05..e40544959 100644--- a/apps/screenpipe-app-tauri/components/settings/account-plan-options.test.ts+++ b/apps/screenpipe-app-tauri/components/settings/account-plan-options.test.ts@@ -100,9 +100,9 @@ describe("account plan options", () => {expect(accountPlanForEntitlement("basic", true)).toBe("standard");});- it("puts Lifetime on Basic, not Business", () => {- // Lifetime maps to the Basic hosted AI tier.- expect(accountPlanForEntitlement("lifetime", true)).toBe("standard");+ it("does not mark a monthly subscription current for Lifetime", () => {+ expect(accountPlanForEntitlement("lifetime", true)).toBeNull();+ expect(accountPlanForEntitlement("LIFETIME", true)).toBeNull();});it("marks the capacity level the account actually pays for", () => {diff --git a/apps/screenpipe-app-tauri/components/settings/account-plan-options.tsx b/apps/screenpipe-app-tauri/components/settings/account-plan-options.tsxindex a24a716fc..6a3cf7a0d 100644--- a/apps/screenpipe-app-tauri/components/settings/account-plan-options.tsx+++ b/apps/screenpipe-app-tauri/components/settings/account-plan-options.tsx@@ -140,18 +140,18 @@ export function recommendedCapacityCard(return upgrade ? CARD_FOR_TARGET[upgrade.targetPlan] : null;}-/** Which card to mark "current" for an entitlement plan (users.plan). */+/** Which subscription card to mark current; Lifetime has its own active card. */export function accountPlanForEntitlement(plan: string | null | undefined,hasPaidAccess: boolean,-): AccountPlanId {+): AccountPlanId | null {switch ((plan || "").toLowerCase()) {case "standard":case "basic":- // Lifetime is the permanent app entitlement and maps to the Basic hosted- // AI tier, so it is not Business.- case "lifetime":return "standard";+ // A one-time entitlement must not label a monthly subscription as current.+ case "lifetime":+ return null;// Each capacity level owns a card now, so the badge lands on the tier the// account actually pays for. Before this a Business Max account read// "$50 / seat / month" under a "your plan" badge while paying $100.@@ -181,7 +181,7 @@ export function AccountPlanOptions({disabledReason,onSelect,}: {- current: AccountPlanId;+ current: AccountPlanId | null;/** Raw entitlement (users.plan), used to point at the next capacity step. */entitlementPlan?: string | null;/** Plan the account drops to when a trial or grant ends. */diff --git a/apps/screenpipe-app-tauri/components/settings/account-section.tsx b/apps/screenpipe-app-tauri/components/settings/account-section.tsxindex b59eebe28..41cc44238 100644--- a/apps/screenpipe-app-tauri/components/settings/account-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/account-section.tsx@@ -173,6 +173,7 @@ export function AccountSection() {(selection: BusinessUpgradeSelection) => Promise<void>>(async () => {});const subscriptionPlan = settings.user?.subscription_plan ?? null;+ const isLifetimePlan = subscriptionPlan?.toLowerCase() === "lifetime";const hasNamedPlan = !!subscriptionPlan && subscriptionPlan !== "none";const appUser = settings.user as AppUser | null;const hasExpiringProfilePlan = getUserPlanExpiration(appUser) !== null;@@ -1014,11 +1015,17 @@ export function AccountSection() {</span></div><p className="text-sm text-muted-foreground mt-2">- local capture, search & timeline. add cloud sync, cloud AI & 50+- integrations with Business below.+ {isLifetimePlan+ ? "one-time purchase. local capture, search & timeline are included."+ : "local capture, search & timeline. add cloud sync, cloud AI & 50+ integrations with Business below."}</p><div className="mt-4">+ {isLifetimePlan && (+ <p className="text-sm text-muted-foreground mb-3">+ optional subscriptions+ </p>+ )}<AccountPlanOptionscurrent={accountPlanForEntitlement(subscriptionPlan, true)}entitlementPlan={subscriptionPlan}diff --git a/apps/screenpipe-workflows-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsx b/apps/screenpipe-workflows-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsxindex 26c0d8cf3..1d87f2d85 100644--- a/apps/screenpipe-workflows-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsx+++ b/apps/screenpipe-workflows-tauri/components/settings/__tests__/account-section.subscription-gate.test.tsx@@ -452,6 +452,10 @@ describe("AccountSection subscription/login gating", () => {expect(screen.queryByTestId(ACTIVE_CARD)).not.toBeInTheDocument();// Branch-3 named-plan badge still renders for the paying Basic user.expect(screen.getByText("active")).toBeInTheDocument();+ expect(screen.getByTestId("account-plan-standard")).toHaveAttribute(+ "data-current", "true",+ );+ expect(screen.queryByText(/one-time purchase/)).not.toBeInTheDocument();});it("sends existing Basic subscribers to billing even with a stale cloud flag", () => {@@ -515,6 +519,13 @@ describe("AccountSection subscription/login gating", () => {expect(screen.queryByTestId(ACTIVE_CARD)).not.toBeInTheDocument();expect(screen.getByText("Screenpipe Lifetime")).toBeInTheDocument();+ expect(screen.getByText("active")).toBeInTheDocument();+ expect(screen.getByText(/one-time purchase/)).toBeInTheDocument();+ expect(screen.getByText("optional subscriptions")).toBeInTheDocument();+ const plans = screen.getByTestId("account-plan-options");+ expect(within(plans).queryByText("current")).not.toBeInTheDocument();+ expect(within(plans).queryByText("your plan")).not.toBeInTheDocument();+ expect(plans.querySelector('[data-current="true"]')).toBeNull();fireEvent.click(screen.getByRole("button", { name: /upgrade to business/i }));await waitFor(() => expect(checkoutFetch).toHaveBeenCalledTimes(1));diff --git a/apps/screenpipe-workflows-tauri/components/settings/account-plan-options.test.ts b/apps/screenpipe-workflows-tauri/components/settings/account-plan-options.test.tsindex e01adee05..e40544959 100644--- a/apps/screenpipe-workflows-tauri/components/settings/account-plan-options.test.ts+++ b/apps/screenpipe-workflows-tauri/components/settings/account-plan-options.test.ts@@ -100,9 +100,9 @@ describe("account plan options", () => {expect(accountPlanForEntitlement("basic", true)).toBe("standard");});- it("puts Lifetime on Basic, not Business", () => {- // Lifetime maps to the Basic hosted AI tier.- expect(accountPlanForEntitlement("lifetime", true)).toBe("standard");+ it("does not mark a monthly subscription current for Lifetime", () => {+ expect(accountPlanForEntitlement("lifetime", true)).toBeNull();+ expect(accountPlanForEntitlement("LIFETIME", true)).toBeNull();});it("marks the capacity level the account actually pays for", () => {diff --git a/apps/screenpipe-workflows-tauri/components/settings/account-plan-options.tsx b/apps/screenpipe-workflows-tauri/components/settings/account-plan-options.tsxindex a24a716fc..6a3cf7a0d 100644--- a/apps/screenpipe-workflows-tauri/components/settings/account-plan-options.tsx+++ b/apps/screenpipe-workflows-tauri/components/settings/account-plan-options.tsx@@ -140,18 +140,18 @@ export function recommendedCapacityCard(return upgrade ? CARD_FOR_TARGET[upgrade.targetPlan] : null;}-/** Which card to mark "current" for an entitlement plan (users.plan). */+/** Which subscription card to mark current; Lifetime has its own active card. */export function accountPlanForEntitlement(plan: string | null | undefined,hasPaidAccess: boolean,-): AccountPlanId {+): AccountPlanId | null {switch ((plan || "").toLowerCase()) {case "standard":case "basic":- // Lifetime is the permanent app entitlement and maps to the Basic hosted- // AI tier, so it is not Business.- case "lifetime":return "standard";+ // A one-time entitlement must not label a monthly subscription as current.+ case "lifetime":+ return null;// Each capacity level owns a card now, so the badge lands on the tier the// account actually pays for. Before this a Business Max account read// "$50 / seat / month" under a "your plan" badge while paying $100.@@ -181,7 +181,7 @@ export function AccountPlanOptions({disabledReason,onSelect,}: {- current: AccountPlanId;+ current: AccountPlanId | null;/** Raw entitlement (users.plan), used to point at the next capacity step. */entitlementPlan?: string | null;/** Plan the account drops to when a trial or grant ends. */diff --git a/apps/screenpipe-workflows-tauri/components/settings/account-section.tsx b/apps/screenpipe-workflows-tauri/components/settings/account-section.tsxindex b59eebe28..41cc44238 100644--- a/apps/screenpipe-workflows-tauri/components/settings/account-section.tsx+++ b/apps/screenpipe-workflows-tauri/components/settings/account-section.tsx@@ -173,6 +173,7 @@ export function AccountSection() {(selection: BusinessUpgradeSelection) => Promise<void>>(async () => {});const subscriptionPlan = settings.user?.subscription_plan ?? null;+ const isLifetimePlan = subscriptionPlan?.toLowerCase() === "lifetime";const hasNamedPlan = !!subscriptionPlan && subscriptionPlan !== "none";const appUser = settings.user as AppUser | null;const hasExpiringProfilePlan = getUserPlanExpiration(appUser) !== null;@@ -1014,11 +1015,17 @@ export function AccountSection() {</span></div><p className="text-sm text-muted-foreground mt-2">- local capture, search & timeline. add cloud sync, cloud AI & 50+- integrations with Business below.+ {isLifetimePlan+ ? "one-time purchase. local capture, search & timeline are included."+ : "local capture, search & timeline. add cloud sync, cloud AI & 50+ integrations with Business below."}</p><div className="mt-4">+ {isLifetimePlan && (+ <p className="text-sm text-muted-foreground mb-3">+ optional subscriptions+ </p>+ )}<AccountPlanOptionscurrent={accountPlanForEntitlement(subscriptionPlan, true)}entitlementPlan={subscriptionPlan}