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

[Discover] Add field types in-product help #126657

Merged
merged 33 commits into from
Apr 11, 2022

Conversation

andreadelrio
Copy link
Contributor

@andreadelrio andreadelrio commented Mar 2, 2022

Summary

This is a follow-up to the work started in ON week.

  • Adds a help button next to the Filter by type dropdown. This button displays a popover with information about field types.

image

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:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@andreadelrio andreadelrio requested review from a team as code owners March 2, 2022 03:06
@andreadelrio andreadelrio requested a review from gchaps March 2, 2022 03:06
@andreadelrio andreadelrio self-assigned this Mar 2, 2022
@kertal
Copy link
Member

kertal commented Mar 2, 2022

@elasticmachine merge upstream

@cchaos
Copy link
Contributor

cchaos commented Mar 2, 2022

I 😍 this extra in-page documentation. I wonder if we can keep it around instead of allowing it to be dismissed? For instance, what if the Filter by type input had an append that triggers this popover? That way, as ES continues to add support for more field types, the user will always be able to find the full list. Maybe even add a popoer footer to a full docs page?
Screen Shot 2022-03-02 at 10 09 44 AM

@andreadelrio
Copy link
Contributor Author

I 😍 this extra in-page documentation. I wonder if we can keep it around instead of allowing it to be dismissed? For instance, what if the Filter by type input had an append that triggers this popover? That way, as ES continues to add support for more field types, the user will always be able to find the full list. Maybe even add a popoer footer to a full docs page? Screen Shot 2022-03-02 at 10 09 44 AM

I think this is a good idea! I was a bit worried about users dismissing the callout and not being able to access this info afterward. The filter dropdown currently uses EuiFilterButton which doesn't support an append. I've used EuiButtonIcon instead which I think works well too.

image

@gchaps what should we include in the footer?

@cchaos
Copy link
Contributor

cchaos commented Mar 2, 2022

☹️ These ragged lines are breaking my designer heart.
156453518-59ba0d58-9747-4bc3-9ea9-f0e1fd65e1a2

Instead of an append you could just turn it into a filter group and add another EuiFilterButton like so: https://codesandbox.io/s/youthful-bohr-uq8tnh?file=/demo.js
Screen Shot 2022-03-02 at 16 50 15 PM

@andreadelrio
Copy link
Contributor Author

@cchaos Thanks for the feedback. This is what I came up with. I had to resort to an EUI mixin (euiFocusBackground) to add a fill to the help button. Let me know if you know of a better way to achieve that.

image

@andreadelrio andreadelrio added release_note:skip Skip the PR/issue when compiling release notes v8.2.0 labels Mar 3, 2022
@elizabetdev
Copy link
Contributor

@andreadelrio @cchaos I just want to share some guidelines that we've been working on with @gchaps: Figma project.

It is still a work in progress but the idea is to have some guidelines to ensure consistency in the way we show product help across our products.

  • In our work in progress, the icon to this use case (documentation that opens in a popover) would be the documentation icon. Figma frame.
  • Because it's clickable it would show in a primary color.

Of course, these are only ideas we have... Still WIP. So feel free to ignore them and we can revisit them later on.

It would also be great to also have your thoughts on the guidelines. So feel free to add comments on the Figma project.

@andreadelrio
Copy link
Contributor Author

@andreadelrio @cchaos I just want to share some guidelines that we've been working on with @gchaps: Figma project.

It is still a work in progress but the idea is to have some guidelines to ensure consistency in the way we show product help across our products.

  • In our work in progress, the icon to this use case (documentation that opens in a popover) would be the documentation icon. Figma frame.
  • Because it's clickable it would show in a primary color.

Of course, these are only ideas we have... Still WIP. So feel free to ignore them and we can revisit them later on.

It would also be great to also have your thoughts on the guidelines. So feel free to add comments on the Figma project.

This is great @miukimiu ! Thanks for bringing it up. I actually think this could also fall under the Field description - long text category as we're not explaining how a feature works but providing info on the field types. This would be a new case to consider adding to our guidelines under that category: using an append.

On a separate note and following up on the background color which I added to try to mimic the behavior of EuiFormLayout's append. I wanted to point out that because of the way this is currently built when the EuiFilterButton on the left receives focus it gets a gray background that matches the color of the "append". I don't love how that looks. @cchaos Do you think this makes it worth considering adding proper prepend/append support for EuiFilterGroup? Especially considering we're developing guidelines for this type of in-product help.

Screen Recording 2022-03-03 at 12 08 33 PM

Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

Is this the complete list of field types? I thought there were more.

As for the footer, I agree that we should include a link to the ES docs.

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Great reference @miukimiu , thank you! We really should get those finalized.

I agree with @andreadelrio here though, that this isn't a "How this feature works" but more like a cheatsheet. I see it falling more under the category of Field description: Long content with formatting so probably just need to change this to an iInCircled icon.

@andreadelrio
Copy link
Contributor Author

