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

[Lens] Use accordion menus in field list for available and empty fields #68871

Merged
merged 35 commits into from
Jun 26, 2020

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Jun 11, 2020

Summary

Fixes #67203

  • check copy for warning messages with @cchaos

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@mbondyra mbondyra force-pushed the lens/fielditems_empty_accordion branch from 369e077 to d8e3cec Compare June 11, 2020 12:32
- Changed Field Filters component (once again)
- Fixed some overflows of accordions
@cchaos
Copy link
Contributor

cchaos commented Jun 11, 2020

@mbondyra This PR is fantastic! I didn't really have much design feedback, though I've been making more decisions on the Field filter button that I implemented. Here's a PR4U: mbondyra#1

Other than that I just have some lingering questions we probably need to answer.

1. Should we also align the list of fields in the config panel?

Meaning, use the same heading "Available fields" instead of "Individual fields" and should we include fields without data? Right now that list restricts to showing only the fields with dat.

Screen Shot 2020-06-11 at 16 54 24 PM

2. Callout in the "Empty fields" section too?

When the empty fields section doesn't have any fields to show (usually because of some filters being applied) I think we need to show the callout in there as well.

Screen Shot 2020-06-11 at 16 06 03 PM

3. Records item bug?

Not sure if this stems from this PR, but before I change any filters, the "Records" item is white indicating data. However, when I filter to only show the "Records" field type, it changes to look like it doesn't have any data.

Screen Shot 2020-06-11 at 16 00 31 PM


@KOTungseth Here are a bunch of screenshots where text has been updated. Perhaps you can do a quick pass?

Screen Shot 2020-06-11 at 16 32 10 PM

Screen Shot 2020-06-11 at 16 31 56 PM

Screen Shot 2020-06-11 at 16 06 03 PM

^^ That one, not shown, is that I've applied a global filter from the KQL bar

@mbondyra
Copy link
Contributor Author

mbondyra commented Jun 12, 2020

Hi @cchaos thank you for all the feedback! In order with points:

  1. I've merged your PR, thank you for that. I only have one concern with EuiSpacer removal. That causes the last element in accordion being cut. Also, when testing on macbook 13' screen, I looks like it'd be nice to add some margin in the bottom (I added <EuiSpacer size=l/> but let me know your thoughts!). Screenshots below:

Paddings inside accordion:

The black area is outside of the browser and I am already at the bottom of scroll:
3.

  1. Done!
  2. Yes, that's a good point, I'll add it in my next PR. Just one question: what happens if we have 50 available fields and 0 empty? Should we show callout for empty fields in this situation?
  3. The bug was here before - it happens when the list of normal fields is empty (so we have no data) but it respects already filtered fields - I corrected it to respect fields before filtering. @wylieconlon can you confirm that the logic for special fields(so far records)?

@cchaos
Copy link
Contributor

cchaos commented Jun 12, 2020

  1. Wow good catch, I did not notice that all since it also seems really odd that it would behave that way. But found that adding padding to the accordion child wrapper directly was what was causing this. I think it will be slightly easier to manage with padding. Another PR coming your way.

  2. I think we can use the same message as the Available fields
    image

I also just saw you added a specific bullet for when there's text in the search box for the fields list. I think this is confusing since it sounded like it was talking about the global filters. I think you can use the same text as the "field filters" option

Screen Shot 2020-06-12 at 11 32 06 AM

  1. Thanks! Much better now

  2. I think I'm walking back my idea to auto-expand all the sections when the user has added a filter or search. I think it could be annoying to the user to keep having to re-close any they don't care to see. I think the notification badge with the count should be enough to indicate that the lists have been filtered.

@mbondyra
Copy link
Contributor Author

@elasticmachine merge upstream

@mbondyra mbondyra marked this pull request as ready for review June 15, 2020 13:40
@mbondyra mbondyra requested a review from a team June 15, 2020 13:40
@mbondyra mbondyra requested a review from a team as a code owner June 15, 2020 13:40
@mbondyra mbondyra added Feature:Lens release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.9.0 v8.0.0 labels Jun 15, 2020
@mbondyra
Copy link
Contributor Author

