: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
feat(data-modeling): make lineage node dragging available (#114714)
Jovan Sakovicf7cd6224c640
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 66b34e3d3521..abdda15d6c44 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -7011,17 +7011,17 @@ snapshots:products-data-modeling-lineage-graph--reset-moved-nodes--light:hash: v1.k794b7964.58aa75c5200337a71da0b9e4eb6455df23e16c91592982406f1934d9fcab4173.uvZ46-W9atDhcT0R_h9rtD0s4Z4UItW3nnL-9DDi6Lgproducts-data-modeling-lineage-graph--search-focus--dark:- hash: v1.k794b7964.5d7be76a33e7ae6df78aefed37a4457e715de7366eac74c7fe797cc4ebb94572.QhMijLKdjHkiCM-8bYkRm8K-4h5hA1Mqu1xtEyleSqE+ hash: v1.k794b7964.e620ed1b4d970eff0b93c3c99ec1180a8a2c8a8968ff9452c0eddf7980579fb0.K9rW9ZrdutsowcVxTOesI1rffbsms45utafU_NNUW4kproducts-data-modeling-lineage-graph--search-focus--light:- hash: v1.k794b7964.6d3766df17830581fe2bdb54348d733bee6587d9715b4c47960fa175ffa0c3b1.ZutGBNNBQUS3coCVsLxlreoxXzdIYrFpLCGaFM6ntxA+ hash: v1.k794b7964.f0abd3dcb5beca11fa88e53156122110da3c91a9c284fedb3a7da6be35d2c86a.GsNJz21eT7RcVVcv23KuLnS1AiVIcfbDI50so0ZuYTYproducts-data-modeling-lineage-graph--selectable--dark:hash: v1.k794b7964.6715d1a72146914d134deef3cc269fa35d5c1d2de75e863c43ffd4dfa13928b6.GObyY80pnRagOt_eHG5SjVjTUjGavbHm6QinFyLCoMgproducts-data-modeling-lineage-graph--selectable--light:hash: v1.k794b7964.579d47e411eb1193beb2e755ccff18fb4aa8a7fb8ed4695fc2cf7c83db9744d1.pOkDE2mWmnzAPs_sMwCSKmgYXq8XS625_wQfbNL6ZXoproducts-data-modeling-lineage-graph--selector-focus--dark:- hash: v1.k794b7964.413f24009c5c56513324d5b159121d68d991a467aa64598d24ff297772aefe31.Ak92fV37aEoxdElxT_kg-nBT3oiyT1UQ9DdPkK4QBu0+ hash: v1.k794b7964.100345f53d5381b4a6c350123fdbeaf4f28ebf8be73f233d8deda4afc669fcf7.ASz5pyqTaU_O8MRWbOBWvx_tSqQlH7yAwSZWwtb0_7Yproducts-data-modeling-lineage-graph--selector-focus--light:- hash: v1.k794b7964.25e2e198212f76604c03e486ce03cc4f025200ba48ed574c8058ca885021f4e4.Rmi_EAGJ_je1eiVwQt99dOA-sjEgiMzJX6WmhHy0RUc+ hash: v1.k794b7964.8a190f5354d8c712318a056f9336b2684c0e13059fe7aba8164b6083285ac0de.H_je6IcWNl_mtyFzSesM711LTiXYuisNoFDXEDsAf-Iproducts-data-modeling-lineage-graph--single-node--dark:hash: v1.k794b7964.3a7800242792b8dd49d06a252b0ccf609de5be3bf5b077e28904ca2ef46b9150.3jN6spC1a4TJhjq6LOuaDGym92gQz9Xw2KUfy0Br-D8products-data-modeling-lineage-graph--single-node--light:@@ -7179,9 +7179,9 @@ snapshots:products-data-modeling-node-detail-scene--paginated-columns--light:hash: v1.k794b7964.b119e3e790d76d28ef0b53b7a7116717a4c2660347e23054a47922696c799548.YmPMhBqGr7MBKRXPb815ZXpqZp1V17KRg4PPq33hd5Iproducts-data-modeling-node-detail-scene--post-hog-table--dark:- hash: v1.k794b7964.9558a1129188f1a84a39c294c3c28f7ce4565bad14986d3ff2e8798a73a53e6d.3708GN6B7dH8DqEwtxysyJHgp9LLdUqe54fpdPQhw1s+ hash: v1.k794b7964.4c6319ac95438cae6bdb4708f9e5df00ae41cdd530f5a6b627c874b539c370d2._qHdJB0ZxCNXW61GVlt-oRucyXgt-_H-hKbJ3pdoFikproducts-data-modeling-node-detail-scene--post-hog-table--light:- hash: v1.k794b7964.5ca2ea3457e8b8f7a37cc7b29b771904aeba50ea260f3cf668e8354da9c1f904.Psfcg6zMrSrCAsb2L_B62Bgj5huWUqHeYAcs6shJSEM+ hash: v1.k794b7964.c474db9b0735159cb759321ed76d03fac43af5ac42dde55863cef1b3c163e689.glgHI4jLj4ilKS3-W2jB8DXoKMNI9b8XQR53C7SpR6Iproducts-data-modeling-node-detail-scene--suspended-with-run-history--dark:hash: v1.k794b7964.8777021fae0861f86ccd00ee197d14fcacf12d0ae1ba8a8fe7b38f20591cbc41.r_GyHK2h2ozRGIYXoZ3N4CAlJMClpccnfeC5TEgiDOoproducts-data-modeling-node-detail-scene--suspended-with-run-history--light:diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 4b4793440234..b5bdffd715a9 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -317,7 +317,6 @@ export const FEATURE_FLAGS = {DASHBOARD_TEMPLATE_CHOOSER_EXPERIMENT: 'dashboard-template-chooser-experiment', // owner: @mattp #team-analytics-platform multivariate=control,simple,newDASHBOARD_WIDGETS: 'dashboard-widgets', // owner: @mattp #team-analytics-platformDATA_MODELING_INCREMENTAL_VIEWS: 'data-modeling-incremental-views', // owner: #team-data-modeling- DATA_MODELING_LINEAGE_NODE_DRAGGING: 'data-modeling-lineage-node-dragging', // owner: #team-data-modelingDATA_QUALITY_CHECKS: 'data-quality-checks', // owner: #team-data-modelingDATA_WAREHOUSE_CUSTOM_SOURCE_AI_BUILDER: 'dwh-custom-source-ai-builder', // owner: #team-warehouse-sourcesDATA_WAREHOUSE_CUSTOM_SOURCE_OAUTH2: 'dwh-custom-source-oauth2', // owner: #team-warehouse-sourcesdiff --git a/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx b/products/data_modeling/frontend/lineage/LineageGraph.stories.tsxindex 691b5e7b3eb0..db990977cef2 100644--- a/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx+++ b/products/data_modeling/frontend/lineage/LineageGraph.stories.tsx@@ -3,8 +3,6 @@ import { fireEvent, waitFor, within } from '@testing-library/dom'import type { XYPosition } from '@xyflow/react'import { MakeLogicType, actions, kea, path, reducers, useActions, useValues } from 'kea'-import { FEATURE_FLAGS } from 'lib/constants'-import { mswDecorator } from '~/mocks/browser'import { DataModelingEdge, DataModelingNode } from '~/types'@@ -280,7 +278,6 @@ const modelsTabDecorator = mswDecorator({})export const DraggableNodes: Story = {- parameters: { featureFlags: [FEATURE_FLAGS.DATA_MODELING_LINEAGE_NODE_DRAGGING] },render: () => <ModelsLineageTab />,decorators: [modelsTabDecorator],play: async ({ canvasElement }) => {@@ -325,10 +322,7 @@ export const DraggableNodes: Story = {// The play function leaves the menu open, so this story takes no snapshot. Opening the menu in// DraggableNodes instead would paint it over that story's picture on every run.export const NodeMenu: Story = {- parameters: {- featureFlags: [FEATURE_FLAGS.DATA_MODELING_LINEAGE_NODE_DRAGGING],- testOptions: { snapshotBrowsers: [] },- },+ parameters: { testOptions: { snapshotBrowsers: [] } },render: () => <ModelsLineageTab />,decorators: [modelsTabDecorator],play: async ({ canvasElement }) => {diff --git a/products/data_modeling/frontend/lineage/ModelsLineageTab.tsx b/products/data_modeling/frontend/lineage/ModelsLineageTab.tsxindex 32fec271a289..e787bf112350 100644--- a/products/data_modeling/frontend/lineage/ModelsLineageTab.tsx+++ b/products/data_modeling/frontend/lineage/ModelsLineageTab.tsx@@ -4,7 +4,6 @@ import { useRef } from 'react'import { IconInfo } from '@posthog/icons'import { LemonButton, LemonInput, Tooltip } from '@posthog/lemon-ui'-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'import { LemonInputSelect } from 'lib/lemon-ui/LemonInputSelect'import { pluralize } from 'lib/utils/strings'@@ -25,7 +24,6 @@ const TYPE_OPTIONS = LINEAGE_FILTER_TYPES.map((type) => ({export function ModelsLineageTab(): JSX.Element {const searchInputRef = useRef<HTMLInputElement>(null)- const nodesDraggable = useFeatureFlag('DATA_MODELING_LINEAGE_NODE_DRAGGING')const {nodes,nodesLoading,@@ -161,12 +159,12 @@ export function ModelsLineageTab(): JSX.Element {searchFocusRequest={searchFocusRequest}variant="canvas"interactive- nodesDraggable={nodesDraggable}- nodePositions={nodesDraggable ? nodePositions : undefined}+ nodesDraggable+ nodePositions={nodePositions}nodeOpenUrl={lineageNodeUrl}selectable- onNodeDragStop={nodesDraggable ? (node, position) => nodeDragStopped(node.id, position) : undefined}- onResetNodePositions={nodesDraggable ? resetNodePositions : undefined}+ onNodeDragStop={(node, position) => nodeDragStopped(node.id, position)}+ onResetNodePositions={resetNodePositions}showControlsshowMinimaploading={nodesLoading || edgesLoading}diff --git a/products/data_modeling/frontend/nodeDetail/NodeDetailLineage.tsx b/products/data_modeling/frontend/nodeDetail/NodeDetailLineage.tsxindex 7ac28c482366..758bdff35b4f 100644--- a/products/data_modeling/frontend/nodeDetail/NodeDetailLineage.tsx+++ b/products/data_modeling/frontend/nodeDetail/NodeDetailLineage.tsx@@ -1,11 +1,9 @@import { useActions, useValues } from 'kea'-import { router } from 'kea-router'import { useMemo } from 'react'import { IconExpand45, IconExternal } from '@posthog/icons'import { LemonBanner, LemonButton } from '@posthog/lemon-ui'-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'import { LemonModal } from 'lib/lemon-ui/LemonModal/LemonModal'import { urls } from 'scenes/urls'@@ -23,7 +21,6 @@ function nodeLineageUrl(node: DataModelingNode): string {const LINEAGE_FIT_VIEW_OPTIONS = { maxZoom: 1 }export function NodeDetailLineage({ id }: { id: string }): JSX.Element {- const nodesDraggable = useFeatureFlag('DATA_MODELING_LINEAGE_NODE_DRAGGING')const {lineageGraph,lineageGraphLoading,@@ -57,10 +54,6 @@ export function NodeDetailLineage({ id }: { id: string }): JSX.Element {[lineageGraph?.currentNodeId])- const openNode = (node: DataModelingNode): void => {- router.actions.push(nodeLineageUrl(node))- }-if (!lineageGraphLoading && lineageGraphError) {return (<LemonBanner type="error" action={{ children: 'Retry', onClick: loadLineageGraph }}>@@ -99,16 +92,13 @@ export function NodeDetailLineage({ id }: { id: string }): JSX.Element {variant="full"interactivefitViewOptions={LINEAGE_FIT_VIEW_OPTIONS}- nodesDraggable={nodesDraggable}- nodePositions={nodesDraggable ? lineageNodePositions : undefined}- nodeOpenUrl={nodesDraggable ? nodeLineageUrl : undefined}- onNodeDragStop={- nodesDraggable ? (node, position) => lineageNodeDragStopped(node.id, position) : undefined- }- onResetNodePositions={nodesDraggable ? resetLineageNodePositions : undefined}+ nodesDraggable+ nodePositions={lineageNodePositions}+ nodeOpenUrl={nodeLineageUrl}+ onNodeDragStop={(node, position) => lineageNodeDragStopped(node.id, position)}+ onResetNodePositions={resetLineageNodePositions}showControlsshowMinimap- onNodeClick={nodesDraggable ? undefined : openNode}panels={<div className="flex flex-col gap-1"><LemonButton@@ -144,22 +134,12 @@ export function NodeDetailLineage({ id }: { id: string }): JSX.Element {focusNodeIds={focusNodeIds}variant="full"interactive- nodesDraggable={nodesDraggable}- nodePositions={nodesDraggable ? lineageNodePositions : undefined}- nodeOpenUrl={nodesDraggable ? nodeLineageUrl : undefined}- onNodeDragStop={- nodesDraggable ? (node, position) => lineageNodeDragStopped(node.id, position) : undefined- }- onResetNodePositions={nodesDraggable ? resetLineageNodePositions : undefined}+ nodesDraggable+ nodePositions={lineageNodePositions}+ nodeOpenUrl={nodeLineageUrl}+ onNodeDragStop={(node, position) => lineageNodeDragStopped(node.id, position)}+ onResetNodePositions={resetLineageNodePositions}showControls- onNodeClick={- nodesDraggable- ? undefined- : (node) => {- closeLineageModal()- openNode(node)- }- }/></div></LemonModal>diff --git a/products/data_modeling/frontend/nodeDetail/NodeDetailScene.stories.tsx b/products/data_modeling/frontend/nodeDetail/NodeDetailScene.stories.tsxindex 6ea5bf820333..d18be401eb3d 100644--- a/products/data_modeling/frontend/nodeDetail/NodeDetailScene.stories.tsx+++ b/products/data_modeling/frontend/nodeDetail/NodeDetailScene.stories.tsx@@ -201,7 +201,7 @@ export const View: Story = {}export const WarehouseTable: Story = {args: { id: tableNode.id },parameters: {- featureFlags: [FEATURE_FLAGS.DATA_QUALITY_CHECKS, FEATURE_FLAGS.DATA_MODELING_LINEAGE_NODE_DRAGGING],+ featureFlags: [FEATURE_FLAGS.DATA_QUALITY_CHECKS],pageUrl: urls.nodeDetail(tableNode.id, 'lineage'),msw: {mocks: {