Skip to content

Keep entity summary panels at 400px so lineage tab counts fit - #37888

Merged
anuj-kumary merged 4 commits into
open-metadata:mainfrom
Vansh0310:fix/summary-panel-min-width
Nov 17, 2026
Merged

anuj-kumary merged 4 commits into
open-metadata:mainfrom
Vansh0310:fix/summary-panel-min-width

Conversation

@Vansh0310

@Vansh0310 Vansh0310 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
image image image image image

Describe your changes:

No linked issue: the owner chose to open this fix without one, so Validate PR Metadata needs the skip-pr-checks label.

Bug. In the asset preview panel's Lineage tab, the Downstream tab and its count badge spill outside the Upstream/Downstream tab bar. Repro: Data Product → Assets → click an asset → Lineage, in a 1512px-wide window (AI mode). Narrower windows clip the Downstream tab entirely.

Cause. The preview panel is the second panel of ResizablePanels (minWidth: 400) beside the asset list (minWidth: 800, or 700 on Glossary/Metric). On mount react-reflex raises each panel's flex to its minSize (ReflexContainer.computeFlexData), then renders flexGrow: flex with flexBasis: 0%. When the two minimums together exceed the container, the space is split by that ratio, so the right panel gets about a third of it, well under 400px. The tab bar is then narrower than the two tabs need:

Window Panel before Tab bar before Tabs need
1512px 356px 234px ~264px
1280px 279px 157px ~264px

Fix. PanelProps gets an opt-in enforceMinWidth. When it is set, ResizablePanels gives the second panel style={{ minWidth }} from its existing minWidth (not while collapsed), so CSS holds the panel at its declared 400px and the asset list takes the rest. The six pages that render EntitySummaryPanel this way spread a new COMMON_RESIZABLE_PANEL_CONFIG.ENTITY_SUMMARY_PANEL (minWidth: 400, flex: 0.33, enforceMinWidth: true); Glossary and Metric keep their flex: 0.3. Wider windows keep their flex share (e.g. 527px at 1920px, unchanged). Upstream and Downstream stay side by side; the core Tabs component is untouched.

Trade-offs for reviewers:

  • On narrower windows the asset list gets less room (≈440px instead of ≈558px at a 1280px classic-mode window).
  • Domain → Data Products now passes hideSecondPanel={!selectedCard}, like the other five pages, so an empty preview panel never holds 400px.
  • Dragging the splitter: reflex's shrink check (offsetWidth − minSize) now returns 0 at the minimum, where it previously went negative.

Type of change:

  • Bug fix

High-level design:

  • ResizablePanels.interface.ts: PanelProps.enforceMinWidth?: boolean (documented on the prop).
  • ResizablePanels.tsx: second ReflexElement gets style={getEnforcedMinWidthStyle(secondPanel, isRightPanelCollapsed)}; react-reflex merges style into the element's own. The helper sits in ResizablePanels.utils.ts because an inline ternary pushed the component over sonarjs/cyclomatic-complexity (12 > 10).
  • ResizablePanel.constants.ts: COMMON_RESIZABLE_PANEL_CONFIG.ENTITY_SUMMARY_PANEL. RIGHT_PANEL is unchanged, so its other users (Domain Documentation, Service details) are untouched.
  • The six summary-panel callers spread ENTITY_SUMMARY_PANEL:
Page File
Data Product → Assets / Input-Output Ports preview utils/DataProductUtils.tsx
Domain → Assets utils/DomainUtils.tsx
Domain → Data Products components/Domain/DomainTabs/DataProductsTab/DataProductsTab.component.tsx
Tag → Assets pages/TagPage/TagPage.tsx
Glossary term → Assets utils/Glossary/GlossaryTermUtils.tsx
Metric → Assets components/Metric/MetricAssetsTab/MetricAssetsTab.tsx

Alternatives rejected:

  • Enforce minWidth in ResizablePanels by default — would change ~28 other callers (first panels with minWidth: 800, Table Queries at flex: 0.13, Add Service, SSO, Collate panels) on narrow screens; hence opt-in.
  • A hardcoded tw:min-w-100 on each caller (this PR's first version) — duplicated the 400 next to minWidth and put a Tailwind class into each panel's data-testid; replaced per review.
  • Wrap or truncate the lineage tabs (tw:flex-wrap / min-w-0 + truncate) — stacks Upstream over Downstream or cuts the labels to "Downstr…"; the tabs are meant to stay side by side, which needs the panel width.
  • Override tab padding — not allowed on core components (frontend-styling.md).

The panels' className (which ResizablePanels also uses as data-testid) is unchanged, so no test IDs change. openmetadata-collate was checked in review: nothing selects these IDs.

Not covered here: Team → Assets (TeamDetailsV1.tsx) renders the same summary panel in a 6/24 Grid.Item, not in ResizablePanels, so it can also be under 400px. It predates this change and needs a different layout fix (e.g. the Users page's tw:flex-[0_0_400px]).

Tests:

Use cases covered

  • Previewing an asset and opening Lineage on Data Product → Assets, Domain → Assets, Glossary term → Assets, Tag → Assets and Metric → Assets shows Upstream and Downstream side by side with both counts inside the tab bar at 1280px and 1512px windows.
  • Domain → Data Products preview panel keeps 400px (that summary has no Lineage tab).
  • At 1920px the panel keeps its flex share (527px), unchanged.

Unit tests

  • Added tests:
    • ResziablePanels.test.tsx: the second panel gets an inline min-width: 400px with enforceMinWidth, and none without it. Fails without the fix (checked by removing the style prop: 1 failed, 7 passed).
    • ResizablePanels.utils.test.ts: getEnforcedMinWidthStyle for enforced, not enforced, and collapsed (the collapsed path isn't reachable from the component test).

Run on c98719adfa8 (after merging main):

yarn test ResizablePanels DataProductsTab MetricAssetsTab TagPage.test DomainUtils.test GlossaryTermUtils.test \
  utils/DataProduct DataProducts/InputOutputPortsTab MarketplaceSearchBar EntitySummaryPanel/LineageTab \
  DomainTabs/DocumentationTab pages/ServiceDetailsPage
Test Suites: 18 passed, 18 total
Tests:       240 passed, 240 total

yarn ui-checkstyle:changed on all changed files: 0 errors (8 pre-existing warnings on untouched lines). yarn tsc:check: no errors from this change.

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

Not run locally. make playwright_affected selects ~95 impacted specs (Domain, Data Product, Glossary, Tag, Metric pages); they run in the merge queue. The impact map has no entry for utils/DataProductUtils.tsx, so CI runs the full suite for it.

Visual regression baselines

  • Pending — needs a CI capture run. These scenes render the preview panel at 1440px, where it was 332–370px; it is now 400px, so these baselines change (light + dark each, 14 files):

    • entityTabs.spec.ts-snapshots/: tab-dataProduct-assets, tab-domain-assets, tab-domain-data-products, glossaryTerm-tab-assets, tag-tab-assets, metric-tab-assets
    • metricList.spec.ts-snapshots/: metric-state-assets

    This branch is on a fork, so gh workflow run playwright-postgresql-e2e.yml --ref fix/summary-panel-min-width -f full_suite=false cannot be dispatched upstream from here. A maintainer run (or a run on a pushed upstream branch) is needed to capture the Linux -actual.png files, which then get committed over these baselines.

Manual testing performed

  1. Local backend (docker/development, sample data) + this branch's UI via Vite; signed in as admin.
  2. Data Product → Assets → clicked an asset → Lineage, at 1280×800 and 1512×900: panel 400px, tab bar 278px, both tabs and counts inside the bar (before: panel 279px / 356px with Downstream past the bar's edge).
  3. Repeated on Domain → Assets, Glossary term → Assets, Tag (PII.Sensitive) → Assets (2 upstream / 2 downstream) and Metric → Assets (3 / 3): panel 400px, tabs inside.
  4. Domain → Data Products: preview panel 400px.
  5. 1920×1000: panel keeps its flex share (527px), tabs in one row.
  6. Checked no new horizontal page scroll from this change (the classic-mode top bar's existing 12px overflow at 1280px is the same with or without it).
  7. Confirmed the original symptom and the fix's effect on release-2-1 by applying the same 400px minimum in DevTools at 1280px and 1512px.

UI screen recording:

Not applicable — standalone layout bug fix, not a feature. Measurements are listed above.

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation> — no linked issue (see top).

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above — no linked issue (see top).

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. — N/A

  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
    Fresh-eyes review of edd81fd07a4: no 🔴. 🟡 inaccurate react-reflex comment/commit text → fixed in the follow-up commit. 🟡 no test fails if the fix is reverted → answered: jsdom has no layout and every Jest suite mocks ResizablePanels; the 14 visual baselines listed above, once refreshed, capture the panel at 400px at 1440px, so a revert fails the visual lane. 🟡 Team → Assets panel → out of scope (not ResizablePanels, pre-existing), noted above.
    Maintainer review (anuj-kumary) → applied in c98719adfa8: opt-in enforceMinWidth, shared ENTITY_SUMMARY_PANEL config, one comment on the prop, hideSecondPanel on Domain → Data Products, Jest coverage.

  • Decision check: no new decision — the 400px minimum was already declared by each panel's minWidth; this makes it hold on first render.

  • I have added a test that covers the exact scenario we are fixing (ResziablePanels.test.tsx; fails without the fix).


Summary by Gitar

  • Shared panel min width:
    • Added enforceMinWidth to PanelProps, applied through getEnforcedMinWidthStyle in ResizablePanels.utils.ts
    • Added ENTITY_SUMMARY_PANEL config with enforceMinWidth: true in ResizablePanel.constants.ts
  • Domain Data Products:
    • Added hideSecondPanel={!selectedCard} so the preview panel is hidden until a card is selected
  • Entity preview pages:
    • Switched Data Product, Domain, Glossary term, Tag, and Metric asset previews to ENTITY_SUMMARY_PANEL
  • Tests:
    • Added unit tests for getEnforcedMinWidthStyle and CSS min-width behavior in ResizablePanels

This will update automatically on new commits.

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge.

Summary

Keeps entity summary previews at their declared 400px minimum without changing other resizable panels.

  • Entity summary panels keep 400px so their Lineage tabs fit side by side.
  • Domain Data Products hides its preview until someone selects a card.

Vansh0310 explicitly deferred visual baseline updates until a CI capture is available. Tests and browser checks were not rerun during this review; local dependencies were unavailable.

Reviews (10) · Last reviewed commit: "refactor(ui): enforce the summary panel ..." · Reviewed by Greptile

react-reflex applies a ReflexElement's minSize only while the splitter is
dragged; on first render the panel takes its flex share. Beside the 800px
asset list that share drops below the declared 400px (about 356px at a
1512px window, 279px at 1280px), so the lineage tab's Upstream/Downstream
tabs no longer fit and the Downstream count spilled outside the tab bar.

Add tw:min-w-100 to the right summary panel on the Data Product, Domain,
Domain data products, Glossary term, Tag and Metric pages so the declared
minimum also holds on first render. Wider windows keep their flex share.
react-reflex does apply minSize on mount: it raises each panel's flex to
its minSize. When the left panel's minimum (800px, 700px on Glossary and
Metric) plus the right panel's 400px exceed the container, flex-grow then
splits the space by those ratios, so the right panel gets about a third
(279px at a 1280px window, 356px at 1512px). The previous comments said
reflex applied minWidth only while dragging; replace them with the real
reason. tw:min-w-100 keeps the summary panel at 400px at every width.
@Vansh0310
Vansh0310 requested a review from a team as a code owner November 16, 2026 11:01
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@anuj-kumary anuj-kumary added the safe to test Add this label to run secure Github workflows on PRs label Nov 16, 2026

@anuj-kumary anuj-kumary left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed root-cause write-up. The diagnosis is right: minSize is only enforced by react-reflex's JS, so when 800 + 400 exceeds the container the right panel gets squeezed below its declared minimum. The CSS fix itself is safe (--spacing: 4px → tw:min-w-100 = 400px, .reflex-element { overflow: hidden } lets the left panel shrink cleanly, and .hidden still applies display: none). I also checked openmetadata-collate: nothing selects these panel test IDs, so that open question is answered.

I'd like the minimum to live in ResizablePanels as an opt-in driven by minWidth, rather than a hardcoded class on six callers:

// ResizablePanels.interface.ts → PanelProps
enforceMinWidth?: boolean;

// ResizablePanels.tsx, second <ReflexElement> (ReflexElement merges `style`)
style={
  secondPanel.enforceMinWidth && !isRightPanelCollapsed
    ? { minWidth: secondPanel.minWidth }
    : undefined
}

Why:

  • One source of truth. The CSS minimum comes from minWidth, so changing it later can't leave a stale tw:min-w-100 behind.
  • Testable. ResziablePanels.test.tsx can assert style.minWidth === '400px' when the prop is set and nothing when it isn't, so a revert fails Jest instead of relying on visual baselines that haven't been captured yet.
  • Opt-in keeps the blast radius you were worried about small. Default-on would change 30+ other callers (Add Service, SSO, Collate's QueryRunner/Automator…) on narrow screens.
  • Test IDs stay clean. className doubles as data-testid, so the current approach puts a Tailwind class into six test IDs.
  • Optionally, add a COMMON_RESIZABLE_PANEL_CONFIG.ENTITY_SUMMARY_PANEL with enforceMinWidth: true so the summary callers spread one config.

Follow-up (separate issue, not blocking): the underlying fragility is LineageTabContent's <Tabs.List fullWidth size="sm" type="button-border">, which can't shrink (core TabList only scrolls for variant="card"). That's why Team → Assets stays broken. A container query that drops the label text below ~280px and keeps the count with a tooltip would cover every host.

Before merge: the PR still needs a linked issue or the skip-pr-checks label, the 14 visual baselines refreshed, and the affected Playwright specs run.

// Both minWidths can exceed the container, so reflex splits it by ratio; tw:min-w-100 keeps 400px.
className:
'entity-summary-resizable-right-panel-container domain-resizable-panel-container',
'entity-summary-resizable-right-panel-container domain-resizable-panel-container tw:min-w-100',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

400 is now declared twice on this panel: minWidth: 400 above (for reflex) and tw:min-w-100 here (for CSS). If minWidth changes, the class silently stays at 400. The same applies to all six callers. I'd prefer enforceMinWidth: true with ResizablePanels applying style={{ minWidth }} from the existing value (details in the review summary). That also keeps tw:min-w-100 out of this panel's data-testid.

),
minWidth: 400,
flex: 0.33,
// Both minWidths can exceed the container, so reflex splits it by ratio; tw:min-w-100 keeps 400px.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this comment is repeated verbatim in six files. With the opt-in prop, one comment on the prop in ResizablePanels.interface.ts covers it and these can go.

// Both minWidths can exceed the container, so reflex splits it by ratio; tw:min-w-100 keeps 400px.
className:
'entity-summary-resizable-right-panel-container domain-resizable-panel-container',
'entity-summary-resizable-right-panel-container domain-resizable-panel-container tw:min-w-100',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike the other five, this ResizablePanels (line 150) has no hideSecondPanel. Once the preview is closed (setSelectedCard(undefined)), an empty panel now holds 400px instead of ~1/3. Could you add hideSecondPanel={!selectedCard} to match the others?

Review follow-up. Instead of a hardcoded tw:min-w-100 on six callers,
PanelProps gets an opt-in enforceMinWidth: when set, ResizablePanels gives
the second panel style={{ minWidth }} from its existing minWidth (not while
collapsed), so the CSS minimum cannot drift from the reflex one and the
panel data-testid no longer carries a Tailwind class.

The six entity summary panels spread a new
COMMON_RESIZABLE_PANEL_CONFIG.ENTITY_SUMMARY_PANEL (400px, 0.33, enforced);
Glossary and Metric keep their 0.3 flex. The style helper lives in
ResizablePanels.utils.ts to keep the component under the sonarjs
complexity limit. Domain > Data Products also hides its second panel when
no card is selected, like the other five pages.

Tests: ResizablePanels asserts the inline min width with and without the
prop (fails without the fix); the util test covers the collapsed case.
@gitar-bot

gitar-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Applying CSS minimum widths across six entity preview layouts changes panel sizing, which could reduce asset-list space on narrower windows.

Keeps entity summary preview panels at their declared 400px minimum by enforcing it through a shared ENTITY_SUMMARY_PANEL config in ResizablePanels, so Lineage tab counts fit on narrower windows. Domain Data Products now hides the preview panel until a card is selected. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@anuj-kumary
anuj-kumary merged commit 0e5a52d into open-metadata:main Nov 17, 2026
48 of 54 checks passed
shah-harshit added a commit that referenced this pull request Nov 18, 2026
* test(playwright): refresh stale 2.1 visual baselines and fix shell menu scenes

Refresh 32 baselines from the 2.1 nightly (run 44266671648) actuals. Every
diff traces to an intended change that arrived with the main merge: Tableau
connected-app auth option (#37084), 400px entity summary panel (#37888),
unified CopyButton (#37953), new Insights/AdvancedSearch icons (#37973),
Data Estate connector counts (#37910) and the users Name/Email columns
(#37127, #37998).

shell-profile-menu and shell-mode-menu waited for my-data-page, which
#38077 removed from /my-data in AI mode; wait for home-landing-page.

* test(playwright): complete 2.1 shell and expanded Tableau baselines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants