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

Refactor quick-order-list.css #3006

Merged
merged 8 commits into from
Oct 5, 2023
Merged

Conversation

andrewetchen
Copy link
Contributor

@andrewetchen andrewetchen commented Sep 21, 2023

PR Summary

This PR refactors the quick-order-list.css file by removing any duplicate or redundant CSS.

Why are these changes introduced?

Fixes #2956

What approach did you take?

  • I went through line-by-line and removed any duplicate or redundant code.
  • I removed a couple of rules that had incorrect class names, missing ;'s, or had spelling errors.
  • I repositioned some rules and declarations.
  • I ensured the removal of any code didn't break anything.
  • I made sure to compare against the component-cart-items.css file since a lot of the CSS was taken from it.

Other considerations

  • The quick-order-list.css file could probably benefit from further refactoring (e.g., organizing the same @media blocks into one vs. having multiple blocks) but I see this as a nice-to-have and something that doesn't need to be scoped into this PR.
  • We can also create a shared stylesheet (e.g., table.css) for similarities between quick-order-list.css and component-cart-items.css. This would also require additional changes to the markup.
  • Edit (October 4 2023): We're not applying the max-height and overflow-y to the quick order list container and will tackle this separately
  • Considerations from @eugenekasimov
    • When you add a variant to the cart via the quick-order-list a horizontal scrolling bar appears for a loading period of time.
    • Edit (October 4 2023): Sofia and I have decided to not include the max-height and overflow-y to the quick order list container so the horizontal scrolling is not an issue in this PR

Note: This PR includes Eugene's fix from #3003

Testing steps/scenarios

Use the Dawn main editor link below to help with comparing these changes.

  • Ensure the quick order list section works as expected
  • Test all screen sizes
  • Test on different web browsers

Demo links

Checklist

Copy link
Contributor

@eugenekasimov eugenekasimov left a comment

Choose a reason for hiding this comment

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

Looks good so far. I will keep reviewing it tmr.

assets/quick-order-list.css Show resolved Hide resolved
Comment on lines 16 to 17
max-height: 90rem;
overflow-y: auto;
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to rethink about it because it causes an issue with scrolling 👇

https://screenshot.click/25-36-u81os-rw42j.mp4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Eugene, it was suggested to add this back here but for another class: #3006 (comment)

I'm wondering if we should just remove it since it wasn't ever being used? CC: @sofiamatulis

Copy link
Contributor

Choose a reason for hiding this comment

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

For some context, this was accidentally not added in the release because of the class change names. But it was something @edmund-teh had requested for and the scrolling was something we knew about and aligned that was ok

So let's get Ed's opinion. But here are the options

  1. Add the scrolling that was supposed to be there, but accidentally didnt because of the class name changes. This means the scroll will show. The max height was important so the section itself is not long. This means this could become a very long section and the bottom footer doesnt show up

  2. Keep it as is, but that means there is no max height. Since merchants can add many sections, that could be an issue as the page could get very long

Video: https://screenshot.click/25-52-czeo6-n3am3.mp4

Copy link
Contributor Author

@andrewetchen andrewetchen Sep 25, 2023

Choose a reason for hiding this comment

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

Thanks for the context, Sofia. I'm aligned with Option 1

The max height was important so the section itself is not long. This means this could become a very long section and the bottom footer doesn't show up

That's the first thing I noticed as a good thing when I added this here: 00557a5

I don't mind the scrollbars showing like in Eugene's video, especially if you and @edmund-teh aligned on this previously.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, I recall this actually. Let me drop a short video here why I was initially against adding max-height and overflow-y.
https://screenshot.click/25-02-hwmw2-3h4x2.mp4

Of course it's up to @edmund-teh. I think if we decide to go with max-height and scrolling bar then we need to add paddings on the right for both the table and total bar and somehow make it work equally for users who use touchpad and the mouse.

Choose a reason for hiding this comment

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

Hey everyone! Thanks for being thorough and discussing this.

I'm aligned with adding the max-height and scrolling (Option 1).

I do also see the value in @eugenekasimov's style tweaks that would account for a sidebar to the right of the totals. But if we were to implement these changes, we'd also have to adjust this for the footer, as well:
https://screenshot.click/Screenshot_2023-09-25_at_4.54.43_PM.png

These style tweaks would be accounting for whatever default browser scroll bar the buyer is using, so that may have a lot of variation in itself, right? I think we would have to decide if this is worth the effort (from a Product decision, perspective, cc: @nicklepine).

This is also something we'd probably implement for Quick order form, too? So, maybe we would need @scottgmeadows's input, as well?

cc: @sofiamatulis @andrewetchen

Copy link
Contributor Author

@andrewetchen andrewetchen Sep 25, 2023

Choose a reason for hiding this comment

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

Thanks @edmund-teh

One thing I wanted to point out (might help us decide) is that we already have a similar behaviour with a visible scrollbar but in this context, it's always visible regardless of your System Settings > Appearance > Show scroll bars setting -- whether it's Automatically based on mouse or trackpad, When scrolling, or Always:


Set the Cart type to Drawer and add multiple items to your cart, you can see the vertical scrollbar. This happens in Chrome and Safari but not in FireFox and this was something the team was okay with:


Here are 2 videos showing how the different Show scroll bars settings affect the cart drawer and quick order list:

show-scrollbars-setting-cart-drawer.mp4
show-scrollbars-setting-quick-order-list.mp4

Choose a reason for hiding this comment

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

One thing I wanted to point out (might help us decide) is that we already have a similar behaviour with a visible scrollbar but in this context, it's always visible regardless of your System Settings > Appearance > Show scroll bars setting -- whether it's Automatically based on mouse or trackpad, When scrolling, or Always:

Good point @andrewetchen, if it's already something we're experiencing with other interactions in Dawn, we should probably keep things consistent.

Copy link
Contributor

@eugenekasimov eugenekasimov Sep 25, 2023

Choose a reason for hiding this comment

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

I really like an approach we use for the cart-drawer when we see a scrolling bar all the time no matter what settings/devices are set/used. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks everyone. This thread has a lot of great context!

Good point @andrewetchen, if it's already something we're experiencing with other interactions in Dawn, we should probably keep things consistent.

@edmund-teh and I had a chat about this. We're good to move forward with the visible scrollbars (with Show scroll bars setting: Automatically based on mouse or trackpad or Always).

cc: @sofiamatulis @eugenekasimov

Copy link
Contributor

@eugenekasimov eugenekasimov left a comment

Choose a reason for hiding this comment

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

Great job, Andrew!

I added my concern to the description for this PR.

Copy link
Contributor

@sofiamatulis sofiamatulis left a comment

Choose a reason for hiding this comment

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

I am testing with all the settings to ensure there are no regressions. I have noticed one thing

Ill do one final pass. Here are the scenarios:

  • no JS
  • mobile
  • tablet
  • desktop
  • no sku/sku
  • no image/image
  • error states
  • with qty rules/vol pricing

assets/quick-order-list.css Show resolved Hide resolved
Copy link
Contributor

@sofiamatulis sofiamatulis left a comment

Choose a reason for hiding this comment

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

Noticed a few more things - i can do one final pass once theyre fixed 👌

assets/quick-order-list.css Show resolved Hide resolved
max-height: 90rem;
overflow-y: auto;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed this was introduced on this PR https://screenshot.click/29-56-4zuwn-hkbg9.mp4

the popover is showing behind

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's strange is that this is coming from this: 7e2238a

#3006 (comment)

quick-order-list-container.mp4

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think it's due to the overflow-y. https://screenshot.click/03-43-z9vco-k9eqv.mp4

Have you seen if there is a way around it?

We should test it with a long list of variants that has qty rules/vol pricing

Copy link
Contributor Author

@andrewetchen andrewetchen Oct 3, 2023

Choose a reason for hiding this comment

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

That's the first thing I noticed while testing this. When I remove the overflow-y from the following it works as expected:

.quick-order-list__container {
  padding-bottom: 4rem;
  max-height: 90rem;
  overflow-y: auto;
}

Have you seen if there is a way around it?

I'll try to tweak things 👍🏼

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here's a solution to fix this -- let me know what you think: 7d26147

assets/quick-order-list.css Show resolved Hide resolved
assets/quick-order-list.css Show resolved Hide resolved
assets/quick-order-list.css Show resolved Hide resolved
assets/quick-order-list.css Show resolved Hide resolved
assets/quick-order-list.css Show resolved Hide resolved
Copy link
Contributor

@sofiamatulis sofiamatulis 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 happening now when you start scrolling: https://screenshot.click/04-28-ptcgs-w8vk4.mp4

(comparing this branch to main in the video)

@andrewetchen
Copy link
Contributor Author

andrewetchen commented Oct 4, 2023

This is happening now when you start scrolling: https://screenshot.click/04-28-ptcgs-w8vk4.mp4

(comparing this branch to main in the video)

Hey @sofiamatulis, as we discussed on Slack, the current issue seems to be a side-effect of applying the following CSS:

.quick-order-list__container {
  max-height: 90rem;
  overflow-y: auto;
}

When this CSS is applied, we're encountering one of two issues:

Given the complexity of these issues and since this CSS wasn't added to the latest release, I propose we descope this from the current refactoring PR. Instead, we can address the max-height addition to the container in a separate, follow-up PR. This way, we can focus on resolving these issues without delaying the current refactoring work.

Let me know your thoughts on this approach.

@sofiamatulis
Copy link
Contributor

This is happening now when you start scrolling: https://screenshot.click/04-28-ptcgs-w8vk4.mp4
(comparing this branch to main in the video)

Hey @sofiamatulis, as we discussed on Slack, the current issue seems to be a side-effect of applying the following CSS:

.quick-order-list__container {
  max-height: 90rem;
  overflow-y: auto;
}

When this CSS is applied, we're encountering one of two issues:

Given the complexity of these issues and since this CSS wasn't added to the latest release, I propose we descope this from the current refactoring PR. Instead, we can address the max-height addition to the container in a separate, follow-up PR. This way, we can focus on resolving these issues without delaying the current refactoring work.

Let me know your thoughts on this approach.

I am aligned :) Let's revert the removal of the position: relative and the addition of the max height and scroll and we can tackle this on a separate PR and get UX eyes on it too

Copy link
Contributor

@sofiamatulis sofiamatulis left a comment

Choose a reason for hiding this comment

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

Looks good 🎉 thanks for tackling this

@andrewetchen andrewetchen merged commit 7ee3da2 into main Oct 5, 2023
9 checks passed
@andrewetchen andrewetchen deleted the andrew/quick-order-list-css branch October 5, 2023 14:33
hz70ma added a commit to hz70ma/dawn that referenced this pull request Jan 31, 2024
* Update 1 translation file (Shopify#2997)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* Update 1 translation file (Shopify#3001)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* [Image_tag] Update to remove lazy loading and let it automatically decide the best loading strategy (Shopify#3002)

* remove lazy loading where necessary to better performance

* add fetch priority

* [Facets] update filter counts on filter selection (Shopify#2988)

* Correct CSS (Shopify#3003)

* Check if there is compare_at_price (Shopify#3000)

* Update 1 translation file (Shopify#3012)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* [Facets] fix mobile count update (Shopify#3018)

* Update 1 translation file (Shopify#3043)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* Update 1 translation file (Shopify#3044)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* [Image with text] Add color scheme picker for section wrapper (Shopify#3016)

* [Image with text] Add color scheme picker for section wrapper

* address review comment about overlap and transparency

* Refactor `quick-order-list.css` (Shopify#3006)

* Fix Add to Cart error on page load/slower connections (Shopify#3008)

* [Facets] dynamic header (Shopify#3048)

* Add component-card.css to cart drawer (Shopify#3049)

* [Refactoring] Replace loading spinner with snippet (Shopify#2996)

* Change spinner for main-cart-items

* Change spinner for cart-drawer

* remove extra div and change classes

* Replace spinner with snippet for pdp and fead prod

* Remove unnecessary classes

* Add comment for snippet

* Change naming for files and css classes

* Put back deleted elements

* Remove unused classes

* Put back loading-overlay for cases when no spinner

* Chnage loading-overlay--error name

* Minor change in CSS

* Move loading-overlay styles to template-collection

* Rename component-loading-overlay

* Fix bug with overlay and spinner for facets

* Remove component-loading-spinner import from files

* Use spinner snippet for predictive search

* Hide product count when loading for drawer filters

* Address feedback. Clean-up.

* Minor changes to address feedback

* Fix spinner conflict with cart drawer

* Address feedabck

* Add missing whitespace for if tag

* [Sliders] Regression fix. Apply CSS only when necessary in theme editor (Shopify#3070)

* [Sliders] Regretion fix. Apply CSS only when necessary in theme editor

* change of approach

* add comment to explain CSS

* Add visual representation for filters (Shopify#3045)

* [Facets] update visual representation of facets operators (Shopify#3061)

* [Collection template] Product grid color scheme picker (Shopify#3017)

* [Collection template] Product grid color scheme picker]

* move color setting up in the list

* support gradient

* [Cart] Add color picker on cart page and in general cart settings (Shopify#3021)

* rebase final final

* use the update for the loading spinner

* add color picker for the cart drawer and cart popup

* fix spacing issues on cart page

* add gradient support

* address review comments

* adjust where the class is added. Fix gradient issue

* isolation needed for shadow

* add comment

* Remove unnecessary isolate

* use the isolate class instead

* [Product] Add color scheme picker (Shopify#3015)

* [Product] Add color scheme picker

* support gradient

* apply background color to be full width

* address review comments: color scheme applied to quick add modal and lightbox modal

* add color scheme to product availability drawer and move color settings up

* fix color classes to work properly with gradients

* Add support for gradient on modal

* remove console log

* [VisualDisplay] bump the active outline width (Shopify#3083) (Shopify#3091)

* 12.0.0 Version Bump and release notes (Shopify#3092)

* Update 1 translation file (Shopify#3093)

* updated code to match new color scheme naming (Shopify#2801)

* updated code to match new color scheme naming

* removing additional background-1 after rebase

* Fixed race condition for cart note updates (Shopify#3125)

* [Facets] support dynamic facet lists (Shopify#3123)

* Assign font family to input fields (Shopify#2871)

* Price per item, Popover and global style bugs (Shopify#2851)

* Fix cart submission on Quick Order List (Shopify#2868)

* Social icons: Visual fixes (Shopify#2855)

* Adjust spacing.

* Facebook + Tumblr icon size adjustments.

* Update social icon SVGs.

* Tidy up new icon sizes again.

* Resize icons.

* Make spacing slightly smaller.

* Make icons larger so they're more similar to the old sizes.

* Remove padding to compensate for extra viewbox space.

* Try a smaller Twitter icon.

* Update snapchat icon.

* Resize social links in menu drawer to 44x44

* replace translation string to have the translation visible (Shopify#2869)

* B2B compare at price with price range (Shopify#2858)

* Add sale badge and price-range for volume-pricing

* Add compare_at price to PDP and Feat Prod.

* Change opacity to 100% for price per item.

* Update the logic

* Hide price per item for unavailable variants.

* Remove margin for dl.

* Refactoring

* Correct a mistake in liquid.

* Change the JS logic back for updating price per item

* Add compare at to prod card. Add style to compare at

* Assign font family to input fields.

* Update assets/base.css

Co-authored-by: Kai <[email protected]>

* Use the theme's font style + weight in form elements.

---------

Co-authored-by: Sofia Matulis <[email protected]>
Co-authored-by: melissaperreault <[email protected]>
Co-authored-by: Eugene Kasimov <[email protected]>
Co-authored-by: Kai <[email protected]>

* Update 1 translation file (Shopify#3155)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* Update 1 translation file (Shopify#3157)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* Update 1 translation file (Shopify#3158)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* Update 1 translation file (Shopify#3161)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* Update 2 translation files (Shopify#3160)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* Applied image shape and ratio to placeholder images (Shopify#2817)

added classes and styles to get image shape and image ratio working

added styling on portrait placeholders

aligned placeholder when in potrait mode

applying code review suggestions and removed image-ratio

* [Visual Display] Display accurate filter colors when high contrast mode is enabled (Shopify#3165)

* Improved country selectors (Shopify#3175)

Original PR with review comments -> Shopify#3135

* Update inline quantity error styles. (Shopify#3150)

* Update 1 translation file (Shopify#3177)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* [Variant Picker] Update settings copy (Shopify#3173)

* Bring back the lighthouse-ci-action to v1 (Shopify#3181)

This will make sure new releases are automatically used.

Better for forks as well.

* Changed slider to work on tablet for multicolumn (Shopify#3176)

* Changed slider to work on tablet for multicolumn

* Adjusted to prevent early cutoff on tablet

* Adjusted Featured Collection placeholders to work with any number of desktop columns (Shopify#3182)

* Adjusted featured collection placeholders to work with any number of desktop columns

* [Variant Picker] Add swatch display type (Shopify#3180)

* [VariantPicker] Unify variant selects and radios under new component

* [VariantPicker] Add swatch settings

* [VariantPicker] Move styles to dedicated CSS file

* [Variant Picker] Update settings copy

* [VariantPicker] Add swatch component

* [VariantPicker] Add a swatch to selected dropdown option

* [Variant Picker] Update disabled state

* [Variant Picker] Swatch snippet

* [Variant Picker] Swatch input snippet

* [Variant Picker] Tweak swatch border colors

* Update swatch border (Shopify#3184)

* Update translations: merchant (Shopify#3178)

* Update 1 translation file

* Update 1 translation file

* Update 2 translation files

* Update 1 translation file

---------

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* [Variant Picker] Ensure that swatches wrap correctly (Shopify#3185)

* Focus search on country selector open and fix iOS bug (Shopify#3183)

* Focus search on country selector open

* Set stacking context

* Prevent sticky header from hiding when country selector is open (Shopify#3188)

* change to 100% (Shopify#3190)

* [Variant Picker] Simplify swatch settings (Shopify#3189)

* [Variant Picker] Simplify swatch settings

* Update 7 translation files

* Update 12 translation files

* Update 1 translation file

---------

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

* Escape filter label consistently (Shopify#3192)

* Update 1 translation file (Shopify#3202)

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>

---------

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>
Co-authored-by: Ludo <[email protected]>
Co-authored-by: Patrick Racicot <[email protected]>
Co-authored-by: Eugene Kasimov <[email protected]>
Co-authored-by: Andrew Etchen <[email protected]>
Co-authored-by: Jason Addleman <[email protected]>
Co-authored-by: Sofia Matulis <[email protected]>
Co-authored-by: Louisa Goncharenko <[email protected]>
Co-authored-by: Tyler Alsbury <[email protected]>
Co-authored-by: Kjell Reigstad <[email protected]>
Co-authored-by: melissaperreault <[email protected]>
Co-authored-by: Kai <[email protected]>
Co-authored-by: Alex Ilea <[email protected]>
Co-authored-by: Abdulrahman Hamideh <[email protected]>
Co-authored-by: CP Clermont <[email protected]>
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pull out some of the duplicate classes in component-cart-items.css and quick-order-list css
4 participants