mbondyra commented Jun 18, 2020

@wylieconlon thanks so much for paying attention to this one! I've optimized some data transformation I put in wrong places and I've wrapped the FieldItem with debouncedComponent so it rerenders when user stops typing and not on every keystroke. In the end I managed to speed things up compared to master.

After:

Before (master):

@elastic elastic deleted a comment from kibanamachine Jun 18, 2020
Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

Overall LGTM- the performance is significantly improved compared to master, and the UX is better too. Good job!

} else return 'emptyFields';
}),
};
}, [allFields, existingFields[currentIndexPattern.title], currentIndexPattern]);
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 that if we enable the linting rules for hooks, this would complain about missing an explicit dependency on hasSyncedExistingFields and defaultFieldGroups

<EuiSpacer size="m" />
<EuiFlexGroup justifyContent="spaceAround">
<EuiFlexItem grow={false}>
<EuiLoadingSpinner size="m" />
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the loading spinner, but we already had a loading indicator on the entire panel for this. This now creates two indicators for the same thing. I'm okay with it, but I do think @cchaos should opine.

Screenshot 2020-06-18 14 56 41

Copy link
Contributor Author

@mbondyra mbondyra Jun 18, 2020

Choose a reason for hiding this comment

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

I completely agree - that's why I named the commit 'controversial spinner' :D
I was trying to find a solution for the problem we currently have - glitch of NoFieldsCallout before existing fields are loaded, but I wanted to talk about it during sync. Video from the 7.8 cloud version, simulated 3g network below:
https://www.loom.com/share/3c398f5296be4cf3a89755041300e8d8

Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of replacing the accordion content with the spinner, can you replace the notification count instead? This will better indicate that the number of fields is being updated as well.

if (scrollContainer) {
const nearBottom =
scrollContainer.scrollTop + scrollContainer.clientHeight >
scrollContainer.scrollHeight * 0.9;
Copy link
Contributor

Choose a reason for hiding this comment

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

Scroll performance is significantly better in this update, but I would identify this function as an area of concern: it's reading DOM attributes like scrollTop which can be slow. It's possible that this function needs to be debounced, since scroll events on browsers like Chrome can happen within milliseconds of each other.

</EuiCallOut>
)}
)}
</EuiAccordion>
Copy link
Contributor

Choose a reason for hiding this comment

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

Both accordions seem to share a lot of common code: it might not be worth it, but can these be made into a function?

@mbondyra
Copy link
Contributor Author

@elasticmachine merge upstream

@mbondyra
Copy link
Contributor Author

@cchaos is this good enough?

@wylieconlon I addressed all your comments if you want to take a look again :)

@mbondyra mbondyra force-pushed the lens/fielditems_empty_accordion branch from 5e69375 to 65451f0 Compare June 25, 2020 13:38
Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

Changes LGTM!

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 to me! Thank you @mbondyra! I know that was quite a few rounds of design input. But this is such a better experience overall.

I had just one last question with the loading icon, but approving whatever the answer is.

Comment on lines 86 to 90
<EuiFlexGroup justifyContent="spaceAround">
<EuiFlexItem grow={false}>
<EuiLoadingSpinner size="m" />
</EuiFlexItem>
</EuiFlexGroup>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the flex group here necessary? Usually they're only useful when you have more than 1 item.

@flash1293
Copy link
Contributor

This looks almost perfect to me, thanks for the great work. I noticed one thing by setting the network latency to super high:
slow_switch

  • Spinner is not shown while the index pattern saved object itself is loaded (probably not relevant for real world use cases because this query is normally very fast)
  • While the field existence data is fetched, the "no data" callout is shown - seems like we want to hide that while the fetch is ongoing? (this is more noticable, especially when hitting more data)

Both aren't blockers for me to merge.

@cchaos
Copy link
Contributor

cchaos commented Jun 26, 2020

++ To @flash1293's suggestions around loading.

@mbondyra
Copy link
Contributor Author

