Skip to content

[8.x] [Cloud Security] Improve graph node label ellipsis logic (#204580)#204933

Merged
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-204580
Dec 19, 2024
Merged

[8.x] [Cloud Security] Improve graph node label ellipsis logic (#204580)#204933
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-204580

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

)

## Summary

This PR improves the logic of node's label truncation. It follows the
guidelines from design:

> - Set the maximum width for names to 160px
> - Truncate names to max two lines
> - I recommend truncating names in the middle, as entity IDs often
differ only in their last characters while starting similarly. This
approach will make it easier to identify differences between names
> - Display the full name in a tooltip on hover for better visibility

Before:

<img width="150"
src="https://github.com/user-attachments/assets/4bc18b98-1e1b-41df-ac69-79b2adf1f127"
/>
<img width="150"
src="https://github.com/user-attachments/assets/69c335f6-3952-44e8-8836-19eab3bff28f"
/>
<img width="150"
src="https://github.com/user-attachments/assets/4ba65932-5af5-4382-b721-41c6ee7388a8"
/>

After:

https://github.com/user-attachments/assets/2ab04809-7599-45ab-9aaa-ae1fcabdf969

**How to test**

To test this PR you can run

```
yarn storybook cloud_security_posture_packages
```

### Checklist

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

---------

Co-authored-by: Sean Rathier <sean.rathier@elastic.co>
Co-authored-by: Brad White <Ikuni17@users.noreply.github.com>
(cherry picked from commit f316612)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Dec 19, 2024
@kibanamachine kibanamachine enabled auto-merge (squash) December 19, 2024 12:59
@kibanamachine kibanamachine merged commit 17b5861 into elastic:8.x Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants