Conversation
| @@ -1,25 +1,29 @@ | |||
| {{ 'template-collection.css' | asset_url | stylesheet_tag }} | |||
| {{ 'component-card.css' | asset_url | stylesheet_tag }} | |||
There was a problem hiding this comment.
Diff best viewed with Hide whitespace changes enabled
|
@tyleralsbury requested review from you because you have the most context on facet filtering on themes side. @carolineschnapp requested review from you because you have context on how to best leverage Thank you |
|
Super, Kai. Thanks for creating this. I'll probably get a chance to take a look at it next week. I'll carve out some time in my calendar to take a good look. Very exciting to get this into Search! 🚀 |
|
When changing sort on search page the number of results increases. Ex: https://os2-demo.myshopify.com/search?q=art |
…h-facet-filtering # Conflicts: # locales/zh-CN.json
|
@grumpyoldflo
Hi, the increase in result count here isn't actually due to sorting. On Dawn, we set search |
ludoboludo
left a comment
There was a problem hiding this comment.
Working well, didn't run into any issues.
A few things I noted:
- when clicking on the
Skip to main contentlink, it messes with the loading state of the page/filters. But doesn't seem to do it on the collection page. video - a few accessibility things. We don't announce the
detailsbeing open when using voice over and pressingEnter. Seem to work with the spacebar. Also the link from the bubbles to remove the filter aren't being announced as something to remove the filter in question. But those aren't related to this PR. (video)
|
@ludoboludo Thanks for reviewing.
Good catch. This also brought to my attention that the function which runs on window history change |
This reverts commit 3793c14.
|
Reopening the PR after updating some |
assets/facets.js
Outdated
There was a problem hiding this comment.
I didn't re test the rest of the functionality as I think we won't be able to use that approach 🙁
There was a problem hiding this comment.
Ah good point. I will look into an alternative
There was a problem hiding this comment.
In my testing, it appears static methods work fine even on iOS 13, but static class properties were causing a JS error. I've therefore moved the properties out of the class. 88b35d1
…h-facet-filtering # Conflicts: # locales/de.json
…h-facet-filtering # Conflicts: # sections/main-search.liquid
ludoboludo
left a comment
There was a problem hiding this comment.
Left some small comments but overall didn't encounter any issues, seem to work well 👌
| <span class="active-facets__button-inner button button--tertiary"> | ||
| {{ value.label | escape }} | ||
| {% render 'icon-close-small' %} | ||
| <span class="visually-hidden">{{ 'products.facets.clear_filter' | t }}</span> |
There was a problem hiding this comment.
Is it easier to put it at the end so it doesn't disrupt the selectors to style label before it ? I feel like it sounds better when hearing: Clear filter Buttermilk. Rather than Buttermilk Clear filter.
But I don't have strong feelings, this is much better already.
There was a problem hiding this comment.
I deemed the value.label to be the most pertinent information and that it should be read first by the screenreader. Otherwise, quickly tabbing through the list of filters, the screenreader will repeatedly announce "Clear filter" and the user must pause and wait for each value.label to be read.
tyleralsbury
left a comment
There was a problem hiding this comment.
This is looking really great overall. I focused on looking at the changes to the JS and the use of the Snippet. I think this is a good case for Snippet use and you used it in a really smart way. Though we are trying to avoid using snippets, this is a pretty large piece of complex code that would be a pain to maintain if it were duplicated between two different files, so I do agree with the snippet use here.
Aside from that, I like the efficient data sharing between instances of the classes. I think it's really a smart way to handle that and is something we should consider when building out these types of components.
I tested on desktop and mobile on Chrome and Firefox and it all worked well. I played around with it for about 10 - 15 minutes and didn't run into any issues. I also tried using keyboard navigation and using my mouse and both worked well, too. Overall, I think it's looking good.
Code and Testing both look good to me 👍 Nothing to flag in particular.
Also great collaboration between yourself and Ludo in the comments. I was able to follow along with everything you two discussed and get all the context I needed. Very helpful!
…h-facet-filtering # Conflicts: # assets/template-collection.css
…fy/dawn into add-search-facet-filtering
ludoboludo
left a comment
There was a problem hiding this comment.
Looks like all translations came back 👌
tyleralsbury
left a comment
There was a problem hiding this comment.
Took a quick look at the translation commits and they look 👍
be5d512
This reverts commit be5d512.
* Move facet/filtering to snippet, include snippet in collection and search * Update logic for empty states * Update facet variables names * Generalize naming to disassociate elements from collection * Disassociate strings from collection * Update JS naming for facets * Update 19 translation files * Update 10 translation files * Change facet functions to static * Ensure title links inherit parent font-size * Simplify naming to follow BEM conventions * Update container id * Load facet js conditionally when enabled * Update from Shopify for theme dawn/add-search-facet-filtering * Revert "Update from Shopify for theme dawn/add-search-facet-filtering" This reverts commit 3793c14. * Refactor event listener * Move static properties out of class * Address PR feedback * Update 17 translation files * Update 13 translation files * Update from Shopify for theme dawn/add-search-facet-filtering * Revert "Update from Shopify for theme dawn/add-search-facet-filtering" This reverts commit be5d512. Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com> Co-authored-by: shopify-online-store[bot] <79544226+shopify-online-store[bot]@users.noreply.github.com>

Why are these changes introduced?
Fixes #46
Fixes #538
What approach did you take?
Modularize facets:
snippets/facets.liquidassets/component-facets.cssassets/facets.jscollectionsection.collection_templatetoproducts.facetsRender
facetssnippet inmain-collection-product-grid.liquidandmain-search.liquidAdd facet section settings in
main-searchand pass to snippetAdd additional Liquid logic to handle empty search results (differentiate scenarios that can lead to no search results - see "Other considerations" for more info)
Other considerations
Notes on differentiating 2 different empty states to present the buyer with context-aware messaging/UI:
Scenarios
Liquid
Demo links
Checklist
Additional