Repository navigation
[EuiDataGrid] Fix copy/paste column alignment with control columns - #9954
weronikaolejniczak merged 7 commits into
Conversation
Kibana Regression Integration TestStatus: 💚 Kibana CI passed |
7dfe431 to
aa4c15e
Compare
716a99d to
bac649f
Compare
💚 Build Succeeded
History
|
There was a problem hiding this comment.
🟡 Changes recommended
The updated Cypress selectAndCopy range logic can unintentionally select content outside the target element when startSelector is used, risking flaky copy assertions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes EuiDataGrid tabular copy/paste output when leading/trailing control columns are present by excluding control columns from the copied TSV and ensuring row newlines are emitted from the last data column (not the last visible column).
Changes:
- Exclude control column header/body cells from tabular copy via
no-copyboundaries. - Emit tab/newline markers based on the last data column (
isLastCopyColumn) to keep headers/body aligned with control columns present. - Add/extend Cypress + Jest test coverage for copy behavior (including regression for #9951) and update snapshots/changelog.
File summaries
| File | Description |
|---|---|
| packages/eui/src/components/datagrid/data_grid.spec.tsx | Expands Cypress coverage to verify data-only copy output with control columns. |
| packages/eui/src/components/datagrid/data_grid_copy.test.tsx | Adds Jest regression test for tabular copy alignment with control columns. |
| packages/eui/src/components/datagrid/body/header/data_grid_header_cell.tsx | Ensures newline marker is emitted from the last data header cell even when trailing control columns exist. |
| packages/eui/src/components/datagrid/body/header/data_grid_header_cell.test.tsx | Adds unit test asserting newline marker comes from last data column. |
| packages/eui/src/components/datagrid/body/header/data_grid_header_cell_wrapper.tsx | Adds control-column handling to emit no-copy boundaries instead of tab/newline markers. |
| packages/eui/src/components/datagrid/body/header/data_grid_header_cell_wrapper.test.tsx | Tests that control headers are excluded from tabular copy markers. |
| packages/eui/src/components/datagrid/body/header/data_grid_control_header_cell.tsx | Marks control header cells as control columns for tabular copy behavior. |
| packages/eui/src/components/datagrid/body/header/data_grid_control_header_cell.test.tsx | Updates snapshot expectations for control header copy markers. |
| packages/eui/src/components/datagrid/body/footer/data_grid_footer_row.tsx | Passes isLastCopyColumn through footer cells to align copy row termination. |
| packages/eui/src/components/datagrid/body/cell/data_grid_cell.tsx | Uses isLastCopyColumn and excludes control cells from tabular copy markers. |
| packages/eui/src/components/datagrid/body/cell/data_grid_cell_wrapper.tsx | Computes isLastCopyColumn based on data-column position (ignoring trailing controls). |
| packages/eui/src/components/datagrid/snapshots/data_grid.test.tsx.snap | Updates snapshots for new no-copy markers in control columns. |
| packages/eui/cypress/support/index.d.ts | Updates Cypress selectAndCopy typing to optionally start selection from a selector. |
| packages/eui/cypress/support/copy/select_and_copy.tsx | Updates Cypress selection helper to support a start selector for copy range. |
| packages/eui/changelogs/upcoming/9954.md | Adds changelog entry for the copy/paste alignment fix. |
Review details
- Files reviewed: 14/15 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
6cb05f7 to
2809fbf
Compare
8cc3046 to
de885fe
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Selections beginning inside control cells can leave unmatched boundaries that remove intervening copied data.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 14/15 changed files
- Comments generated: 2
- Review effort level: Balanced
There was a problem hiding this comment.
🟢 Approval recommended
The change is well-scoped, updates both runtime behavior and marker plumbing consistently, and adds targeted Jest + Cypress coverage for the reported misalignment case.
Review details
- Files reviewed: 17/18 changed files
- Comments generated: 0 new
- Review effort level: Lite
mgadewoll
left a comment
There was a problem hiding this comment.
🟢 Changes LGTM. Thanks for the fix!
💚 Build Succeeded
History
|
💚 Build Succeeded
History
|
|
🟢 Build succeeded in Kibana. Merging the PR. |
## Dependency updates `@elastic/eui` - v121.0.0 ⏩ v122.0.0 `@elastic/eui-illustrations` - v1.0.2 ⏩ v1.1.0 `@elastic/eui-test-helpers` - v1.6.0 ⏩ v1.7.0 ## Changes - Cherry-picked staged Kibana prep commits from `kibana-prep-commits`: - #288940 (`1fdf41c`) — type `EuiSuperSelect` refs as `EuiSuperSelectRef` following the breaking `ref` change in elastic/eui#9972 - #290240 (`54cae3c`) — update tests, page objects, the EUI i18n mapping, and translation files for the removed `euiSelectableListItem.checkedOption` screen-reader text (elastic/eui#9850) - Synced EUI i18n tokens: added `euiKeyboardShortcuts.cmd`, `euiKeyboardShortcuts.copyTitle`, and `euiKeyboardShortcuts.copyDescription` to `i18n_eui_mapping.tsx` and updated the `i18n_service` snapshot ## Package updates ### `@elastic/eui` [v122.0.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md) - Added Ctrl/Cmd+C support on `EuiDataGrid` to copy the focused cell value when no text is selected ([#9995](elastic/eui#9995)) **Bug fixes** - Fixed `EuiDataGrid` copy/paste shifting body rows one column right of the headers when control columns were present ([#9954](elastic/eui#9954)) **Breaking changes** - Changed the `ref` of `EuiSuperSelect` from the class instance to an `EuiSuperSelectRef` object, which exposes `openPopover()` and `closePopover()` ([#9972](elastic/eui#9972)) **Accessibility** - Improved the accessibility of `EuiSelectable` by removing redundant "Checked option." screen-reader text (checked state is already conveyed via `aria-checked`/`aria-selected`) ([#9850](elastic/eui#9850)) - Improved the accessibility of `EuiSelectable` and `EuiComboBox` by moving the `title` attribute to the inner text element, preventing duplicate screen-reader announcements of option names ([#9850](elastic/eui#9850)) ### `@elastic/eui-illustrations` [v1.1.0](https://github.com/elastic/eui/blob/main/packages/illustrations/changelogs/CHANGELOG_2026.md) - Added `attachments`, `detection`, `discovery`, `fieldExtraction`, `generatePreview`, `knowledgeIndicator`, `noData`, `processorsError`, `processorsLoading`, and `processorsPreview` illustrations ([#10001](elastic/eui#10001)) ### `@elastic/eui-test-helpers` [v1.7.0](https://github.com/elastic/eui/blob/main/packages/test-helpers/changelogs/CHANGELOG_2026.md) - Added `EuiTreeViewObject`, a Playwright Component Object for `EuiTreeView` ([#10025](elastic/eui#10025)) - Added `EuiToolTipObject`, a Playwright Component Object for `EuiToolTip` ([#10026](elastic/eui#10026)) - Added `EuiContextMenuObject`, a Playwright Component Object for `EuiContextMenu` ([#10013](elastic/eui#10013)) - Added `EuiColorPickerObject`, a Playwright Component Object for `EuiColorPicker` ([#10020](elastic/eui#10020)) **Bug fixes** - Fixed Component Objects not finding components whose `data-test-subj` holds several space-separated tokens, such as `EuiColorPicker`. The root now matches one token, following Kibana's `data-test-subj` convention ([#10015](elastic/eui#10015)) --------- Co-authored-by: Weronika Olejniczak <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: Alexey Antonov <[email protected]> Co-authored-by: Lene Gadewoll <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
## Dependency updates `@elastic/eui` - v121.0.0 ⏩ v122.0.0 `@elastic/eui-illustrations` - v1.0.2 ⏩ v1.1.0 `@elastic/eui-test-helpers` - v1.6.0 ⏩ v1.7.0 ## Changes - Cherry-picked staged Kibana prep commits from `kibana-prep-commits`: - elastic#288940 (`1fdf41c`) — type `EuiSuperSelect` refs as `EuiSuperSelectRef` following the breaking `ref` change in elastic/eui#9972 - elastic#290240 (`54cae3c`) — update tests, page objects, the EUI i18n mapping, and translation files for the removed `euiSelectableListItem.checkedOption` screen-reader text (elastic/eui#9850) - Synced EUI i18n tokens: added `euiKeyboardShortcuts.cmd`, `euiKeyboardShortcuts.copyTitle`, and `euiKeyboardShortcuts.copyDescription` to `i18n_eui_mapping.tsx` and updated the `i18n_service` snapshot ## Package updates ### `@elastic/eui` [v122.0.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md) - Added Ctrl/Cmd+C support on `EuiDataGrid` to copy the focused cell value when no text is selected ([elastic#9995](elastic/eui#9995)) **Bug fixes** - Fixed `EuiDataGrid` copy/paste shifting body rows one column right of the headers when control columns were present ([elastic#9954](elastic/eui#9954)) **Breaking changes** - Changed the `ref` of `EuiSuperSelect` from the class instance to an `EuiSuperSelectRef` object, which exposes `openPopover()` and `closePopover()` ([elastic#9972](elastic/eui#9972)) **Accessibility** - Improved the accessibility of `EuiSelectable` by removing redundant "Checked option." screen-reader text (checked state is already conveyed via `aria-checked`/`aria-selected`) ([elastic#9850](elastic/eui#9850)) - Improved the accessibility of `EuiSelectable` and `EuiComboBox` by moving the `title` attribute to the inner text element, preventing duplicate screen-reader announcements of option names ([elastic#9850](elastic/eui#9850)) ### `@elastic/eui-illustrations` [v1.1.0](https://github.com/elastic/eui/blob/main/packages/illustrations/changelogs/CHANGELOG_2026.md) - Added `attachments`, `detection`, `discovery`, `fieldExtraction`, `generatePreview`, `knowledgeIndicator`, `noData`, `processorsError`, `processorsLoading`, and `processorsPreview` illustrations ([elastic#10001](elastic/eui#10001)) ### `@elastic/eui-test-helpers` [v1.7.0](https://github.com/elastic/eui/blob/main/packages/test-helpers/changelogs/CHANGELOG_2026.md) - Added `EuiTreeViewObject`, a Playwright Component Object for `EuiTreeView` ([elastic#10025](elastic/eui#10025)) - Added `EuiToolTipObject`, a Playwright Component Object for `EuiToolTip` ([elastic#10026](elastic/eui#10026)) - Added `EuiContextMenuObject`, a Playwright Component Object for `EuiContextMenu` ([elastic#10013](elastic/eui#10013)) - Added `EuiColorPickerObject`, a Playwright Component Object for `EuiColorPicker` ([elastic#10020](elastic/eui#10020)) **Bug fixes** - Fixed Component Objects not finding components whose `data-test-subj` holds several space-separated tokens, such as `EuiColorPicker`. The root now matches one token, following Kibana's `data-test-subj` convention ([elastic#10015](elastic/eui#10015)) --------- Co-authored-by: Weronika Olejniczak <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: Alexey Antonov <[email protected]> Co-authored-by: Lene Gadewoll <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
…lastic#9954) Co-authored-by: Cursor <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Summary
EuiDataGridcopy/paste no longer includes control columns.API Changes
N/A
Screenshots
Impact Assessment
Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.
Impact level: 🟢 Low
Kibana test PR: see comments
Release Readiness
Figma:Migration guide:Adoption plan (new features):QA instructions for reviewer
Open the Data grid playground with leading + trailing control columns.
Checklist before marking Ready for Review
QA: Tested light/dark modes, high contrast, mobile, Chrome/Safari/Edge/Firefox, keyboard-only, screen readerQA: Tested docs changesBreaking changes: Addedbreaking changelabel (if applicable)Reviewer checklist
Made with Cursor