Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Remove featured product list section from product list page - frontend changes #1488

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

federicobadini
Copy link
Contributor

@federicobadini federicobadini commented Mar 21, 2023

closes #1483

This PR removes the featured-product-list section since the new mockups do not include that component anymore.

Since the featured-product-list section was relying on Algolia, this forced us to put in place a "multi-index" Algolia configuration for the page, and this seems to bring some unwanted side effects. So this is also an opportunity to get rid of that.

In this PR we remove all the frontend code linked to the featured-product-list component.
Another PR will follow for the Strapi cleanup.

Screenshot 2023-03-20 at 17 48 16

Detailed explanation

Having multiple indexes on the page means that the internal Algolia state needs to take into account both a facet-filtered search (the one associated to the main content) and a search without any facet (the one associated to a featured-product-list section).
So we effectively perform two queries towards Algolia.

By inspecting how the Algolia state updates, there is a short time window in which the internal Algolia state clears the list of facets. This is what causes the flicker described in #1483.
This was present also before we chose to hide the facets panel if empty: it was only less visible because the panel remained in place but the facets were briefly removed and then re-added.
Please note that this is not a transition from the previous facets to the new facets since the new facets were already visible before the facets were temporarily emptied.

You can see the two queries, the old behaviour of facets and all the details described above in the following video:

Screen.Recording.2023-03-21.at.12.31.31.mov

QA

  1. Visit Vercel preview
  2. Verify that product list pages are still displaying correctly
  3. Verify that the issue described in Facets disappear briefly on page load #1483 is not present anymore
  4. Verify that we are now performing a single query towards Algolia (while performing client side navigation)

@vercel
Copy link

vercel bot commented Mar 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
react-commerce ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 21, 2023 at 4:25PM (UTC)
react-commerce-prod ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 21, 2023 at 4:25PM (UTC)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 21, 2023

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 353.58 KB (🟢 -655 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Seven Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/Parts 49.95 KB (🟢 -799 B) 403.53 KB
/Parts/[...deviceHandleItemType] 49.97 KB (🟢 -799 B) 403.55 KB
/Shop/[handle] 49.96 KB (🟢 -798 B) 403.53 KB
/Tools 49.95 KB (🟢 -798 B) 403.53 KB
/Tools/[handle] 49.96 KB (🟢 -799 B) 403.53 KB
/products/[handle] 82.84 KB (🟡 +2 B) 436.42 KB
/store 42.33 KB (🟡 +2 B) 395.91 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@federicobadini federicobadini force-pushed the remove-featured-product-list-frontend branch from e77178e to 03be51e Compare March 21, 2023 13:32
@federicobadini federicobadini marked this pull request as ready for review March 21, 2023 13:59
@federicobadini federicobadini changed the title Remove featured product list section from product list page Remove featured product list section from product list page - frontend changes Mar 21, 2023
masonmcelvain
masonmcelvain previously approved these changes Mar 21, 2023
Copy link
Contributor

@masonmcelvain masonmcelvain left a comment

Choose a reason for hiding this comment

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

CR ✌🏻 with some non-blocking comments. Nice job!

frontend/models/product-list/types.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@masonmcelvain masonmcelvain left a comment

Choose a reason for hiding this comment

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

CR ✌🏻 Thanks!

@deltuh-vee deltuh-vee self-assigned this Mar 21, 2023
@deltuh-vee deltuh-vee added the QAing Under QA team review label Mar 21, 2023
@deltuh-vee
Copy link
Contributor

QA 🎬

@deltuh-vee deltuh-vee removed the QAing Under QA team review label Mar 21, 2023
@deltuh-vee deltuh-vee merged commit bd710d8 into main Mar 21, 2023
@deltuh-vee deltuh-vee deleted the remove-featured-product-list-frontend branch March 21, 2023 20:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Facets disappear briefly on page load
3 participants