-
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] Normalize Axis title input within popover with compact design #126943
Conversation
@elasticmachine merge upstream |
Thanks for putting this together, @dej611. I'll attempt to answer your questions below:
Regarding the contents of the legend popover breaking with an increase to the popover width, could you elaborate on what you're seeing? In my quick glance, I didn't see anything that couldn't be remedied by utilizing the full width props provided for the form and button group components, but I may be overlooking something. Let me know.
Yes, I agree with you that we should be normalizing the form layouts for our toolbar popovers. In most (if not all) cases, we should be using the |
I think there was a problem with the shared I've removed the So I think that should be ok now. Let me know if I missed anything.
I've moved all the switches into a Given the extra space you may have noticed how the One downside of such change is that the help tooltip when the button group row is disabled shows up now only on buttons hover, and not on label hover: That is because the tooltip styling broke the row padding behaviour when wrapping the whole row, so I had to move inside to the ButtonGroup field only. The only exception which is still in |
@MichaelMarcialis do you think a dual range input would work as well? Compared to two number fields it is a more compact design with a clear indication of a range. The only downside of it I see it's the range popover that will show up when editing: In the PoC above the dual range input has been appended to the |
Also, just noticed about the |
Is there a finite upper bound limit that we impose on the user? If so, I like the idea of using this range input. If there isn't a finite upper bound limit though, I worry about the range input's included slider being honest. In any case, if we do end up going with the range input, I imagine we can probably do away with the upper/lower prepend/append labels then, as the low and high of the range is already represented via the component.
True. In the future, I think this will be at least partially addressed by hiding instead of disabling aspects of these forms when they are unavailable. So in that future scenario, we wouldn't need to have the For the present however, as we are still disabling instead of hiding, and EUI doesn't support placing a tooltip on individual buttons within a button group, I suggest we either have this help text appear immediately below the bounds button group or as an icon-based tooltip appended to the bounds label. Whichever is easily achievable and doesn't look bad 😄
I'm personally fine with shortening this to |
I think Data is problematic because I don't think of this as the data part of the chart at all (it's the axis scale options in d3, as an example). @gvnmagni @elastic/datavis - what should we call the name of the "Data Bounds" control?
|
@ghudgins: Just to clarify, I'm talking about renaming the middle "Data bounds" button in the "Bounds" button group. Not the "Bounds" label for the entire button group, in case that's what you thought I meant here. |
ah - much better. sorry for missing this earlier. sounds good to me |
@MichaelMarcialis reworked the layout for the dual range input without the slider (and proposed to ship it in EUI as separate component): For line charts the help text between the two fields is not shown: As you've noticed also the |
@elasticmachine merge upstream |
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
@dej611 @MichaelMarcialis @ghudgins I'm proposing this because:
|
That The |
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.
I like it! The settings popover look much better now :) Changed LGTM! I tested it locally and works fine!
Thanks for making those changes, @dej611! This is looking great. I'm leaving a few quick comments/questions below:
Thanks for your thoughtful comments, @markov00! My initial thoughts are below:
I'm not a big fan of the pattern of using empty or cleared inputs as a means to revert to using automatic values. While that approach does help to reduce the UI required, I don't think it's very obvious to users. I'd rather the form be slightly bigger (via the button group in this case) and the experience of switching between be more obvious.
This is an interesting approach. I like the notion of trying to automatically prevent users from hitting an error for not including zero, but I do fear that the switch may create more confusion in the process. What if we instead took the automation idea and applied it to the upper/lower bound inputs instead? For example, if the user were to change an upper or lower value in a way that the range excluded zero, we simply auto-adjust their value to include zero at a minimum on blur. Thoughts? Additionally, I think it's worth mentioning how much cleaner this experience will become once we get around to hiding form elements rather than disabling them in these popovers. This will dramatically reduce the visual complexity of this feature and it's popover, as users would initially only see the button group with three options (full/data/custom). When custom is selected, then range input would only appear for further direction from the user. |
I think the scope of this PR is getting a bit out of hand. |
You're right! Apologies for all the comments and ideating in this PR, @dej611. My first two bullet points in my previous comment still stand, but the discussion regarding @markov00's suggestion and my follow-up thoughts on auto-adjusting the upper or lower bound values to include zero automatically on blur can be spun off as a separate issue. |
As stated in my initial comment I'm not widening the scope but it was just a follow-up on the changes proposed by you folks. Happy to discuss it further on a separate issue |
@elasticmachine merge upstream |
I've reported @markov00 into a separate issue to discuss layout improvement of the extends control. |
@elasticmachine merge upstream |
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.
@dej611: Leaving a few small comments below for your review. As these are small issues, I'll approve now so I don't hold you up further after addressing.
- Per my previous comment, it looks like range input errors for upper/lower bounds are replacing the input's help text. Rather than replacing the help text, can we instead show the error in addition to the help text (similar to examples shown in EUI docs)?
- Per my previous comment, it looks like the
Lower
prepend andUpper
append labels are still present on the range input. Given that the range input already implies this spatially, can we remove those labels to further simplify?
label={title || ''} | ||
mode={titleMode} | ||
placeholder={i18n.translate('xpack.lens.shared.overwriteAxisTitle', { | ||
defaultMessage: 'Overwrite axis title', |
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.
Rather than using Overwrite axis title
as the placeholder for auto-generated titles, is it possible for us to have this placeholder text reflect whatever the auto-generated title is currently?
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.
It's possible, but I would like to split this one out as it's not as easy as it seems (information about the currently rendered chart which is required for this is not passed to this component at the moment).
@elasticmachine merge upstream |
@MichaelMarcialis fixed your previous comments, merging once green. |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
Fixes #124223
This PR attempts to redesign the Axis title fields within the XY/Heatmap axis popups.
Typing in the text input makes the mode switch automatically to
Custom
. It is not true the opposite, in fact it is possible to have theCustom
mode with an empty title, which will fallback the axis title to the default one. Also theCustom
mode will be only temporary in this specific case as closing and reopening the popupAuto
will be chosen again.Here's updated pic of the popover rework after addressing all design feedback:
Previous questions for design
I have few questions, maybe for @MichaelMarcialis here about some styling (solved):the gauge popover has a width of
500px
to deal with the label box taking 1/3 of the width + theselect
content that requires some spaceHas been considered to normalize also switch inputs? I see two patterns here (and the latter does not look great IMHO):

Would it make sense to normalize switches as the former one?
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers