fix(desktop): start screen capture after chat onboarding step#5967
Conversation
Screen capture was only starting after the full onboarding (step 3 Tasks), but permissions are granted during the chat step (step 0). This meant the Rewind tab was empty when users first opened it after onboarding. Now startMonitoring() fires right after the chat step completes, so screenshots accumulate while the user goes through floating bar demo, voice shortcut, and tasks steps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR fixes a UX bug where the Rewind tab had no screenshots immediately after onboarding because screen-capture monitoring only started at the very end of onboarding (Tasks step), well after screen-recording permission was granted during the chat step. The fix calls Key details:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant OnboardingView
participant ProactiveAssistantsPlugin
User->>OnboardingView: Complete / Skip chat step (step 0)
OnboardingView->>ProactiveAssistantsPlugin: startMonitoring() [new]
ProactiveAssistantsPlugin-->>ProactiveAssistantsPlugin: refreshScreenRecordingPermission()
alt Permission granted
ProactiveAssistantsPlugin-->>ProactiveAssistantsPlugin: isMonitoring = true, captureTimer starts
else Permission not yet granted
ProactiveAssistantsPlugin-->>ProactiveAssistantsPlugin: requestAllScreenCapturePermissions() + retry (2s/4s/8s)
end
OnboardingView->>OnboardingView: currentStep = 1 (FloatingBar)
User->>OnboardingView: Complete steps 1–3
OnboardingView->>OnboardingView: handleOnboardingComplete()
OnboardingView->>ProactiveAssistantsPlugin: startMonitoring() [pre-existing, no-op if already running]
ProactiveAssistantsPlugin-->>OnboardingView: completion(true, nil) [guard short-circuits]
Reviews (1): Last reviewed commit: "fix(desktop): start screen capture after..." | Re-trigger Greptile |
| onSkip: { | ||
| if !ProactiveAssistantsPlugin.shared.isMonitoring { | ||
| ProactiveAssistantsPlugin.shared.startMonitoring { _, _ in } | ||
| } | ||
| currentStep = 1 |
There was a problem hiding this comment.
Missing analytics for skip path
The onSkip handler starts monitoring but does not record an analytics event for step 0 being skipped, while steps 1 and 2 both call AnalyticsManager.shared.onboardingStepCompleted with a _Skipped suffix in their onSkip closures. This is pre-existing, but the PR adds monitoring to the skip path without closing the gap.
Consider adding:
| onSkip: { | |
| if !ProactiveAssistantsPlugin.shared.isMonitoring { | |
| ProactiveAssistantsPlugin.shared.startMonitoring { _, _ in } | |
| } | |
| currentStep = 1 | |
| onSkip: { | |
| AnalyticsManager.shared.onboardingStepCompleted(step: 0, stepName: "Chat_Skipped") | |
| if !ProactiveAssistantsPlugin.shared.isMonitoring { | |
| ProactiveAssistantsPlugin.shared.startMonitoring { _, _ in } | |
| } | |
| currentStep = 1 | |
| } |
…ardware#5967) ## Summary - Screen capture only started after the full onboarding (Tasks step), but permissions are granted during the chat step - Users would finish onboarding, click Rewind, and see no screenshots because capture hadn't started yet - Now `startMonitoring()` fires right after the chat step (step 0) completes, giving 2-3 minutes of screenshots to accumulate while the user goes through the remaining onboarding steps (floating bar, voice shortcut, tasks) ## Test plan - [ ] Reset onboarding, go through chat step, complete it - [ ] While on floating bar / voice shortcut steps, verify screenshots are being captured (check log for "captureFrame") - [ ] Finish onboarding, open Rewind tab — should already have screenshots 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
startMonitoring()fires right after the chat step (step 0) completes, giving 2-3 minutes of screenshots to accumulate while the user goes through the remaining onboarding steps (floating bar, voice shortcut, tasks)Test plan
🤖 Generated with Claude Code