Skip to content

Conversation

@jsnmoon
Copy link
Contributor

@jsnmoon jsnmoon commented Feb 21, 2020

Please note that the commit log includes previously merged changes for Instant Search. The new code introduced by this PR is from Feb 12, 2020, and onwards.

Changes proposed in this Pull Request:

  • This PR primarily focuses on improving the overall user experience for Jetpack Instant Search.

Before:

Screen Shot 2020-02-21 at 3 42 30 PM

After:

Screen Shot 2020-02-21 at 3 40 31 PM

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

  • No, this is an incremental update for Jetpack Instant Search.

Testing instructions:

  1. Follow these setup instructions to set up Jetpack Instant Search on your site. Please note that the Jetpack Search widget will need to be added to twice: once to your site sidebar/footer and once to the Jetpack Search Sidebar within the search overlay.

  2. Submit a query into your site search input. Ensure that a search overlay appears with your search results.

  3. Try using the new sort select controls below the overlay search input. Ensure that they behave as expected.

  4. Try resizing your window to be narrower than 768 pixels; a Filters button should spawn adjacent to the sort select controls.

  5. Try clicking on the Filters button in (4). Ensure that a filters popover spawns below the button, like so:

Screen Shot 2020-02-21 at 3 47 34 PM

Proposed changelog entry for your changes:

  • Interface refinements and bugfixes for Jetpack Instant Search.

bluefuton and others added 30 commits November 4, 2019 07:44
* Add label and button to search box and convert to functional component

* Correct lodash import
* Turn statements into sentence fragments
* Add appropriate landmark roles for elements
* Set portaled widget as a search form
* Use ordered list for search results
* [not verified] Add product search result component

* [not verified] Refactor renderResult into component

* [not verified] Convert SearchResult to stateless functional component

* [not verified] Move comments to new shared component

* [not verified] Move Tracks out to common SearchResult

* [not verified] Request additional fields for product results

* Correct field names and remove ratings for now

* Basic styling of cards with images

* Add price where available

* Read result_format from the query string

* Use ordered list

* Style cleanup

* Minor cleanup

* Remove resultFormat from component state

* SearchResults component cleanup

* Standardise class names

* Validate result format before using as CSS class

* Address review nits
* Add PhotonImage component

* Bump default dimensions to 300x300

* Bump asset size limit to 100kb
* Add label and button to search box and convert to functional component

* Correct lodash import
* Turn statements into sentence fragments
* Add appropriate landmark roles for elements
* Set portaled widget as a search form
* Use ordered list for search results
* [not verified] Add product search result component

* [not verified] Refactor renderResult into component

* [not verified] Convert SearchResult to stateless functional component

* [not verified] Move comments to new shared component

* [not verified] Move Tracks out to common SearchResult

* [not verified] Request additional fields for product results

* Correct field names and remove ratings for now

* Basic styling of cards with images

* Add price where available

* Read result_format from the query string

* Use ordered list

* Style cleanup

* Minor cleanup

* Remove resultFormat from component state

* SearchResults component cleanup

* Standardise class names

* Validate result format before using as CSS class

* Address review nits
* Add PhotonImage component

* Bump default dimensions to 300x300

* Bump asset size limit to 100kb
* Instant Search: use default values for getting results to avoid duplication

* getResults: default to empty object

Co-Authored-By: Jason Moon <[email protected]>
keoshi and others added 6 commits February 20, 2020 12:56
* Ensure there's a cross to clear search on browsers that support it

* Reduce font-size on results count text

* Make close button behave similarly on different themes

* Ensure there's a cross to clear search on browsers that support it

* Reduce font-size on results count text

* Make close button behave similarly on different themes

* Ensures the clear button is displayed in the search box

Props to @jsnmoon
* Use link for clear filters instead of a button

* Update name in CSS
* Add className to label

* Ensure search box is always full-width

* Improves alignment of the layout grid

* Tweak close button position
…4711)

Sorting buttons and "Filter" button drop down on mobile.

Co-authored-by: Jason Moon <[email protected]>
Co-authored-by: Greg Ichneumon Brown <[email protected]>
@jsnmoon jsnmoon added [Status] Needs Review This PR is ready for review. [Feature] Search For all things related to Search Instant Search labels Feb 21, 2020
@jsnmoon jsnmoon added this to the InstantSearchLaunch milestone Feb 21, 2020
@jsnmoon jsnmoon requested review from a team, gibrown, jeherve, keoshi and mdbitz February 21, 2020 22:52
@jsnmoon jsnmoon self-assigned this Feb 21, 2020
@jetpackbot
Copy link
Collaborator

Warnings
⚠️

pre-commit hook was skipped for one or more commits

This is an automated check which relies on PULL_REQUEST_TEMPLATE. We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS against 4046871

@jeherve jeherve modified the milestones: InstantSearchLaunch, 8.3 Feb 24, 2020
Copy link
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.

Didn't see any code issues. Mucked around with the UX a bunch. Found some minor stuff, but nothing that is a blocker for merging this.

Copy link
Contributor

@mdbitz mdbitz left a comment

Choose a reason for hiding this comment

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

👋 Overall this looks good to me. The only question I have is if we need to do any validation/whitelisting of the locale prefix. Is there concern for bad values "https://.jetpack.com" "https://werer.jetpack.com/search", or etc

const locale_prefix = typeof props.locale === 'string' ? props.locale.split( '-', 1 )[ 0 ] : null;
const url =
locale_prefix && locale_prefix !== 'en'
? 'https://' + locale_prefix + '.jetpack.com/search'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be any validation/whitelisting of accepted prefixes?

Copy link
Member

Choose a reason for hiding this comment

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

I guess in theory the locale for the site could get set to something weird though I am not sure how.

I opened #14785

@mdbitz
Copy link
Contributor

mdbitz commented Feb 24, 2020

@gibrown @jsnmoon 👍

merging this for 8.3. I'd appreciate your thoughts on hardening the locale prefix (if needed) in a future update.

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 Touches WP.com Files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants