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

[Code] Search results are fixed to top of page #45182

Merged
merged 7 commits into from
Sep 11, 2019

Conversation

rylnd
Copy link
Contributor

@rylnd rylnd commented Sep 9, 2019

Summary

elastic/code#1606

  • Project page: Allow scrolling of main content while search results remain fixed
  • Search suggestions: overflowing text is truncated

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

Since this is my first PR:

  • Add missing labels (versions)
  • Assign reviewers

For maintainers

@rylnd rylnd added Team:Code release_note:skip Skip the PR/issue when compiling release notes labels Sep 9, 2019
@rylnd rylnd requested a review from mw-ding September 9, 2019 18:46
@rylnd rylnd requested a review from a team as a code owner September 9, 2019 18:46
@elasticmachine
Copy link
Contributor

Pinging @elastic/code

@rylnd rylnd changed the title Fixed position main searchbar [Code] Search results are fixed to top of page Sep 9, 2019
Copy link
Contributor

@mw-ding mw-ding left a comment

Choose a reason for hiding this comment

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

LGTM. @daveyholler can you take a look on the design's end?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@rylnd
Copy link
Contributor Author

rylnd commented Sep 9, 2019

@daveyholler @WangQianliang since this is my first PR to kibana, any and all comments are greatly appreciated.

@@ -171,12 +171,12 @@
white-space: nowrap;
}

.codeSearch__suggestion-text-container {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing this code has been around for a while, but we should be using snake case in these instances rather than hyphens: codeSearch__suggestionTextContainer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I noticed some inconsistencies with BEM classes here; I'm happy to change that. Should I leave the existing classes for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

7b4f233

@rylnd rylnd force-pushed the fixed-position-main-searchbar branch from 6cdeb8a to ba5f91a Compare September 10, 2019 17:44
@elasticmachine
Copy link
Contributor

💔 Build Failed

@spalger
Copy link
Contributor

spalger commented Sep 10, 2019

Please merge master

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

By allowing overflow on the main content, we implicitly fix the sibling
search bar in position.

elastic/code#1606
This gives the parent element a width, so that our text-overflow
rules apply to these elements.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1086218#c4 for details
on the issue.
If both the icon and the text are allowed to grow/shrink as needed,
flexbox will grow truncated text based on its original width, leading to
subtle sub-pixel alignment issues with other rows.

By fixing the icon to a specific width, we can ensure that the
suggestion text does not grow too big.
We don't need to flex these elements currently as they contain either no
children or inline elements only.
Without this directive on the parent, it had no width or flex growth and
didn't respect the parent width. This allows it to take on the correct
flexed width, and thus take on the overflow rules.
We have an overriding align-items declaration immediately after this
one.
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@rylnd rylnd force-pushed the fixed-position-main-searchbar branch from 62bd14f to 9d25daf Compare September 10, 2019 20:57
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@rylnd rylnd merged commit 98b652b into elastic:master Sep 11, 2019
@rylnd rylnd deleted the fixed-position-main-searchbar branch September 11, 2019 18:27
rylnd added a commit to rylnd/kibana that referenced this pull request Sep 11, 2019
* Fix main search bar to top of screen

By allowing overflow on the main content, we implicitly fix the sibling
search bar in position.

elastic/code#1606

* Allow search suggestion text to be truncated

This gives the parent element a width, so that our text-overflow
rules apply to these elements.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1086218#c4 for details
on the issue.

* Fix alignment issue with overflowed search suggestions

If both the icon and the text are allowed to grow/shrink as needed,
flexbox will grow truncated text based on its original width, leading to
subtle sub-pixel alignment issues with other rows.

By fixing the icon to a specific width, we can ensure that the
suggestion text does not grow too big.

* Remove unneeded CSS

We don't need to flex these elements currently as they contain either no
children or inline elements only.

* style: prefer camelCase element names over hyphens

* Fix search result suggestion overflow on IE

Without this directive on the parent, it had no width or flex growth and
didn't respect the parent width. This allows it to take on the correct
flexed width, and thus take on the overflow rules.

* Remove unused CSS rule

We have an overriding align-items declaration immediately after this
one.
rylnd added a commit to rylnd/kibana that referenced this pull request Sep 11, 2019
* Fix main search bar to top of screen

By allowing overflow on the main content, we implicitly fix the sibling
search bar in position.

elastic/code#1606

* Allow search suggestion text to be truncated

This gives the parent element a width, so that our text-overflow
rules apply to these elements.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1086218#c4 for details
on the issue.

* Fix alignment issue with overflowed search suggestions

If both the icon and the text are allowed to grow/shrink as needed,
flexbox will grow truncated text based on its original width, leading to
subtle sub-pixel alignment issues with other rows.

By fixing the icon to a specific width, we can ensure that the
suggestion text does not grow too big.

* Remove unneeded CSS

We don't need to flex these elements currently as they contain either no
children or inline elements only.

* style: prefer camelCase element names over hyphens

* Fix search result suggestion overflow on IE

Without this directive on the parent, it had no width or flex growth and
didn't respect the parent width. This allows it to take on the correct
flexed width, and thus take on the overflow rules.

* Remove unused CSS rule

We have an overriding align-items declaration immediately after this
one.
rylnd added a commit that referenced this pull request Sep 11, 2019
* Fix main search bar to top of screen

By allowing overflow on the main content, we implicitly fix the sibling
search bar in position.

elastic/code#1606

* Allow search suggestion text to be truncated

This gives the parent element a width, so that our text-overflow
rules apply to these elements.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1086218#c4 for details
on the issue.

* Fix alignment issue with overflowed search suggestions

If both the icon and the text are allowed to grow/shrink as needed,
flexbox will grow truncated text based on its original width, leading to
subtle sub-pixel alignment issues with other rows.

By fixing the icon to a specific width, we can ensure that the
suggestion text does not grow too big.

* Remove unneeded CSS

We don't need to flex these elements currently as they contain either no
children or inline elements only.

* style: prefer camelCase element names over hyphens

* Fix search result suggestion overflow on IE

Without this directive on the parent, it had no width or flex growth and
didn't respect the parent width. This allows it to take on the correct
flexed width, and thus take on the overflow rules.

* Remove unused CSS rule

We have an overriding align-items declaration immediately after this
one.
rylnd added a commit that referenced this pull request Sep 11, 2019
* Fix main search bar to top of screen

By allowing overflow on the main content, we implicitly fix the sibling
search bar in position.

elastic/code#1606

* Allow search suggestion text to be truncated

This gives the parent element a width, so that our text-overflow
rules apply to these elements.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1086218#c4 for details
on the issue.

* Fix alignment issue with overflowed search suggestions

If both the icon and the text are allowed to grow/shrink as needed,
flexbox will grow truncated text based on its original width, leading to
subtle sub-pixel alignment issues with other rows.

By fixing the icon to a specific width, we can ensure that the
suggestion text does not grow too big.

* Remove unneeded CSS

We don't need to flex these elements currently as they contain either no
children or inline elements only.

* style: prefer camelCase element names over hyphens

* Fix search result suggestion overflow on IE

Without this directive on the parent, it had no width or flex growth and
didn't respect the parent width. This allows it to take on the correct
flexed width, and thus take on the overflow rules.

* Remove unused CSS rule

We have an overriding align-items declaration immediately after this
one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.5.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants