Repository navigation
[1.13] Fixes #33951: key-based CommonWidgets, respect widget size, fix tab flicker - #33997
Conversation
…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)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
Code Review ✅ Approved🟡 Medium risk · Refactors entity-page widgets, persists size metadata, and changes pane measurement behavior Backport of key-based OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Fixes #33951
Backport of #33952 to
1.13: key-basedCommonWidgetsregistry, widgets respect the Small/Large size picked when adding them (config.size, preserved through react-grid-layout updates), andDynamicHeightWidgetignores 0×0 measurements from unrendered panes (LeftPanel flicker / unresponsive tab clicks on persona tabs).Adapted to 1.13 (1.13's pre-refactor
CommonWidgetsbehaviour kept as-is):PermissionDerivation, so each widget uses the same checks 1.13'sCommonWidgetsdid (permissions.X || permissions.EditAll,&& !deleted;getPrioritizedViewPermissionfor custom-property view).OwnerWidgetrenders 1.13'sOwnerLabelV2instead of main's card-based owner widget.DescriptionV1; widgets render without theEntityDetailWidgetSkeletonfallback (not present on 1.13, which rendered these widgets eagerly).isRulesLoaded, matching 1.13.DynamicHeightWidget: 1.13's own implementation plus only the 0×0 guard.CommonWidgets.test.tsxassertions 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 importCSV.utilsthere), so it's left untouched.Type of change:
Tests:
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.