@kertal I pushed some changes to hopefully clean up the code for the table and added a separate file to keep the description texts (now i18n ready). Do you think you can help me add pagination to it? 6 rows per page would be ideal and we don't need the "Rows per page" button.

@kertal
Copy link
Member

kertal commented Mar 4, 2022

@kertal I pushed some changes to hopefully clean up the code for the table and added a separate file to keep the description texts (now i18n ready). Do you think you can help me add pagination to it? 6 rows per page would be ideal and we don't need the "Rows per page" button.

Thx for this great work! For sure I can help, but more likely next week. There are also some "unknown" fields like "date_range" we should explain (after researching what they're doing)

@andreadelrio
Copy link
Contributor Author

@kertal I pushed some changes to hopefully clean up the code for the table and added a separate file to keep the description texts (now i18n ready). Do you think you can help me add pagination to it? 6 rows per page would be ideal and we don't need the "Rows per page" button.

Thx for this great work! For sure I can help, but more likely next week. There are also some "unknown" fields like "date_range" we should explain (after researching what they're doing)

@kertal awesome thanks! @gchaps is working on the remaining descriptions

@kertal
Copy link
Member

kertal commented Mar 14, 2022

@elasticmachine merge upstream

andreadelrio and others added 2 commits April 5, 2022 12:55
[Discover] Add field types in-product help: Scrolling instead of pagination
@andreadelrio
Copy link
Contributor Author

@kertal please let me know if it's possible to have links inside i18n.translate like @gchaps is asking.
@cchaos thanks for your comments and PR! It looks a lot better. I felt something off with the footer and your solution is perfect. I merged your PR and addressed the rest of your feedback.

@dimaanj
Copy link
Contributor

dimaanj commented Apr 6, 2022

@kertal please let me know if it's possible to have links inside i18n.translate like @gchaps is asking.

Yes, there is an example here.

i18n.translate('discover.advancedSettings.disableDocumentExplorerDescription', {
  defaultMessage:
    'To use the new {documentExplorerDocs} instead of the classic view, turn off this option. ' +
    'The Document Explorer offers better data sorting, resizable columns, and a full screen view.',
  values: {
    documentExplorerDocs:
      `<a href=${docLinks.links.discover.documentExplorer}
        target="_blank" rel="noopener">` +
      i18n.translate('discover.advancedSettings.documentExplorerLinkText', {
        defaultMessage: 'Document Explorer',
      }) +
      '</a>',
  },
});

@kertal
Copy link
Member

kertal commented Apr 6, 2022

@kertal please let me know if it's possible to have links inside i18n.translate like @gchaps is asking.

Just wanted to add to @dmitriynj suggestion, there's another way to do it, using react components in the values property:

<FormattedMessage
id="discover.docExplorerUpdateCallout.bodyMessage"
defaultMessage="Experience the new {documentExplorer}. Understand the shape of your data with {fieldStatistics}."
values={{
fieldStatistics: (
<span css={semiBoldStyle}>
<FormattedMessage
id="discover.docExplorerUpdateCallout.fieldStatistics"
defaultMessage="Field Statistics"
/>
</span>
),
documentExplorer: (
<span css={semiBoldStyle}>
<FormattedMessage

FYI @jughosta , sharing i18n knowledge that's not obvious

Comment on lines 112 to 115
const { curPageIndex, pageSize, totalPages, startIndex, changePageIndex } = usePager({
initialPageSize: FIELD_TYPES_PER_PAGE,
totalItems: presentFieldTypes.length,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the pagination component is removed now, there's a lot of logic/variables you don't need either.

andreadelrio and others added 2 commits April 6, 2022 13:16
@kertal
Copy link
Member

kertal commented Apr 7, 2022

@elasticmachine merge upstream

@kertal kertal self-requested a review April 7, 2022 15:39
Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Code LGTM, this is great especially for users starting with Kibana and ES, also of course for all others 🎉 . Discover is now supporting better understanding of Elasticsearch basics.

Tested locally using Safari, Firefox, Chrome, works as expected. Last thing I wondered, was the font-size in the mobile view, which seems to be large. But this might be right this way, for mobile users targeting better readability. So not a blocker, just an observation:
Bildschirmfoto 2022-04-07 um 17 37 20

@andreadelrio
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

LGTM!!

@andreadelrio andreadelrio requested a review from cchaos April 11, 2022 06:24
Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Looks great!

@andreadelrio
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
discover 445 446 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 400.7KB 406.8KB +6.0KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 318.9KB 319.0KB +120.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
discover 35 36 +1

Total ESLint disabled count

id before after diff
discover 37 38 +1

History

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

cc @andreadelrio

@andreadelrio andreadelrio merged commit f032bbb into elastic:main Apr 11, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 11, 2022
@kertal kertal added the Feature:Discover Discover Application label Apr 19, 2022
@tylersmalley tylersmalley added ci:cloud-deploy Create or update a Cloud deployment and removed ci:deploy-cloud labels Aug 17, 2022
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 ci:cloud-deploy Create or update a Cloud deployment Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants