feat(posthog): Add tracking on mothership abort#4023
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@BugBot review |
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 1468b67. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1468b67. Configure here.
Greptile SummaryThis PR adds PostHog analytics tracking for when users abort AI task generation in two chat interfaces: the mothership home view and the copilot panel. It introduces a new
Confidence Score: 5/5Safe to merge — minimal, well-scoped analytics addition with no logic changes The PR only adds PostHog event tracking with no changes to core logic. The implementation correctly reuses the existing No files require special attention
|
| Filename | Overview |
|---|---|
| apps/sim/lib/posthog/events.ts | Adds task_generation_aborted event type with workspace_id and view ('mothership' |
| apps/sim/app/workspace/[workspaceId]/home/home.tsx | Wraps stopGeneration in handleStopGeneration to fire task_generation_aborted PostHog event before stopping generation in mothership view |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx | Adds posthogRef pattern and handleCopilotStopGeneration wrapper to fire task_generation_aborted before stopping copilot generation |
Sequence Diagram
sequenceDiagram
participant U as User
participant H as handleStopGeneration / handleCopilotStopGeneration
participant PH as PostHog (captureEvent)
participant SG as stopGeneration / copilotStopGeneration
U->>H: Click abort button
H->>PH: captureEvent('task_generation_aborted', { workspace_id, view })
PH-->>H: (fire-and-forget)
H->>SG: Call underlying stop function
SG-->>U: Generation stopped
Reviews (1): Last reviewed commit: "feat(posthog): Add tracking on mothershi..." | Re-trigger Greptile
Summary
Added posthog event for mothership and copilot aborts so we can filter session recordings by these places which commonly signal there's some issue (incorrect behavior, long running jobs, stuck processes, etc)
Type of Change
Testing
Checklist
Screenshots/Videos