8000 [MRG+1] Added v2 Custom Search API and fixed css placement for search box by Trion129 · Pull Request #8542 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG+1] Added v2 Custom Search API and fixed css placement for search box #8542

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

Merged
merged 5 commits into from
Mar 12, 2017

Conversation

Trion129
Copy link
Contributor
@Trion129 Trion129 commented Mar 6, 2017

Reference Issue

Fixes #8388

What does this implement/fix? Explain your changes.

I changed the old Custom Search API with v2 as the one used currently was deprecated. That fixed the Powered by Google. This caused wrong placement of search box though, so I changed the earlier value in css to fix the positioning.

@GaelVaroquaux GaelVaroquaux changed the title Added v2 Custom Search API and fixed css placement for search box [MRG+1] Added v2 Custom Search API and fixed css placement for search box Mar 6, 2017
@GaelVaroquaux
Copy link
Member

This looks much better than what is on master.

+1 for merge!

To help another reviewer, here is the link to the website generated by circleCI:
https://9334-843222-gh.circle-artifacts.com/0/home/ubuntu/scikit-learn/doc/_build/html/stable/index.html

@jnothman
Copy link
Member
jnothman commented Mar 6, 2017

I'm getting a very buggy rendering in Chrome. The search box is half off the screen (vertically) and "powered by Google" floats over the navbar ("Home" et al) the whole time.

@GaelVaroquaux
Copy link
Member

I am seeing the same now. Strangely, I am pretty that I did not see this when I did the initial review.

I am removing my +1 until we figure out what is happening.

@GaelVaroquaux GaelVaroquaux changed the title [MRG+1] Added v2 Custom Search API and fixed css placement for search box [MRG] Added v2 Custom Search API and fixed css placement for search box Mar 6, 2017
@lesteve
Copy link
Member
lesteve commented Mar 6, 2017

To help another reviewer, here is the link to the website generated by circleCI:
https://9334-843222-gh.circle-artifacts.com/0/home/ubuntu/scikit-learn/doc/_build/html/stable/index.html

😕 I am still seeing the original problem, what I am missing ? Here is a snapshot:
google-search

I tried to generate the doc locally to make sure this was not a CircleCI quirk and I still see the same issue as well ...

@Trion129
Copy link
Contributor Author
Trion129 commented Mar 7, 2017

This is really weird 😅 It is as if Google changed the api's working within a day.

@jnothman
Copy link
Member
jnothman commented Mar 7, 2017 via email

@GaelVaroquaux
Copy link
Member

I can get a somewhat decent formating with the following CSS:

.search_form {
    margin-top: -35px;
    min-height: 42px;
    max-width: 19em;
    margin-left: auto;
    margin-bottom: -5px;
}

It should be more robust than what we had before.

@@ -219,10 +219,6 @@ div.navbar div.nav-icon {
width: 50px;
}

