Skip to content

[1.13] Fixes #33951: key-based CommonWidgets, respect widget size, fix tab flicker - #33997

Merged
chirag-madlani merged 1 commit into
1.13from
backport/1.13/pr-33952
Sep 25, 2026
Merged

chirag-madlani merged 1 commit into
1.13from
backport/1.13/pr-33952

Conversation

@chirag-madlani

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #33951

Backport of #33952 to 1.13: key-based CommonWidgets registry, widgets respect the Small/Large size picked when adding them (config.size, preserved through react-grid-layout updates), and DynamicHeightWidget ignores 0×0 measurements from unrendered panes (LeftPanel flicker / unresponsive tab clicks on persona tabs).

Adapted to 1.13 (1.13's pre-refactor CommonWidgets behaviour kept as-is):

  • Permissions: 1.13 has no PermissionDerivation, so each widget uses the same checks 1.13's CommonWidgets did (permissions.X || permissions.EditAll, && !deleted; getPrioritizedViewPermission for custom-property view).
  • Owners: OwnerWidget renders 1.13's OwnerLabelV2 instead of main's card-based owner widget.
  • Description: uses 1.13's DescriptionV1; widgets render without the EntityDetailWidgetSkeleton fallback (not present on 1.13, which rendered these widgets eagerly).
  • Data products: multi-select isn't gated on isRulesLoaded, matching 1.13.
  • DynamicHeightWidget: 1.13's own implementation plus only the 0×0 guard.
  • CommonWidgets.test.tsx assertions follow 1.13 semantics (OwnerLabelV2, raw-OR tag permission, ungated multi-select).
  • BulkEntityImportPage.interface.ts: main's type-only import change doesn't apply (1.13 doesn't import CSV.utils there), so it's left untouched.

Type of change:

  • Improvement

Tests:

  • Related suites on 1.13 (CommonWidgets + widgets + hooks, DynamicHeightWidget, CustomizePageWidgetUtils, TablePureUtils and the moved extract* helper suites, GenericTab/GenericProvider/LeftPanelContainer/CustomizeTabWidget, TableDetailsPageV1): 20 suites, 147 tests pass.
  • tsc: no errors in the 40 touched files. ESLint: 0 errors, 0 warnings on touched files.

UI screen recording / screenshots:

See #33952.

…licker (#33952)

* refactor(ui): key-based registry for common detail-page widgets

Split the monolithic CommonWidgets into one component per widget key so each
widget only initialises its own hooks and closures, and resolve keys exactly
instead of by prefix. Stop DynamicHeightWidget from reporting a 0x0 measurement
from an unrendered pane into the shared layout (it collapsed the visible
LeftPanel and ping-ponged on persona tab switches), and record the picked
small/large size on new widgets so Description renders full vs read-more
independent of its content-measured height.

* fix(ui): keep widget config when react-grid-layout reports a layout change

onLayoutChange returns only grid fields, so the customize page replaced each
widget with a bare Layout and dropped widget-owned fields such as config.size
right after a widget was added. Merge RGL's positions onto the stored widgets
by id in both the main grid and the left panel handlers.

* fix(ui): keep the read-more toggle on default-expanded descriptions

Pass isDescriptionExpanded to Description again and let only a Large widget or
a Domain drop the toggle, so a Small widget that opens expanded (e.g. a table
with no columns) can still collapse long text.

* chore(ui): clear lint warnings in CommonWidgets and cover the new widgets

Break the import cycles that reached CommonWidgets through TablePureUtils by
moving the pure extract* helpers it used out of the JSX util modules, and drop
two runtime imports that only carried types. Move WidgetConfig to the interface
layer (pages re-exports it) so the widgets no longer import from pages. Add
tests for the hooks, Description, Owner, DataProducts and LeftPanel widgets
and the remaining widget keys, bringing every new file to full line coverage.

(cherry picked from commit 509e0c5)
@chirag-madlani
chirag-madlani requested a review from a team as a code owner September 25, 2026 04:52
@chirag-madlani chirag-madlani added the UI UI specific issues label Sep 25, 2026
@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.

@github-actions github-actions Bot added the safe to test Add this label to run secure Github workflows on PRs label Sep 25, 2026
@gitar-bot

gitar-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Refactors entity-page widgets, persists size metadata, and changes pane measurement behavior

Backport of key-based CommonWidgets registry to 1.13 with widget size preservation and tab flicker fixes. Adapted to 1.13's pre-refactor architecture with equivalent permission checks, OwnerLabelV2 rendering, and DynamicHeightWidget 0×0 guard. All 147 tests pass with no TypeScript or linting errors.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.73% (61685/96781) 45.09% (33878/75121) 47.25% (10420/22051)

@sonarqubecloud

Copy link
Copy Markdown

@chirag-madlani
chirag-madlani merged commit 7f9c603 into 1.13 Sep 25, 2026
144 of 153 checks passed
@chirag-madlani
chirag-madlani deleted the backport/1.13/pr-33952 branch September 25, 2026 07:15

This branch was previously deployed

1 inactive deployment
test — 8d80008b Deployed Sep 25, 2026 by chirag-madlani via playwright-ci-postgresql (6, 6) #94396
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant