From fb91d4d8f63fbbf56de764db0198205718b18ae4 Mon Sep 17 00:00:00 2001 From: Davis McPhee Date: Fri, 10 Jan 2025 12:07:15 -0400 Subject: [PATCH] [Discover] Fix document comparison table padding (#205984) ## Summary This PR fixes the table padding on the Discover document comparison table which was causing the diff decorations to be cut off. This likely started after #188495 when some of the standard table styles the comparison table inherits from changed. Fixes #205463. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit de3bd71d2cb34526e742a645f85b9f1f700a289d) --- .../components/compare_documents/compare_documents.test.tsx | 2 +- .../src/components/compare_documents/compare_documents.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/compare_documents.test.tsx b/src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/compare_documents.test.tsx index 52df4974218fb..683b5a29a0657 100644 --- a/src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/compare_documents.test.tsx +++ b/src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/compare_documents.test.tsx @@ -109,7 +109,7 @@ describe('CompareDocuments', () => { "data-test-subj": "unifiedDataTableCompareDocuments", "gridStyle": Object { "border": "horizontal", - "cellPadding": "s", + "cellPadding": "l", "fontSize": "s", "header": "underline", "rowHover": "highlight", diff --git a/src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/compare_documents.tsx b/src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/compare_documents.tsx index fc79c0efadf91..3e29e3903e717 100644 --- a/src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/compare_documents.tsx +++ b/src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/compare_documents.tsx @@ -56,7 +56,11 @@ export interface CompareDocumentsProps { const COMPARISON_ROW_HEIGHT: EuiDataGridRowHeightsOptions = { defaultHeight: 'auto' }; const COMPARISON_IN_MEMORY: EuiDataGridInMemory = { level: 'sorting' }; -const COMPARISON_GRID_STYLE: EuiDataGridStyle = { ...DATA_GRID_STYLE_DEFAULT, stripes: undefined }; +const COMPARISON_GRID_STYLE: EuiDataGridStyle = { + ...DATA_GRID_STYLE_DEFAULT, + cellPadding: 'l', + stripes: undefined, +}; const getStorageKey = (consumer: string, key: string) => `${consumer}:dataGridComparison${key}`;