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

[Lens] Chart switch icons redesign #178328

Merged
merged 12 commits into from
Mar 19, 2024
Merged

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Mar 8, 2024

Summary

Fixes #178232

Screenshot 2024-03-14 at 09 55 23

Apart from the design changes, I also made the tooltip copy more specific. Here are the 3 cases we have:

  1. We loose all configuration (eg from multilayer xy to gauge).
Screenshot 2024-03-14 at 09 56 14
  1. We loose layers (and apart from that, we can loose columns from the first layer too so I inform user about it too!) ( eg from multilayer xy chart to table)
Screenshot 2024-03-14 at 09 56 33
  1. We loose columns only (eg. from donut chart to gauge)
Screenshot 2024-03-14 at 09 56 07

@mbondyra mbondyra added Team:Visualizations Visualization editors, elastic-charts and infrastructure release_note:skip Skip the PR/issue when compiling release notes Feature:Lens v8.14.0 labels Mar 8, 2024
@amyjtechwriter
Copy link
Contributor

Copy suggestions (I can iterate on them, this is a bit of a first pass):

1 - Selecting this visualization clears the current configuration.

2 - Selecting this visualization keeps first layer data only. Columns kept:

3 - Selecting this visualization keeps columns:

@mbondyra mbondyra force-pushed the chart_switch_poc branch 4 times, most recently from 73f8151 to ad514e8 Compare March 11, 2024 16:22
@MichaelMarcialis
Copy link
Contributor

MichaelMarcialis commented Mar 11, 2024

Hey, @mbondyra. Love the thinking here and the explorations you shared in the Slack thread! My only concerns with this approach are that 1) I fear this information may be a bit too much to cram into a tooltip and 2) are we certain that the users require this level of specificity when transitioning between visualization types. Is it an issue our customers have complained about in the past? How well does the concept hold up if/when a user has changed the name of one or more of the dimension items in the layer?

image

Regarding the first concern, if we want to continue using a simple tooltip to inform our users about incompatibilities between visualization types, I think we need to be more succinct about it. Given the three scenarios you present above, I'd suggest something along the lines of:

  1. Changing to this visualization type will clear the currently selected layer's configuration and remove all other layers.

  2. Changing to this visualization type will modify the currently selected layer's configuration and remove all other layers.

  3. Changing to this visualization type will modify the currently selected layer's configuration.

Regarding the second concern, if we decide that being this specific is indeed valuable for users, then perhaps a better location for that information would be in something like the subsequent confirmation modal I mentioned in my original comment?

Alternatively, if the modal concept isn't desirable, we could potentially forgo the modal and explore some kind of conditionally appearing element within the visualization type popover menu itself. Off the top of my head, I can imagine a conditional panel that appears to the right of the visualization type options and houses content explaining the exact details of what will change.

But again, such specificity may be overkill if it's something the users don't particularly care to be so over-informed about. CCing @stratoula, @markov00, @timductive, @ninoslavmiskovic in case they have any thoughts/opinions on this concern. If there is any consensus on proceeding with such a direction, please let me know and how I should prioritize it, and I can plan to mock something up.

@amyjtechwriter
Copy link
Contributor

@MichaelMarcialis I really like your copy suggestions more than mine 😂

@mbondyra
Copy link
Contributor Author

mbondyra commented Mar 12, 2024

@amyjtechwriter I like yours because of how concise it is and it reads better for non-native speaker 😅 . How about taking the precision from Michael's copy but keep the concisement from yours? I also don't like using 'layer' word so much when for the single layer charts we don't even put it anywhere in the interface.
I propose these:

  • Changing to this visualization clears the current configuration.

  • Changing to this visualization modifies the current configuration.

  • Changing to this visualization modifies currently selected layer's configuration and removes all other layers.

I am still not super convinced about using 'modifies' word when it means 'removes parts of configuration' but I can live with it. 😀

@amyjtechwriter
Copy link
Contributor

@mbondyra I feel like that would be an excellent compromise :D

@mbondyra mbondyra marked this pull request as ready for review March 12, 2024 16:44
@mbondyra mbondyra requested review from a team as code owners March 12, 2024 16:44
@elasticmachine
Copy link
Contributor

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

