Skip to content
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

Fix collection filtering UX #268

Merged
merged 42 commits into from
Aug 4, 2021
Merged

Fix collection filtering UX #268

merged 42 commits into from
Aug 4, 2021

Conversation

KaichenWang
Copy link
Contributor

@KaichenWang KaichenWang commented Jul 26, 2021

Why are these changes introduced?

Fixes #198

What approach did you take?

  • Update Liquid logic
  • Update styles
  • Update JS to ensure product count (now separate from product grid) is updated properly

Other considerations

  • Some edge cases still need to be tweaked/perfected
  • TODO: Adjust no-JS implementation

Demo links

Checklist

@ghost ghost added the cla-needed label Jul 26, 2021
@tyleralsbury tyleralsbury self-requested a review July 27, 2021 14:10
Copy link
Contributor

@tyleralsbury tyleralsbury left a comment

Choose a reason for hiding this comment

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

Just leaving reminders for the auto-pushed setting updates.

@@ -1,10 +1,24 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder that we'll need to revert the changes in here

@@ -1 +1,86 @@
{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder that we'll need to revert the changes in here

@Oliviammarcello
Copy link
Contributor

Oliviammarcello commented Jul 28, 2021

Looking good so far, I have some notes:

  • The filter and sort link should take the outline button colour (which is used for text links)
  • The setting copy should be updated to "Collapse on larger screens"
  • Change total space between "filter and sort" text and the product number closer to 2rem. Screenshot
  • The "filter and sort" link should take the Button label styling instead of Caption large. The font size is the same, but the letter spacing slightly increases.
  • Reduce total space to 5rem between collection title and filters or collection banner and filters. Screenshot
  • The clear all text link is missing a hover style. It should match all other text links
  • The filter and sort button disappears when the drawer comes out. Video
  • The filter icon is slightly misaligned. Screenshot
  • Align "X products" to the same line as filter and sort on mobile. Screenshot
  • On desktop align "X products" to the same line as the pills. Screenshot. When there are two lines of pills, it should align to the second line if possible. Screenshot.
  • Can you add additional padding to the left and right side of the sort by active state. It should match this spacing. Screenshot
  • The hover states for the filters should match what is done for text links in the navigation. It should change to 100% opacity and show an underline (with the same animation applied). On active, the opacity should remain at 100%, but the underline shouldn't since the page isn't changing. Video.
  • The "Filter and sort" button should underline on hover and change to 100% opacity as well when collapse on larger screens has been selected.
  • When the filter options are revealed, the same animation used for the navigation dropdown should be applied. Video.
  • Can we change the filters styling to "Caption large" instead of "caption". It should be 13px. Screenshot.
  • When JS is disabled the CTAs should be the tertiary button style, the sort button should align with the rest of the content and there should be a minimum of 80px of space to the left of "sort by". Screeenshot

There are a few issues with the filters that were documented here as well.

@KaichenWang
Copy link
Contributor Author

KaichenWang commented Jul 29, 2021

@Oliviammarcello Thanks for the review. I've addressed most issues in the list . For issues not yet addressed, I've documented them here. Here's some more details:

Reduce total space to 5rem between collection title and filters or collection banner and filters

This was not a change introduced in this PR. To limit the scope of this PR, could we update in separate PR?

The filter and sort button disappears when the drawer comes out

Still looking into this. @tyleralsbury any particular reason the "Filter and sort" button is hidden in CSS when the drawer is opened?

details[open] .mobile-facets__open {
    visibility: hidden;
}

The filter icon is slightly misaligned

On my end, I don't see the same misalignment, but will continue testing with different fonts
Screen Shot 2021-07-29 at 3 55 26 PM

Can you add additional padding to the left and right side of the sort by active state. It should match this spacing

Still exploring a way to do this without adding too much code

When the filter options are revealed, the same animation used for the navigation dropdown should be applied

To limit the scope of this PR, could we update in separate PR?

@@ -17,214 +17,224 @@
<div class="page-width collection-filters" id="main-collection-filters" data-id="{{ section.id }}">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Best to view this diff with Hide whitespace changes enabled

@KaichenWang KaichenWang marked this pull request as ready for review August 2, 2021 14:07
@Oliviammarcello
Copy link
Contributor

Oliviammarcello commented Aug 2, 2021

@KaichenWang I'm aligned with creating separate ​issues if that is easier for you.

Just took a look and I have a few polish notes:

  • The space between the filters and the sort by should be much smaller. Only 80px should be between them. Screenshot
  • Can the "Sort by" label match the active state styling used here. "Sort by" should be closer to the label
  • Add more space between the pills and the product cards. Screenshot
  • Remove bubble indicators on mobile. Screenshot
  • Align labels in the tertiary buttons to the centre of the button. Screenshot
  • "Clear all" is still missing its hover style + animation. It should what is done in the navigation. Video.
  • Remove the word "Showing" from "Showing x products". The text will now be "X products" or "X of X products"
  • On tablet and mobile, the pills are supposed to reduce in size and leave enough space for the tap target. Figma | Screenshot
  • Align title to the center of the pills. Screenshot
  • Apologies for changing the loading state again, but now that the "x products" label is on the right, can the spinner replace that? Screenshot

Oliviammarcello
Oliviammarcello previously approved these changes Aug 4, 2021
Copy link
Contributor

@tauthomas01 tauthomas01 left a comment

Choose a reason for hiding this comment

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

Tested on all browsers, looks good.

Comment on lines +82 to +84
if (containerDesktop) {
containerDesktop.innerHTML = count;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Small nitpick: does it work if we use optional chaining?

document.getElementById('CollectionProductCountDesktop')?.innerHTML = count;

Copy link
Contributor

Choose a reason for hiding this comment

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

It's actually an interesting case - you can't use optional chaining for the left side of an assignment.

You can see the discussion on the proposal here:

tc39/proposal-optional-chaining#18

Comment on lines +80 to +84
.active-facets-mobile + .collection-product-count {
grid-column-start: 2;
grid-row-start: 2;
text-align: right;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed? It's hidden when we're on desktop

alt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The .large-up-hide is added conditionally in Liquid. Depending on the collapse_on_larger_devices setting, the "mobile" product count may also visible on desktop:

{% unless section.settings.collapse_on_larger_devices %} medium-hide large-up-hide{% endunless %}

tyleralsbury
tyleralsbury previously approved these changes Aug 4, 2021
Copy link
Contributor

@tyleralsbury tyleralsbury left a comment

Choose a reason for hiding this comment

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

Looks great! I tested on desktop and mobile with collapse enabled and disabled.

I noticed one thing, in the collapsible version the price still has a bubble indicating that it's being filtered. Not sure if that was intended or not, given the removal of all of the other bubbles. That was the only issue I found.

Code looks good, too. JS looks like it wasn't huge in terms of changes, and the CSS is looking nice. We might still be able to improve some of the naming for the CSS but it was already very "first draft" naming before this PR so it's a refactor we can consider later.

Screen Shot 2021-08-04 at 12 20 57 PM

@KaichenWang
Copy link
Contributor Author

I noticed one thing, in the collapsible version the price still has a bubble indicating that it's being filtered. Not sure if that was intended or not, given the removal of all of the other bubbles. That was the only issue I found.

I missed that one. Now removed

@KaichenWang KaichenWang merged commit dff1060 into main Aug 4, 2021
@KaichenWang KaichenWang deleted the fix-collection-filtering-ux branch August 4, 2021 20:47
@gregjotau
Copy link

image

translation missing: nb.sections.collection_template.product_count_simple

Only in the english translation files, which not everyone uses by default. Not sure if that is intended.

@gregjotau
Copy link

IMO, in production: english should just override the default language. Please implement that since english is understood universally in all "important" markets for most merchants.

olafghanizadeh pushed a commit to hyttefeber/dawn that referenced this pull request Aug 5, 2021
* Add setting to enable filtering drawer on larger devices. Adjust button styling

* Update styling. Tighten spacing

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update styles and spacing for filters

* Adjust font sizes for filters

* Adjust alignment and spacing

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update link style for clear

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Address design feedback

* Update locales

* Update locales/cs.schema.json

* Update locales/da.schema.json

* Update locales/de.schema.json

* Update locales/es.schema.json

* Update locales/fi.schema.json

* Update locales/fr.schema.json

* Update locales/it.schema.json

* Update locales/ja.schema.json

* Update locales/ko.schema.json

* Update locales/nb.schema.json

* Update locales/nl.schema.json

* Update locales/pl.schema.json

* Update locales/pt-BR.schema.json

* Update locales/pt-PT.schema.json

* Update locales/sv.schema.json

* Update locales/th.schema.json

* Update locales/tr.schema.json

* Update locales/vi.schema.json

* Update locales/zh-CN.schema.json

* Update locales/zh-TW.schema.json

* Remove bubble for price filtering

Co-authored-by: shopify-online-store[bot] <79544226+shopify-online-store[bot]@users.noreply.github.com>
Co-authored-by: translation-platform[bot] <[email protected]>
@KaichenWang
Copy link
Contributor Author

KaichenWang commented Aug 5, 2021

@gregjotau

translation missing: nb.sections.collection_template.product_count_simple

Only in the english translation files, which not everyone uses by default. Not sure if that is intended.

Occasionally, translation strings for languages other than English may be added in a separate PR. We are working to avoid this in the future and ensure translations for all languages are included in the same PR.

IMO, in production: english should just override the default language. Please implement that since english is understood universally in all "important" markets for most merchants.

This is a good suggestion. Will forward this internally to the appropriate team.

maplerock added a commit to fellowsmedia/nsra_shopify_2021 that referenced this pull request Aug 12, 2021
* main: (23 commits)
  Cart content update (Shopify#370)
  Footer spacing and alignment adjustments (Shopify#369)
  Product Template UI polish updates (Shopify#219)
  footer ui updates (Shopify#318)
  Fix cart improvements empty state (Shopify#319)
  [Announcement] Adjust block id for displaying dynamic names (Shopify#327)
  Update translations: buyer (Shopify#329)
  Revert editor setting changes (Shopify#328)
  Update translations (Shopify#294)
  Fix collection filtering UX (Shopify#268)
  Added page width setting and fixed image quality (Shopify#292)
  Add top border on cart notification when "show separator line" setting is deactivated (Shopify#306)
  movebadge code into base.css (Shopify#313)
  Collage UI bug fixes (Shopify#308)
  Customer account UI polish (Shopify#177)
  Added custom liquid block to product page (Shopify#269)
  Fix disclosure icon (Shopify#310)
  Fix facet price filter label spacing (Shopify#300)
  Fix duplicate search icon when header logo is set to "Top center" (Shopify#252)
  Add card outline setting (Shopify#239)
  ...
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
* Add setting to enable filtering drawer on larger devices. Adjust button styling

* Update styling. Tighten spacing

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update styles and spacing for filters

* Adjust font sizes for filters

* Adjust alignment and spacing

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Update link style for clear

* Update from Shopify for theme dawn/fix-collection-filtering-ux

* Address design feedback

* Update locales

* Update locales/cs.schema.json

* Update locales/da.schema.json

* Update locales/de.schema.json

* Update locales/es.schema.json

* Update locales/fi.schema.json

* Update locales/fr.schema.json

* Update locales/it.schema.json

* Update locales/ja.schema.json

* Update locales/ko.schema.json

* Update locales/nb.schema.json

* Update locales/nl.schema.json

* Update locales/pl.schema.json

* Update locales/pt-BR.schema.json

* Update locales/pt-PT.schema.json

* Update locales/sv.schema.json

* Update locales/th.schema.json

* Update locales/tr.schema.json

* Update locales/vi.schema.json

* Update locales/zh-CN.schema.json

* Update locales/zh-TW.schema.json

* Remove bubble for price filtering

Co-authored-by: shopify-online-store[bot] <79544226+shopify-online-store[bot]@users.noreply.github.com>
Co-authored-by: translation-platform[bot] <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revisit UI for Filters & Behavior
6 participants