Skip to content

Commit

Permalink
chore: add more metrics to notebooks (#18761)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Nov 21, 2023
1 parent 420d5cc commit d7fefa4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { notebookNodeLogic } from '../notebookNodeLogic'
import { useEffect, useState } from 'react'
import { LemonInput, Tooltip } from '@posthog/lemon-ui'
import { notebookLogic } from 'scenes/notebooks/Notebook/notebookLogic'
import posthog from 'posthog-js'

export function NotebookNodeTitle(): JSX.Element {
const { isEditable } = useValues(notebookLogic)
Expand All @@ -21,6 +22,10 @@ export function NotebookNodeTitle(): JSX.Element {
title: newValue ?? undefined,
})

if (title != newValue) {
posthog.capture('notebook node title updated')
}

setEditing(false)
}

Expand All @@ -42,7 +47,10 @@ export function NotebookNodeTitle(): JSX.Element {
<span
title={title}
className="NotebookNodeTitle NotebookNodeTitle--editable"
onDoubleClick={() => setEditing(true)}
onDoubleClick={() => {
setEditing(true)
posthog.capture('notebook editing node title')
}}
>
{title}
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NotebookNodeType } from '~/types'
import { LemonSelectMultiple } from 'lib/lemon-ui/LemonSelectMultiple'
import { NotebooksListFilters } from 'scenes/notebooks/NotebooksTable/notebooksTableLogic'
import posthog from 'posthog-js'

export const fromNodeTypeToLabel: Omit<
Record<NotebookNodeType, string>,
Expand Down Expand Up @@ -48,6 +49,7 @@ export function ContainsTypeFilters({
}, {})}
value={filters.contains}
onChange={(newValue: string[]) => {
posthog.capture('notebook containing filter applied')
setFilters({ contains: newValue.map((x) => x as NotebookNodeType) })
}}
data-attr={'notebooks-list-contains-filters'}
Expand Down

0 comments on commit d7fefa4

Please sign in to comment.