feat: wire remaining PostHog events across all key user actions (#111)

- export_generated: session copy, copy-for-ticket, download
- ai_feature_used: copilot, assistant chat, session-to-flow, KB accelerator, flow assist
- psa_connected: ConnectWise integration creation
- session_shared: share link creation
- flow_created: troubleshooting editor, procedural editor, session-to-flow

All 9 events from the product analytics plan are now fully wired.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit was merged in pull request #111.
This commit is contained in:
chihlasm
2026-03-16 18:49:01 -04:00
committed by GitHub
parent 1e8ed09fbd
commit c44edc5088
9 changed files with 23 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import { useEffect, useState, useCallback, useRef } from 'react'
import { useParams, useNavigate, useBlocker } from 'react-router-dom'
import { useStore } from 'zustand'
import { Undo2, Redo2, Save, CheckCircle2, Monitor, FileText, Code2, LayoutList, BarChart3, Settings, Download, Sparkles } from 'lucide-react'
import { analytics } from '@/lib/analytics'
import { Button } from '@/components/ui/Button'
import { getMonacoEditor } from '@/components/tree-editor/code-mode'
import { treesApi } from '@/api/trees'
@@ -364,6 +365,7 @@ export function TreeEditorPage() {
toast.success('Draft saved successfully')
} else {
const newTree = await treesApi.create(treeData as TreeCreate)
analytics.flowCreated({ flow_type: 'troubleshooting', method: 'manual' })
setTreeStatus('draft')
markSaved()
toast.success('Draft created successfully')
@@ -443,6 +445,7 @@ export function TreeEditorPage() {
toast.success('Tree published successfully')
} else {
const newTree = await treesApi.create(treeData as TreeCreate)
analytics.flowCreated({ flow_type: 'troubleshooting', method: 'manual' })
setTreeStatus('published')
markSaved()
toast.success('Tree published successfully')