Skip to content

Conversation

gibrown
Copy link
Member

@gibrown gibrown commented Oct 11, 2019

Implements a number of design tweaks that were suggested from the demo:

  • Gets rid of having multiple icons, but does potentially show a single one depending on the content or post type of the result. Hopefully this helps differentiate different types of results while not adding as much clutter.
  • Fixes html for the filters so it is all divs
  • adds left justify to fix issues with the zerif-lite theme
  • a bit of spacing between filter checkbox and the label
  • min-height for the results to try and prevent the page bouncing too much when you clear the search

Fixes some of the issues in #13391

Testing instructions:

  • Add define( "JETPACK_SEARCH_PROTOTYPE", true ); to your wp-config.php.
  • Ensure that your site has the Jetpack Pro plan and has Jetpack Search enabled.
  • Add a Jetpack Search widget to the Search page sidebar. (though I guess it should now work without this added at all)
  • Enter a query into a search widget. Alternatively, navigate to a search page like /?s=privacy.
  • The following code lets you test against any other site by adding this filter and then adding &blog_id=20115252 to your search page url (that is the jetpack.com blog_id). Also can dynamically set the theme with &theme=twentyten
function jp_instant_search_options( $options ) {
	if ( $_GET['blog_id'] ) {
		$options['siteId'] = (int) $_GET['blog_id'];
	}
	return $options;
}
add_filter( 'jetpack_instant_search_options', 'jp_instant_search_options' );

function filter_theme( $theme ) {
	if ( $_GET['theme'] ) {
		$theme = sanitize_key( $_GET['theme'] );
	}
	return $theme;
}
add_filter( 'stylesheet', 'filter_theme', 1 );
add_filter( 'template', 'filter_theme', 1 );

@gibrown gibrown requested a review from a team October 11, 2019 03:24
@gibrown gibrown self-assigned this Oct 11, 2019
@gibrown gibrown added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Oct 11, 2019
@gibrown gibrown requested review from jsnmoon and crunnells October 11, 2019 03:25
@gibrown
Copy link
Member Author

gibrown commented Oct 11, 2019

props @joanrho and @crunnells for a lot of the design feedback :)

Copy link
Contributor

@jsnmoon jsnmoon left a comment

Choose a reason for hiding this comment

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

Changes look good 👍

@gibrown gibrown merged commit 55325ab into instant-search-master Oct 12, 2019
@gibrown gibrown deleted the fix/instant-search-design-bugs branch October 12, 2019 14:55
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Needs Review This PR is ready for review. labels Oct 12, 2019
jsnmoon added a commit that referenced this pull request Oct 23, 2019
* Implement minimal search results and spelling correction (#13365)
* Add filtering display (#13371)
* Fix search result display bugs and make improvements (#13393)
* Add rudimentary support for filtering on post types (#13430)
* Add support for filtering on categories and tags (#13505)
* Add instant search sorting based on the URL (#13377)
* Add support for filtering on dates (#13545)
* Add custom taxonomy filtering (#13605)
* add sort widget (#13614)
* fix many theme incompatibilities (#13602)
* Add infinite scrolling (#13684)
* Add caching to the api requests (#13714)
* Clean up some design bugs/issues (#13721)
* Fix labels for post types when we have them. (#13750)
* Add localization and formatting of all dates (#13748)
* search from any page on the site (#13713)
* Hook up default options (inc. sort) (#13742)
* Add TrainTracks analytics (#13730)
* Create PostTypeIcon component (#13790)
* Upgrade to Preact 10 (#13794)
* Add comments component (#13797)
* Address review feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Search For all things related to Search
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants