Skip to content

: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.

feat(data-quality): focus first check creation (#92861)

Thiago Salvatore673afbc3b133
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ad881a780615..334762069b66 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -3040,6 +3040,9 @@ importers:
products/data_quality:
dependencies:
+ '@posthog/brand':
+ specifier: 'catalog:'
+ version: 0.10.0([email protected])
'@posthog/icons':
specifier: 'catalog:'
diff --git a/products/data_quality/frontend/overview/DataQualityOverview.test.tsx b/products/data_quality/frontend/overview/DataQualityOverview.test.tsx
index 809f8d3031ab..04ddd101af1b 100644
--- a/products/data_quality/frontend/overview/DataQualityOverview.test.tsx
+++ b/products/data_quality/frontend/overview/DataQualityOverview.test.tsx
@@ -212,7 +212,7 @@ describe('DataQualityOverview', () => {
expect(screen.getAllByText('orders').length).toBeGreaterThan(0)
})
- it('opens the subject picker from the first-use state', async () => {
+ it('shows only the creation path from the illustrated first-use state', async () => {
;(dataQualityChecksList as jest.Mock).mockResolvedValue({ results: [] })
;(dataQualityChecksHealthList as jest.Mock).mockResolvedValue([])
render(<DataQualityOverview />)
@@ -220,6 +220,8 @@ describe('DataQualityOverview', () => {
expect(await screen.findByText('No checks yet')).toBeTruthy()
expect(screen.queryByText('No checks match these filters.')).toBeNull()
expect(document.querySelector('[data-attr="data-quality-overview-new-check"]')).not.toBeNull()
+ expect(document.querySelector('[data-attr="data-quality-overview-browse"]')).toBeNull()
+ expect(document.querySelector('[data-attr="data-quality-overview-empty-state"] img')).not.toBeNull()
fireEvent.click(document.querySelector('[data-attr="data-quality-overview-first-check"]')!)
diff --git a/products/data_quality/frontend/overview/DataQualityOverview.tsx b/products/data_quality/frontend/overview/DataQualityOverview.tsx
index 8cb4bc0c32c0..6accdab52c5a 100644
--- a/products/data_quality/frontend/overview/DataQualityOverview.tsx
+++ b/products/data_quality/frontend/overview/DataQualityOverview.tsx
@@ -1,5 +1,6 @@
import { BindLogic, useActions, useValues } from 'kea'
+import * as scientistPng from '@posthog/brand/hoggies/png/scientist'
import { IconChevronRight, IconEllipsis } from '@posthog/icons'
import {
LemonBanner,
@@ -14,8 +15,8 @@ import {
Spinner,
} from '@posthog/lemon-ui'
+import { pngHoggie } from 'lib/brand/hoggies'
import { TZLabel } from 'lib/components/TZLabel'
-import { urls } from 'scenes/urls'
import { CheckEditorModal } from '../CheckEditorModal'
import { CheckRunsTable } from '../CheckRunsTable'
@@ -25,7 +26,7 @@ import { DataQualityCheckEditorLogicProps, dataQualityCheckEditorLogic } from '.
import type { DataQualityOverviewCheckApi } from '../generated/api.schemas'
import { DataQualityGateToggle } from './DataQualityGateToggle'
import {
- BROWSE_ACTION_ID,
+ NEW_CHECK_ACTION_ID,
OverviewStatusFilter,
SubjectGroup,
dataQualityOverviewLogic,
@@ -41,7 +42,7 @@ const STATUS_FILTERS: { value: OverviewStatusFilter; label: string }[] = [
{ value: 'never_run', label: 'Not run yet' },
]
-const NEW_CHECK_ACTION_ID = 'data-quality-overview-new-check'
+const HedgehogScientist = pngHoggie(scientistPng)
function focusFirstAvailable(elementIds: string[]): void {
// Runs after the removed row has left the DOM, so the first id that still resolves wins.
@@ -209,21 +210,18 @@ export function DataQualityOverview(): JSX.Element {
function NoChecksYet({ onAddCheck }: { onAddCheck: () => void }): JSX.Element {
return (
- <div className="border rounded p-4 flex flex-col items-start gap-2">
- <h4 className="mb-0">No checks yet</h4>
- <p className="mb-0 text-secondary">Add a check here, or browse tables and views first.</p>
+ <div
+ data-attr="data-quality-overview-empty-state"
+ className="border rounded px-4 py-8 flex flex-col items-center text-center mx-auto"
+ >
+ <HedgehogScientist width="128" height="128" className="mb-4" />
+ <h2 className="text-xl leading-tight">No checks yet</h2>
+ <p className="mb-4 text-sm text-balance text-tertiary">
+ Create a check to spot issues in your data before they affect your analysis.
+ </p>
<LemonButton type="primary" size="small" onClick={onAddCheck} data-attr="data-quality-overview-first-check">
Add your first check
</LemonButton>
- <LemonButton
- id={BROWSE_ACTION_ID}
- type="secondary"
- size="small"
- to={urls.database()}
- data-attr="data-quality-overview-browse"
- >
- Browse tables and views
- </LemonButton>
</div>
)
}
diff --git a/products/data_quality/frontend/overview/dataQualityOverviewLogic.test.ts b/products/data_quality/frontend/overview/dataQualityOverviewLogic.test.ts
index 6130df2d3d63..527ac546ab24 100644
--- a/products/data_quality/frontend/overview/dataQualityOverviewLogic.test.ts
+++ b/products/data_quality/frontend/overview/dataQualityOverviewLogic.test.ts
@@ -20,6 +20,7 @@ import type {
} from 'products/data_quality/frontend/generated/api.schemas'
import {
+ NEW_CHECK_ACTION_ID,
dataQualityOverviewLogic,
focusCandidatesAfterDelete,
rowActionsId,
@@ -531,7 +532,7 @@ describe('dataQualityOverviewLogic', () => {
const candidates = focusCandidatesAfterDelete(logic.values.subjectGroups, 'view:uuid-customers', 'check-3')
- expect(candidates).toEqual([subjectDisclosureId('view:uuid-orders'), 'data-quality-browse-subjects'])
+ expect(candidates).toEqual([subjectDisclosureId('view:uuid-orders'), NEW_CHECK_ACTION_ID])
})
async function drainListeners(): Promise<void> {
diff --git a/products/data_quality/frontend/overview/dataQualityOverviewLogic.ts b/products/data_quality/frontend/overview/dataQualityOverviewLogic.ts
index 1b369d4b4d79..964111230aa5 100644
--- a/products/data_quality/frontend/overview/dataQualityOverviewLogic.ts
+++ b/products/data_quality/frontend/overview/dataQualityOverviewLogic.ts
@@ -90,7 +90,7 @@ export function subjectDetailUrl(check: DataQualityOverviewCheckApi): string | n
export const ROW_ACTIONS_ID_PREFIX = 'data-quality-check-actions-'
export const SUBJECT_DISCLOSURE_ID_PREFIX = 'data-quality-subject-disclosure-'
-export const BROWSE_ACTION_ID = 'data-quality-browse-subjects'
+export const NEW_CHECK_ACTION_ID = 'data-quality-overview-new-check'
export function rowActionsId(checkId: string): string {
return `${ROW_ACTIONS_ID_PREFIX}${checkId}`
@@ -120,7 +120,7 @@ export function focusCandidatesAfterDelete(groups: SubjectGroup[], subjectKey: s
...(siblings.length ? [subjectDisclosureId(subjectKey)] : []),
...(groups[groupIndex + 1] ? [subjectDisclosureId(groups[groupIndex + 1].subjectKey)] : []),
...(groupIndex > 0 ? [subjectDisclosureId(groups[groupIndex - 1].subjectKey)] : []),
- BROWSE_ACTION_ID,
+ NEW_CHECK_ACTION_ID,
]
}
diff --git a/products/data_quality/package.json b/products/data_quality/package.json
index 101a56cf7b27..4b4792b70e9f 100644
--- a/products/data_quality/package.json
+++ b/products/data_quality/package.json
@@ -14,6 +14,7 @@
"@testing-library/react": "^14.3.1"
},
"peerDependencies": {
+ "@posthog/brand": "catalog:",
"@posthog/icons": "catalog:",
"@types/react": "*",
"clsx": "*",