-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Conversation
97b2da9
to
0b21f22
Compare
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: |
73f8151
to
ad514e8
Compare
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? 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:
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. |
ad514e8
to
3196f8e
Compare
@MichaelMarcialis I really like your copy suggestions more than mine 😂 |
@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 am still not super convinced about using 'modifies' word when it means 'removes parts of configuration' but I can live with it. 😀 |
@mbondyra I feel like that would be an excellent compromise :D |
3196f8e
to
1569d71
Compare
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
There was a problem hiding this 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
...ublic/editor_frame_service/editor_frame/workspace_panel/chart_switch/chart_option_append.tsx
Show resolved
Hide resolved
...plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch/index.tsx
Outdated
Show resolved
Hide resolved
…orkspace_panel/chart_switch/index.tsx Co-authored-by: Stratoula Kalafateli <[email protected]>
...plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch/index.tsx
Show resolved
Hide resolved
…orkspace_panel/chart_switch/index.tsx
There was a problem hiding this 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 :)
...plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch/index.tsx
Outdated
Show resolved
Hide resolved
…orkspace_panel/chart_switch/index.tsx
/ci |
I like it! Also, would love to see undo/redo added, possibly removing the need for all this messaging. |
looks great! |
There was a problem hiding this 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.
<EuiBetaBadge | ||
css={css` | ||
vertical-align: middle; | ||
`} | ||
iconType="beaker" | ||
label={i18n.translate('xpack.lens.chartSwitch.experimentalLabel', { | ||
defaultMessage: 'Technical preview', | ||
})} | ||
size="s" | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and done!
.lnsChartSwitch__option { | ||
.euiSelectableListItem__text { | ||
flex-grow: 0; | ||
} | ||
.euiSelectableListItem__append { | ||
margin-left: $euiSizeXS; | ||
} | ||
} |
There was a problem hiding this comment.
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this 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!
## 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]>
Summary
Fixes #178232
Apart from the design changes, I also made the tooltip copy more specific. Here are the 3 cases we have: