Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UsersProfilePopover] Fix email sometimes is not visible #184318

Merged
merged 10 commits into from
Jun 5, 2024

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented May 27, 2024

Summary

fix #182945

  • This fixes UsersProfilePopover to always show email on the 2nd line. To keep the list virtualized had to increase the height a bit for every row

Before:

image

After:

Screenshot 2024-05-27 at 15 28 05

  • Also adds email in a label to make it appear in a browser tooltip

Screenshot 2024-05-27 at 16 20 12

Screenshot 2024-05-28 at 15 57 21

  • Increase popover width in TableListView

The only concern that I have is that cases popover was working around that issue with email visibility by making the popover very wide, I wonder if this fix is OK for them and if we could reduce the width now? cc @cnasikas @MichaelMarcialis
The downside of this fix is that each row takes a bit more height.

Screenshot 2024-05-27 at 16 31 23

@Dosant Dosant added release_note:skip Skip the PR/issue when compiling release notes Feature:Security/User Profile labels May 27, 2024
@Dosant Dosant requested review from a team as code owners May 27, 2024 15:30
<EuiHighlight search={searchValue}>{displayName}</EuiHighlight>
</div>
{option.user.email && option.user.email !== displayName ? (
<div className="eui-textTruncate" css={{ fontSize: '0.8em', lineHeight: 1.2 }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

may we just use EuiText component here? with color and size options

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree, looks better 👍

@cnasikas
Copy link
Member

cnasikas commented May 28, 2024

The only concern that I have is that cases popover was working around that issue with email visibility by making the popover very wide, I wonder if this fix is OK for them and if we could reduce the width now? cc @cnasikas @MichaelMarcialis
The downside of this fix is that each row takes a bit more height.

The new changes LGTM for Cases! About the width, I am not sure to be honest. I think it depends if we want to be consistent across Kibana. I will leave the decision to @MichaelMarcialis or @mdefazio.

@Dosant Dosant requested a review from elena-shostak May 28, 2024 12:31
@Dosant Dosant self-assigned this May 28, 2024
Copy link
Contributor

@elena-shostak elena-shostak left a comment

Choose a reason for hiding this comment

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

LGTM!

@Dosant Dosant requested a review from a team May 29, 2024 07:54
@Dosant Dosant added the Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) label May 29, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@Dosant
Copy link
Contributor Author

Dosant commented Jun 3, 2024

@elasticmachine merge upstream

@MichaelMarcialis
Copy link
Contributor

The only concern that I have is that cases popover was working around that issue with email visibility by making the popover very wide, I wonder if this fix is OK for them and if we could reduce the width now? cc @cnasikas @MichaelMarcialis
The downside of this fix is that each row takes a bit more height.

Yes, I think reducing the cases popover to a more reasonable width would be warranted with the improvements you've made.

@Dosant
Copy link
Contributor Author

Dosant commented Jun 4, 2024

Yes, I think reducing the cases popover to a more reasonable width would be warranted with the improvements you've made.

I am reducing to 400px to align with other popovers on that page

Screenshot 2024-06-04 at 17 07 49

@Dosant Dosant requested a review from a team as a code owner June 4, 2024 15:08
Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together, @Dosant. It looks great. I've left a few small comments below, but nothing worth holding you up for. Assuming you're able to address them, I'll approve now.


My first comment is regarding the assignee dropdown menu when creating a new case. It looks like this new stacking of display name and email wasn't applied here. Can/should we do so?

CleanShot 2024-06-04 at 12 45 25

Comment on lines 47 to 50
<div>
<strong>{displayName}</strong>
</div>
{user.email && user.email !== displayName ? <div>{user.email}</div> : undefined}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we take the same approach in the tooltips that we are for the selectable lists? For example, should we:

  • Truncate both the display name and email to a single line.
  • Remove the strong element around the display name.
  • Reduce the email font size to 12px.

Doing so may be more consistent and yield a less crowded tooltip in situations with lengthy names/emails. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Truncate both the display name and email to a single line.

I initially did this but then reverted. I concluded that the idea of a tooltip is to show the full information, even if it is not that nice visually. So decided to better wrap, not truncate.

Remove the strong element around the display name.
Reduce the email font size to 12px.

agree, changed 👍

Comment on lines +342 to +352
<EuiText
size={'xs'}
color={option.disabled ? 'disabled' : 'subdued'}
className="eui-textTruncate"
>
{searchValue ? (
<EuiHighlight search={searchValue}>{option.user.email}</EuiHighlight>
) : (
option.user.email
)}
</EuiText>
Copy link
Contributor

Choose a reason for hiding this comment

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

On hover and focus of one of the users, the underline text decoration is blue for the subued-colored email. Any chance you could change it so the text-decoration-color for the email matches its text color?

CleanShot 2024-06-04 at 11 46 48

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just checked that it isn't flexible, this would require a EUI change.
Text decoration is applied on the whole euiSelectableListItem__text and the text decoration color is not changed if I change it on a child . euiText with email

Copy link
Contributor Author

@Dosant Dosant left a comment

Choose a reason for hiding this comment

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

@MichaelMarcialis, thanks for the review, I improved what I could

My first comment is regarding the assignee dropdown menu when creating a new case. It looks like this new stacking of display name and email wasn't applied here. Can/should we do so?

Looks like this is a different component :(
I won't touch it

Also in that case because how wide the input is, it should fit the longer names nicely. Unfortunetly, not consistent with this other component

Comment on lines +342 to +352
<EuiText
size={'xs'}
color={option.disabled ? 'disabled' : 'subdued'}
className="eui-textTruncate"
>
{searchValue ? (
<EuiHighlight search={searchValue}>{option.user.email}</EuiHighlight>
) : (
option.user.email
)}
</EuiText>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just checked that it isn't flexible, this would require a EUI change.
Text decoration is applied on the whole euiSelectableListItem__text and the text decoration color is not changed if I change it on a child . euiText with email

Comment on lines 47 to 50
<div>
<strong>{displayName}</strong>
</div>
{user.email && user.email !== displayName ? <div>{user.email}</div> : undefined}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Truncate both the display name and email to a single line.

I initially did this but then reverted. I concluded that the idea of a tooltip is to show the full information, even if it is not that nice visually. So decided to better wrap, not truncate.

Remove the strong element around the display name.
Reduce the email font size to 12px.

agree, changed 👍

@kibana-ci
Copy link
Collaborator

💚 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
cases 479.3KB 479.2KB -69.0B
dashboard 495.9KB 495.7KB -191.0B
eventAnnotationListing 295.4KB 295.2KB -192.0B
filesManagement 104.4KB 104.2KB -192.0B
graph 396.9KB 396.7KB -192.0B
maps 3.0MB 3.0MB -192.0B
observabilityAIAssistantApp 151.3KB 151.4KB +74.0B
searchPlayground 166.5KB 166.6KB +74.0B
security 587.2KB 587.0KB -181.0B
securitySolution 13.6MB 13.6MB -63.0B
visualizations 285.8KB 285.6KB -190.0B
total -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
security 69.0KB 69.1KB +111.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @Dosant

@Dosant Dosant merged commit db9e530 into elastic:main Jun 5, 2024
19 checks passed
@kibanamachine kibanamachine added v8.15.0 backport:skip This commit does not require backporting labels Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Security/User Profile release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UsersProfilePopover] Email sometimes is not visible <UserAvatarTip/> doesn't handle long names well
8 participants