@elastic elastic deleted a comment from kibana-ci Mar 12, 2024
@mbondyra mbondyra changed the title Chart switch poc [Lens] Chart switch icons redesign Mar 12, 2024
Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Looks fantastic. Just 2 small comments from the code review. I will continue with testing it

…orkspace_panel/chart_switch/index.tsx

Co-authored-by: Stratoula Kalafateli <[email protected]>
Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

This works fine! LGTM! Nice improvement :)

@mbondyra
Copy link
Contributor Author

/ci

@drewdaemon
Copy link
Contributor

I like it! Also, would love to see undo/redo added, possibly removing the need for all this messaging.

@ninoslavmiskovic
Copy link
Contributor

looks great!

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 so quickly, @mbondyra. It looks great. I have two small comments below for your review.

Comment on lines 58 to 67
<EuiBetaBadge
css={css`
vertical-align: middle;
`}
iconType="beaker"
label={i18n.translate('xpack.lens.chartSwitch.experimentalLabel', {
defaultMessage: 'Technical preview',
})}
size="s"
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to also apply a tooltip to this badge that states "Technical preview", similar to how we do with the same badge in layer settings?

CleanShot 2024-03-14 at 16 14 36

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and done!

Comment on lines 27 to 34
.lnsChartSwitch__option {
.euiSelectableListItem__text {
flex-grow: 0;
}
.euiSelectableListItem__append {
margin-left: $euiSizeXS;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

These style overrides are causing the selectable list's "enter" key badge that appears on focus to be in the wrong position. This focus badge should be aligned right, but this change causes it to appear to the left and immediately adjacent to the selectable list text content.

CleanShot 2024-03-14 at 16 22 26

Would it be possible to fix this? My first thought would be to try moving the technical preview badge and warning icon into the .euiSelectableListItem__text element, rather than using the append prop. If that doesn't work, you could also try styling a parent container of the badge and icon elements to occupy the full space between the selectable text and the focus badge. Just let me know if you want to chat about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mar-15-2024 10-10-16
Fixed it with styles manipulation, we cannot pass node to the text element you mention, just a string.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 1347 1349 +2

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.4MB 1.4MB +1.1KB

History

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

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 making those changes, @mbondyra. LGTM!

@mbondyra mbondyra merged commit 7545046 into elastic:main Mar 19, 2024
16 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 19, 2024
@mbondyra mbondyra deleted the chart_switch_poc branch March 19, 2024 14:16
mbondyra added a commit that referenced this pull request Mar 20, 2024
## Summary

By merging this [PR](#178328) I
introduced the following bug: when searching through the chart switch,
the label text doesn't appear.

Before:
Searching (the actual bug):
<img width="474" alt="Screenshot 2024-03-19 at 21 12 55"
src="https://github.com/elastic/kibana/assets/4283304/4c29837f-e580-4a45-9f18-20201118a68f">
not searching (correct behavior, just here to compare with the 'after'):
<img width="492" alt="Screenshot 2024-03-19 at 21 12 46"
src="https://github.com/elastic/kibana/assets/4283304/483b9f6c-fd16-48f7-bf46-f40fb922a265">


I tried to fix it with CSS and still follow the design we agreed on, but
I cannot make it work. The problem is that we have to set up the
`euiSelectableListItem__text` css prop to `flex-grow: 0` to have the
extra icons next to the text. At the same time, when we search through
the component, the internal EuiTruncate component calculates the space
to generate the truncated string. Because of the `flex-grow:0`, the
EuiTruncate assumes there is no space and shows nothing. I tried to find
a solution for a while now and I don't think it's possible. Instead of
reverting my changes, for now I'll just change the styles to appear on
the right side, the same way as before. Any other ideas welcome 🙏🏼

After:
searching:
<img width="461" alt="Screenshot 2024-03-19 at 21 12 01"
src="https://github.com/elastic/kibana/assets/4283304/6a8fa484-7cf9-4d38-b852-99c5f0db9847">

not searching (the icons from the right):
<img width="468" alt="Screenshot 2024-03-19 at 21 12 15"
src="https://github.com/elastic/kibana/assets/4283304/37378e88-e6a3-4d1a-955d-b015a0cb02c9">

Co-authored-by: Stratoula Kalafateli <[email protected]>
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:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Redesign technical preview and incompatible chart type badges in Chart Switch
9 participants