.gsc-branding {
display: none;
Copy link
Member

Choose a reason for hiding this comment

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

In order to remove "Powered by Google", keep this section and add !important at the end of this line. From what I can gather Google his adding its own CSS dynamically and we want our own CSS to prevail. Adding !important is one way to ensure that.

@Trion129
Copy link
Contributor Author
Trion129 commented Mar 7, 2017

Added the !important and changed values for css for a bit prettier solution.
🤔 what messed up Google custom search suddenly is still a mystery

@lesteve
Copy link
Member
lesteve commented Mar 7, 2017

Link to the generated doc: http://scikit-learn.org/circle?9369

@lesteve
Copy link
Member
lesteve commented Mar 7, 2017

LGTM.

It would be great to fix the vertical misalignment of the input box and the search button in a separate PR !

@lesteve lesteve changed the title [MRG] Added v2 Custom Search API and fixed css placement for search box [MRG+1] Added v2 Custom Search API and fixed css placement for search box Mar 7, 2017
@lesteve
Copy link
Member
lesteve commented Mar 8, 2017

😕 it looks like something has changed now and the text color in the "Search" button is white.

There seems to be a way to disable additional css, e.g. from:
https://developers.google.com/loader/#DetailedDocumentation

I think this is worth investigating.

@lesteve lesteve changed the title [MRG+1] Added v2 Custom Search API and fixed css placement for search box [MRG] Added v2 Custom Search API and fixed css placement for search box Mar 8, 2017
@Trion129
Copy link
Contributor Author
Trion129 commented Mar 8, 2017

😅 Google reverted the changes that happened last time.... 😓
Seems like they had reverted to old version of cse for a day and then fixed it back, I went back to old commit and it looks good
https://9334-843222-gh.circle-artifacts.com/0/home/ubuntu/scikit-learn/doc/_build/html/stable/index.html

The disabling of css won't work as google loader is not used for the cse v2. There is a way to load results from a custom form
http://stackoverflow.com/a/26933495
but that will put a query in the url, so if user refreshes page, the results would stay there unless he presses back button which doesn't seem natural for a user to do.

@lesteve
Copy link
Member
lesteve commented Mar 8, 2017

Google reverted the changes that happened last time.... 😓

In any case we need to find a way to be robust against this kind of changes ...

@GaelVaroquaux
Copy link
Member
GaelVaroquaux commented Mar 8, 2017 via email

@Trion129
Copy link
Contributor Author
Trion129 commented Mar 8, 2017

I am thinking of making a custom implementation for as much css as possible and override them all. That would make the search more reliable on styling even if google changes it

@codecov
Copy link
codecov bot commented Mar 8, 2017

Codecov Report

Merging #8542 into master will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           master   #8542      +/-   ##
=========================================
+ Coverage   95.48%   95.5%   +0.01%     
=========================================
  Files         342     342              
  Lines       61000   61207     +207     
=========================================
+ Hits        58246   58454     +208     
+ Misses       2754    2753       -1
Impacted Files Coverage Δ
sklearn/feature_selection/univariate_selection.py 99.46% <0%> (ø)
sklearn/utils/estimator_checks.py 93.36% <0%> (+0.08%)
sklearn/ensemble/gradient_boosting.py 96.88% <0%> (+1.09%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5135c56...fc43dd4. Read the comment docs.

@Trion129
Copy link
Contributor Author
Trion129 commented Mar 8, 2017

I settled values in middle of old and new so it still looks ok if google randomly changed response to old api. 😛 Added Sklearn color to the search button and it looks very cool!

@GaelVaroquaux I didn't use max-width as results and search box are in same div so that made the result enclosed in a small box of 19em width.

@jnothman
Copy link
Member
jnothman commented Mar 9, 2017

Issues:

  • there remains some vertical offset (in Chrome) between the search box and the button. Removing bootstrap's input[type="text"] { margin-bottom: 10px } declaration helps. But after doing that, the button now looks like it is 1px smaller vertically than the search box.
  • I'm not sure I like the blue border around the button.
  • If we are copying the scikit-learn style for the button, we should also make the corners more rounded.
  • at the bottom of the search results is the page selector (search, for instance, for "model"), which is altogether poorly styled, but the "current page" indicator (.gsc-cursor-current-page) is illegible due to low contrast between background and foreground colour.
  • search results are overall very grey

@lesteve
Copy link
Member
lesteve commented Mar 9, 2017

I am not a CSS expert but the result LGTM

Link:
https://scikit-learn.org/circle?9413

snapshot (on Firefox):
search

@lesteve lesteve changed the title [MRG] Added v2 Custom Search API and fixed css placement for search box [MRG+1] Added v2 Custom Search API and fixed css placement for search box Mar 9, 2017
@agramfort
Copy link
Member

LGTM

@raghavrv raghavrv merged commit e548ea6 into scikit-learn:master Mar 12, 2017
@raghavrv
Copy link
Member

Thanks @Trion129 :)

@raghavrv
Copy link
Member

Link:
https://scikit-learn.org/circle?9413

This is a cool way to reference the result...

@raghavrv
Copy link
Member

(@jnothman I merged it as all the mentioned issues have been fixed in the latest commit)

@jnothman
Copy link
Member
jnothman commented Mar 12, 2017 via email

@Przemo10 Przemo10 mentioned this pull request Mar 17, 2017
herilalaina pushed a commit to herilalaina/scikit-learn that referenced this pull request Mar 26, 2017
… box (scikit-learn#8542)

* Added v2 Custom Search API and fixed css placement for search box

* Tweaked CSS and hid the branding section

* Button made cute and override some css to make it look good for old api and new api alike

* Better button placement

* Colored the search results and pagination section
@thundergolfer
Copy link

Still seeing this issue, and agree that it is confusing.

@Trion129
Copy link
Contributor Author

https://scikit-learn.org/circle?9413 is looking good though 😅

@lesteve
Copy link
Member
lesteve commented Apr 21, 2017

Still seeing this issue, and agree that it is confusing.

@thundergolfer the issue should be fixed in the dev doc: http://scikit-learn.org/dev.

massich pushed a commit to massich/scikit-learn that referenced this pull request Apr 26, 2017
… box (scikit-learn#8542)

* Added v2 Custom Search API and fixed css placement for search box

* Tweaked CSS and hid the branding section

* Button made cute and override some css to make it look good for old api and new api alike

* Better button placement

* Colored the search results and pagination section
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
… box (scikit-learn#8542)

* Added v2 Custom Search API and fixed css placement for search box

* Tweaked CSS and hid the branding section

* Button made cute and override some css to make it look good for old api and new api alike

* Better button placement

* Colored the search results and pagination section
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
… box (scikit-learn#8542)

* Added v2 Custom Search API and fixed css placement for search box

* Tweaked CSS and hid the branding section

* Button made cute and override some css to make it look good for old api and new api alike

* Better button placement

* Colored the search results and pagination section
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
… box (scikit-learn#8542)

* Added v2 Custom Search API and fixed css placement for search box

* Tweaked CSS and hid the branding section

* Button made cute and override some css to make it look good for old api and new api alike

* Better button placement

* Colored the search results and pagination section
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
… box (scikit-learn#8542)

* Added v2 Custom Search API and fixed css placement for search box

* Tweaked CSS and hid the branding section

* Button made cute and override some css to make it look good for old api and new api alike

* Better button placement

* Colored the search results and pagination section
jwjohnson314 pushed a commit to jwjohnson314/scikit-learn that referenced this pull request Dec 18, 2017
… box (scikit-learn#8542)

* Added v2 Custom Search API and fixed css placement for search box

* Tweaked CSS and hid the branding section

* Button made cute and override some css to make it look good for old api and new api alike

* Better button placement

* Colored the search results and pagination section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"powered by Google" from search bar appears in confusing position
7 participants
0