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): stop screenshot capture when the user turns rewind off
Anshgrover23e5191ac366b1
diff --git a/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.test.tsx b/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.test.tsxindex a92d1244c..621ccde33 100644--- a/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.test.tsx+++ b/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.test.tsx@@ -34,7 +34,7 @@ describe("TimelineChoice", () => {mocks.updateSettings.mockResolvedValue(undefined);});- it("recommends on for high tier and persists disableTimeline: false when chosen", async () => {+ it("recommends on for high tier and keeps both capture flags on when chosen", async () => {mocks.settings.deviceTier = "high";const handleNextSlide = vi.fn();render(<TimelineChoice handleNextSlide={handleNextSlide} />);@@ -53,6 +53,7 @@ describe("TimelineChoice", () => {expect(mocks.updateSettings).toHaveBeenCalledWith({disableTimeline: false,+ disableScreenshots: false,});expect(handleNextSlide).toHaveBeenCalledTimes(1);});@@ -69,7 +70,7 @@ describe("TimelineChoice", () => {).not.toBeInTheDocument();});- it("recommends off on low tier and persists disableTimeline: true when chosen", async () => {+ it("recommends off on low tier and stops screenshot capture too when chosen", async () => {mocks.settings.deviceTier = "low";const handleNextSlide = vi.fn();render(<TimelineChoice handleNextSlide={handleNextSlide} />);@@ -87,8 +88,12 @@ describe("TimelineChoice", () => {fireEvent.click(offButton);});+ // disableScreenshots is the flag that actually stops capture, JPEG writes,+ // the OCR fallback and the ffmpeg compaction worker — disableTimeline alone+ // would only skip the in-memory hot frame cache.expect(mocks.updateSettings).toHaveBeenCalledWith({disableTimeline: true,+ disableScreenshots: true,});expect(handleNextSlide).toHaveBeenCalledTimes(1);});@@ -104,11 +109,13 @@ describe("TimelineChoice", () => {expect(mocks.updateSettings).toHaveBeenCalledWith({disableTimeline: false,+ disableScreenshots: false,});expect(mocks.capture).toHaveBeenCalledWith("onboarding_timeline_choice",expect.objectContaining({timeline_enabled: true,+ screenshots_enabled: true,device_tier: "low",followed_recommendation: false,}),@@ -142,6 +149,7 @@ describe("TimelineChoice", () => {expect(mocks.updateSettings).toHaveBeenCalledTimes(1);expect(mocks.updateSettings).toHaveBeenCalledWith({disableTimeline: false,+ disableScreenshots: false,});expect(handleNextSlide).toHaveBeenCalledTimes(1);});diff --git a/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.tsx b/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.tsxindex 017df2f11..93c4571e9 100644--- a/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.tsx+++ b/apps/screenpipe-app-tauri/components/onboarding/timeline-choice.tsx@@ -162,18 +162,29 @@ export default function TimelineChoice({ handleNextSlide }: TimelineChoiceProps)setSaving(true);posthog.capture("onboarding_timeline_choice", {timeline_enabled: enabled,+ screenshots_enabled: enabled,device_tier: settings.deviceTier ?? "unknown",followed_recommendation: enabled === recommendEnabled,time_spent_ms: Date.now() - mountTimeRef.current,});try {- // This slide runs before engine-startup spawns screenpipe, so the- // value is read at first spawn — no restart needed here (unlike the- // settings-page toggle in display-section.tsx).- await updateSettings({ disableTimeline: !enabled });+ // Both flags move together. On its own `disableTimeline` only skips the+ // in-memory hot frame cache — screen capture, JPEG writes, the OCR+ // fallback and the ffmpeg compaction worker all keep running, so "saves+ // ram, cpu & disk" would not hold. `disableScreenshots` stops that work+ // while accessibility-tree capture continues, which is why search, ask+ // and pipes are unaffected either way.+ //+ // This slide runs before engine-startup spawns screenpipe, so both values+ // are read at first spawn — no restart needed here (unlike the+ // settings-page toggles).+ await updateSettings({+ disableTimeline: !enabled,+ disableScreenshots: !enabled,+ });} catch {- // non-fatal: the default (timeline on) applies; user can change it- // later in settings → display+ // non-fatal: the defaults (both on) apply; the user can change them+ // later in settings}handleNextSlide();};@@ -305,7 +316,7 @@ export default function TimelineChoice({ handleNextSlide }: TimelineChoiceProps)animate={{ opacity: 1 }}transition={{ delay: 0.45 }}>- not a forever choice — change it anytime in settings → display+ not a forever choice — change it anytime in settings</motion.p></motion.div>);