Shopify / dawn

Shopify's first source available reference theme, with Online Store 2.0 features and performance built-in.
Other
2.36k stars 3.13k forks source link

[Quick Add Bulk] Don't block quantity input during cart API call #3461

Closed sofiamatulis closed 2 weeks ago

sofiamatulis commented 3 weeks ago

PR Summary:

Before (user blocked until the current call being made is done): 08-03-zbmw1-m72jp

After:

08-02-7ja4p-kpdq3

Why are these changes introduced?

Fixes #3417 https://github.com/orgs/Shopify/projects/6397/views/28?pane=issue&itemId=59790024

What approach did you take?

I am reusing the functionality from the QOL to create a queue of calls. I am also doing some refactoring to re-use some of the functions in both quick-order-list.js and quick-add-bulk.js

Other considerations

I have not pulled out updateMultipleQty and renderSections since there are some differences there. I think it will make it a bit more difficult for readability

Testing steps/scenarios

Demo links

Checklist

dan-menard commented 3 weeks ago

I can't seem to reproduce this anymore 😅 I must've been previewing the live store and getting the existing behaviour.

~I noticed when I time my clicks so I only click when the loading bar is active, it will sometimes decrease the number instead of increasing it:~

https://github.com/Shopify/dawn/assets/590055/31fdcae8-d1b6-418d-869b-a43ffd850159