Repository navigation
Fixes #29815: Fix fitView not centering the lineage DAG - #30163
Conversation
The handleFitView callback was immediately overriding the zoom level calculated by fitView() with the user's previous zoom via zoomTo(), making the fit-to-screen action ineffective. Remove the zoomTo override and add maxZoom: 1 to prevent over-zooming on small graphs. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
…ight to use fitToScreen Remove manual Dropdown open/close state and triggerRef in favor of built-in Dropdown.Root behavior. Adjust react-flow panel margins and positioning. Update Playwright lineage tests to use fitToScreen helper instead of performZoomOut for more reliable node visibility. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Replace performZoomOut with fitToScreen in LineageFilters.spec.ts import - Sort imports alphabetically in DataAssetLineage.spec.ts - Remove unused useRef and useState imports from LineageControlButtons.tsx Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
🟡 Playwright Results — all passed (31 flaky)✅ 4538 passed · ❌ 0 failed · 🟡 31 flaky · ⏭️ 95 skipped
🟡 31 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review ✅ Approved 2 resolved / 2 findingsRemoves the redundant zoom override to correctly center the lineage DAG, and standardizes test navigation with a new fit-to-screen helper. Unused imports and state management have been cleaned up. ✅ 2 resolved✅ Bug: fitToScreen used but not imported in LineageFilters.spec.ts
✅ Quality: Unused useRef/useState imports after Dropdown cleanup
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
* Fixes #29815: Fix fitView not centering the lineage DAG The handleFitView callback was immediately overriding the zoom level calculated by fitView() with the user's previous zoom via zoomTo(), making the fit-to-screen action ineffective. Remove the zoomTo override and add maxZoom: 1 to prevent over-zooming on small graphs. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * Fixes #29815: Clean up Dropdown, fix panel spacing, and update Playwright to use fitToScreen Remove manual Dropdown open/close state and triggerRef in favor of built-in Dropdown.Root behavior. Adjust react-flow panel margins and positioning. Update Playwright lineage tests to use fitToScreen helper instead of performZoomOut for more reliable node visibility. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * Fix missing fitToScreen import and remove unused React imports - Replace performZoomOut with fitToScreen in LineageFilters.spec.ts import - Sort imports alphabetically in DataAssetLineage.spec.ts - Remove unused useRef and useState imports from LineageControlButtons.tsx Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]> (cherry picked from commit 3fc3975)



Describe your changes:
Fixes #29815
The
handleFitViewcallback was capturing the current zoom level, callingfitView()to fit all nodes, then immediately overriding the calculated zoom withzoomTo(currentZoom)— restoring the user's previous zoom and making "Fit to Screen" ineffective. The graph would shift erratically but never actually scale to fit the viewport.Changes:
zoomTooverride sofitViewretains its calculated center and scalemaxZoom: 1to prevent over-zooming on small graphsfitToScreenhelper instead ofperformZoomOutType of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unit tests
LineageControlButtons.test.tsx— removed obsoletemockZoomTo/getZoommocks, updatedfitViewassertion to expect{ padding: 0.2, maxZoom: 1 }Backend integration tests
Ingestion integration tests
Playwright (UI) tests
openmetadata-ui/.../ui/playwright/for UI changes.playwright/utils/lineage.ts— addedfitToScreenhelperplaywright/e2e/Pages/Lineage/DataAssetLineage.spec.ts— replacedperformZoomOutwithfitToScreenplaywright/e2e/Pages/Lineage/LineageFilters.spec.ts— replacedperformZoomOutwithfitToScreenManual testing performed
UI screen recording / screenshots:
Screen.Recording.2026-07-17.at.11.35.56.AM.mov
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code
Greptile Summary
This PR fixes the lineage DAG fit-to-screen behavior and updates the related controls and tests. The main changes are:
Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "Fix missing fitToScreen import and remov..." | Re-trigger Greptile
Context used (3)