:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(dashboards): instrument word art usage (#69654)
Jon McCallume4f65a845834
diff --git a/frontend/src/lib/components/Cards/TextCard/WordArt/WordArtModal.tsx b/frontend/src/lib/components/Cards/TextCard/WordArt/WordArtModal.tsxindex 7c41ba9b1913..68b9fcab1b0d 100644--- a/frontend/src/lib/components/Cards/TextCard/WordArt/WordArtModal.tsx+++ b/frontend/src/lib/components/Cards/TextCard/WordArt/WordArtModal.tsx@@ -1,5 +1,6 @@import clsx from 'clsx'-import { useState } from 'react'+import posthog from 'posthog-js'+import { useEffect, useState } from 'react'import { LemonButton, LemonInput, LemonModal, LemonSegmentedButton } from '@posthog/lemon-ui'@@ -37,12 +38,25 @@ export function WordArtModal({const [text, setText] = useState(initialText ?? '')const [style, setStyle] = useState(normalizeWordArtStyle(initialStyle))const [size, setSize] = useState<WordArtSize>(normalizeWordArtSize(initialSize))+ const isEditing = !!initialText++ // Mounted only while open, so this fires once per gallery open+ useEffect(() => {+ posthog.capture('dashboard text tile word art gallery opened', { is_editing: isEditing })+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [])const trimmedText = text.trim()const previewText = trimmedText || 'Your text here'const save = (): void => {if (trimmedText) {+ posthog.capture('dashboard text tile word art saved', {+ is_new: !isEditing,+ style,+ size,+ text_length: trimmedText.length,+ })onSave({ text: trimmedText, style, size })}}@@ -65,7 +79,7 @@ export function WordArtModal({onClick={save}disabledReason={!trimmedText ? 'Enter some text first' : undefined}>- {initialText ? 'Update' : 'Insert'}+ {isEditing ? 'Update' : 'Insert'}</LemonButton></>}