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

KQL autocomplete cut off in visualize editor #73250

Closed
wants to merge 22 commits into from

Conversation

DianaDerevyankina
Copy link
Contributor

@DianaDerevyankina DianaDerevyankina commented Jul 27, 2020

Closes #70964

Made KQL autocomplete dropdown appear not cut off.

To make SuggestionsComponent able to open outside the accordion it was put into EuiPortal so now it's no longer cut off:

image

Also now the list opens up if there's not enough space below to fit

image

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@DianaDerevyankina DianaDerevyankina added Feature:Vis Editor Visualization editor issues v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Jul 27, 2020
@DianaDerevyankina DianaDerevyankina self-assigned this Jul 27, 2020
@DianaDerevyankina DianaDerevyankina added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Jul 29, 2020
@DianaDerevyankina DianaDerevyankina marked this pull request as ready for review July 29, 2020 10:24
@DianaDerevyankina DianaDerevyankina requested a review from a team July 29, 2020 10:24
@DianaDerevyankina DianaDerevyankina requested review from a team as code owners July 29, 2020 10:24
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@alexwizp
Copy link
Contributor

@lizozom @stratoula could you please have a look that?

@alexwizp
Copy link
Contributor

@dziyanadzeraviankina could you please add some screens how it works now?

@DianaDerevyankina
Copy link
Contributor Author

@alexwizp, sure, updated the description by adding some screens

@stratoula
Copy link
Contributor

@dziyanadzeraviankina thanx for that! Some initial findings:
When I resize kibana (for example in a mobile screen) and click on the filter field, the dropdown is not displayed correctly

Screenshot 2020-07-30 at 5 56 23 PM

On a bigger screen, I don't see the whole row (this existed before too)
Screenshot 2020-07-30 at 5 59 21 PM

I like that the list opens up when there is no space 💯


if (queryBarRect && kbnTypeaheadDiv) {
const documentHeight = document.documentElement.clientHeight || window.innerHeight;
const suggestionsListOffsetBottom = 20;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we could gather all the constants on a constants file. It will be cleaner I think and easier to find. As far as I can understand these are suggestionsListOffsetBottom , defaultMaxHeight and dropdownHeight

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@@ -60,6 +60,7 @@ interface Props {
onChangeQueryInputFocus?: (isFocused: boolean) => void;
onSubmit?: (query: Query) => void;
dataTestSubj?: string;
dropdownHeight?: string;
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 it would be better if we could override this setting via CSS in visualize editor, rather than pass it in as an argument, or at least somehow resolve this by passing in a custom class.
The QueryStringInput component is public API and I'd rather not add very specific properties to it.

@lizozom
Copy link
Contributor

lizozom commented Aug 3, 2020

Tested and fix works well, but see my comment.

@cchaos
Copy link
Contributor

cchaos commented Aug 4, 2020

Hi @dziyanadzeraviankina, I'm finding a few bugs with this new rendering mechanism.

  1. The dropdown placement is incorrect. It should only expand to the left and right bounds of the input, not all the way to the sides of the append and prepend buttons. What it looked like before and should still behave as:

Screen Shot 2020-08-04 at 15 51 24 PM

  1. I can get it into a state where the dropdown thinks it should be attached to the non-expanded size of the input by navigating to a different browser tab and back again.

Screen Shot 2020-08-04 at 15 51 33 PM

  1. I can no longer actually click on on item in the dropdown anymore, neither in the global header version or in the visualize instance.

Screen Recording 2020-08-04 at 03 54 42 PM


Would it help at all to use the EuInputPopover (see bottom of this page) to wrap the text field in which comes with all the positioning and is already wrapped in a portal.

Copy link
Contributor

@alexwizp alexwizp left a comment

Choose a reason for hiding this comment

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

needs more work

@alexwizp
Copy link
Contributor

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
data 543 +1 542

async chunks size

id value diff baseline
visualize 693.9KB +32.0B 693.8KB

page load bundle size

id value diff baseline
charts 873.9KB +32.0B 873.8KB
data 1.4MB +2.0KB 1.4MB
regionMap 832.7KB +32.0B 832.7KB
tileMap 844.3KB +32.0B 844.3KB
visTypeMarkdown 553.2KB +32.0B 553.2KB
visTypeMetric 576.3KB +32.0B 576.3KB
visTypeTable 605.1KB +32.0B 605.1KB
visTypeTagcloud 837.5KB +32.0B 837.5KB
visTypeTimelion 712.3KB +32.0B 712.3KB
visTypeVega 661.9KB +32.0B 661.8KB
visTypeVislib 1.3MB +32.0B 1.3MB
total +2.3KB

History

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

@DianaDerevyankina
Copy link
Contributor Author

Here's another solution to the issue with styled-components used #75557.

@DianaDerevyankina
Copy link
Contributor Author

Closing this pull request as for this issue was created another one with a better solution #75557

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Vis Editor Visualization editor issues release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KQL autocomplete cut off in visualize editor
8 participants