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

Update UX for fielddata percentage / absolute frequency #53966

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented Jan 3, 2020

Fixes #53935

Note: I left the controls stacked vertically (differs from mockup) as I believe this was an intentional change done via #52142. Also, the range component does not support appending characters (for %) AFAICT.

Screen Shot 2020-01-03 at 3 00 17 PM

Screen Shot 2020-01-03 at 3 00 25 PM

@alisonelizabeth alisonelizabeth added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes Feature:Mappings Editor Index mappings editor UI labels Jan 3, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

UI looks good! Just had some suggestions regarding wording and accessibility.

value={[min.value as number, max.value as number]}
onChange={onFrequencyFilterChange}
showInput
fullWidth
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can supply an append prop to add the "%" sign.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

If append does not work, we should be able to solve it with a 3 columns layout

  1. Field 1 (<NumericField field={min} euiProps{{ append: '%' }} />)
  2. Dual range without showing the inputs
  3. Field 2 (<NumericField field={max} euiProps{{ append: '%' }} />)

As we have a single source of truth (the min and max hook fields), changing the value on one side will update both components. 😊

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cjcenizal @sebelga append/prepend are only valid in the input-only version of the EuiDualRange component, which is what design suggested to use. The example included above is using the EuiRange component (I believe).

Here are the updated screens:
Screen Shot 2020-01-07 at 11 38 28 AM
Screen Shot 2020-01-07 at 11 38 37 AM
Screen Shot 2020-01-07 at 11 38 45 AM

This also doesn't take up as much room horizontally, so I also moved the Minimum segment size input inline.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think these changes look great Alison!

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @cjcenizal , this looks awesome! 😊

isInvalid={minIsInvalid}
fullWidth
data-test-subj="input"
controlOnly={true}
Copy link
Contributor

Choose a reason for hiding this comment

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

When I use VoiceOver on OS X to read these inputs, I just get the value in the input followed by "stepper". Is it possible to add internationalized aria-label props for "Minimum absolute frequency" and "Maximum absolute frequency"?

label={
<FormattedMessage
id="xpack.idxMgmt.mappingsEditor.fielddata.frequencyFilterAbsoluteFieldLabel"
defaultMessage="Min/max frequency absolute"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this would be more human-readable if we changed it to "Absolute frequency range". WDYT?

label={
<FormattedMessage
id="xpack.idxMgmt.mappingsEditor.fielddata.frequencyFilterPercentageFieldLabel"
defaultMessage="Min/max frequency percentage"
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly, what do you think of "Percentage-based frequency range"?

/>
}
>
<EuiDualRange
Copy link
Contributor

Choose a reason for hiding this comment

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

This component has a similar screen-reader accessibility issue. I created elastic/eui#2737 to track this in EUI.

Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

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

LGTM! Tested locally and works great. I left a few comments in the code but nothing important.

Have you tried the layout with the minimum segment size on the right as in the design? As the field is not supposed to get many characters (4/5 max), having it full width might not be necessary.


<EuiSpacer size="s" />

<EuiSwitch
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the compressed version for the switch? I think that's what Michael had in mind and I think would look nicer.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@alisonelizabeth alisonelizabeth merged commit 6c60f4d into elastic:feature/mappings-editor Jan 8, 2020
@alisonelizabeth alisonelizabeth deleted the mappings-editor/fielddata-ux branch January 8, 2020 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Mappings Editor Index mappings editor UI release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants