Skip to content

[Discover] Add discover SplitButton component#231786

Merged
AlexGPlay merged 8 commits intoelastic:mainfrom
AlexGPlay:225702-split-search-button
Sep 1, 2025
Merged

[Discover] Add discover SplitButton component#231786
AlexGPlay merged 8 commits intoelastic:mainfrom
AlexGPlay:225702-split-search-button

Conversation

@AlexGPlay
Copy link
Contributor

@AlexGPlay AlexGPlay commented Aug 14, 2025

Summary

Closes #225702

Adds a split button that can be later used in the new background search implementation.

Example Screenshot
Both icons image
Default image
Danger image
Success image
Warning image
Disabled image

There are more examples in the storybook.

How to test?

To test it you can go to the component storybook by running yarn storybook unified_search and going to http://localhost:9001/?path=/story/split-button--default

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@AlexGPlay AlexGPlay force-pushed the 225702-split-search-button branch from f776b0a to 86611c1 Compare August 20, 2025 10:30
@AlexGPlay AlexGPlay self-assigned this Aug 20, 2025
@AlexGPlay AlexGPlay added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// Feature:Search Sessions labels Aug 20, 2025
Comment on lines -10 to -25
import { defaultConfig } from '@kbn/storybook';
import { merge as webpackMerge } from 'webpack-merge';
import { resolve } from 'path';

const mockConfig = {
resolve: {
alias: {
'@kbn/esql/public': resolve(__dirname, '../public/mocks/esql_editor.tsx'),
},
},
};

module.exports = {
...defaultConfig,
webpackFinal: (config) => webpackMerge(config, mockConfig),
};
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 updated this storybook config to the basic one - this one crashed and after testing the default one it was working as expected
Captura de pantalla 2025-08-20 a las 12 41 18

@AlexGPlay AlexGPlay marked this pull request as ready for review August 20, 2025 13:10
@AlexGPlay AlexGPlay requested a review from a team as a code owner August 20, 2025 13:10
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@AlexGPlay AlexGPlay force-pushed the 225702-split-search-button branch from c4e60f5 to 571a487 Compare August 25, 2025 06:44
Copy link
Contributor

@akowalska622 akowalska622 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for changes!

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Can we move the split button itself into a package? I know it will be useful in other places -the Dashboard top nav for instance.

I assume this is only meant to be temporary until EUI supports split-buttons? Still, it might be best to have our temporary code in one place.

@AlexGPlay AlexGPlay force-pushed the 225702-split-search-button branch from 31b8469 to f692508 Compare August 27, 2025 09:02
@l-suarez
Copy link
Contributor

LGTM, great work @AlexGPlay!

For smaller screens, I want to recommend using the combo Text | Icon to avoid leaving the CTA with just two icons. cc @ninoslavmiskovic

Split button on smaller screens following current behaviour:
image

Split button with new behaviour:
image

As a side note, I noticed that we are going to "responsive mode" quite early, at the 1440px mark. Could we revise this limit and apply these styles at 768px like the appBar, for example? cc @ThomThomson

responsiveness.mp4

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Thx for the move to the package, FYI @andreadelrio
I think we need to adjust code ownership for this until EUI takes over , else nobody owns this

https://github.com/elastic/kibana/blob/main/.github/CODEOWNERS

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

LGTM, just had a quick look, @akowalska622 had a closer one, so data discovery is covered. just one question about the yarn.lock

@AlexGPlay AlexGPlay force-pushed the 225702-split-search-button branch from 1c66daa to 52a976b Compare September 1, 2025 07:12
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

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
@kbn/split-button - 2 +2
Unknown metric groups

API count

id before after diff
@kbn/split-button - 2 +2

History

cc @AlexGPlay

@AlexGPlay AlexGPlay merged commit ad496c1 into elastic:main Sep 1, 2025
14 checks passed
ymao1 pushed a commit to ymao1/kibana that referenced this pull request Sep 2, 2025
## Summary

Closes elastic#225702

Adds a split button that can be later used in the new background search
implementation.

