: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
fix(data-quality): wrap the overview toolbar at narrow scene widths (#101046)
Thiago Salvatore258dd19cf739
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 70e255d51a6b..55c28b7feff0 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -5804,6 +5804,22 @@ snapshots:hash: v1.k794b7964.eceb80b180d692b6f616365ea7269d24bb6f084128cbfafc661cf6159dc281ec.FagEpfMfYMDwAJaH7ctNLBVSS-sThFgcTnQ8Ghwk8wIproducts-data-modeling-views-list--actions--light:hash: v1.k794b7964.72724e994dcffa8f4d3914d5e9f87d9c6ad7ddfe0ffd28a02897129354ba956d.Vu7BhdcTI1yxaNzfgaW9gFoiBIScbrYMw9RN8FmP1ms+ products-data-quality-overview--default--dark:+ hash: v1.k794b7964.1d8602147e022dc66f365cd1adaecea883b58c9882959151f69e2b1e174854e1.v4WuLvd2kNBF9E9wu-ga73LWO0E7T_hWA4ipRR_nq50+ products-data-quality-overview--default--light:+ hash: v1.k794b7964.b6c5da27b88a2c579ec3c2c176e8c9ffe613c6429810232a1315e79b80cec4ac.fyT6ugM02IBcH2t_JLB9iqu1AiRX4dDE6-YAmaSEfNc+ products-data-quality-overview--empty--dark:+ hash: v1.k794b7964.521afa3781f830cc7711e3afaca83cca31428780c9750b62f525ddbf32b4b7e1.l64ODysehFkdsQhCfzbQyGvfMtP7yYauTO27XfoOZTE+ products-data-quality-overview--empty--light:+ hash: v1.k794b7964.fae8647ae4c1f915ac9fce2f917588fb725b798eeb922ff7a4761ac7e7d64962.wGwZ5yL_avhnizzxPNWndWUjytnujaC4C3cX8C6Fk8s+ products-data-quality-overview--narrow--dark:+ hash: v1.k794b7964.ab1dc8d009d28798ed92bac7897cae61a541492a713b7c3e0aae8d30b20cbb70.1RHkf5iF7pgMZru0VsuyYFr54yToqY8wWqkfgKt95O4+ products-data-quality-overview--narrow--light:+ hash: v1.k794b7964.874828133fdc4247f4ba0e6485094636e490e90cbb265c0c519f9f8ba2168a2a.d7PqHHUzicKzzWuqBJUz6pLOJf44hkf_19dL5k6x4wA+ products-data-quality-overview--narrow-empty--dark:+ hash: v1.k794b7964.ef813fd10215bab43b653620d7ff3dcf56d3fb16bab81c0409b67786bcc359a1.eJz8r_4_6j-DVZnnbuL6nTucLWqDnZKwiFq7DE4gvb0+ products-data-quality-overview--narrow-empty--light:+ hash: v1.k794b7964.81260019eb44052bb76fe97fe8debcc7f15ecb6b3a8dcef2422cc19ed8d5acd3.THqGZDG1xTBrwV_Gc404fpGHMABzSYAnm9uCflx5WEoproducts-mcp-analytics-routingbar--all-variants--dark:hash: v1.k794b7964.769a69526cf676447319f587f24ed0d2670a137098867f8d3ee87ebda3415a70.3FGS0pbxxcrZUSto8SNCNHEkxaFXH6T8shqpdg5zzlQproducts-mcp-analytics-routingbar--all-variants--light:diff --git a/products/data_quality/frontend/overview/DataQualityGateToggle.tsx b/products/data_quality/frontend/overview/DataQualityGateToggle.tsxindex 86c539514cd2..9ae4c812a84f 100644--- a/products/data_quality/frontend/overview/DataQualityGateToggle.tsx+++ b/products/data_quality/frontend/overview/DataQualityGateToggle.tsx@@ -18,7 +18,6 @@ export function DataQualityGateToggle(): JSX.Element | null {return (<LemonSwitch- borderedchecked={gateConfig.gate_materialization_on_checks}onChange={setGateEnabled}loading={gateSaving}diff --git a/products/data_quality/frontend/overview/DataQualityOverview.stories.tsx b/products/data_quality/frontend/overview/DataQualityOverview.stories.tsxnew file mode 100644index 000000000000..513364b856db--- /dev/null+++ b/products/data_quality/frontend/overview/DataQualityOverview.stories.tsx@@ -0,0 +1,159 @@+import type { Decorator, Meta, StoryObj } from '@storybook/react'++import { urls } from 'scenes/urls'++import { mswDecorator } from '~/mocks/browser'+import { AccessControlLevel, AccessControlResourceType } from '~/types'++import { DataQualityOverview } from './DataQualityOverview'++const LONG_SUBJECT_NAME = 'monthly_revenue_summary_by_region_and_channel_v2'++const checks = [+ {+ id: 'check-1',+ name: 'order_id is never null',+ check_type: 'not_null',+ column_name: 'order_id',+ severity: 'error',+ enabled: true,+ subject_type: 'view',+ subject_uuid: 'view-long-name',+ subject_name: LONG_SUBJECT_NAME,+ subject_node_id: 'node-long-name',+ last_status: 'failed',+ last_run_at: '2026-09-14T22:00:00Z',+ },+ {+ id: 'check-2',+ name: 'revenue rows arrive daily',+ check_type: 'freshness',+ column_name: '',+ severity: 'warn',+ enabled: true,+ subject_type: 'view',+ subject_uuid: 'view-long-name',+ subject_name: LONG_SUBJECT_NAME,+ subject_node_id: 'node-long-name',+ last_status: 'passed',+ last_run_at: '2026-09-14T22:00:00Z',+ },+ {+ id: 'check-3',+ name: 'customer_id is unique',+ check_type: 'unique',+ column_name: 'customer_id',+ severity: 'error',+ enabled: true,+ subject_type: 'table',+ subject_uuid: 'table-customers',+ subject_name: 'customers',+ last_status: 'passed',+ last_run_at: '2026-09-14T21:30:00Z',+ },+ {+ id: 'check-4',+ name: 'signup conversion stays under 100%',+ check_type: 'custom_sql',+ column_name: '',+ severity: 'error',+ enabled: true,+ subject_type: 'metric',+ subject_uuid: 'metric-signup-conversion',+ subject_name: 'signup_conversion',+ subject_metric_name: 'signup_conversion',+ last_status: null,+ last_run_at: null,+ },+]++const health = [+ {+ subject_type: 'view',+ subject_uuid: 'view-long-name',+ health: 'failing',+ checks_total: 2,+ checks_failing: 1,+ },+ {+ subject_type: 'table',+ subject_uuid: 'table-customers',+ health: 'healthy',+ checks_total: 1,+ checks_failing: 0,+ },+ {+ subject_type: 'metric',+ subject_uuid: 'metric-signup-conversion',+ health: 'unknown',+ checks_total: 1,+ checks_failing: 0,+ },+]++function mocks(overviewChecks: unknown[], subjectHealth: unknown[]): Record<string, unknown> {+ return {+ get: {+ '/api/projects/:team_id/data_quality_checks/': {+ results: overviewChecks,+ count: overviewChecks.length,+ },+ '/api/projects/:team_id/data_quality_checks/health/': subjectHealth,+ '/api/projects/:team_id/data_warehouse/data_quality_gate/': { gate_materialization_on_checks: true },+ },+ }+}++const narrowDecorators: Decorator[] = [+ (Story) => (+ <div className="@container/main-content w-128 max-w-full">+ <Story />+ </div>+ ),+]++const meta: Meta<typeof DataQualityOverview> = {+ title: 'Products/Data quality/Overview',+ component: DataQualityOverview,+ beforeEach: () => {+ const context = window.POSTHOG_APP_CONTEXT!+ const previous = context.resource_access_control+ context.resource_access_control = {+ ...previous,+ [AccessControlResourceType.WarehouseObjects]: AccessControlLevel.Editor,+ }+ return () => {+ context.resource_access_control = previous+ }+ },+ decorators: [+ (Story) => (+ <div className="@container/main-content w-256">+ <Story />+ </div>+ ),+ mswDecorator({}),+ ],+ parameters: {+ pageUrl: urls.models('data-quality'),+ mockDate: '2026-09-15',+ msw: { mocks: mocks(checks, health) },+ testOptions: { snapshotBrowsers: ['chromium'] },+ },+}+export default meta++type Story = StoryObj<typeof DataQualityOverview>++export const Default: Story = {}++export const Narrow: Story = { decorators: narrowDecorators }++export const Empty: Story = {+ parameters: { msw: { mocks: mocks([], []) } },+}++export const NarrowEmpty: Story = {+ ...Empty,+ decorators: narrowDecorators,+}diff --git a/products/data_quality/frontend/overview/DataQualityOverview.tsx b/products/data_quality/frontend/overview/DataQualityOverview.tsxindex 6a299e5135c7..fe0fede42255 100644--- a/products/data_quality/frontend/overview/DataQualityOverview.tsx+++ b/products/data_quality/frontend/overview/DataQualityOverview.tsx@@ -116,27 +116,27 @@ export function DataQualityOverview(): JSX.Element {return (<BindLogic logic={dataQualityCheckEditorLogic} props={editorProps}><div className="flex flex-col gap-3">- <div className="flex flex-col md:flex-row md:items-center md:justify-between gap-2">- <div className="flex flex-col md:flex-row md:items-center gap-2 w-full md:w-auto">+ <div className="flex flex-wrap items-center gap-2">+ <div className="flex flex-wrap items-center gap-2 grow basis-full @2xl/main-content:basis-0"><LemonInputtype="search"+ size="small"placeholder="Search checks"value={filters.search}onChange={(search) => setFilters({ search })}- className="w-full md:w-64"+ className="flex-1 min-w-40 max-w-64"/><LemonSegmentedButtonsize="small"value={filters.status}onChange={(status) => setFilters({ status })}options={STATUS_FILTERS}- className="w-full md:w-auto"/></div>- <div className="flex flex-wrap items-center gap-2">- <DataQualityGateToggle />+ <div className="flex flex-wrap items-center gap-2 ml-auto"><LemonButtontype="secondary"+ size="small"onClick={() => runChecks({ kind: 'all' })}loading={runningAll}disabledReason={@@ -153,6 +153,7 @@ export function DataQualityOverview(): JSX.Element {<LemonButtonid={NEW_CHECK_ACTION_ID}type="primary"+ size="small"onClick={addCheck}data-attr="data-quality-overview-new-check">@@ -161,7 +162,10 @@ export function DataQualityOverview(): JSX.Element {</div></div>- {overviewSummary && <p className="mb-0 text-secondary">{overviewSummary}</p>}+ <div className="flex flex-wrap items-center gap-x-4 gap-y-2 empty:hidden">+ {overviewSummary && <p className="mb-0 text-secondary flex-1 min-w-0">{overviewSummary}</p>}+ <DataQualityGateToggle />+ </div>{overviewError && snapshotLoaded && (<LemonBanner type="warning" action={{ children: 'Retry', onClick: loadOverview }}>