Skip to content

Instant search: add post type icon component#13790

Merged
bluefuton merged 1 commit intoinstant-search-masterfrom
instant-search-post-type-icon-component
Oct 21, 2019
Merged

Instant search: add post type icon component#13790
bluefuton merged 1 commit intoinstant-search-masterfrom
instant-search-post-type-icon-component

Conversation

@bluefuton
Copy link
Copy Markdown
Contributor

@bluefuton bluefuton commented Oct 21, 2019

Changes proposed in this Pull Request:

We currently show a post type icon alongside search results in the Jetpack Instant Search prototype.

Screen Shot 2019-10-21 at 15 39 18

This is currently part of the 'minimal search result' component. As we expand to offer different search results styles (like products - see #13774), we need to reuse this icon in different spots. This PR moves the rendering of a post type icon into a separate Preact component so it can be shared.

Is this a new feature or does it add/remove features to an existing part of Jetpack?

This is primarily a refactor of existing functionality. I've added one improvement - posts with multiple images now receive the same icon as posts containing a gallery.

Testing instructions:

  • Add define( "JETPACK_SEARCH_PROTOTYPE", true ); to your wp-config.php.
    If using Jetpack's Docker development environment, you can create a file at /docker/mu-plugins/instant-search.php and add the define there.

  • Ensure that your site has the Jetpack Pro plan and Jetpack Search enabled.
    You can enable Jetpack Search in the Performance tab within the Jetpack menu (/wp-admin/admin.php?page=jetpack#/performance).

  • Perform a search and make sure the correct icon is applied for various results. For example: /?s=card&blog_id=84860689 should give you a gallery icon for this result:

Screen Shot 2019-10-21 at 15 35 10

....and /?s=socks&blog_id=84860689 should give you a product icon:

Screen Shot 2019-10-21 at 15 35 53

Proposed changelog entry for your changes:

  • No changelog entry needed. This PR merges into the instant-search-master branch.

@bluefuton bluefuton added [Feature] Search For all things related to Search Instant Search labels Oct 21, 2019
@bluefuton bluefuton requested a review from a team October 21, 2019 02:36
@bluefuton bluefuton self-assigned this Oct 21, 2019
@bluefuton bluefuton added the [Status] Needs Review This PR is ready for review. label Oct 21, 2019
@bluefuton bluefuton requested review from gibrown and jsnmoon October 21, 2019 02:37
Copy link
Copy Markdown
Member

@gibrown gibrown left a comment

Choose a reason for hiding this comment

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

LGTM

@jsnmoon jsnmoon force-pushed the instant-search-master branch from 97d6015 to b73e2fb Compare October 21, 2019 20:00
Copy link
Copy Markdown
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.

This is a nice refactor. 👍

@bluefuton bluefuton merged commit 94e0d87 into instant-search-master Oct 21, 2019
@bluefuton bluefuton deleted the instant-search-post-type-icon-component branch October 21, 2019 22:59
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Needs Review This PR is ready for review. labels Oct 21, 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.

4 participants