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.

fix(data-modeling): paginate models overview tables (#100836)

Jovan Sakovicbb287fcabccf
diff --git a/docs/internal/models.md b/docs/internal/models.md
index 74a70289cf7c..9ab0bbe9545a 100644
--- a/docs/internal/models.md
+++ b/docs/internal/models.md
@@ -1,6 +1,13 @@
# Managing models
+The Models overview shows ten rows per page in each section: models needing attention, models behind schedule, and failing data quality checks.
+Each section has independent previous and next controls when it has more than ten rows.
+Screen readers identify these controls as Previous page and Next page.
+Paginated tables keep the height of a full page, including on a partial last page, so other sections stay in place.
+Skipped runs describe upstream models stopped after repeated failures as suspended.
+
Open a saved view from Models to inspect its query, refresh schedule, and run history.
+The Models breadcrumb on a model detail page returns to the models list tab.
The actions menu offers **Delete view** for a saved view and **Delete materialized view** for a materialized view.
Deletion asks for confirmation, removes the saved view and its materialized data, and returns to Models after success.
Queries that depend on the deleted view will stop working.
@@ -15,3 +22,6 @@ The latest run continues to update independently while you browse older pages, s
When suspension enforcement is enabled, a model suspended on the serving engine shows **Suspended** in both the attention list and its detail summary.
The summary includes the reason and the stopped schedule; past runs retain their recorded outcomes.
A marker on a shadow engine, or a marker while enforcement is disabled, does not mean scheduled refreshes have stopped.
+
+Model list action menus use full-width buttons.
+Deleting a view shows one success notification after the deletion request succeeds.
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 240a281e291f..3e3a454a05a5 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -5640,6 +5640,10 @@ snapshots:
hash: v1.k794b7964.30f9f54de7be7442005c8c331928461a8b9f35c39a83879d512d43fc760805a7.HejGI_ne5ckT89F7KRuBZl8cHd8yxdCvDbU10jo9Zoo
products-data-modeling-lineage-graph--full--light:
hash: v1.k794b7964.5dad2ad87a0457c985581810013a0fa058bb4bb8f0596932bb829bfb46a2e18c.p9m_GryZwVUwkGgah-EvQZUyu1-1-I3sN8Tlu3kSYM4
+ products-data-modeling-lineage-graph--search-focus--dark:
+ hash: v1.k794b7964.4fb56362fec2b7af59c737389abdfc6e01b3971b08fcc4c2bbc706e2c55fcd91.8jHcM2nb1Otah1aJRj4AgXagv9q_uhbn6yRFNMWBTgo
+ products-data-modeling-lineage-graph--search-focus--light:
+ hash: v1.k794b7964.482002621af8d75dbee2f842b6bb21b814b5494f52dfbeb83db882b4f51ae22f.qEI8JmfvdHP4tQWt0USqKRQxlfoArtQY0PqnQE9Vxvw
products-data-modeling-lineage-graph--single-node--dark:
hash: v1.k794b7964.4344045fc1bada8b4f2067de9f83cdb38b5dbe14719e7b4d332c2a7689a5d8cd.NvfJs1mb9VLArjiQdsrspse5hcopmjfyz4HXvwD_MZA
products-data-modeling-lineage-graph--single-node--light:
@@ -5716,6 +5720,22 @@ snapshots:
hash: v1.k794b7964.727a524bea080ccdd40b9d0d0d24fa11124956af6de43b8d1c7c55ecac8396fe.65eGhlez_kvcvkBca8RfUE_Vaw5E2KlZeBOB4vTHpgE
products-data-modeling-model-view-summary--one-dependent-model--light:
hash: v1.k794b7964.dfec6463b360d4256744023dcd168e8d00f4a15b49d0ab102389e63b73a16365.u5HZ_NMmZXGGMkfZG2ggcYyw--1BmBQ3OINd9m_arTE
+ products-data-modeling-models-overview--narrow--dark:
+ hash: v1.k794b7964.b05ce52737a3aafe04e7bf7219f0cf117abe1ddf8e4324032638a2217275e8b0.l_KcmfKVER-Bg-A4q9C7tT6boC18cfFhdQ5LuoPYpH0
+ products-data-modeling-models-overview--narrow--light:
+ hash: v1.k794b7964.8de8341c1349f8cb5552472ba0e31c9a3056aa38d8b0d080ddf6b3926df163ad.dnf-HokaWWpeRhejbFuoAtanPjQrZt8Siu89-G1BHCg
+ products-data-modeling-models-overview--narrow-partial-last-page--dark:
+ hash: v1.k794b7964.d7b4e0ddd20acfa6b10cef2ec04ed2b9aa0fbd21e4c78ce4a2056ea60c104228.mNhLlTtZzkVmNDmMyf4IFbB3NDvTp_ZoRThjwrdEts4
+ products-data-modeling-models-overview--narrow-partial-last-page--light:
+ hash: v1.k794b7964.d337628955e3ce769a33f45d97ce51958a8db287b1a4344fbf06bd72f172248b.CKw4zIA6QRuweF82g9IMxGqJYkFkxMG-6rAeJ-FExW0
+ products-data-modeling-models-overview--paginated--dark:
+ hash: v1.k794b7964.8cac888d0fad47cbd5c4c4092010e2b62ceee02dfd1fed95f577498577cb6474.xae-ilaOzklSJOP6aVJJZKIHqNNukIpgMDve-n1XZUE
+ products-data-modeling-models-overview--paginated--light:
+ hash: v1.k794b7964.f80388b1c73a52fb6412a33a4666f8f2df1bab209232a313c306a0990c9a3fca.8If9Zb3m9t5VtbIk5BMEGJ3uvzP5pGRsPFV_PIm_wjA
+ products-data-modeling-models-overview--partial-last-page--dark:
+ hash: v1.k794b7964.1a4ce304197dd14d4151ca1083e7ae7039f9908200c34f7378465025b79d7e08.94Li-jYAcO0uRnZLtl2_PHZpM-CXBrx24-RLOofaY_E
+ products-data-modeling-models-overview--partial-last-page--light:
+ hash: v1.k794b7964.0a510efc77afae6a02c52831583c4c38870a6e9c1a1dcd78c2905ff05933c085.KSDQ61iPt91mJjAozciHJ7_p5ed-dd3IkN5KPYxR204
products-data-modeling-node-detail-scene--materialized-view--dark:
hash: v1.k794b7964.9c8663e101f08c4bd2578b787402053a1bd7e930f06fad0ee6f5f1d728b0b14c.hV26Y05ssUiKJQPOBYVX6EXXkVSkd9rCOQvnA3PRPBY
products-data-modeling-node-detail-scene--materialized-view--light:
@@ -5740,6 +5760,10 @@ snapshots:
hash: v1.k794b7964.c3a0122ed3c944fd0036bf07405b2e09e14f7f218660863779a3587da606f3aa.HS-n7WOMbDZm10kaWIku0Y01udvSaEeEdFoDzUBLlrk
products-data-modeling-node-detail-scene--view--light:
hash: v1.k794b7964.36643c2fa6800cf361c623fca665343f8b4a2708afd3cd46ed9abb19cfd1db5f.mqGLSD5Sce2yBSvIXIS7PajSjOdXlLIoEjGEK4iwYEc
+ products-data-modeling-views-list--actions--dark:
+ hash: v1.k794b7964.eceb80b180d692b6f616365ea7269d24bb6f084128cbfafc661cf6159dc281ec.FagEpfMfYMDwAJaH7ctNLBVSS-sThFgcTnQ8Ghwk8wI
+ products-data-modeling-views-list--actions--light:
+ hash: v1.k794b7964.72724e994dcffa8f4d3914d5e9f87d9c6ad7ddfe0ffd28a02897129354ba956d.Vu7BhdcTI1yxaNzfgaW9gFoiBIScbrYMw9RN8FmP1ms
products-mcp-analytics-routingbar--all-variants--dark:
hash: v1.k794b7964.769a69526cf676447319f587f24ed0d2670a137098867f8d3ee87ebda3415a70.3FGS0pbxxcrZUSto8SNCNHEkxaFXH6T8shqpdg5zzlQ
products-mcp-analytics-routingbar--all-variants--light:
diff --git a/frontend/src/lib/lemon-ui/PaginationControl/PaginationControl.tsx b/frontend/src/lib/lemon-ui/PaginationControl/PaginationControl.tsx
index d21ce5384028..82fe052a6490 100644
--- a/frontend/src/lib/lemon-ui/PaginationControl/PaginationControl.tsx
+++ b/frontend/src/lib/lemon-ui/PaginationControl/PaginationControl.tsx
@@ -50,6 +50,7 @@ export function PaginationControl<T>({
</span>
<LemonButton
icon={<IconChevronLeft />}
+ aria-label="Previous page"
disabledReason={!isPreviousAvailable ? 'No previous page' : undefined}
size="small"
onClick={() => {
@@ -61,6 +62,7 @@ export function PaginationControl<T>({
/>
<LemonButton
icon={<IconChevronRight />}
+ aria-label="Next page"
disabledReason={!isNextAvailable ? 'No next page' : undefined}
size="small"
onClick={() => {
diff --git a/frontend/src/scenes/data-warehouse/scene/ViewsTab.tsx b/frontend/src/scenes/data-warehouse/scene/ViewsTab.tsx
index 161f1325b713..89f26dcfd93a 100644
--- a/frontend/src/scenes/data-warehouse/scene/ViewsTab.tsx
+++ b/frontend/src/scenes/data-warehouse/scene/ViewsTab.tsx
@@ -249,6 +249,7 @@ export function ViewsTab({ getViewUrl, suspensionByViewId }: ViewsTabProps = {})
minAccessLevel={AccessControlLevel.Editor}
>
<LemonButton
+ fullWidth
onClick={() => runMaterialization(view.id)}
disabledReason={
view.status === 'Running' ? 'Materialization is already running' : undefined
@@ -259,7 +260,9 @@ export function ViewsTab({ getViewUrl, suspensionByViewId }: ViewsTabProps = {})
</AccessControlAction>
)}
{warehouseAccessControlEnabled && view.managed_viewset_kind === null && (
- <LemonButton onClick={() => openAccessControlModal(view)}>Access control</LemonButton>
+ <LemonButton fullWidth onClick={() => openAccessControlModal(view)}>
+ Access control
+ </LemonButton>
)}
<AccessControlAction
resourceType={AccessControlResourceType.WarehouseObjects}
@@ -267,6 +270,7 @@ export function ViewsTab({ getViewUrl, suspensionByViewId }: ViewsTabProps = {})
userAccessLevel={view.user_access_level}
>
<LemonButton
+ fullWidth
status="danger"
onClick={() => deleteView(view.id)}
disabledReason={getDisabledReason(view)}
diff --git a/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.test.ts b/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.test.ts
index b3cf4e1a7395..b72732f35739 100644
--- a/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.test.ts
+++ b/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.test.ts
@@ -1,5 +1,10 @@
import { expectLogic } from 'kea-test-utils'
+import { LemonDialog } from '@posthog/lemon-ui'
+
+import { lemonToast } from 'lib/lemon-ui/LemonToast'
+import { dataWarehouseViewsLogic } from 'scenes/data-warehouse/saved_queries/dataWarehouseViewsLogic'
+
import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
@@ -33,6 +38,7 @@ describe('viewsTabLogic', () => {
},
},
post: { '/api/environments/:team_id/query/': { tables: {} } },
+ delete: { '/api/environments/:team_id/warehouse_saved_queries/:id/': [204, null] },
})
initKeaTests()
logic = viewsTabLogic()
@@ -71,4 +77,20 @@ describe('viewsTabLogic', () => {
expect(logic.values.filteredViews.map((view) => view.id)).toEqual(['mat-1', 'mat-10'])
})
+ it('shows one success toast only after the confirmed deletion succeeds', async () => {
+ const dialog = jest.spyOn(LemonDialog, 'open').mockImplementation(() => {})
+ const toast = jest.spyOn(lemonToast, 'success').mockImplementation(() => '')
+ try {
+ logic.actions.deleteView('plain-a')
+ const confirm = dialog.mock.calls[0][0].primaryButton!.onClick!
+ confirm({} as React.MouseEvent<HTMLButtonElement>)
+ expect(toast).not.toHaveBeenCalled()
+ await expectLogic(dataWarehouseViewsLogic).toFinishAllListeners()
+ expect(toast).toHaveBeenCalledTimes(1)
+ expect(toast).toHaveBeenCalledWith('View deleted')
+ } finally {
+ dialog.mockRestore()
+ toast.mockRestore()
+ }
+ })
})
diff --git a/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.ts b/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.ts
index 742de2ad6675..04b1d12a6377 100644
--- a/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.ts
+++ b/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.ts
@@ -4,7 +4,6 @@ import { loaders } from 'kea-loaders'
import { LemonDialog } from '@posthog/lemon-ui'
import api from 'lib/api'
-import { lemonToast } from 'lib/lemon-ui/LemonToast'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { databaseTableListLogic } from 'scenes/data-management/database/databaseTableListLogic'
@@ -318,7 +317,6 @@ export const viewsTabLogic = kea<viewsTabLogicType>([
status: 'danger',
onClick: () => {
actions.deleteDataWarehouseSavedQuery(viewId)
- lemonToast.success('View deleted successfully')
},
},
secondaryButton: {
diff --git a/frontend/src/scenes/models/nodeDetailSceneLogic.ts b/frontend/src/scenes/models/nodeDetailSceneLogic.ts
index d52195dab916..e16c20f48fee 100644
--- a/frontend/src/scenes/models/nodeDetailSceneLogic.ts
+++ b/frontend/src/scenes/models/nodeDetailSceneLogic.ts
@@ -303,7 +303,7 @@ export const nodeDetailSceneLogic = kea<nodeDetailSceneLogicType>([
{
key: 'Models',
name: 'Models',
- path: urls.models(),
+ path: urls.models('models'),
},
{
key: ['NodeDetail', node?.id || 'loading'],
diff --git a/frontend/src/scenes/models/tabs/ModelsLineageTab.tsx b/frontend/src/scenes/models/tabs/ModelsLineageTab.tsx
index 50af3226da1b..f4a7d79d6db8 100644
--- a/frontend/src/scenes/models/tabs/ModelsLineageTab.tsx
+++ b/frontend/src/scenes/models/tabs/ModelsLineageTab.tsx
@@ -80,6 +80,7 @@ export function ModelsLineageTab(): JSX.Element {
<LineageGraph
nodes={visibleNodes}
edges={visibleEdges}
+ focusNodeIds={highlightedNodeIds}
variant="canvas"
interactive
showControls
diff --git a/frontend/src/scenes/models/tabs/ModelsOverviewTab.tsx b/frontend/src/scenes/models/tabs/ModelsOverviewTab.tsx
index a24d5cd8da09..3dbb6b57a042 100644
--- a/frontend/src/scenes/models/tabs/ModelsOverviewTab.tsx
+++ b/frontend/src/scenes/models/tabs/ModelsOverviewTab.tsx
@@ -1,7 +1,7 @@
import { useActions, useValues } from 'kea'
import { IconCheckCircle } from '@posthog/icons'
-import { LemonBanner, LemonTable, LemonTableColumns, LemonTag, Link, Tooltip } from '@posthog/lemon-ui'
+import { LemonBanner, LemonTableColumns, LemonTag, Link, Tooltip } from '@posthog/lemon-ui'
import { TZLabel } from 'lib/components/TZLabel'
import { LemonTableLink } from 'lib/lemon-ui/LemonTable/LemonTableLink'
@@ -11,6 +11,7 @@ import { CADENCE_LABELS } from 'scenes/data-warehouse/saved_queries/SyncFrequenc
import { urls } from 'scenes/urls'
import { BehindScheduleModel } from 'products/data_modeling/frontend/freshness'
+import { ModelsOverviewTable } from 'products/data_modeling/frontend/ModelsOverviewTable'
import { checkDisplayName } from 'products/data_quality/frontend/checksConstants'
import { CheckStatusCell } from 'products/data_quality/frontend/CheckStatusCell'
import { DataQualityOverviewCheckApi } from 'products/data_quality/frontend/generated/api.schemas'
@@ -214,7 +215,7 @@ function OverviewBody({
</Link>
}
>
- <LemonTable
+ <ModelsOverviewTable
columns={ATTENTION_COLUMNS}
dataSource={attentionModels}
loading={nodesLoading}
@@ -229,8 +230,9 @@ function OverviewBody({
title="Models behind schedule"
description="Each of these declares how fresh it should be, but has gone more than twice that long without finishing a run. Nothing reported a failure, so they may have stopped quietly."
>
- <LemonTable
+ <ModelsOverviewTable
columns={BEHIND_COLUMNS}
+ maxHeaderWidth="7rem"
dataSource={behindSchedule}
rowKey={(row) => row.node.id}
size="small"
@@ -257,7 +259,7 @@ function OverviewBody({
</Link>
}
>
- <LemonTable
+ <ModelsOverviewTable
columns={CHECK_COLUMNS}
dataSource={failingChecks}
loading={checksLoading}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 32bde9e8eb9b..7f78cc627c6c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -3075,6 +3075,9 @@ importers:
'@posthog/icons':
specifier: 'catalog:'
+ '@testing-library/dom':
+ specifier: '*'
+ version: 10.4.0
'@types/react':
specifier: 18.3.27
version: 18.3.27
diff --git a/posthog/temporal/data_modeling/activities/create_data_modeling_job.py b/posthog/temporal/data_modeling/activities/create_data_modeling_job.py
index 6ec2e2c93ef9..4b24b5d7f1cf 100644
--- a/posthog/temporal/data_modeling/activities/create_data_modeling_job.py
+++ b/posthog/temporal/data_modeling/activities/create_data_modeling_job.py
@@ -114,13 +114,13 @@ def _subject(names: list[str], total: int) -> str:
def _skip_reason(*, failed: list[str], failed_total: int, suspended: list[str], suspended_total: int) -> str:
if failed_total and suspended_total:
subject = _subject(failed + suspended, failed_total + suspended_total)
- return f"Skipped because {subject} are failing or paused."
+ return f"Skipped because {subject} are failing or suspended."
if failed_total:
verb = "is" if failed_total == 1 else "are"
return f"Skipped because {_subject(failed, failed_total)} {verb} failing."
if suspended_total:
verb = "was" if suspended_total == 1 else "were"
- return f"Skipped because {_subject(suspended, suspended_total)} {verb} paused after repeated failures."
+ return f"Skipped because {_subject(suspended, suspended_total)} {verb} suspended after repeated failures."
return "Skipped because an upstream view failed."
diff --git a/products/data_modeling/frontend/ModelsOverviewTab.stories.tsx b/products/data_modeling/frontend/ModelsOverviewTab.stories.tsx
new file mode 100644
index 000000000000..e29358adcc36
--- /dev/null
+++ b/products/data_modeling/frontend/ModelsOverviewTab.stories.tsx
@@ -0,0 +1,104 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { fireEvent, waitFor, within } from '@testing-library/dom'
+
+import { FEATURE_FLAGS } from 'lib/constants'
+import { ModelsOverviewTab } from 'scenes/models/tabs/ModelsOverviewTab'
+import { urls } from 'scenes/urls'
+
+import { mswDecorator } from '~/mocks/browser'
+
+const nodes = ['attention', 'behind'].flatMap((group) =>
+ Array.from({ length: 12 }, (_, index) => ({
+ id: `${group}-${index + 1}`,
+ name: `${group}_model_${index + 1}`,
+ type: 'matview',
+ dag: 'example-dag',
+ created_at: '2026-01-01T00:00:00Z',
+ updated_at: '2026-01-01T00:00:00Z',
+ last_run_at: '2026-09-14T00:00:00Z',
+ last_run_status: group === 'attention' ? 'Failed' : 'Completed',
+ last_run_error: group === 'attention' ? 'Example refresh failed.' : null,
+ sync_interval: '1hour',
+ upstream_count: 0,
+ downstream_count: 0,
+ }))
+)
+const checks = Array.from({ length: 12 }, (_, index) => ({
+ id: `check-${index + 1}`,
+ name: `Example check ${index + 1}`,
+ check_type: 'not_null',
+ subject_type: 'view',
+ subject_name: `example_view_${index + 1}`,
+ subject_node_id: `attention-${index + 1}`,
+ last_status: 'failed',
+}))
+
+const meta: Meta<typeof ModelsOverviewTab> = {
+ title: 'Products/Data modeling/Models overview',
+ component: ModelsOverviewTab,
+ decorators: [mswDecorator({})],
+ parameters: {
+ featureFlags: [FEATURE_FLAGS.DATA_QUALITY_CHECKS],
+ pageUrl: urls.models(),
+ mockDate: '2026-09-15',
+ msw: {
+ mocks: {
+ get: {
+ '/api/environments/:team_id/data_modeling_nodes/': { results: nodes, count: nodes.length },
+ '/api/environments/:team_id/data_modeling_edges/': { results: [], count: 0 },
+ '/api/environments/:team_id/warehouse_saved_queries/': { results: [], count: 0 },
+ '/api/projects/:team_id/data_quality_checks/': { results: checks, count: checks.length },
+ '/api/projects/:team_id/data_quality_checks/health/': [],
+ },
+ },
+ },
+ testOptions: { snapshotBrowsers: ['chromium'] },
+ },
+}
+export default meta
+
+type Story = StoryObj<typeof ModelsOverviewTab>
+export const Paginated: Story = {}
+export const Narrow: Story = {
+ decorators: [
+ (Story) => (
+ <div className="w-128 max-w-full">
+ <Story />
+ </div>
+ ),
+ ],
+}
+
+export const PartialLastPage: Story = {
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement)
+ await canvas.findAllByText('1-10 of 12 entries')
+ await waitFor(() => {
+ if (canvas.queryAllByText('1-10 of 12 entries').length !== 3) {
+ throw new Error('All three overview tables must finish loading')
+ }
+ })
+ const tables = ['attention', 'behind', 'failing-checks'].map((section) => {
+ const table = canvasElement.querySelector<HTMLElement>(`[data-attr="models-overview-${section}"]`)!
+ return { table, height: table.offsetHeight, top: table.getBoundingClientRect().top + window.scrollY }
+ })
+ for (const { table } of tables) {
+ within(table).getByRole('button', { name: 'Previous page' })
+ const next = within(table).getByRole('button', { name: 'Next page' })
+ fireEvent.click(next)
+ await within(table).findByText('11-12 of 12 entries')
+ for (const initial of tables) {
+ if (
+ initial.table.offsetHeight !== initial.height ||
+ initial.table.getBoundingClientRect().top + window.scrollY !== initial.top
+ ) {
+ throw new Error('Paging must preserve table heights and the positions of surrounding sections')
+ }
+ }
+ }
+ },
+}
+export const NarrowPartialLastPage: Story = {
+ ...Narrow,
+ play: PartialLastPage.play,
+}
diff --git a/products/data_modeling/frontend/ModelsOverviewTable.tsx b/products/data_modeling/frontend/ModelsOverviewTable.tsx
new file mode 100644
index 000000000000..670f47e7ba2d
--- /dev/null
+++ b/products/data_modeling/frontend/ModelsOverviewTable.tsx
@@ -0,0 +1,39 @@
+import { useLayoutEffect, useRef } from 'react'
+
+import { LemonTable, LemonTableProps } from 'lib/lemon-ui/LemonTable'
+
+export function ModelsOverviewTable<T extends Record<string, any>>({
+ 'data-attr': dataAttr,
+ ...props
+}: LemonTableProps<T>): JSX.Element {
+ const containerRef = useRef<HTMLDivElement>(null)
+ const contentRef = useRef<HTMLDivElement>(null)
+ const hasMultiplePages = props.dataSource.length > 10
+
+ useLayoutEffect(() => {
+ const container = containerRef.current
+ const content = contentRef.current
+ if (!container || !content || !hasMultiplePages) {
+ container?.style.removeProperty('min-height')
+ return
+ }
+ let height = 0
+ const preserveHeight = (): void => {
+ const bounds = content.getBoundingClientRect()
+ height = Math.max(height, bounds.height)
+ container.style.minHeight = `${height}px`
+ }
+ preserveHeight()
+ const observer = new ResizeObserver(preserveHeight)
+ observer.observe(content)
+ return () => observer.disconnect()
+ }, [hasMultiplePages])
+
+ return (
+ <div ref={containerRef} data-attr={dataAttr}>
+ <div ref={contentRef}>
+ <LemonTable {...props} scrollToTopOnPageChange={false} pagination={{ pageSize: 10, useUrl: false }} />
+ </div>
+ </div>
+ )
+}
diff --git a/products/data_modeling/frontend/ViewsTab.stories.tsx b/products/data_modeling/frontend/ViewsTab.stories.tsx
new file mode 100644
index 000000000000..8e7beb790c51
--- /dev/null
+++ b/products/data_modeling/frontend/ViewsTab.stories.tsx
@@ -0,0 +1,53 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { fireEvent, within } from '@testing-library/dom'
+
+import { FEATURE_FLAGS } from 'lib/constants'
+import { ViewsTab } from 'scenes/data-warehouse/scene/ViewsTab'
+
+import { mswDecorator } from '~/mocks/browser'
+
+const meta: Meta<typeof ViewsTab> = {
+ title: 'Products/Data modeling/Views list',
+ component: ViewsTab,
+ decorators: [mswDecorator({})],
+ parameters: {
+ featureFlags: [FEATURE_FLAGS.HOGQL_WAREHOUSE_ACCESS_CONTROL],
+ mockDate: '2026-09-15',
+ msw: {
+ mocks: {
+ get: {
+ '/api/environments/:team_id/warehouse_saved_queries/': {
+ count: 1,
+ results: [
+ {
+ id: 'example-view',
+ name: 'example_summary',
+ columns: [],
+ is_materialized: true,
+ created_at: '2026-01-01T00:00:00Z',
+ managed_viewset_kind: null,
+ user_access_level: 'editor',
+ },
+ ],
+ },
+ '/api/environments/:team_id/data_modeling_nodes/': { count: 0, results: [] },
+ '/api/environments/:team_id/data_modeling_edges/': { count: 0, results: [] },
+ '/api/environments/:team_id/warehouse_saved_queries/:id/run_history/': { run_history: [] },
+ },
+ post: { '/api/environments/:team_id/query/': { tables: {} } },
+ },
+ },
+ testOptions: { snapshotBrowsers: ['chromium'] },
+ },
+}
+export default meta
+
+type Story = StoryObj<typeof ViewsTab>
+export const Actions: Story = {
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement)
+ await canvas.findByText('example_summary')
+ fireEvent.click(canvas.getByRole('button', { name: 'more' }))
+ await within(document.body).findByText('Access control')
+ },
+}
diff --git a/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx b/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx
index af9f48d198b5..d28b75d09752 100644
--- a/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx
+++ b/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx
@@ -1,5 +1,9 @@
import type { Meta, StoryObj } from '@storybook/react'
+import { fireEvent, waitFor, within } from '@testing-library/dom'
+import { ModelsLineageTab } from 'scenes/models/tabs/ModelsLineageTab'
+
+import { mswDecorator } from '~/mocks/browser'
import { DataModelingEdge, DataModelingNode } from '~/types'
import { LineageGraph } from './LineageGraph'
@@ -87,3 +91,36 @@ export const EmptyState: Story = {
<LineageGraph nodes={[]} edges={[]} emptyMessage="This query doesn't depend on any other tables or views" />
),
}
+
+export const SearchFocus: Story = {
+ render: () => <ModelsLineageTab />,
+ decorators: [
+ mswDecorator({
+ get: {
+ '/api/environments/:team_id/data_modeling_nodes/': { count: GRAPH_NODES.length, results: GRAPH_NODES },
+ '/api/environments/:team_id/data_modeling_edges/': { count: GRAPH_EDGES.length, results: GRAPH_EDGES },
+ },
+ }),
+ ],
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement)
+ await canvas.findByText('monthly_report')
+ const graph = canvasElement.querySelector<HTMLElement>('.react-flow')!
+ const target = graph.querySelector<HTMLElement>('.react-flow__node[data-id="4"]')!
+ const search = canvas.getByPlaceholderText('Search, or +name for upstream')
+ fireEvent.change(search, { target: { value: 'monthly_report' } })
+ await waitFor(() => {
+ const nodeBounds = target.getBoundingClientRect()
+ const graphBounds = graph.getBoundingClientRect()
+ if (
+ Math.abs(nodeBounds.x + nodeBounds.width / 2 - graphBounds.x - graphBounds.width / 2) > 5 ||
+ Math.abs(nodeBounds.y + nodeBounds.height / 2 - graphBounds.y - graphBounds.height / 2) > 5
+ ) {
+ throw new Error('The search match must be centered in the lineage viewport')
+ }
+ })
+ if (graph.querySelectorAll('.react-flow__node').length !== GRAPH_NODES.length) {
+ throw new Error('Plain search must keep the rest of the graph visible')
+ }
+ },
+}
diff --git a/products/data_modeling/frontend/lineage/LineageGraph.tsx b/products/data_modeling/frontend/lineage/LineageGraph.tsx
index 8cab5c875878..db9204c24f90 100644
--- a/products/data_modeling/frontend/lineage/LineageGraph.tsx
+++ b/products/data_modeling/frontend/lineage/LineageGraph.tsx
@@ -10,9 +10,10 @@ import {
PanelPosition,
ReactFlow,
ReactFlowProvider,
+ useReactFlow,
} from '@xyflow/react'
import { useValues } from 'kea'
-import { ReactNode } from 'react'
+import { ReactNode, useEffect } from 'react'
import { IconArchive } from '@posthog/icons'
import { Spinner } from '@posthog/lemon-ui'
@@ -36,6 +37,7 @@ export interface LineageGraphProps {
/** Enable zoom/pan. Off by default for inline previews */
interactive?: boolean
fitViewOptions?: FitViewOptions
+ focusNodeIds?: Set<string>
showMinimap?: boolean
minimapPosition?: PanelPosition
showControls?: boolean
@@ -54,8 +56,9 @@ export interface LineageGraphProps {
}
function LineageGraphContent(props: LineageGraphProps): JSX.Element {
+ const { fitView, viewportInitialized } = useReactFlow()
const { isDarkModeOn } = useValues(themeLogic)
- const { currentNodeId, nodeState, nodeCallbacks, onNodeClick } = props
+ const { currentNodeId, nodeState, nodeCallbacks, onNodeClick, focusNodeIds } = props
const { layout } = useValues(
lineageGraphLogic({
nodes: props.nodes,
@@ -65,6 +68,16 @@ function LineageGraphContent(props: LineageGraphProps): JSX.Element {
})
)
+ useEffect(() => {
+ if (!viewportInitialized || !focusNodeIds?.size || !layout) {
+ return
+ }
+ const nodes = layout.nodes.filter((node) => focusNodeIds.has(node.id))
+ if (nodes.length > 0) {
+ void fitView({ nodes, padding: 0.2, maxZoom: 1 })
+ }
+ }, [fitView, viewportInitialized, focusNodeIds, layout])
+
if (!layout) {
return (
<div className="flex items-center justify-center w-full h-full">
diff --git a/products/data_modeling/package.json b/products/data_modeling/package.json
index 5adabc8a0d1c..0548e33ecf22 100644
--- a/products/data_modeling/package.json
+++ b/products/data_modeling/package.json
@@ -17,6 +17,7 @@
},
"peerDependencies": {
"@posthog/icons": "catalog:",
+ "@testing-library/dom": "*",
"@types/react": "*",
"@xyflow/react": "*",
"clsx": "*",