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
style(onboarding): format timeline choice
Louis Beaumont73a9293cc116
diff --git a/apps/screenpipe-app-tauri/app/onboarding/page.test.tsx b/apps/screenpipe-app-tauri/app/onboarding/page.test.tsxindex 5b2af9dc5..d112d0c90 100644--- a/apps/screenpipe-app-tauri/app/onboarding/page.test.tsx+++ b/apps/screenpipe-app-tauri/app/onboarding/page.test.tsx@@ -129,8 +129,12 @@ describe("enterprise onboarding authentication", () => {render(<OnboardingPage />);expect(screen.getByText("regular sign in")).toBeInTheDocument();- fireEvent.click(screen.getByRole("button", { name: /use enterprise key/i }));- expect(mocks.selectAuthenticationMethod).toHaveBeenCalledWith("license_key");+ fireEvent.click(+ screen.getByRole("button", { name: /use enterprise key/i }),+ );+ expect(mocks.selectAuthenticationMethod).toHaveBeenCalledWith(+ "license_key",+ );});it("renders Enterprise Key entry on the onboarding login step", () => {@@ -148,7 +152,9 @@ describe("enterprise onboarding authentication", () => {render(<OnboardingPage />);expect(screen.getByText("regular sign in")).toBeInTheDocument();- expect(screen.queryByRole("button", { name: /use enterprise key/i })).not.toBeInTheDocument();+ expect(+ screen.queryByRole("button", { name: /use enterprise key/i }),+ ).not.toBeInTheDocument();expect(mocks.capture).toHaveBeenCalledWith("onboarding_funnel_step", {funnel_version: "onboarding_ui_v1",step: "started",@@ -198,7 +204,9 @@ describe("enterprise onboarding authentication", () => {render(<OnboardingPage />);- await waitFor(() => expect(mocks.setOnboardingStep).toHaveBeenCalledWith("permissions"));+ await waitFor(() =>+ expect(mocks.setOnboardingStep).toHaveBeenCalledWith("permissions"),+ );});it("keeps a rejected enterprise account on login with the key alternative", () => {@@ -208,9 +216,13 @@ describe("enterprise onboarding authentication", () => {render(<OnboardingPage />);- expect(screen.getByText(/not associated with the enterprise organization/i)).toBeInTheDocument();+ expect(+ screen.getByText(/not associated with the enterprise organization/i),+ ).toBeInTheDocument();expect(screen.getByText("regular sign in")).toBeInTheDocument();- expect(screen.getByRole("button", { name: /use enterprise key/i })).toBeInTheDocument();+ expect(+ screen.getByRole("button", { name: /use enterprise key/i }),+ ).toBeInTheDocument();});it("completes onboarding after permissions when enterprise app UI is hidden", async () => {@@ -220,7 +232,7 @@ describe("enterprise onboarding authentication", () => {render(<OnboardingPage />);fireEvent.click(- await screen.findByRole("button", { name: /finish permissions/i })+ await screen.findByRole("button", { name: /finish permissions/i }),);await waitFor(() =>@@ -238,11 +250,11 @@ describe("enterprise onboarding authentication", () => {render(<OnboardingPage />);fireEvent.click(- await screen.findByRole("button", { name: /finish permissions/i })+ await screen.findByRole("button", { name: /finish permissions/i }),);await waitFor(() =>- expect(mocks.setOnboardingStep).toHaveBeenCalledWith("timeline")+ expect(mocks.setOnboardingStep).toHaveBeenCalledWith("timeline"),);expect(mocks.completeOnboarding).not.toHaveBeenCalled();});@@ -276,14 +288,18 @@ describe("enterprise onboarding authentication", () => {it("never enters UI-only steps when hidden onboarding completion fails", async () => {onboardingData.currentStep = "permissions";mocks.applyEnterpriseUiVisibility.mockResolvedValue(true);- mocks.completeOnboarding.mockRejectedValueOnce(new Error("store unavailable"));+ mocks.completeOnboarding.mockRejectedValueOnce(+ new Error("store unavailable"),+ );const closeWindow = vi.spyOn(window, "close").mockImplementation(() => {});- const consoleError = vi.spyOn(console, "error").mockImplementation(() => {});+ const consoleError = vi+ .spyOn(console, "error")+ .mockImplementation(() => {});render(<OnboardingPage />);fireEvent.click(- await screen.findByRole("button", { name: /finish permissions/i })+ await screen.findByRole("button", { name: /finish permissions/i }),);await waitFor(() => expect(closeWindow).toHaveBeenCalledTimes(1));@@ -318,11 +334,11 @@ describe("timeline slide sequencing", () => {render(<OnboardingPage />);fireEvent.click(- await screen.findByRole("button", { name: /finish permissions/i })+ await screen.findByRole("button", { name: /finish permissions/i }),);await waitFor(() =>- expect(mocks.setOnboardingStep).toHaveBeenCalledWith("timeline")+ expect(mocks.setOnboardingStep).toHaveBeenCalledWith("timeline"),);expect(await screen.findByText("timeline choice")).toBeInTheDocument();expect(screen.queryByText("engine")).not.toBeInTheDocument();@@ -332,7 +348,7 @@ describe("timeline slide sequencing", () => {device_tier: "low",timeline_choice_eligible: true,timeline_choice_policy_locked: false,- }+ },);});@@ -344,11 +360,11 @@ describe("timeline slide sequencing", () => {render(<OnboardingPage />);fireEvent.click(- await screen.findByRole("button", { name: /finish permissions/i })+ await screen.findByRole("button", { name: /finish permissions/i }),);await waitFor(() =>- expect(mocks.setOnboardingStep).toHaveBeenCalledWith("engine")+ expect(mocks.setOnboardingStep).toHaveBeenCalledWith("engine"),);expect(await screen.findByText("engine")).toBeInTheDocument();expect(screen.queryByText("timeline choice")).not.toBeInTheDocument();@@ -360,24 +376,24 @@ describe("timeline slide sequencing", () => {: "unknown",timeline_choice_eligible: false,timeline_choice_policy_locked: false,- }+ },);- }+ },);it("skips straight to engine when policy manages disableTimeline", async () => {mocks.isSettingLocked.mockImplementation(- (key: string) => key === "disableTimeline"+ (key: string) => key === "disableTimeline",);render(<OnboardingPage />);fireEvent.click(- await screen.findByRole("button", { name: /finish permissions/i })+ await screen.findByRole("button", { name: /finish permissions/i }),);await waitFor(() =>- expect(mocks.setOnboardingStep).toHaveBeenCalledWith("engine")+ expect(mocks.setOnboardingStep).toHaveBeenCalledWith("engine"),);expect(await screen.findByText("engine")).toBeInTheDocument();expect(screen.queryByText("timeline choice")).not.toBeInTheDocument();@@ -387,7 +403,7 @@ describe("timeline slide sequencing", () => {device_tier: "low",timeline_choice_eligible: false,timeline_choice_policy_locked: true,- }+ },);});@@ -395,17 +411,17 @@ describe("timeline slide sequencing", () => {// either one already decides the outcome and the choice must not be offered.it("skips straight to engine when policy manages disableScreenshots only", async () => {mocks.isSettingLocked.mockImplementation(- (key: string) => key === "disableScreenshots"+ (key: string) => key === "disableScreenshots",);render(<OnboardingPage />);fireEvent.click(- await screen.findByRole("button", { name: /finish permissions/i })+ await screen.findByRole("button", { name: /finish permissions/i }),);await waitFor(() =>- expect(mocks.setOnboardingStep).toHaveBeenCalledWith("engine")+ expect(mocks.setOnboardingStep).toHaveBeenCalledWith("engine"),);expect(await screen.findByText("engine")).toBeInTheDocument();expect(screen.queryByText("timeline choice")).not.toBeInTheDocument();@@ -450,12 +466,14 @@ describe("timeline slide sequencing", () => {"does not resume onto the timeline slide when policy manages %s",async (lockedKey) => {onboardingData.currentStep = "timeline";- mocks.isSettingLocked.mockImplementation((key: string) => key === lockedKey);+ mocks.isSettingLocked.mockImplementation(+ (key: string) => key === lockedKey,+ );render(<OnboardingPage />);expect(await screen.findByText("engine")).toBeInTheDocument();expect(screen.queryByText("timeline choice")).not.toBeInTheDocument();- }+ },);});diff --git a/apps/screenpipe-app-tauri/app/onboarding/page.tsx b/apps/screenpipe-app-tauri/app/onboarding/page.tsxindex 36b054981..75f68615d 100644--- a/apps/screenpipe-app-tauri/app/onboarding/page.tsx+++ b/apps/screenpipe-app-tauri/app/onboarding/page.tsx@@ -97,7 +97,7 @@ const EndowedProgress = ({: "bg-border"}`}/>- )+ ),)}</div></div>@@ -123,7 +123,7 @@ export default function OnboardingPage() {} | null>(null);const handlePermissionsProgress = useCallback((done: number, total: number) => setPermissionsProgress({ done, total }),- []+ [],);const { onboardingData, isLoading, completeOnboarding } = useOnboarding();const { settings, isSettingsLoaded } = useSettings();@@ -163,7 +163,7 @@ export default function OnboardingPage() {: "unknown";const visibleOrder = useMemo(() => SLIDE_ORDER.filter((s) => s !== "timeline" || timelineChoiceVisible),- [timelineChoiceVisible]+ [timelineChoiceVisible],);// Read by the hydration-gated restore effect below. Assigned during render,// per the ref-mirror rule in CLAUDE.md.@@ -211,7 +211,7 @@ export default function OnboardingPage() {setCurrentSlide(mapped === "timeline" && !timelineChoiceVisibleRef.current? "engine"- : mapped+ : mapped,);}}@@ -292,7 +292,7 @@ export default function OnboardingPage() {} catch (error) {console.warn("failed to resolve enterprise UI visibility after permissions:",- error+ error,);}@@ -327,9 +327,8 @@ export default function OnboardingPage() {// Walk SLIDE_ORDER (never the filtered list) so the index stays valid even// for a slide that policy hides, then land on the next visible slide.const nextSlide =- SLIDE_ORDER.slice(currentIdx + 1).find((s) =>- visibleOrder.includes(s)- ) || "first-dashboard";+ SLIDE_ORDER.slice(currentIdx + 1).find((s) => visibleOrder.includes(s)) ||+ "first-dashboard";try {await commands.setOnboardingStep(nextSlide);} catch {@@ -405,11 +404,13 @@ export default function OnboardingPage() {sub={currentSlide === "permissions" ? permissionsProgress : null}/>)}- {currentSlide === "login" && (- isManagedDeployment ? (+ {currentSlide === "login" &&+ (isManagedDeployment ? (authenticationState === "license_key" ? (<div className="mx-auto w-full max-w-sm">- <h2 className="mb-1 text-lg font-semibold">activate this device</h2>+ <h2 className="mb-1 text-lg font-semibold">+ activate this device+ </h2><p className="mb-4 text-sm text-muted-foreground">enter the enterprise key provided by your administrator</p>@@ -448,8 +449,7 @@ export default function OnboardingPage() {)) : (<OnboardingLogin handleNextSlide={handleNextSlide} />- )- )}+ ))}{currentSlide === "permissions" && (<PermissionsStephandleNextSlide={handleNextSlide}diff --git a/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.test.tsx b/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.test.tsxindex 8baf811a0..0e8b9abe2 100644--- a/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.test.tsx+++ b/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.test.tsx@@ -280,7 +280,9 @@ describe("TimelineChoice", () => {mocks.settings.deviceTier = "low";mocks.localFetch.mockResolvedValue({ ok: true, status: 200 });mocks.spawnScreenpipe.mockRejectedValue(new Error("spawn failed"));- const consoleError = vi.spyOn(console, "error").mockImplementation(() => {});+ const consoleError = vi+ .spyOn(console, "error")+ .mockImplementation(() => {});const handleNextSlide = vi.fn();render(<TimelineChoice handleNextSlide={handleNextSlide} />);diff --git a/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.tsx b/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.tsxindex 9a3d449e8..68e31ab99 100644--- a/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.tsx+++ b/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.tsx@@ -187,7 +187,9 @@ function restartRunningEngine(): void {// capture flag is enterprise-policy-managed the slide sequencer in// app/onboarding/page.tsx leaves this slide out entirely.-export default function TimelineChoice({ handleNextSlide }: TimelineChoiceProps) {+export default function TimelineChoice({+ handleNextSlide,+}: TimelineChoiceProps) {const { settings, updateSettings } = useSettings();const mountTimeRef = useRef(Date.now());const hasAdvanced = useRef(false);@@ -231,7 +233,9 @@ export default function TimelineChoice({ handleNextSlide }: TimelineChoiceProps)});} catch (e) {console.error("failed to save timeline choice:", e);- posthog.capture("onboarding_timeline_choice_failed", { stage: "persist" });+ posthog.capture("onboarding_timeline_choice_failed", {+ stage: "persist",+ });setError("couldn't save that choice. check disk space and try again.");inFlight.current = false;setPending(null);@@ -323,11 +327,11 @@ export default function TimelineChoice({ handleNextSlide }: TimelineChoiceProps)heads-up: this device has limited ram/cores</p><p className="font-mono text-[10px] text-muted-foreground/70 mt-1 leading-snug">- the timeline can take a real toll on machines like this one.- keeping it off saves memory, cpu and disk. the text screenpipe- reads from your apps stays recorded and searchable — you lose the- visual rewind, and apps that don't expose their text stop- being captured.+ the timeline can take a real toll on machines like this one. keeping+ it off saves memory, cpu and disk. the text screenpipe reads from+ your apps stays recorded and searchable — you lose the visual+ rewind, and apps that don't expose their text stop being+ captured.</p></motion.div>)}