Skip to content

Comments

[Lens] Fix secondary metric styles to prevent wrapping#227234

Merged
mariairiartef merged 7 commits intoelastic:mainfrom
mariairiartef:fix/226208
Jul 14, 2025
Merged

[Lens] Fix secondary metric styles to prevent wrapping#227234
mariairiartef merged 7 commits intoelastic:mainfrom
mariairiartef:fix/226208

Conversation

@mariairiartef
Copy link
Contributor

@mariairiartef mariairiartef commented Jul 9, 2025

Closes #226208

Summary

The secondary metric component stays on a single line with proper text overflow handling, while giving priority to the value/badge over the prefix when space is limited.

Screenshot 2025-07-09 at 14 20 20

The value/badge can take the whole width

Screenshot 2025-07-09 at 14 16 38

Checklist

  • 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.

@mariairiartef mariairiartef self-assigned this Jul 9, 2025
@mariairiartef mariairiartef added Feature:Lens v9.1.0 v8.19.0 v9.2.0 bug Fixes for quality problems that affect the customer experience Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels labels Jul 9, 2025
@mariairiartef mariairiartef marked this pull request as ready for review July 9, 2025 15:34
@mariairiartef mariairiartef requested a review from a team as a code owner July 9, 2025 15:34
@elasticmachine
Copy link
Contributor

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

@markov00 markov00 added release_note:fix and removed release_note:skip Skip the PR/issue when compiling release notes labels Jul 10, 2025
@gvnmagni
Copy link

From the purely design/visual perspective everything seems to work fine!

Copy link
Contributor

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

Tested locally works great!

@mariairiartef mariairiartef enabled auto-merge (squash) July 14, 2025 06:41
@mariairiartef mariairiartef merged commit c238ede into elastic:main Jul 14, 2025
11 of 12 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
expressionMetricVis 8.4KB 9.0KB +677.0B

History

cc @mariairiartef

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 14, 2025
Closes elastic#226208

## Summary

The secondary metric component stays on a single line with proper text
overflow handling, while giving priority to the value/badge over the
prefix when space is limited.

<img width="1080" alt="Screenshot 2025-07-09 at 14 20 20"
src="https://github.com/user-attachments/assets/dc6cc536-eb74-411d-9237-16ae6713e33e"
/>

#### The value/badge can take the whole width

<img width="316" alt="Screenshot 2025-07-09 at 14 16 38"
src="https://github.com/user-attachments/assets/1257b677-0983-43c3-a39f-ae038716651b"
/>

### Checklist