| Example | Screenshot |
|--|--|
| Both icons | <img width="169" height="47" alt="image"
src="https://github.com/user-attachments/assets/71c9af0d-f6e6-4030-9525-0ec49e4fb98d"
/> |
| Default | <img width="167" height="54" alt="image"
src="https://github.com/user-attachments/assets/fdb31a84-c521-445f-ad20-f23fee6c3976"
/> |
| Danger | <img width="165" height="50" alt="image"
src="https://github.com/user-attachments/assets/7370076f-b7b7-4a96-b915-d6122cecc02d"
/> |
| Success | <img width="161" height="48" alt="image"
src="https://github.com/user-attachments/assets/0348edb4-f02f-4286-8319-b326ede24572"
/> |
| Warning | <img width="161" height="51" alt="image"
src="https://github.com/user-attachments/assets/611a2ef3-5a62-46c4-b12d-050f3000a01a"
/> |
| Disabled | <img width="165" height="53" alt="image"
src="https://github.com/user-attachments/assets/5412881a-7cd5-49c0-bab1-9533ec50049c"
/> |

There are more examples in the storybook.

#### How to test?
To test it you can go to the component storybook by running `yarn
storybook unified_search` and going to
http://localhost:9001/?path=/story/split-button--default

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.


- [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
- [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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
MichelLosier pushed a commit to MichelLosier/kibana that referenced this pull request Sep 2, 2025
## Summary

Closes elastic#225702

Adds a split button that can be later used in the new background search
implementation.

| Example | Screenshot |
|--|--|
| Both icons | <img width="169" height="47" alt="image"
src="https://github.com/user-attachments/assets/71c9af0d-f6e6-4030-9525-0ec49e4fb98d"
/> |
| Default | <img width="167" height="54" alt="image"
src="https://github.com/user-attachments/assets/fdb31a84-c521-445f-ad20-f23fee6c3976"
/> |
| Danger | <img width="165" height="50" alt="image"
src="https://github.com/user-attachments/assets/7370076f-b7b7-4a96-b915-d6122cecc02d"
/> |
| Success | <img width="161" height="48" alt="image"
src="https://github.com/user-attachments/assets/0348edb4-f02f-4286-8319-b326ede24572"
/> |
| Warning | <img width="161" height="51" alt="image"
src="https://github.com/user-attachments/assets/611a2ef3-5a62-46c4-b12d-050f3000a01a"
/> |
| Disabled | <img width="165" height="53" alt="image"
src="https://github.com/user-attachments/assets/5412881a-7cd5-49c0-bab1-9533ec50049c"
/> |

There are more examples in the storybook.

#### How to test?
To test it you can go to the component storybook by running `yarn
storybook unified_search` and going to
http://localhost:9001/?path=/story/split-button--default

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.


- [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
- [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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
kowalczyk-krzysztof pushed a commit to kowalczyk-krzysztof/kibana that referenced this pull request Sep 3, 2025
## Summary

Closes elastic#225702

Adds a split button that can be later used in the new background search
implementation.

| Example | Screenshot |
|--|--|
| Both icons | <img width="169" height="47" alt="image"
src="https://github.com/user-attachments/assets/71c9af0d-f6e6-4030-9525-0ec49e4fb98d"
/> |
| Default | <img width="167" height="54" alt="image"
src="https://github.com/user-attachments/assets/fdb31a84-c521-445f-ad20-f23fee6c3976"
/> |
| Danger | <img width="165" height="50" alt="image"
src="https://github.com/user-attachments/assets/7370076f-b7b7-4a96-b915-d6122cecc02d"
/> |
| Success | <img width="161" height="48" alt="image"
src="https://github.com/user-attachments/assets/0348edb4-f02f-4286-8319-b326ede24572"
/> |
| Warning | <img width="161" height="51" alt="image"
src="https://github.com/user-attachments/assets/611a2ef3-5a62-46c4-b12d-050f3000a01a"
/> |
| Disabled | <img width="165" height="53" alt="image"
src="https://github.com/user-attachments/assets/5412881a-7cd5-49c0-bab1-9533ec50049c"
/> |

There are more examples in the storybook.

#### How to test?
To test it you can go to the component storybook by running `yarn
storybook unified_search` and going to
http://localhost:9001/?path=/story/split-button--default

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.


- [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
- [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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Search Sessions release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Background search] Implement enhanced search button

7 participants