While the field existence data is fetched, the "no data" callout is shown - seems like we want to hide that while the fetch is ongoing? (this is more noticable, especially when hitting more data)

Yep, I saw that too and tried to make it better - I replaced it with spinner that then I moved after design review to replace the number of fields. I thought we want the callout to stay 🙈 I am much happier with removing it when things are not loaded! 👍

Spinner is not shown while the index pattern saved object itself is loaded (probably not relevant for real world use cases because this query is normally very fast)

We don't use the smartest flag to indicate the data is loaded so I'd leave it outside of this PR.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
lens 83 +5 78

History

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

@mbondyra mbondyra merged commit 7440eea into elastic:master Jun 26, 2020
@mbondyra mbondyra deleted the lens/fielditems_empty_accordion branch June 26, 2020 16:43
mbondyra added a commit to mbondyra/kibana that referenced this pull request Jun 26, 2020
mbondyra added a commit that referenced this pull request Jun 27, 2020
…ds (#68871) (#70095)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 29, 2020
* master: (59 commits)
  [Lens] Fix broken test (elastic#70117)
  [SIEM] Import timeline fix (elastic#65448)
  [SECURITY SOLUTION][INGEST] UX update for ingest manager edit/create datasource for endpoint (elastic#70079)
  [Telemetry] Collector Schema (elastic#64942)
  [Endpoint] Add Endpoint empty states for onboarding (elastic#69626)
  Hide unused resolver buttons (elastic#70112)
  [Security] `Investigate in Resolver` Timeline Integration (elastic#70111)
  [Discover] Improve styling of graphs in sidebar (elastic#69440)
  [Metrics UI] Fix EuiTheme type issue (elastic#69735)
  skip failing suite (elastic#70104) (elastic#70103)
  [ENDPOINT] Hide the Timeline Flyout while on the Management Pages (elastic#69998)
  [SIEM][CASE] Persist callout when dismissed (elastic#68372)
  [SIEM][Exceptions] - Cleaned up and updated exception list item comment structure (elastic#69532)
  [Maps] remove indexing state from redux (elastic#69765)
  Add API integration test for deleting data streams. (elastic#70020)
  renames SIEM to Security Solution (elastic#70070)
  Adding saved_objects_page in OSS (elastic#69900)
  [Lens] Use accordion menus in field list for available and empty fields (elastic#68871)
  Dynamic uiActions & license support (elastic#68507)
  [SIEM] Update readme for timeline apis (elastic#67038)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 29, 2020
…bana into alerting/consumer-based-rbac

* 'alerting/consumer-based-rbac' of github.com:gmmorris/kibana: (25 commits)
  [Lens] Fix broken test (elastic#70117)
  [SIEM] Import timeline fix (elastic#65448)
  [SECURITY SOLUTION][INGEST] UX update for ingest manager edit/create datasource for endpoint (elastic#70079)
  [Telemetry] Collector Schema (elastic#64942)
  [Endpoint] Add Endpoint empty states for onboarding (elastic#69626)
  Hide unused resolver buttons (elastic#70112)
  [Security] `Investigate in Resolver` Timeline Integration (elastic#70111)
  [Discover] Improve styling of graphs in sidebar (elastic#69440)
  [Metrics UI] Fix EuiTheme type issue (elastic#69735)
  skip failing suite (elastic#70104) (elastic#70103)
  [ENDPOINT] Hide the Timeline Flyout while on the Management Pages (elastic#69998)
  [SIEM][CASE] Persist callout when dismissed (elastic#68372)
  [SIEM][Exceptions] - Cleaned up and updated exception list item comment structure (elastic#69532)
  [Maps] remove indexing state from redux (elastic#69765)
  Add API integration test for deleting data streams. (elastic#70020)
  renames SIEM to Security Solution (elastic#70070)
  Adding saved_objects_page in OSS (elastic#69900)
  [Lens] Use accordion menus in field list for available and empty fields (elastic#68871)
  Dynamic uiActions & license support (elastic#68507)
  [SIEM] Update readme for timeline apis (elastic#67038)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Use accordion menus in field list to fix the "where are my fields" problem
7 participants