- [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.

(cherry picked from commit c238ede)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts
9.1

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 227234

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 Jul 16, 2025
@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
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

mariairiartef added a commit to mariairiartef/kibana that referenced this pull request Jul 16, 2025
Closes elastic#226208

## Summary

The secondary metric component stays on a single line with proper text
overflow handling, while giving priority to the value/badge over the
prefix when space is limited.

<img width="1080" alt="Screenshot 2025-07-09 at 14 20 20"
src="https://github.com/user-attachments/assets/dc6cc536-eb74-411d-9237-16ae6713e33e"
/>

#### The value/badge can take the whole width

<img width="316" alt="Screenshot 2025-07-09 at 14 16 38"
src="https://github.com/user-attachments/assets/1257b677-0983-43c3-a39f-ae038716651b"
/>

### Checklist

- [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.

(cherry picked from commit c238ede)

# Conflicts:
#	src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.test.tsx
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mariairiartef

2 similar comments
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mariairiartef

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mariairiartef

mariairiartef added a commit that referenced this pull request Jul 22, 2025
… (#228188)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Lens] Fix secondary metric styles to prevent wrapping
(#227234)](#227234)

<!--- Backport version: 10.0.1 -->

### 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-07-14T08:39:53Z","message":"[Lens]
Fix secondary metric styles to prevent wrapping (#227234)\n\nCloses
https://github.com/elastic/kibana/issues/226208\n\n## Summary\n\nThe
secondary metric component stays on a single line with proper
text\noverflow handling, while giving priority to the value/badge over
the\nprefix when space is limited.\n\n<img width=\"1080\"
alt=\"Screenshot 2025-07-09 at 14 20
20\"\nsrc=\"https://github.com/user-attachments/assets/dc6cc536-eb74-411d-9237-16ae6713e33e\"\n/>\n\n####
The value/badge can take the whole width\n\n<img width=\"316\"
alt=\"Screenshot 2025-07-09 at 14 16
38\"\nsrc=\"https://github.com/user-attachments/assets/1257b677-0983-43c3-a39f-ae038716651b\"\n/>\n\n\n###
Checklist\n\n- [x] 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-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"c238ede3d4ac816fce88d6c96ecc1f5445a6414a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Visualizations","Feature:Lens","backport
missing","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Lens]
Fix secondary metric styles to prevent
wrapping","number":227234,"url":"https://github.com/elastic/kibana/pull/227234","mergeCommit":{"message":"[Lens]
Fix secondary metric styles to prevent wrapping (#227234)\n\nCloses
https://github.com/elastic/kibana/issues/226208\n\n## Summary\n\nThe
secondary metric component stays on a single line with proper
text\noverflow handling, while giving priority to the value/badge over
the\nprefix when space is limited.\n\n<img width=\"1080\"
alt=\"Screenshot 2025-07-09 at 14 20
20\"\nsrc=\"https://github.com/user-attachments/assets/dc6cc536-eb74-411d-9237-16ae6713e33e\"\n/>\n\n####
The value/badge can take the whole width\n\n<img width=\"316\"
alt=\"Screenshot 2025-07-09 at 14 16
38\"\nsrc=\"https://github.com/user-attachments/assets/1257b677-0983-43c3-a39f-ae038716651b\"\n/>\n\n\n###
Checklist\n\n- [x] 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-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"c238ede3d4ac816fce88d6c96ecc1f5445a6414a"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/227767","number":227767,"state":"OPEN"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227234","number":227234,"mergeCommit":{"message":"[Lens]
Fix secondary metric styles to prevent wrapping (#227234)\n\nCloses
https://github.com/elastic/kibana/issues/226208\n\n## Summary\n\nThe
secondary metric component stays on a single line with proper
text\noverflow handling, while giving priority to the value/badge over
the\nprefix when space is limited.\n\n<img width=\"1080\"
alt=\"Screenshot 2025-07-09 at 14 20
20\"\nsrc=\"https://github.com/user-attachments/assets/dc6cc536-eb74-411d-9237-16ae6713e33e\"\n/>\n\n####
The value/badge can take the whole width\n\n<img width=\"316\"
alt=\"Screenshot 2025-07-09 at 14 16
38\"\nsrc=\"https://github.com/user-attachments/assets/1257b677-0983-43c3-a39f-ae038716651b\"\n/>\n\n\n###
Checklist\n\n- [x] 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-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"c238ede3d4ac816fce88d6c96ecc1f5445a6414a"}}]}]
BACKPORT-->
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mariairiartef

2 similar comments
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mariairiartef

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mariairiartef

kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
Closes elastic#226208

## Summary

The secondary metric component stays on a single line with proper text
overflow handling, while giving priority to the value/badge over the
prefix when space is limited.

<img width="1080" alt="Screenshot 2025-07-09 at 14 20 20"
src="https://github.com/user-attachments/assets/dc6cc536-eb74-411d-9237-16ae6713e33e"
/>

#### The value/badge can take the whole width

<img width="316" alt="Screenshot 2025-07-09 at 14 16 38"
src="https://github.com/user-attachments/assets/1257b677-0983-43c3-a39f-ae038716651b"
/>


### Checklist

- [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.
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mariairiartef

@mariairiartef
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.1

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

Questions ?

Please refer to the Backport tool documentation

mariairiartef added a commit to mariairiartef/kibana that referenced this pull request Jul 28, 2025
Closes elastic#226208

## Summary

The secondary metric component stays on a single line with proper text
overflow handling, while giving priority to the value/badge over the
prefix when space is limited.

<img width="1080" alt="Screenshot 2025-07-09 at 14 20 20"
src="https://github.com/user-attachments/assets/dc6cc536-eb74-411d-9237-16ae6713e33e"
/>

#### The value/badge can take the whole width

<img width="316" alt="Screenshot 2025-07-09 at 14 16 38"
src="https://github.com/user-attachments/assets/1257b677-0983-43c3-a39f-ae038716651b"
/>

### Checklist

- [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.

(cherry picked from commit c238ede)
mariairiartef added a commit that referenced this pull request Jul 28, 2025
#229564)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Lens] Fix secondary metric styles to prevent wrapping
(#227234)](#227234)

<!--- Backport version: 10.0.1 -->

### 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-07-14T08:39:53Z","message":"[Lens]
Fix secondary metric styles to prevent wrapping (#227234)\n\nCloses
https://github.com/elastic/kibana/issues/226208\n\n## Summary\n\nThe
secondary metric component stays on a single line with proper
text\noverflow handling, while giving priority to the value/badge over
the\nprefix when space is limited.\n\n<img width=\"1080\"
alt=\"Screenshot 2025-07-09 at 14 20
20\"\nsrc=\"https://github.com/user-attachments/assets/dc6cc536-eb74-411d-9237-16ae6713e33e\"\n/>\n\n####
The value/badge can take the whole width\n\n<img width=\"316\"
alt=\"Screenshot 2025-07-09 at 14 16
38\"\nsrc=\"https://github.com/user-attachments/assets/1257b677-0983-43c3-a39f-ae038716651b\"\n/>\n\n\n###
Checklist\n\n- [x] 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-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"c238ede3d4ac816fce88d6c96ecc1f5445a6414a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Visualizations","Feature:Lens","backport
missing","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Lens]
Fix secondary metric styles to prevent
wrapping","number":227234,"url":"https://github.com/elastic/kibana/pull/227234","mergeCommit":{"message":"[Lens]
Fix secondary metric styles to prevent wrapping (#227234)\n\nCloses
https://github.com/elastic/kibana/issues/226208\n\n## Summary\n\nThe
secondary metric component stays on a single line with proper
text\noverflow handling, while giving priority to the value/badge over
the\nprefix when space is limited.\n\n<img width=\"1080\"
alt=\"Screenshot 2025-07-09 at 14 20
20\"\nsrc=\"https://github.com/user-attachments/assets/dc6cc536-eb74-411d-9237-16ae6713e33e\"\n/>\n\n####
The value/badge can take the whole width\n\n<img width=\"316\"
alt=\"Screenshot 2025-07-09 at 14 16
38\"\nsrc=\"https://github.com/user-attachments/assets/1257b677-0983-43c3-a39f-ae038716651b\"\n/>\n\n\n###
Checklist\n\n- [x] 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-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"c238ede3d4ac816fce88d6c96ecc1f5445a6414a"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/228188","number":228188,"state":"MERGED","mergeCommit":{"sha":"be0f29268950f326aeef95ff3d1ecc612ac7c750","message":"[8.19]
[Lens] Fix secondary metric styles to prevent wrapping (#227234)
(#228188)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.19`:\n- [[Lens] Fix secondary metric styles to prevent
wrapping\n(#227234)](https://github.com/elastic/kibana/pull/227234)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227234","number":227234,"mergeCommit":{"message":"[Lens]
Fix secondary metric styles to prevent wrapping (#227234)\n\nCloses
https://github.com/elastic/kibana/issues/226208\n\n## Summary\n\nThe
secondary metric component stays on a single line with proper
text\noverflow handling, while giving priority to the value/badge over
the\nprefix when space is limited.\n\n<img width=\"1080\"
alt=\"Screenshot 2025-07-09 at 14 20
20\"\nsrc=\"https://github.com/user-attachments/assets/dc6cc536-eb74-411d-9237-16ae6713e33e\"\n/>\n\n####
The value/badge can take the whole width\n\n<img width=\"316\"
alt=\"Screenshot 2025-07-09 at 14 16
38\"\nsrc=\"https://github.com/user-attachments/assets/1257b677-0983-43c3-a39f-ae038716651b\"\n/>\n\n\n###
Checklist\n\n- [x] 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-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"c238ede3d4ac816fce88d6c96ecc1f5445a6414a"}}]}]
BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 28, 2025
@mistic mistic added v9.1.1 and removed v9.1.0 labels Jul 29, 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 bug Fixes for quality problems that affect the customer experience Feature:Lens release_note:fix Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.19.0 v9.1.1 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Lens] Metric Chart logic for vertical responsiveness does not work when secondary value is longer than one line

7 participants