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-modeling): add lineage graph loading skeleton (#108509)

Jovan Sakovic77283d34d26c
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index e90a8be0d728..a2af4e10f195 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -6363,9 +6363,9 @@ snapshots:
products-data-catalog-metric-lineage--load-failed--light:
hash: v1.k794b7964.1b9c3b1720e0444a2f33b4ba6dc972f6a56a114c94be10cc77fa455b8441fbca.LUvQPwM50s6A-ZDh32zDhqhWWm5KAPgEFK2qa8ffmWs
products-data-catalog-metric-lineage--loading--dark:
- hash: v1.k794b7964.10e5f42c7d9feef174fbf84585f42b3c023795a750dbbea10febeec15966f0d9.WQdI3QUiM3MPqu2jUswGuIkHtAjQlM-XV8dAV1Qpbmg
+ hash: v1.k794b7964.d2e01904e4c1ba9e222e434c70d459e1d4354b7cf5ec05f8e54aa17844b91fa3.ldvpgC3VPt5yjE4qd-lwTNdm3tfAhpCoWAGhMun3YWk
products-data-catalog-metric-lineage--loading--light:
- hash: v1.k794b7964.5290922c579080221a18b00e7855f14d4fd4bdba8158fcb2acb0dcc1fcd1fb6c.N5PeHfKZdzMTWuAgku68dGntKgBb3tE0dqZbO6orPrY
+ hash: v1.k794b7964.fa63fb4b9b33a6c2cc7a7c22e3968c9f015b0e63e82996ea559b87fdea7797a0.RpSFIW0xf3AwRBHwe-Auvg-qR7JQHSMrhro-qOUhAzo
products-data-catalog-metric-lineage--no-definition--dark:
hash: v1.k794b7964.0a67016ff06498b8f16e83dcbd01d03ced850f02935d9cfc555c5d321a6dc21e.SYouGVS4FM4aPQFE51xlJG_1LPN79L4zsp_xwt4mRJI
products-data-catalog-metric-lineage--no-definition--light:
@@ -6390,6 +6390,18 @@ snapshots:
hash: v1.k794b7964.112213e8e69bef1f6e8aab90994d6e0be0c7fcb922965b6834c1081d3d3805c0.CDKiRu_VCNR1dBVF3-l8EfsSBvtbYuQPHWFYHyXbIoI
products-data-modeling-lineage-graph--full--light:
hash: v1.k794b7964.3d2a0a0a6ff2a27f3f8d682857757695b61970b3bfdc3f50e7508c86257aa4ad.S_I2CjkAMi3HiNyo014ZRrZHZbcDaVTQwF4718lZNws
+ products-data-modeling-lineage-graph--loading--dark:
+ hash: v1.k794b7964.37e743bd1659c207ae6da2e71d236547305a9956ac742799d8de1016d6136129.v6YYaaPBVxDTr4p6vGmQxUR35EzxaX_KryIe6cPHeHI
+ products-data-modeling-lineage-graph--loading--light:
+ hash: v1.k794b7964.799b736f8dfed7d406019308f305b3ce63ff6da574ebdad87d991d3c7bdb654d.H1HIvMH-fmzpbbYKKK3eJ1QhnHzPFV1Rifb2eIqRKUA
+ products-data-modeling-lineage-graph--loading-dark-mode--dark:
+ hash: v1.k794b7964.b4b4e7958ad0e3a27afee43b9617d7885fd4e02bc2edff68bc05598297159ef2.0AecY87D9zDsi6MBje5iYOSAbVAGSIkcJ8QZRH6V21Y
+ products-data-modeling-lineage-graph--loading-dark-mode--light:
+ hash: v1.k794b7964.9db1ad5713b6cdd0b0410f1c7859bee92d885c48f3400611673b50d0cfbdbe43.kR2brmUL-KkueOC8D8pqWJ9bzuTAVJrhRTxuC4fncJ4
+ products-data-modeling-lineage-graph--loading-focused--dark:
+ hash: v1.k794b7964.5c5253d7f45ff64b2a7de267d7f216b5dfbc6cebf566c64bb2804a15d49f6877.jipTXPSFWSQEENdldM5M1jViiEaBSPmHfbpMf8M_nx8
+ products-data-modeling-lineage-graph--loading-focused--light:
+ hash: v1.k794b7964.fe8f51a186a08326e770d97862c7f3edf4fa0d3bc477a9082be1db3bf6a36d24.1sIg57c84D-amSb_6VRD1ySV2WN-HbaeEToOy-e9YuM
products-data-modeling-lineage-graph--search-focus--dark:
hash: v1.k794b7964.50fc53d09a95dbfa156c1bb0234cb4ae94f1edad3c531971a6d29fc6e644792b.CnYgYXb_RjjTDPN13751BGVZ03jgtmKYiwd6IWXzvoE
products-data-modeling-lineage-graph--search-focus--light:
diff --git a/frontend/src/scenes/data-warehouse/editor/output-pane-tabs/QueryInfo.tsx b/frontend/src/scenes/data-warehouse/editor/output-pane-tabs/QueryInfo.tsx
index 236af6f4b9d6..1e1af1a6dcf6 100644
--- a/frontend/src/scenes/data-warehouse/editor/output-pane-tabs/QueryInfo.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/output-pane-tabs/QueryInfo.tsx
@@ -150,7 +150,27 @@ export function QueryInfo({ tabId, view, tabbed = false }: QueryInfoProps): JSX.
upstream?.edges.length === 0 && (
<p className="text-secondary py-8 text-center">No connected models yet.</p>
)}
- {targetView && upstreamLoading && <Spinner />}
+ {targetView && upstreamLoading && !upstream && (
+ <div
+ className={
+ tabbed
+ ? 'h-[min(45vh,500px)] border border-border rounded-md overflow-hidden'
+ : 'h-[500px] border border-border rounded-md overflow-hidden'
+ }
+ >
+ <LineageGraph
+ nodes={[]}
+ edges={[]}
+ loading
+ loadingCenter={{
+ name: targetView.name,
+ type: targetView.is_materialized ? 'matview' : 'view',
+ }}
+ variant="full"
+ fitViewOptions={tabbed ? { maxZoom: 1 } : undefined}
+ />
+ </div>
+ )}
{targetView && upstreamLoadFailed && !upstreamLoading && (
<LemonBanner
type="warning"
diff --git a/products/data_catalog/frontend/MetricLineagePanel.tsx b/products/data_catalog/frontend/MetricLineagePanel.tsx
index 55c6986436fb..59431a69edb7 100644
--- a/products/data_catalog/frontend/MetricLineagePanel.tsx
+++ b/products/data_catalog/frontend/MetricLineagePanel.tsx
@@ -92,7 +92,25 @@ export function MetricLineagePanel({
}
if (lineageLoading && !lineage) {
- return <LemonSkeleton className="h-64 w-full" />
+ return (
+ <div className="@container">
+ <span className="sr-only @[40rem]:hidden" role="status">
+ Loading lineage
+ </span>
+ <div className="@[40rem]:hidden" aria-hidden="true">
+ <LemonSkeleton className="h-64 w-full" />
+ </div>
+ <div className="hidden @[40rem]:block h-[min(45vh,500px)] border border-border rounded-md overflow-hidden">
+ <LineageGraph
+ nodes={[]}
+ edges={[]}
+ loading
+ loadingCenter={{ name: metric.name, type: 'metric' }}
+ variant="full"
+ />
+ </div>
+ </div>
+ )
}
if (lineageProblem === 'not_ready') {
diff --git a/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx b/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx
index fd29030ec062..da59746109ec 100644
--- a/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx
+++ b/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx
@@ -109,6 +109,11 @@ const meta: Meta<typeof LineageGraph> = {
export default meta
+// The loading graph keeps its skeleton nodes on screen, so the test runner must not wait for them to go.
+const LOADING_PARAMETERS = {
+ testOptions: { waitForLoadersToDisappear: false, waitForSelector: '.react-flow__node' },
+}
+
export const Full: Story = {
render: () => (
<LineageGraph nodes={GRAPH_NODES} edges={GRAPH_EDGES} currentNodeId="4" variant="full" showControls />
@@ -121,6 +126,42 @@ export const Canvas: Story = {
),
}
+export const Loading: Story = {
+ parameters: LOADING_PARAMETERS,
+ render: () => (
+ <LineageGraph
+ nodes={GRAPH_NODES}
+ edges={GRAPH_EDGES}
+ loading
+ variant="canvas"
+ showControls
+ showMinimap
+ panels={<span>Graph tools</span>}
+ />
+ ),
+}
+
+export const LoadingFocused: Story = {
+ parameters: LOADING_PARAMETERS,
+ render: () => (
+ <LineageGraph
+ nodes={GRAPH_NODES}
+ edges={GRAPH_EDGES}
+ loading
+ loadingCenter={{ name: 'revenue_summary', type: 'matview' }}
+ variant="full"
+ showControls
+ showMinimap
+ panels={<span>Graph tools</span>}
+ />
+ ),
+}
+
+export const LoadingDarkMode: Story = {
+ ...LoadingFocused,
+ globals: { theme: 'dark' },
+}
+
export const SingleNode: Story = {
render: () => <LineageGraph nodes={[mockNode({ id: '1', name: 'raw_events', type: 'table' })]} edges={[]} />,
}
diff --git a/products/data_modeling/frontend/lineage/LineageGraph.tsx b/products/data_modeling/frontend/lineage/LineageGraph.tsx
index cee2eafb123f..9080f135f691 100644
--- a/products/data_modeling/frontend/lineage/LineageGraph.tsx
+++ b/products/data_modeling/frontend/lineage/LineageGraph.tsx
@@ -16,12 +16,12 @@ import { useValues } from 'kea'
import { ReactNode, useEffect } from 'react'
import { IconArchive } from '@posthog/icons'
-import { Spinner } from '@posthog/lemon-ui'
import { themeLogic } from '~/layout/navigation-3000/themeLogic'
import { DataModelingEdge, DataModelingNode } from '~/types'
import { ElkDirection } from './autolayout'
+import { LineageGraphLoading } from './LineageGraphLoading'
import { lineageGraphLogic } from './lineageGraphLogic'
import { LINEAGE_NODE_TYPES, LineageNodeCallbacks, LineageNodeState, LineageVariant } from './LineageNode'
@@ -44,6 +44,7 @@ export interface LineageGraphProps {
showControls?: boolean
className?: string
loading?: boolean
+ loadingCenter?: Pick<DataModelingNode, 'name' | 'type'>
emptyMessage?: string
/** Per-node visual state (running, dimmed, highlighted), computed by the caller */
nodeState?: (node: DataModelingNode) => LineageNodeState
@@ -97,10 +98,14 @@ function LineageGraphContent(props: LineageGraphProps): JSX.Element {
}, [fitView, viewportInitialized, searchFocusRequest, layout])
if (!layout) {
+ const center = props.loadingCenter ?? props.nodes.find((node) => node.id === currentNodeId)
return (
- <div className="flex items-center justify-center w-full h-full">
- <Spinner />
- </div>
+ <LineageGraphLoading
+ center={center}
+ direction={props.direction ?? 'RIGHT'}
+ fitViewOptions={props.fitViewOptions}
+ variant={props.variant ?? 'full'}
+ />
)
}
@@ -159,9 +164,14 @@ function LineageGraphContent(props: LineageGraphProps): JSX.Element {
export function LineageGraph(props: LineageGraphProps): JSX.Element {
if (props.loading) {
return (
- <div className="flex items-center justify-center w-full h-full">
- <Spinner />
- </div>
+ <ReactFlowProvider>
+ <LineageGraphLoading
+ center={props.loadingCenter}
+ direction={props.direction ?? 'RIGHT'}
+ fitViewOptions={props.fitViewOptions}
+ variant={props.variant ?? 'full'}
+ />
+ </ReactFlowProvider>
)
}
if (props.nodes.length === 0) {
diff --git a/products/data_modeling/frontend/lineage/LineageGraphLoading.tsx b/products/data_modeling/frontend/lineage/LineageGraphLoading.tsx
new file mode 100644
index 000000000000..8ef8d2249a57
--- /dev/null
+++ b/products/data_modeling/frontend/lineage/LineageGraphLoading.tsx
@@ -0,0 +1,160 @@
+import { Background, BackgroundVariant, FitViewOptions, ReactFlow, useReactFlow } from '@xyflow/react'
+import { useValues } from 'kea'
+import { useEffect, useId, useMemo } from 'react'
+
+import { themeLogic } from '~/layout/navigation-3000/themeLogic'
+import { DataModelingEdge, DataModelingNode } from '~/types'
+
+import { ElkDirection } from './autolayout'
+import { initialLineageGraphLayout, lineageGraphLogic } from './lineageGraphLogic'
+import { LINEAGE_NODE_TYPES, LineageVariant } from './LineageNode'
+
+export interface LineageGraphLoadingProps {
+ center?: Pick<DataModelingNode, 'name' | 'type'>
+ direction: ElkDirection
+ fitViewOptions?: FitViewOptions
+ variant: LineageVariant
+}
+
+function loadingGraph(
+ idPrefix: string,
+ center?: Pick<DataModelingNode, 'name' | 'type'>
+): {
+ nodes: DataModelingNode[]
+ edges: DataModelingEdge[]
+ centerNodeId?: string
+} {
+ const dag = 'lineage-loading'
+ const node = (id: string, name: string, type: DataModelingNode['type']): DataModelingNode => ({
+ id,
+ name,
+ type,
+ dag,
+ created_at: '',
+ updated_at: '',
+ upstream_count: 0,
+ downstream_count: 0,
+ })
+ const edge = (id: string, source_id: string, target_id: string): DataModelingEdge => ({
+ id,
+ source_id,
+ target_id,
+ dag,
+ properties: {},
+ created_at: '',
+ updated_at: '',
+ })
+ const upstreamId = `${idPrefix}-upstream`
+ const centerNodeId = `${idPrefix}-center`
+ const downstreamId = `${idPrefix}-downstream`
+
+ if (!center) {
+ return {
+ nodes: [node(upstreamId, '', 'view'), node(downstreamId, '', 'view')],
+ edges: [edge(`${idPrefix}-edge`, upstreamId, downstreamId)],
+ }
+ }
+
+ return {
+ centerNodeId,
+ nodes: [
+ node(upstreamId, 'Loading upstream...', 'table'),
+ node(centerNodeId, center.name, center.type),
+ node(downstreamId, 'Loading downstream...', 'view'),
+ ],
+ edges: [
+ edge(`${idPrefix}-upstream-edge`, upstreamId, centerNodeId),
+ edge(`${idPrefix}-downstream-edge`, centerNodeId, downstreamId),
+ ],
+ }
+}
+
+export function LineageGraphLoading({
+ center,
+ direction,
+ fitViewOptions,
+ variant,
+}: LineageGraphLoadingProps): JSX.Element {
+ const { fitView, viewportInitialized } = useReactFlow()
+ const { isDarkModeOn } = useValues(themeLogic)
+ const reactId = useId()
+ const idPrefix = useMemo(() => `lineage-loading-${reactId.replaceAll(':', '')}`, [reactId])
+ const graph = useMemo(() => loadingGraph(idPrefix, center), [center?.name, center?.type, idPrefix])
+ const { layout } = useValues(
+ lineageGraphLogic({
+ nodes: graph.nodes,
+ edges: graph.edges,
+ variant,
+ direction,
+ })
+ )
+ const initialLayout = useMemo(
+ () => initialLineageGraphLayout(graph.nodes, graph.edges, variant, direction),
+ [graph, variant, direction]
+ )
+ const displayedLayout = layout ?? initialLayout
+ const loadingFitViewOptions = useMemo(
+ () => ({
+ ...fitViewOptions,
+ maxZoom: Math.min(fitViewOptions?.maxZoom ?? 1, 1),
+ }),
+ [fitViewOptions]
+ )
+
+ useEffect(() => {
+ if (viewportInitialized) {
+ void fitView({
+ ...loadingFitViewOptions,
+ nodes: displayedLayout.nodes,
+ padding: loadingFitViewOptions.padding ?? 0.2,
+ duration: 0,
+ })
+ }
+ }, [displayedLayout, fitView, loadingFitViewOptions, viewportInitialized])
+
+ const nodes = displayedLayout.nodes.map((node) => ({
+ ...node,
+ data: {
+ ...node.data,
+ state: {
+ loading: node.id === graph.centerNodeId && center ? ('focus' as const) : ('placeholder' as const),
+ },
+ callbacks: {},
+ },
+ }))
+ const edges = displayedLayout.edges.map((edge) => ({
+ ...edge,
+ className: 'opacity-50',
+ }))
+
+ return (
+ <>
+ <span className="sr-only" role="status">
+ Loading lineage
+ </span>
+ <ReactFlow
+ aria-hidden="true"
+ colorMode={isDarkModeOn ? 'dark' : 'light'}
+ nodes={nodes}
+ edges={edges}
+ nodeTypes={LINEAGE_NODE_TYPES}
+ nodesDraggable={false}
+ nodesConnectable={false}
+ nodesFocusable={false}
+ elementsSelectable={false}
+ fitView
+ fitViewOptions={loadingFitViewOptions}
+ minZoom={0.1}
+ maxZoom={1}
+ zoomOnScroll={false}
+ panOnScroll={false}
+ panOnDrag={false}
+ zoomOnPinch={false}
+ zoomOnDoubleClick={false}
+ proOptions={{ hideAttribution: true }}
+ >
+ <Background variant={BackgroundVariant.Dots} gap={20} size={1} />
+ </ReactFlow>
+ </>
+ )
+}
diff --git a/products/data_modeling/frontend/lineage/LineageNode.tsx b/products/data_modeling/frontend/lineage/LineageNode.tsx
index f603a77a3b2b..aa421a0e58b3 100644
--- a/products/data_modeling/frontend/lineage/LineageNode.tsx
+++ b/products/data_modeling/frontend/lineage/LineageNode.tsx
@@ -12,9 +12,10 @@ import {
IconTarget,
IconWarning,
} from '@posthog/icons'
-import { LemonButton, Spinner, Tooltip } from '@posthog/lemon-ui'
+import { LemonButton, LemonSkeleton, Spinner, Tooltip } from '@posthog/lemon-ui'
import { TZLabel } from 'lib/components/TZLabel'
+import { useCancelAnimationsOnUnmount } from 'lib/hooks/useCancelAnimationsOnUnmount'
import { DataModelingNode } from '~/types'
@@ -50,6 +51,7 @@ export interface LineageNodeState {
/** Ringed when a search or type filter highlights this node */
isHighlighted?: boolean
isSelected?: boolean
+ loading?: 'placeholder' | 'focus'
}
export interface LineageNodeCallbacks {
@@ -193,6 +195,7 @@ function MetadataBar({ node }: { node: LineageNodeShape }): JSX.Element {
export function LineageNode({ data }: { data: LineageNodeData }): JSX.Element {
const { node, variant, direction, state, callbacks } = data
const [isHovered, setIsHovered] = useState(false)
+ const loadingRef = useCancelAnimationsOnUnmount<HTMLDivElement>()
const showMetadata = MATERIALIZING_TYPES.has(node.type)
const showRunArrows = variant === 'canvas' && isHovered && !state.isRunning
@@ -207,6 +210,58 @@ export function LineageNode({ data }: { data: LineageNodeData }): JSX.Element {
callbacks.onMouseLeave?.()
}, [callbacks])
+ if (state.loading) {
+ return (
+ <div
+ ref={loadingRef}
+ className={clsx(
+ 'relative flex h-full w-full min-w-[180px] animate-pulse flex-col rounded-lg border bg-bg-light/70 motion-reduce:animate-none',
+ state.loading === 'focus' ? 'border-border' : 'border-border/50'
+ )}
+ // eslint-disable-next-line react/forbid-dom-props
+ style={{
+ borderColor:
+ state.loading === 'focus' ? `color-mix(in srgb, ${color} 60%, transparent)` : undefined,
+ }}
+ >
+ {data.handles.map((handle) => (
+ <Handle
+ key={handle.id}
+ id={handle.id}
+ type={handle.type}
+ position={handle.position ?? (handle.type === 'target' ? Position.Left : Position.Right)}
+ className="opacity-0"
+ isConnectable={false}
+ />
+ ))}
+ <div className="flex flex-1 flex-col justify-center gap-2 px-3">
+ {state.loading === 'focus' ? (
+ <div className="opacity-70">
+ <NodeTypeTag type={node.type} />
+ </div>
+ ) : (
+ <LemonSkeleton className="h-4 w-16" active={false} />
+ )}
+ {node.name ? (
+ <span
+ className={clsx(
+ 'truncate text-sm font-medium',
+ state.loading === 'focus' ? 'text-primary' : 'text-secondary'
+ )}
+ >
+ {node.name}
+ </span>
+ ) : (
+ <LemonSkeleton className="h-4 w-4/5" active={false} />
+ )}
+ </div>
+ <div className="flex h-6 items-center rounded-b-lg bg-primary/50 px-3">
+ <LemonSkeleton className="h-2 w-2/3" />
+ </div>
+ </div>
+ )
+ }
+
const stop = (fn?: () => void) => (e: React.MouseEvent) => {
e.stopPropagation()
fn?.()
diff --git a/products/data_modeling/frontend/lineage/lineageGraphLogic.ts b/products/data_modeling/frontend/lineage/lineageGraphLogic.ts
index 009ecfb3ce46..2162c1bae357 100644
--- a/products/data_modeling/frontend/lineage/lineageGraphLogic.ts
+++ b/products/data_modeling/frontend/lineage/lineageGraphLogic.ts
@@ -11,6 +11,8 @@ const NODE_SIZES: Record<LineageVariant, { width: number; height: number }> = {
canvas: { width: 180, height: 120 },
}
+const NODE_GAP = 60
+
export interface LineageGraphLayout {
nodes: ReactFlowNode<LineageNodeData>[]
edges: ReactFlowEdge[]
@@ -31,20 +33,19 @@ function handlesForDirection(nodeId: string, direction: ElkDirection): NodeHandl
]
}
-// Layout depends only on the graph's structure — per-node state/callbacks are decorated onto the
-// laid-out nodes at render time, so caller-supplied inline callbacks never retrigger the ELK pass.
-async function layoutGraph(
+export function initialLineageGraphLayout(
nodes: DataModelingNode[],
edges: DataModelingEdge[],
variant: LineageVariant,
direction: ElkDirection
-): Promise<LineageGraphLayout> {
+): LineageGraphLayout {
const { width, height } = NODE_SIZES[variant]
- const rfNodes: ReactFlowNode<LineageNodeData>[] = nodes.map((node) => ({
+ const rfNodes: ReactFlowNode<LineageNodeData>[] = nodes.map((node, index) => ({
id: node.id,
type: 'lineage',
- position: { x: 0, y: 0 },
+ position:
+ direction === 'DOWN' ? { x: 0, y: index * (height + NODE_GAP) } : { x: index * (width + NODE_GAP), y: 0 },
width,
height,
data: {
@@ -66,8 +67,20 @@ async function layoutGraph(
markerEnd: { type: MarkerType.ArrowClosed, width: 20, height: 20 },
}))
- const laidOut = await getFormattedNodes(rfNodes as any, rfEdges, direction)
- return { nodes: laidOut as unknown as ReactFlowNode<LineageNodeData>[], edges: rfEdges }
+ return { nodes: rfNodes, edges: rfEdges }
+}
+
+// Layout depends only on the graph's structure — per-node state/callbacks are decorated onto the
+// laid-out nodes at render time, so caller-supplied inline callbacks never retrigger the ELK pass.
+async function layoutGraph(
+ nodes: DataModelingNode[],
+ edges: DataModelingEdge[],
+ variant: LineageVariant,
+ direction: ElkDirection
+): Promise<LineageGraphLayout> {
+ const initialLayout = initialLineageGraphLayout(nodes, edges, variant, direction)
+ const laidOut = await getFormattedNodes(initialLayout.nodes as any, initialLayout.edges, direction)
+ return { nodes: laidOut as unknown as ReactFlowNode<LineageNodeData>[], edges: initialLayout.edges }
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
diff --git a/products/data_modeling/frontend/nodeDetail/NodeDetailLineage.tsx b/products/data_modeling/frontend/nodeDetail/NodeDetailLineage.tsx
index e58ff6e80778..8aae85aa389e 100644
--- a/products/data_modeling/frontend/nodeDetail/NodeDetailLineage.tsx
+++ b/products/data_modeling/frontend/nodeDetail/NodeDetailLineage.tsx
@@ -3,7 +3,7 @@ import { router } from 'kea-router'
import { useMemo } from 'react'
import { IconExternal } from '@posthog/icons'
-import { LemonBanner, LemonButton, Spinner } from '@posthog/lemon-ui'
+import { LemonBanner, LemonButton } from '@posthog/lemon-ui'
import { IconFullScreen } from 'lib/lemon-ui/icons'
import { LemonModal } from 'lib/lemon-ui/LemonModal/LemonModal'
@@ -23,6 +23,7 @@ export function NodeDetailLineage({ id }: { id: string }): JSX.Element {
effectiveLastRunAt,
effectiveLastRunStatus,
lineageModalOpen,
+ node,
} = useValues(nodeDetailSceneLogic({ id }))
const { openLineageModal, closeLineageModal, loadLineageGraph } = useActions(nodeDetailSceneLogic({ id }))
@@ -48,8 +49,14 @@ export function NodeDetailLineage({ id }: { id: string }): JSX.Element {
if (lineageGraphLoading) {
return (
- <div className="flex flex-1 min-h-[400px] max-h-[70vh] items-center justify-center border rounded bg-bg-light">
- <Spinner />
+ <div className="flex-1 min-h-[400px] max-h-[70vh] w-full border rounded bg-bg-light overflow-hidden">
+ <LineageGraph
+ nodes={[]}
+ edges={[]}
+ loading
+ loadingCenter={node ? { name: node.name, type: node.type } : undefined}
+ variant="full"
+ />
</div>
)
}