-
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] Use accordion menus in field list for available and empty fields #68871
[Lens] Use accordion menus in field list for available and empty fields #68871
Conversation
369e077
to
d8e3cec
Compare
@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. 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. 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. @KOTungseth Here are a bunch of screenshots where text has been updated. Perhaps you can do a quick pass? ^^ That one, not shown, is that I've applied a global filter from the KQL bar |
Hi @cchaos thank you for all the feedback! In order with points:
Paddings inside accordion: The black area is outside of the browser and I am already at the bottom of scroll:
|
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
|
@elasticmachine merge upstream |
@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. |
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.
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]); |
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 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" /> |
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 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.
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 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
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.
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; |
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.
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> |
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.
Both accordions seem to share a lot of common code: it might not be worth it, but can these be made into a function?
@elasticmachine merge upstream |
@cchaos is this good enough? @wylieconlon I addressed all your comments if you want to take a look again :) |
5e69375
to
65451f0
Compare
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.
Changes LGTM!
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.
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.
<EuiFlexGroup justifyContent="spaceAround"> | ||
<EuiFlexItem grow={false}> | ||
<EuiLoadingSpinner size="m" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> |
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.
Is the flex group here necessary? Usually they're only useful when you have more than 1 item.
++ To @flash1293's suggestions around loading. |
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! 👍
We don't use the smartest flag to indicate the data is loaded so I'd leave it outside of this PR. |
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
History
To update your PR or re-run it, just comment with: |
* 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) ...
…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) ...
Summary
Fixes #67203
Checklist
Delete any items that are not applicable to this PR.
For maintainers