Repository navigation
Fixes #33865: Inline lineage editing via node and column menus - #34551
Conversation
Add canEditLineage to the lineage store, computed from hasEditAccess, deleted, platformView, entity type, and scene band instead of the isEditMode toggle. Remove the Edit Lineage button from CustomControls; gate the edge overlay buttons, node connectability, delete-key handler, and drag-drop sidebar on canEditLineage/canEditScene. isEditMode stays in the store but nothing sets it anymore.
Add a node-delete confirmation dialog, route node removal (menu and the temporary-node remove button) through it, and make Delete/Backspace open the node or edge confirmation instead of deleting immediately.
Standalone, props-driven AddLineagePopover: step 1 entity type (filtered to TABLE and DASHBOARD_DATA_MODEL when opened from a column, since those are the only search hit shapes getEntityChildrenAndLabel can flatten via its getTableEntityChildren resolver), step 2 entity search excluding the current node, step 3 column picker only when opened from a column. Picking the final value submits immediately (no Add button); placement is left for upstream, right for downstream, no arrow. Task 6 will mount this in LineageMap.
Adds LineageNodeMenu (a per-node dots menu) and mounts it in CustomNodeV1 in place of the already-dead always-there remove button. Wires LineageMap to open the shared AddLineagePopover from the menu's Edit Upstream/Edit Downstream actions and route Delete through the existing node-delete confirmation. Closes the popover on canvas pan/zoom.
SceneDrillButton is absolutely positioned over the same top-right corner as the new node ⋮ menu, so it always painted on top and swallowed the click. Shift the drill button left via a has-lineage-node-menu modifier class whenever the menu renders, and give the menu trigger an explicit 24x24 size so the offset matches its real footprint.
Dropdown.DotsButton is a plain function component with no forwardRef, so
ref={triggerRef} placed on it never attached in React 18 and the popover
fell back to the viewport origin. Anchor the ref to the wrapper div both
LineageNodeMenu and LineageColumnMenu already own instead.
Without edit mode an edge click opens the modal edge drawer, which hid the floating edit/delete toolbar. Editors now get Edit Pipeline / Delete from a menu in the drawer header; the canvas toolbar is removed. Also fixes issues edit mode used to mask: - edge clicks also reached the pane click handler and cleared the selection, so aggregated edges never opened the drawer - a direct load of the Field band lost its column layer to the default layer setting, collapsing column lists and hiding metric column edges - adding a column edge at the Field band always exhausted the scene refetch retries because the confirmation only matched entity edges
- Delete key on a selected node matched a drawer copy by reference and never fired; match by entity id and only offer it for removable, non-root nodes - Delete key on a selected edge ignored editability, letting rollup edges reach the delete confirmation; require an editable edge - Dropdown.DotsButton now honours a caller's aria-label, so lineage node, column and edge-drawer menus announce their purpose instead of "Open menu" - The add-lineage popover title names its dialog - Replace suppressed hook deps in NodeChildren with the real dependencies - Read-only lineage checks wait for rendered nodes before asserting no menu
Lineage is added from the node and column menus, so the connectable handles on each node side are no longer needed. The expand/collapse buttons keep their handle placement classes. Removes the unused drag-connect path and the dead buildConnectPayload helper.
…oads The asset band fetches no field payloads, so tables, topics, dashboards and other field-bearing kinds were reported as non-expandable and semantic zoom could not drill into them.
- Container nodes (service/database/schema/domain/data product) render logo + name, a 'Type · kind' subtitle and a child count pill, at a fixed width by node type - Control bar: mini-map toggle state, zoom level, fit to screen replaces fullscreen, aria-labels - Semantic zoom drills only into the node under the pointer and shows a toast when that node has no deeper level - Hover via ReactFlow node events, full-graph loading overlay, ReactFlow as the canvas root with pan-on-focus
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
- ImpactAnalysis: match "Asset Level" exactly; the Layers trigger now reads "Data Asset Level" - ContextCenterMemories: the asset search escapes Elasticsearch-reserved characters, so compare the unescaped query - MetricBulkImportExportEdit: Dropdown.DotsButton keeps the caller's aria-label, so the metrics menu is named "Actions", not "Open menu" - LineageInteraction: fire the column click in place; the minimap can cover the column after fit - PlatformLineage: pick a depth different from the current one; the global lineage settings are shared with other specs
🚦 Removed from the merge queue —
|
| "lineage-map-field-count": "{{count}} fields", | ||
| "lineage-map-onboarding-altitude-description": "Overview -> group -> tables -> columns. Zooming changes detail, like Maps country -> city -> street.", | ||
| "lineage-map-onboarding-description": "Today, zoom only scales pixels. Here, two separate controls keep you oriented in graphs of any size.", | ||
| "lineage-map-onboarding-description": "Navigate lineage like a map. Pan freely, zoom in or out to adjust your level of detail, or switch between different views", |
There was a problem hiding this comment.
💡 Quality: sv-se onboarding description still has the old copy
This commit rewrote message.lineage-map-onboarding-description in every locale. The old copy said "Today, zoom only scales pixels..." and the new copy is "Navigate lineage like a map...". sv-se.json was skipped (that's why its diff is +13/-1 instead of +14/-2), so line 4852 still describes the old behaviour. Swedish users will see onboarding text that no longer matches the feature. Update the sv-se value to a translation of the new en-us string.
Translate the updated en-us onboarding description for sv-se:
"lineage-map-onboarding-description": "Navigera i datahärkomsten som på en karta. Panorera fritt, zooma in eller ut för att justera detaljnivån eller växla mellan olika vyer",
Was this helpful? React with 👍 / 👎
🚦 Removed from the merge queue —
|
Code Review 👍 Approved with suggestions 3 closed / 4 findings🔴 High risk · Inline lineage editing adds and deletes persisted asset and column relationships, so mistaken selections could remove or misstate lineage records. Replaces lineage edit mode with inline ⋮ menu editing on nodes and columns, adds an AddLineagePopover for upstream/downstream targets, and makes the platform Lineage page view and export only. Resolved this session: popover search error handling, unhandled rejection on failed node delete, and duplicate error toasts on failed add-lineage requests. One open minor suggestion: the sv-se onboarding description at 💡 Quality: sv-se onboarding description still has the old copy📄 openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json:4852 📄 openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json:4852 This commit rewrote Translate the updated en-us onboarding description for sv-se✅ 3 closed✅ Edge Case: Popover search ignores errors and can show results for the old type
✅ Bug: Failed node delete causes an unhandled rejection and leaves the canvas half-updated
✅ Bug: A failed add-lineage request shows two error toasts
🤖 Prompt for agentsVerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
| if (!init) { | ||
| return <LineageSkeleton />; | ||
| } |
There was a problem hiding this comment.
Refreshed graph loses its view
After adding lineage or changing a filter, fetchLineageData sets init to false, which now unmounts ReactFlow. The fetch then centers the old instance before mounting a new one. The redraw effect watches only reactFlowInstance?.viewportInitialized, so replacing one initialized instance with another does not run it again. The new canvas also lacks fitView, leaving the selected asset potentially outside the visible area.
Keep the canvas mounted during refresh, or redraw and center whenever the instance changes.
| onEdgeClick( | ||
| canEdit && !touchesTempTable | ||
| ? { ...edge, data: { ...edge.data, isEditable: true } } | ||
| : edge | ||
| ); |
There was a problem hiding this comment.
Edits target the wrong connection
When pipelineViewMode is Node, one saved connection is drawn as A → pipeline → B. This handler passes either displayed segment straight to the drawer, but the real A → B connection is stored in data.edge.extraInfo. The drawer and getNewLineageConnectionDetails use the segment endpoints instead. Editing its pipeline, description, or SQL therefore targets A → pipeline or pipeline → B, leaving the intended connection unchanged.
Resolve extraInfo before opening the drawer, as the scene map resolves its original edge.
| const removedEdges = await Promise.all( | ||
| edgesToRemove.map(async (edge) => { | ||
| const edgeData = getEdgeDataFromEdge(edge); | ||
| await removeLineageHandler(edgeData); | ||
|
|
||
| filteredEdges.push( | ||
| ...(entityLineage.edges ?? []).filter( | ||
| (item) => | ||
| !( | ||
| item.fromEntity.id === edgeData.fromId && | ||
| item.toEntity.id === edgeData.toId | ||
| ) | ||
| ) | ||
| ); | ||
|
|
||
| removeEdgesBySourceTarget(edgeData.fromId, edgeData.toId); | ||
|
|
||
| return edgeData; | ||
| }) | ||
| ); | ||
|
|
||
| const filteredEdges = withoutLineageEdges( | ||
| entityLineage.edges ?? [], | ||
| removedEdges |
There was a problem hiding this comment.
The new node menu sends pipeline nodes to removeNodeHandler, which treats displayed segments as separate saved connections. Both segments resolve through extraInfo to the same A → B edge, so deleting the pipeline issues the same DELETE twice; the second can return 404.
Deleting an endpoint also leaves stale segments: withoutLineageEdges and removeEdgesBySourceTarget compare A → B against the displayed A → pipeline and pipeline → B segments, so neither matches. Deduplicate the saved connections and remove their displayed segments together.
| const { children } = getEntityChildrenAndLabel( | ||
| entity as unknown as LineageNodeType | ||
| ); | ||
|
|
||
| return children.map((column) => ({ | ||
| id: column.fullyQualifiedName ?? column.name ?? '', | ||
| label: column.name ?? '', | ||
| })); |
There was a problem hiding this comment.
Nested fields cannot be picked
columnItems only maps the top-level columns returned by the asset API. getEntityChildrenAndLabel does not flatten them; it expects flattenChildren to have been prepared already. A nested field shown on the graph, such as a child of a STRUCT column, therefore cannot be picked as the other endpoint in the replacement editor.
Prepare the asset with the existing flattening helper and include the full field path in each label.
| hasEditAccess | ||
| visible | ||
| edge={selectedEdge} | ||
| hasEditAccess={canEditLineage} |
There was a problem hiding this comment.
canEditEdge correctly excludes temporary-table edges, but EdgeInfoDrawer receives the broader canEditLineage flag. Editors still get the SQL and description edit buttons on those read-only edges. Their save handlers use the synthetic temp_... IDs, so saving fails rather than editing a real connection. Pass canEditEdge to hasEditAccess as well.
| import { LineageDirection } from '../../../generated/api/lineage/lineageDirection'; | ||
| import { EdgeFromToData } from '../../../interface/lineage.interface'; | ||
|
|
||
| export interface LineageEditRequest { |
There was a problem hiding this comment.
This new file uses the legacy .interface.ts suffix. The repository guide requires new local type files to use .types.ts; legacy names are only preserved for existing files. Rename it to AddLineagePopover.types.ts and update its imports. The new LineageColumnMenu.interface.ts and LineageNodeMenu.interface.ts files have the same issue. This repository requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| // React Flow padding is a share of the viewport, not pixels. | ||
| const FIT_VIEW_OPTIONS = { padding: 0.2, maxZoom: 1 }; | ||
|
|
||
| const toEdgeEntity = (node?: Node): EdgeFromToData | undefined => { |
There was a problem hiding this comment.
Helpers stay in component files
The new canvas puts FIT_VIEW_OPTIONS and toEdgeEntity in the component file. The frontend guide requires module-level constants in a constants file and helpers in a utils file, leaving the component file for the component and its props. Move these declarations to sibling files; the new AddLineagePopover.tsx has the same pattern. This repository requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| // positioned drill button, so shift the drill button clear of the 24px | ||
| // menu with enough gap that the two hit areas never overlap. | ||
| &.has-lineage-node-menu .lineage-scene-drill-button { | ||
| right: 34px; |
There was a problem hiding this comment.
The new drill-button offset uses 34px directly. The styling guide requires non-color spacing to use --om-* tokens and says to add a token when no suitable one exists. Replace this literal with a spacing token. New raw offsets also appear in the rail's top calculations. This repository requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|



Describe your changes:
Fixes #33865, #25265, #31600
Replaces lineage edit mode with inline editing, so users add or remove lineage directly from the graph, without switching modes or dragging nodes. Asset Lineage tabs use the classic lineage graph with inline editing. The platform Lineage page (
/lineage) keeps the hierarchical scene map and is view and export only.Type of change:
High-level design:
AddLineagePopover, a slide-out panel built fromFilterSelect+DataAssetAsyncSelectList, with a column picker for column targets. Deleting a node asks for confirmation; Delete / Backspace removes the selected node or edge. Edge actions (Edit Pipeline, Delete) live in the edge drawer.NodeSuggestionsandLineageNodeRemoveButtonstay unchanged because Collate's ER diagram still imports them; their removal is tracked in Remove NodeSuggestions and LineageNodeRemoveButton once Collate ER diagram stops using them #35330.LineageSceneHierarchy.isExpandabletreats field-bearing kinds (table, topic, dashboard, container…) as expandable even though the asset band carries no field payloads.Tests:
Use cases covered
/lineagepage view, search and exportUnit tests
src/components/Lineage/**,src/components/Entity/EntityLineage/**,src/utils/Lineage/**), including the newLineage.integration.test.tsxcase for the duplicate fetch (fails without the fix: 2 calls),edgeMutations.test.ts(single error toast on a failed add) andLineageColumnMenu.test.tsxdropdown.dots-button.test.tsxLineageSceneResolverTest#assetSceneMarksFieldBearingAssetsExpandableWithoutFieldPayloadsBackend integration tests
Ingestion integration tests
Playwright (UI) tests
LineageInteraction,LineageControls,LineageFilters,DataAssetLineage,PlatformLineage,LineageExportPNGSnapshot; helpers inplaywright/utils/lineage.tschromium:DataAssetLineage(101),LineagePipelineAnnotator(5),LineageExportPNGSnapshot(1),LineageFilters(15),PlatformLineage(2)Basic:LineageInteraction(25),LineageControls,LineageNodePagination,LineageRightPanel,PlatformLineage(4),LineageSettingsManual testing performed
dim_customer, added an upstream from the node menu, switched to the Column layer, added a column edge from the column menu, then deleted both nodes from the node menuUI screen recording / screenshots:
lineage-inline-editing.mp4
lineage-inline-editingatdd06eb7ddf2(after the main merge and the review fixes).collate_server, MySQL and Elasticsearch containers healthy;/api/v1/system/versionreturned 200) with the repository sample data. That server image predates this branch, so theLineageSceneHierarchychange is covered by the Java unit test above rather than the recording.customers; Layers → Column; column ⋮ → Edit Downstream →customer_profile.customer_id; node ⋮ → Delete for both added nodes; platform Lineage page → Export. Each save and delete was asserted against the API response, and the added edges were removed afterwards. Light and dark (AI mode) screenshots of the reviewed screens were checked on the same build.Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: not applicable, no schema changes.
For UI changes: I attached a screen recording and/or screenshots above.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
The issue properly describes why the new feature is needed, what's the goal, and how we are building it.
I have updated the documentation.
I have added tests around the new logic.
Do not merge until graph refresh positioning, pipeline edits and deletion, and nested-field selection are fixed.
Findings
Summary
Replaces lineage edit mode with node and column menus on asset tabs, while keeping the platform map view-only.
/lineagekeeps its scene map.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Asset Lineage tab] --> B[EntityLineageCanvas] B --> C[Node or column menu] C --> D[AddLineagePopover] D --> E[Read existing edge details] E --> F[Merge and save lineage] F --> G[Refetch classic graph] B --> H[Edge drawer] H --> I[Edit pipeline or delete edge] B --> J[Confirm node deletion] K[Platform Lineage page] --> L[LineageMap] L --> M[View, drill, and export]Reviews (1) · Last reviewed commit: "Merge origin/main into lineage-inline-ed..." · Reviewed by Greptile