Skip to content

[EuiDataGrid] Fix copy/paste column alignment with control columns - #9954

Merged
weronikaolejniczak merged 7 commits into
elastic:mainfrom
weronikaolejniczak:fix/9951-datagrid-copy-alignment
Sep 8, 2026
Merged

weronikaolejniczak merged 7 commits into
elastic:mainfrom
weronikaolejniczak:fix/9951-datagrid-copy-alignment

Conversation

@weronikaolejniczak

@weronikaolejniczak weronikaolejniczak commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • What: EuiDataGrid copy/paste no longer includes control columns.
  • Why: Fixes [EuiDataGrid] Copy/paste needs cleanup in a spreadsheet #9951 (with control columns present, copied body rows were shifted one column right of the headers)
  • How: Exclude control cells from tabular copy and put the row newline on the last data column. Control columns are not text-selectable, so a highlight cannot start on a checkbox.

API Changes

N/A

Screenshots

Screenshot 2026-08-25 at 13 24 01

Impact Assessment

Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.

  • 🔴 Breaking changes
  • 💅 Visual changes
  • 🧪 Test impact
  • 🔧 Hard to integrate — If changes require substantial updates to Kibana, please stage the changes and link them here.

Impact level: 🟢 Low
Kibana test PR: see comments

Release Readiness

  • Documentation: EuiDataGrid
  • Figma:
  • Migration guide:
  • Adoption plan (new features):

QA instructions for reviewer

Open the Data grid playground with leading + trailing control columns.

  • Select from the first data header through body rows, copy, paste into a spreadsheet.
  • Headers align with body values (no extra empty first body column / last header cell).
  • Control chrome (checkboxes, "Row actions") is not pasted.
  • Full-grid select/copy: same data-only TSV.
  • Drag from the checkbox column: no text highlight. Checkbox still toggles.
  • Grid with no control columns: copy output unchanged.

Checklist before marking Ready for Review

Reviewer checklist

  • Approved Impact Assessment — Acceptable to merge given the consumer impact.
  • Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

Made with Cursor

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Kibana Regression Integration Test

Status: 💚 Kibana CI passed
Branch: update-dependencies/1788860555
Kibana PR: elastic/kibana#289751

@weronikaolejniczak
weronikaolejniczak force-pushed the fix/9951-datagrid-copy-alignment branch from 7dfe431 to aa4c15e Compare August 31, 2026 11:11
@weronikaolejniczak weronikaolejniczak added ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR and removed ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR labels Aug 31, 2026
@weronikaolejniczak
weronikaolejniczak force-pushed the fix/9951-datagrid-copy-alignment branch 2 times, most recently from 716a99d to bac649f Compare August 31, 2026 16:25
@weronikaolejniczak weronikaolejniczak added ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR and removed ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR labels Aug 31, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@weronikaolejniczak weronikaolejniczak added ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR and removed ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR labels Sep 1, 2026
@weronikaolejniczak
weronikaolejniczak marked this pull request as ready for review September 1, 2026 08:21
@weronikaolejniczak
weronikaolejniczak requested a review from a team as a code owner September 1, 2026 08:21
Copilot AI lite review requested due to automatic review settings September 1, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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-copy boundaries.
  • 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.

@weronikaolejniczak
weronikaolejniczak force-pushed the fix/9951-datagrid-copy-alignment branch from 6cb05f7 to 2809fbf Compare September 1, 2026 08:45
@weronikaolejniczak
weronikaolejniczak marked this pull request as draft September 1, 2026 09:27
@weronikaolejniczak
weronikaolejniczak marked this pull request as ready for review September 1, 2026 09:36
@weronikaolejniczak weronikaolejniczak added ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR and removed ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR labels Sep 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

@weronikaolejniczak
weronikaolejniczak marked this pull request as draft September 4, 2026 07:37
@weronikaolejniczak
weronikaolejniczak requested a lite review from Copilot September 4, 2026 07:56
@weronikaolejniczak weronikaolejniczak added ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR and removed ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR labels Sep 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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 mgadewoll left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Changes LGTM. Thanks for the fix!

@weronikaolejniczak weronikaolejniczak added ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR and removed ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR labels Sep 8, 2026
@weronikaolejniczak weronikaolejniczak removed the ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR label Sep 8, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@weronikaolejniczak

Copy link
Copy Markdown
Contributor Author

🟢 Build succeeded in Kibana. Merging the PR.

@weronikaolejniczak
weronikaolejniczak merged commit 27e9427 into elastic:main Sep 8, 2026
7 checks passed
eokoneyo added a commit to elastic/kibana that referenced this pull request Sep 17, 2026
## 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]>
ppisljar pushed a commit to ppisljar/kibana that referenced this pull request Sep 21, 2026
## 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]>
weronikaolejniczak added a commit to boriskirov/eui that referenced this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiDataGrid] Copy/paste needs cleanup in a spreadsheet

3 participants