Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [kbn-grid-layout] Store rows in object instead of array (#212965)…
… (#213162) # Backport This will backport the following commits from `main` to `8.x`: - [[kbn-grid-layout] Store rows in object instead of array (#212965)](#212965) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Hannah Mudge","email":"Heenawter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-03-04T20:34:39Z","message":"[kbn-grid-layout] Store rows in object instead of array (#212965)\n\nCloses https://github.com/elastic/kibana/issues/211930\n\n## Summary\n\nThis PR makes it so that `kbn-grid-layout` stores its rows as an object\n/ dictionary (`{ [key: string]: GridRowData }`) rather than an array\n(`Array<GridRowData>`). This is a prerequisite for\nhttps://github.com//issues/190381 , since it allows us to\nre-order rows without re-rendering their contents. It also means that\ndeleting a row will no longer cause the rows below it to re-render,\nsince re-rendering is now dependant on the row's **ID** rather than the\nrow's order.\n\n**Before**\n\n\nhttps://github.com/user-attachments/assets/83651b24-a32c-4953-8ad5-c0eced163eb5\n\n\n**After**\n\n\nhttps://github.com/user-attachments/assets/9cef6dbc-3d62-46aa-bc40-ab24fc4e5556\n\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"b32f0fe1e863a599c9d61a38e99c974deec6519a","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","loe:small","release_note:skip","impact:high","Project:Collapsable Panels","backport:version","v9.1.0","v8.19.0"],"title":"[kbn-grid-layout] Store rows in object instead of array","number":212965,"url":"https://github.com/elastic/kibana/pull/212965","mergeCommit":{"message":"[kbn-grid-layout] Store rows in object instead of array (#212965)\n\nCloses https://github.com/elastic/kibana/issues/211930\n\n## Summary\n\nThis PR makes it so that `kbn-grid-layout` stores its rows as an object\n/ dictionary (`{ [key: string]: GridRowData }`) rather than an array\n(`Array<GridRowData>`). This is a prerequisite for\nhttps://github.com//issues/190381 , since it allows us to\nre-order rows without re-rendering their contents. It also means that\ndeleting a row will no longer cause the rows below it to re-render,\nsince re-rendering is now dependant on the row's **ID** rather than the\nrow's order.\n\n**Before**\n\n\nhttps://github.com/user-attachments/assets/83651b24-a32c-4953-8ad5-c0eced163eb5\n\n\n**After**\n\n\nhttps://github.com/user-attachments/assets/9cef6dbc-3d62-46aa-bc40-ab24fc4e5556\n\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"b32f0fe1e863a599c9d61a38e99c974deec6519a"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212965","number":212965,"mergeCommit":{"message":"[kbn-grid-layout] Store rows in object instead of array (#212965)\n\nCloses https://github.com/elastic/kibana/issues/211930\n\n## Summary\n\nThis PR makes it so that `kbn-grid-layout` stores its rows as an object\n/ dictionary (`{ [key: string]: GridRowData }`) rather than an array\n(`Array<GridRowData>`). This is a prerequisite for\nhttps://github.com//issues/190381 , since it allows us to\nre-order rows without re-rendering their contents. It also means that\ndeleting a row will no longer cause the rows below it to re-render,\nsince re-rendering is now dependant on the row's **ID** rather than the\nrow's order.\n\n**Before**\n\n\nhttps://github.com/user-attachments/assets/83651b24-a32c-4953-8ad5-c0eced163eb5\n\n\n**After**\n\n\nhttps://github.com/user-attachments/assets/9cef6dbc-3d62-46aa-bc40-ab24fc4e5556\n\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"b32f0fe1e863a599c9d61a38e99c974deec6519a"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
- Loading branch information