Skip to content

[Lens] [Data Table] Add settings for data grid density#220252

Merged
mariairiartef merged 16 commits intoelastic:mainfrom
mariairiartef:lens/216095
May 26, 2025
Merged

[Lens] [Data Table] Add settings for data grid density#220252
mariairiartef merged 16 commits intoelastic:mainfrom
mariairiartef:lens/216095

Conversation

@mariairiartef
Copy link
Contributor

@mariairiartef mariairiartef commented May 6, 2025

Summary

Closes #216095

Introduces a new Density setting for the Lens Data Table, ensuring consistency with the density options available in Discover. This enhancement allows users to customize the table's appearance by selecting from Compact, Normal, and Expanded density modes.

Screenshot 2025-05-08 at 11 13 26

Details

There is an existing DensityControl component in EUI that cannot be accessed directly, only by the use of the toolbarVisibility prop in the EuiDataGrid component. Since we aren't using this prop for the settings display because we are using a separate Toolbar component, we have copied and adapted the component found here.

Screen recording

Screen.Recording.2025-05-08.at.11.26.20.mov

Checklist

  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • 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 was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
@mariairiartef mariairiartef self-assigned this May 6, 2025
);
}

const DensitySettings = ({
Copy link
Contributor Author

@mariairiartef mariairiartef May 6, 2025

Choose a reason for hiding this comment

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

I think that is not possible to use directly the component from EUI, that's why I added it here.

@mariairiartef mariairiartef added release_note:enhancement Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// Feature:Lens labels May 8, 2025
@mariairiartef mariairiartef marked this pull request as ready for review May 8, 2025 11:06
@mariairiartef mariairiartef requested a review from a team as a code owner May 8, 2025 11:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8251

[✅] x-pack/test/functional/apps/lens/group2/config.ts: 50/50 tests passed.

see run history

},
});
const table = screen.getByTestId('lnsDataTable');
expect(table).toHaveClass(/cellPadding-m-fontSize-m/);
Copy link
Contributor

Choose a reason for hiding this comment

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

why using a regex instead of regular string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm using a regex pattern with toHaveClass() because the class name is generated by Emotion and contains the density identifier embedded within a longer class string.
Screenshot 2025-05-21 at 17 17 59

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8288

[✅] x-pack/test/functional/apps/lens/group2/config.ts: 25/25 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8287

[✅] x-pack/test/functional/apps/lens/group2/config.ts: 25/25 tests passed.

see run history

defaultMessage: 'Density',
});

const densityOptions = [
Copy link
Contributor

Choose a reason for hiding this comment

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

can you move this outside of the component function?
Or as alternative use a useMemo here to avoid unnecessary rerenderings (but moving out is preferable).

];

