Skip to content

feat(core): enable product image pagination#2863

Merged
jorgemoya merged 14 commits intocanaryfrom
catalyst-1572-paginate-product-gallery
Feb 10, 2026
Merged

feat(core): enable product image pagination#2863
jorgemoya merged 14 commits intocanaryfrom
catalyst-1572-paginate-product-gallery

Conversation

@jorgemoya
Copy link
Contributor

@jorgemoya jorgemoya commented Feb 3, 2026

What/Why?

Add pagination support for the product gallery. When a product has more images than the initial page load, new images will load as batches once the user reaches the end of the existing thumbnails. Thumbnail images now will display in horizontal direction in all viewport sizes.

Testing

Kapture.2026-02-04.at.13.43.01.mp4

Migration steps

  1. Create the new server action file core/app/[locale]/(default)/product/[slug]/_actions/get-more-images.ts with a GraphQL query to fetch additional product images with pagination.

  2. Update the product page data fetching in core/app/[locale]/(default)/product/[slug]/page-data.ts to include pageInfo (with hasNextPage and endCursor) from the images query.

  3. Update core/app/[locale]/(default)/product/[slug]/page.tsx to pass the new pagination props (pageInfo, productId, loadMoreAction) to the ProductDetail component.

  4. The ProductGallery component now accepts optional props for pagination:

    • pageInfo?: { hasNextPage: boolean; endCursor: string | null }
    • productId?: number
    • loadMoreAction?: ProductGalleryLoadMoreAction

Due to the number of changes, it is recommended to use the PR as a reference for migration.

@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
catalyst Ready Ready Preview, Comment Feb 10, 2026 8:17pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 3, 2026

🦋 Changeset detected

Latest commit: 0c468a1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jorgemoya jorgemoya marked this pull request as ready for review February 4, 2026 19:44
@jorgemoya jorgemoya requested a review from a team as a code owner February 4, 2026 19:44
@jorgemoya jorgemoya force-pushed the catalyst-1572-paginate-product-gallery branch from 2d943d7 to cfe7338 Compare February 4, 2026 19:44
@@ -0,0 +1,39 @@
---
"@bigcommerce/catalyst-core": patch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this be a minor?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think so, looks like it's changing the functionality a bit and is more of a feature.

@jorgemoya
Copy link
Contributor Author

Converting to draft to complete some UI changes.

"embla-carousel-autoplay": "8.5.2",
"embla-carousel-fade": "8.5.2",
"embla-carousel-react": "8.5.2",
"embla-carousel": "9.0.0-rc01",
Copy link
Contributor

Choose a reason for hiding this comment

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

Any concerns over this using an rc version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's a better idea to migrate to this new version which enables the new functionality over staying with the released version. I have also found 0 issues so far with it!

Copy link
Contributor

Choose a reason for hiding this comment

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

RCs I think we are fine with, as long as we are not using canary/alphas/betas. RC's usually indicate that it's pretty stable and the API won't change usually.

@jamesqquick
Copy link
Contributor

jamesqquick commented Feb 9, 2026

Tested this locally and confirmed that it is calling getMoreImages when scrolling through the thumbnails!

@@ -0,0 +1,39 @@
---
"@bigcommerce/catalyst-core": patch
Copy link
Contributor

Choose a reason for hiding this comment

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

I think so, looks like it's changing the functionality a bit and is more of a feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

Any way you can remove the @ts-expect-error's + // eslint-disable-next-line's?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

"embla-carousel-autoplay": "8.5.2",
"embla-carousel-fade": "8.5.2",
"embla-carousel-react": "8.5.2",
"embla-carousel": "9.0.0-rc01",
Copy link
Contributor

Choose a reason for hiding this comment

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

RCs I think we are fine with, as long as we are not using canary/alphas/betas. RC's usually indicate that it's pretty stable and the API won't change usually.

@chanceaclark
Copy link
Contributor

@jorgemoya the lint command is failing.

@jorgemoya jorgemoya added this pull request to the merge queue Feb 10, 2026
@jorgemoya jorgemoya removed this pull request from the merge queue due to a manual request Feb 10, 2026
@jorgemoya jorgemoya added this pull request to the merge queue Feb 10, 2026
Merged via the queue into canary with commit 6a23c90 Feb 10, 2026
10 of 11 checks passed
@jorgemoya jorgemoya deleted the catalyst-1572-paginate-product-gallery branch February 10, 2026 21:25
jamesqquick pushed a commit that referenced this pull request Feb 11, 2026
* feat(core): enable product image pagination

* feat: infinite gallery, no thumbnail

* fix: infinite scroll in thumbnail scroll

* fix: retains scroll position

* fix: infinite scroll fix

* fix: change product image to 12 per page

* fix: remove label prop

* fix: update loading animation

* fix: add accessbility

* chore: update changeset

* fix: merge steamable functions

* fix: update changeset

* fix: remove @ts-expect-errors

* fix: non-nullable assertion
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.

3 participants