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

[EuiToken] Update tokenKeyword and rename old tokenKeyword as tokenTag #5251

Merged
merged 16 commits into from
Oct 14, 2021

Conversation

andreadelrio
Copy link
Contributor

@andreadelrio andreadelrio commented Oct 6, 2021

Summary

This PR updates the icon called tokenKeyword to better match the definition of keyword field type (details described here). In order to preserve the previous icon design for those who might be using it I've kept it under a new name tokenTag.

image
Frame 400

Token in the context of Discover / Data Visualizer

Frame 20

Frame 2-7

Closes #5240

Checklist

  • Check against all themes for compatibility in both light and dark modes
    - [ ] Checked in mobile
    - [ ] Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
  • Added documentation
  • Checked Code Sandbox works for any docs examples
  • Added or updated jest and cypress tests
    - [ ] Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5251/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5251/

@elizabetdev
Copy link
Contributor

Thanks @andreadelrio,

The code looks good. 🎉

But IMO the "K" might seem like an "R".

What do you think of removing the rounded "leg" and just have a straight line?

K@2x

@andreadelrio
Copy link
Contributor Author

Thanks @andreadelrio,

The code looks good. 🎉

But IMO the "K" might seem like an "R".

What do you think of removing the rounded "leg" and just have a straight line?

K@2x

@miukimiu I see what you mean, I really like the proposed k but since we show it such a small size the shape could be hard to distinguish. I played around with some options, my second top choice being option A. What do you think?

Frame 25

image

@elizabetdev
Copy link
Contributor

@andreadelrio option "A" is also my favorite! 😍

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5251/

@cchaos
Copy link
Contributor

cchaos commented Oct 8, 2021

FYI, I just saw this in the Upload File UI:
Screen Shot 2021-10-08 at 16 42 54 PM

You may want to speak with ML about their usage of this icon. Looks like it might be custom in Kibana. I like your representation better as their icon lends more towards "tag" than "keyworkd"

@elizabetdev
Copy link
Contributor

@cchaos that's a good observation. But the icon is not custom. It exists in EUI:
Screenshot 2021-10-11 at 11 15 01

It was introduced in #3165.

That's why @Andrea chose the name tokenKeywordType:

I've chosen this name as we already have another token with the name tokenKeyword.

But yes... It seems that both icons have the same purpose. So should we replace tokenKeyword with the "k"? And rename the old tokenKeyword to tokenTag (so we don't lose it)?

@cchaos
Copy link
Contributor

cchaos commented Oct 11, 2021

Ahh.. hmm, so it looks like the ES-UI team has already created this mapping of ES fields to token, using the old tokenKeyword for this use. https://github.com/elastic/kibana/blob/master/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/field_type_icon.tsx#L33

I would consider talking with them to see if it makes sense in general to change that token icon and maybe ask @mdefazio too since he originally created this one.

@mdefazio
Copy link
Contributor

I would consider talking with them to see if it makes sense in general to change that token icon and maybe ask @mdefazio too since he originally created this one.

This was part of a batch of icons we updated/created. Unfortunately the rationale as to the design choice here escapes me. Sorry for the lack of help here.

@andreadelrio
Copy link
Contributor Author

Ahh.. hmm, so it looks like the ES-UI team has already created this mapping of ES fields to token, using the old tokenKeyword for this use. https://github.com/elastic/kibana/blob/master/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/field_type_icon.tsx#L33

I would consider talking with them to see if it makes sense in general to change that token icon and maybe ask @mdefazio too since he originally created this one.

That mapping was made recently by @qn895 from ML. My understanding is that she's using tokenKeyword only as a temporary solution as we (and the Discover team) are in agreement that we need a better suited icon for the keyword field type.

It's been a bit hard to track down how these tokens were created in the first place. Based on my research the tokenKeyword was designed for the old Code application in Kibana, indicating that a word inside a source code you're viewing is a keyword (e.g. if, while, etc.). So it represents a different concept than the field type keyword hence the need for this new token.

Copy link
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

Searching in Kibana for tokenKeyword only returns what @cchaos indicated: https://github.com/elastic/kibana/blob/master/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/field_type_icon.tsx#L33

That mapping was made recently by @qn895 from ML. My understanding is that she's using tokenKeyword only as a temporary solution as we (and the Discover team) are in agreement that we need a better suited icon for the keyword field type.

If the new icon is better suited and the ML and Discover team are in agreement I would just replace the tokenKeyword with the new one.

@cchaos and @andreadelrio what do you think? Is there anything I'm not considering?

For the old token and because it looks like a tag. I would just rename it to tokenTag so we don't lose it.

@andreadelrio all the code and design look good to me. We just need to decide this and then it's good to merge.

@cchaos
Copy link
Contributor

cchaos commented Oct 13, 2021

I'm good with that approach, though I would consider it a breaking change (which is ok) because it will completely change an icon that others may be using because they wanted the tag-like looking one.

@qn895
Copy link
Member

qn895 commented Oct 13, 2021

My understanding is that she's using tokenKeyword only as a temporary solution

That's correct. It was a temporary switch until this one is merged in. We are happy with the swap to the new k token and I think it looks better aligned with other tokens we are currently using.

@andreadelrio andreadelrio changed the title [EuiToken] Add keywordType [EuiToken] Update tokenKeyword styles and rename old tokenKeyword as tokenTag Oct 13, 2021
@andreadelrio andreadelrio changed the title [EuiToken] Update tokenKeyword styles and rename old tokenKeyword as tokenTag [EuiToken] Update tokenKeyword and rename old tokenKeyword as tokenTag Oct 13, 2021
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5251/

Copy link
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

Thanks, @andreadelrio! Tested in Chrome, Safari, Edge, and Firefox, and LGTM! 🎉

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5251/

@cchaos
Copy link
Contributor

cchaos commented Oct 21, 2021

@andreadelrio Can you also be sure to add this to the Figma library as well?

@andreadelrio
Copy link
Contributor Author

@andreadelrio Can you also be sure to add this to the Figma library as well?

@cchaos will do!

ym pushed a commit to ym/eui that referenced this pull request Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request to add token for keyword field type
6 participants