return (
<EuiFormRow label={densityLabel} display="columnCompressed" data-test-subj="lnsDensitySettings">
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<EuiFormRow label={densityLabel} display="columnCompressed" data-test-subj="lnsDensitySettings">
<EuiFormRow aria-label={densityLabel} display="columnCompressed" data-test-subj="lnsDensitySettings">
it('renders the density settings component with label', () => {
renderDensitySettingsComponent();

expect(screen.getByText('Density', { selector: 'label' })).toBeInTheDocument();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
expect(screen.getByText('Density', { selector: 'label' })).toBeInTheDocument();
expect(screen.getByLabelText('Density')).toBeInTheDocument();
Comment on lines 51 to 52
const normalButton = screen.getByText('Normal').closest('button');
expect(normalButton).toHaveAttribute('aria-pressed', 'true');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const normalButton = screen.getByText('Normal').closest('button');
expect(normalButton).toHaveAttribute('aria-pressed', 'true');
expect(screen.getByRole('button', { name: 'Normal', pressed: true })).toBeInTheDocument();
it('calls onChange with compact density when compact option is clicked', () => {
renderDensitySettingsComponent();

fireEvent.click(screen.getByText('Compact'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
fireEvent.click(screen.getByText('Compact'));
fireEvent.click(screen.getByRole('button', { name: 'Compact' }));
it('calls onChange with expanded density when expanded option is clicked', () => {
renderDensitySettingsComponent();

fireEvent.click(screen.getByText('Expanded'));
Copy link
Contributor

Choose a reason for hiding this comment

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

see above example

});

// The component should still render without errors
expect(screen.getByText('Density', { selector: 'label' })).toBeInTheDocument();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
expect(screen.getByText('Density', { selector: 'label' })).toBeInTheDocument();
expect(screen.getByLabelText('Density')).toBeInTheDocument();
Comment on lines 82 to 83
const normalButton = screen.getByText('Normal').closest('button');
expect(normalButton).toHaveAttribute('aria-pressed', 'true');
Copy link
Contributor

Choose a reason for hiding this comment

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

see example above

Comment on lines 90 to 91
let normalButton = screen.getByText('Normal').closest('button');
expect(normalButton).toHaveAttribute('aria-pressed', 'true');
Copy link
Contributor

Choose a reason for hiding this comment

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

see example above

Comment on lines 97 to 100
const compactButton = screen.getByText('Compact').closest('button');
expect(compactButton).toHaveAttribute('aria-pressed', 'true');
normalButton = screen.getByText('Normal').closest('button');
expect(normalButton).toHaveAttribute('aria-pressed', 'false');
Copy link
Contributor

Choose a reason for hiding this comment

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

see examples above

@mariairiartef mariairiartef requested a review from Copilot May 22, 2025 19:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new Density setting to the Lens Data Table to match the density options available in Discover. Key changes include adding new functions for setting and checking density in functional tests, updating the visualization state and expression args with density, and adding a new DensitySettings component (with associated tests) to the table toolbar.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
x-pack/test/functional/page_objects/lens_page.ts Added functions to set and verify the data table density in tests.
x-pack/test/functional/apps/lens/group2/table.ts Added tests to validate the compact, normal, and expanded density modes.
x-pack/platform/plugins/shared/lens/public/visualizations/datatable/visualization.ts Updated visualization state to include density with a default.
x-pack/platform/plugins/shared/lens/public/visualizations/datatable/visualization.test.tsx Added test case to assert density is correctly passed in expression arguments.
x-pack/platform/plugins/shared/lens/public/visualizations/datatable/components/toolbar.tsx Integrated DensitySettings and added a density change handler into the toolbar.
x-pack/platform/plugins/shared/lens/public/visualizations/datatable/components/toolbar.test.tsx Extended toolbar tests to cover density changes and UI reflection.
x-pack/platform/plugins/shared/lens/public/visualizations/datatable/components/table_basic.tsx Updated grid style computation to incorporate the selected density.
x-pack/platform/plugins/shared/lens/public/visualizations/datatable/components/table_basic.test.tsx Added tests to ensure table style updates correctly with density changes.
x-pack/platform/plugins/shared/lens/public/visualizations/datatable/components/density_settings.tsx Added a new component to render density options with fallback for invalid values.
x-pack/platform/plugins/shared/lens/public/visualizations/datatable/components/density_settings.test.tsx Added unit tests for the DensitySettings component.
x-pack/platform/plugins/shared/lens/common/expressions/defs/datatable/datatable.ts Updated datatable expression function definition to accept a new density argument.
Comments suppressed due to low confidence (1)

x-pack/platform/plugins/shared/lens/common/expressions/defs/datatable/datatable.ts:100

  • Consider clarifying the density argument definition by specifying allowed values or using a more precise type (e.g., a union of 'compact' | 'normal' | 'expanded') to align with DataGridDensity for improved API clarity.
density: { types: ['string'], help: '', },
@mariairiartef mariairiartef requested a review from dej611 May 23, 2025 07:41
@mariairiartef mariairiartef enabled auto-merge (squash) May 26, 2025 10:38
@mariairiartef mariairiartef merged commit 75681df into elastic:main May 26, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15253650313

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 1623 1624 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
lens 559 560 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.6MB 1.6MB +1.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
lens 59.7KB 59.7KB +35.0B
Unknown metric groups

API count

id before after diff
lens 658 659 +1

History

cc @mariairiartef

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Theme] fix theme$ usage when used with useObservable (#220141)
- [ColorMapping] Store assignments as raw/serialized values (#207957)

Manual backport

To create the backport manually run:

node scripts/backport --pr 220252

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 28, 2025
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 220252 locally
cc: @mariairiartef

akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
## Summary

Closes elastic#216095

Introduces a new `Density` setting for the Lens Data Table, ensuring
consistency with the density options available in Discover. This
enhancement allows users to customize the table's appearance by
selecting from `Compact`, `Normal`, and `Expanded` density modes.

<img width="444" alt="Screenshot 2025-05-08 at 11 13 26"
src="https://github.com/user-attachments/assets/c5a3bfb6-d2c7-4e14-ae58-c197165ddddc"
/>

### Details

There is an existing DensityControl component in EUI that cannot be
accessed directly, only by the use of the
[toolbarVisibility](https://eui.elastic.co/docs/components/tabular-content/data-grid/toolbar/#toolbar-visibility)
prop in the `EuiDataGrid` component. Since we aren't using this prop for
the settings display because we are using a separate `Toolbar`
component, we have copied and adapted the component found
[here](https://github.com/elastic/eui/blob/1e78b3f8b435c59379582612aa9b9cfed39ad864/packages/eui/src/components/datagrid/controls/display_selector.tsx#L77).

## Screen recording


https://github.com/user-attachments/assets/4e281b58-7bd4-4cd3-bf8f-d4c2fd553ae8



## Checklist

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [ ] 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
- [ ] 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)

<!--
- [ ] 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)
- [ ] 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)
-->

<!--
### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 220252 locally
cc: @mariairiartef

1 similar comment
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 220252 locally
cc: @mariairiartef

mariairiartef added a commit to mariairiartef/kibana that referenced this pull request Jun 2, 2025
## Summary

Closes elastic#216095

Introduces a new `Density` setting for the Lens Data Table, ensuring
consistency with the density options available in Discover. This
enhancement allows users to customize the table's appearance by
selecting from `Compact`, `Normal`, and `Expanded` density modes.

<img width="444" alt="Screenshot 2025-05-08 at 11 13 26"
src="https://github.com/user-attachments/assets/c5a3bfb6-d2c7-4e14-ae58-c197165ddddc"
/>

### Details

There is an existing DensityControl component in EUI that cannot be
accessed directly, only by the use of the
[toolbarVisibility](https://eui.elastic.co/docs/components/tabular-content/data-grid/toolbar/#toolbar-visibility)
prop in the `EuiDataGrid` component. Since we aren't using this prop for
the settings display because we are using a separate `Toolbar`
component, we have copied and adapted the component found
[here](https://github.com/elastic/eui/blob/1e78b3f8b435c59379582612aa9b9cfed39ad864/packages/eui/src/components/datagrid/controls/display_selector.tsx#L77).

## Screen recording

https://github.com/user-attachments/assets/4e281b58-7bd4-4cd3-bf8f-d4c2fd553ae8

## Checklist

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [ ] 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
- [ ] 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)

<!--
- [ ] 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)
- [ ] 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)
-->

<!--
### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 75681df)

# Conflicts:
#	x-pack/platform/plugins/shared/lens/common/expressions/datatable/datatable.ts
#	x-pack/platform/plugins/shared/lens/public/visualizations/datatable/components/table_basic.tsx
#	x-pack/platform/plugins/shared/lens/public/visualizations/datatable/visualization.tsx
@mariairiartef
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @mariairiartef

mariairiartef added a commit that referenced this pull request Jun 2, 2025
… (#222153)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Lens] [Data Table] Add settings for data grid density
(#220252)](#220252)

<!--- Backport version: 10.0.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Maria
Iriarte","email":"106958839+mariairiartef@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-26T12:13:37Z","message":"[Lens]
[Data Table] Add settings for data grid density (#220252)\n\n##
Summary\n\nCloses
#216095
a new `Density` setting for the Lens Data Table, ensuring\nconsistency
with the density options available in Discover. This\nenhancement allows
users to customize the table's appearance by\nselecting from `Compact`,
`Normal`, and `Expanded` density modes.\n\n<img width=\"444\"
alt=\"Screenshot 2025-05-08 at 11 13
26\"\nsrc=\"https://github.com/user-attachments/assets/c5a3bfb6-d2c7-4e14-ae58-c197165ddddc\"\n/>\n\n###
Details\n\nThere is an existing DensityControl component in EUI that
cannot be\naccessed directly, only by the use of
the\n[toolbarVisibility](https://eui.elastic.co/docs/components/tabular-content/data-grid/toolbar/#toolbar-visibility)\nprop
in the `EuiDataGrid` component. Since we aren't using this prop for\nthe
settings display because we are using a separate `Toolbar`\ncomponent,
we have copied and adapted the component
found\n[here](https://github.com/elastic/eui/blob/1e78b3f8b435c59379582612aa9b9cfed39ad864/packages/eui/src/components/datagrid/controls/display_selector.tsx#L77).\n\n##
Screen
recording\n\n\nhttps://github.com/user-attachments/assets/4e281b58-7bd4-4cd3-bf8f-d4c2fd553ae8\n\n\n\n##
Checklist\n\n- [
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\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- [ ] This was
checked for breaking HTTP API changes, and any breaking\nchanges have
been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] 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\n\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"75681dff3b9f9ae56e0807d3f3fef1e8c9c6e95c","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Visualizations","Feature:Lens","backport
missing","backport:version","v9.1.0","v8.19.0"],"title":"[Lens] [Data
Table] Add settings for data grid
density","number":220252,"url":"https://github.com/elastic/kibana/pull/220252","mergeCommit":{"message":"[Lens]
[Data Table] Add settings for data grid density (#220252)\n\n##
Summary\n\nCloses
#216095
a new `Density` setting for the Lens Data Table, ensuring\nconsistency
with the density options available in Discover. This\nenhancement allows
users to customize the table's appearance by\nselecting from `Compact`,
`Normal`, and `Expanded` density modes.\n\n<img width=\"444\"
alt=\"Screenshot 2025-05-08 at 11 13
26\"\nsrc=\"https://github.com/user-attachments/assets/c5a3bfb6-d2c7-4e14-ae58-c197165ddddc\"\n/>\n\n###
Details\n\nThere is an existing DensityControl component in EUI that
cannot be\naccessed directly, only by the use of
the\n[toolbarVisibility](https://eui.elastic.co/docs/components/tabular-content/data-grid/toolbar/#toolbar-visibility)\nprop
in the `EuiDataGrid` component. Since we aren't using this prop for\nthe
settings display because we are using a separate `Toolbar`\ncomponent,
we have copied and adapted the component
found\n[here](https://github.com/elastic/eui/blob/1e78b3f8b435c59379582612aa9b9cfed39ad864/packages/eui/src/components/datagrid/controls/display_selector.tsx#L77).\n\n##
Screen
recording\n\n\nhttps://github.com/user-attachments/assets/4e281b58-7bd4-4cd3-bf8f-d4c2fd553ae8\n\n\n\n##
Checklist\n\n- [
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\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- [ ] This was
checked for breaking HTTP API changes, and any breaking\nchanges have
been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] 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\n\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"75681dff3b9f9ae56e0807d3f3fef1e8c9c6e95c"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220252","number":220252,"mergeCommit":{"message":"[Lens]
[Data Table] Add settings for data grid density (#220252)\n\n##
Summary\n\nCloses
#216095
a new `Density` setting for the Lens Data Table, ensuring\nconsistency
with the density options available in Discover. This\nenhancement allows
users to customize the table's appearance by\nselecting from `Compact`,
`Normal`, and `Expanded` density modes.\n\n<img width=\"444\"
alt=\"Screenshot 2025-05-08 at 11 13
26\"\nsrc=\"https://github.com/user-attachments/assets/c5a3bfb6-d2c7-4e14-ae58-c197165ddddc\"\n/>\n\n###
Details\n\nThere is an existing DensityControl component in EUI that
cannot be\naccessed directly, only by the use of
the\n[toolbarVisibility](https://eui.elastic.co/docs/components/tabular-content/data-grid/toolbar/#toolbar-visibility)\nprop
in the `EuiDataGrid` component. Since we aren't using this prop for\nthe
settings display because we are using a separate `Toolbar`\ncomponent,
we have copied and adapted the component
found\n[here](https://github.com/elastic/eui/blob/1e78b3f8b435c59379582612aa9b9cfed39ad864/packages/eui/src/components/datagrid/controls/display_selector.tsx#L77).\n\n##
Screen
recording\n\n\nhttps://github.com/user-attachments/assets/4e281b58-7bd4-4cd3-bf8f-d4c2fd553ae8\n\n\n\n##
Checklist\n\n- [
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\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- [ ] This was
checked for breaking HTTP API changes, and any breaking\nchanges have
been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] 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\n\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"75681dff3b9f9ae56e0807d3f3fef1e8c9c6e95c"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Lens release_note:enhancement Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.19.0 v9.1.0

5 participants