Skip to content

chore: update dev with main (keep 4.6.0-dev.0) - #3446

Merged
eduardoformiga merged 22 commits into
devfrom
chore/sync-dev-with-main-4.5.1
Aug 11, 2026
Merged

eduardoformiga merged 22 commits into
devfrom
chore/sync-dev-with-main-4.5.1

Conversation

@eduardoformiga

@eduardoformiga eduardoformiga commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Manual back-merge of main (4.5.1 hotfix) into dev, to bring the infinite-scroll fix (#3437) without resetting the prerelease cycle.

dev was already at 4.6.0-dev.0, so package/lerna versions stay on 4.6.0-dev.0 (ahead of stable 4.5.1) instead of the default resolve-script downgrade to 4.5.1.

The automated back-merge (run 31502187816) failed before opening this PR (missing CLI build — fixed in #3445). This PR was created by running the same steps locally, then correcting the version pin.

Deterministic CHANGELOG conflicts were unioned; lockfile/codegen regenerated. No non-deterministic conflicts.

Contents from main

Summary by CodeRabbit

  • Bug Fixes

    • Improved scroll restoration across navigation, browser history, and infinite-scroll pages.
    • Prevented repeated Intelligent Search redirects.
    • Preserved product-gallery height during loading to reduce layout shifts.
    • Improved gallery behavior when filtering, sorting, or changing viewport size.
  • Improvements

    • Product loading placeholders now match the requested page size.
    • Added safeguards for smoother loading and navigation transitions.
  • Documentation

    • Updated package changelogs for version 4.5.1.

eduardoformiga and others added 21 commits August 6, 2026 23:16
Move Intelligent Search redirects out of render (SO-651) and harden PLP↔PDP
scroll restore so back navigation lands on the product without footer flash or
layout collapse under infinite scroll.
Add unit/browser tests for SO-651 redirect behavior, scroll restore helpers,
ProductGridSkeleton count, and GalleryPageHeightLock reserved heights so
Sonar new-code coverage meets the 75% gate.
…ghts

Compare normalized pathnames for same-route detection, and defer gallery
height reads until after mount to avoid SSR/client mismatches.
Use globalThis instead of window, replaceAll for key sanitization, and a
positive SSR guard so the quality gate stops flagging the new issues.
Use router.pathname for the /s reset guard so locale-prefixed search
paths still skip resetInfiniteScroll, stop carrying stale PDP anchors on
non-PDP exits, ignore modified clicks when saving anchors, and cloak
restore with visibility:hidden instead of opacity:0.
Long PLP paths with multiple facets exceeded the 180-char sanitized key
limit and dropped page/viewport, so mobile and desktop (and adjacent
pages) could share the same sessionStorage height entry.
Use Math.trunc and String#codePointAt instead of | 0 / charCodeAt.
PDP → home was calling resetInfiniteScroll(0) and wiping in-memory pages
while sessionStorage still held [0,1,2] for the PLP. Back then scrolled to
the saved Y with only page 0 mounted, leaving the viewport in empty
reserved height near the footer. Skip reset when leaving PDPs and
rehydrate pages from sessionStorage before scroll restore.
Satisfies Sonar preference for String#replaceAll over replace with a global regex.
Remove the /s and PDP leave guards that leaked Zustand pages into the
next PLP when scrollRestoration is on. Back-nav still rehydrates pages
from pathname-keyed sessionStorage; SO-651 stays covered by SearchWrapper.
# Conflicts:
#	CHANGELOG.md
#	lerna.json
#	packages/api/CHANGELOG.md
#	packages/api/package.json
#	packages/cli/CHANGELOG.md
#	packages/cli/package.json
#	packages/components/CHANGELOG.md
#	packages/components/package.json
#	packages/core/CHANGELOG.md
#	packages/core/package.json
#	packages/diagnostics/CHANGELOG.md
#	packages/diagnostics/package.json
#	packages/lighthouse/CHANGELOG.md
#	packages/lighthouse/package.json
#	packages/sdk/CHANGELOG.md
#	packages/sdk/package.json
#	packages/storybook/CHANGELOG.md
#	packages/storybook/package.json
#	packages/ui/CHANGELOG.md
#	packages/ui/package.json
@eduardoformiga
eduardoformiga requested a review from a team as a code owner August 11, 2026 23:03
@eduardoformiga
eduardoformiga requested review from emersonlaurentino and lemagnetic and removed request for a team August 11, 2026 23:03
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 795a06d3-7f59-4818-8bbb-509eb41f8d2e

📥 Commits

Reviewing files that changed from the base of the PR and between d513eff and 029feb6.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by none and included by none
📒 Files selected for processing (20)
  • packages/api/CHANGELOG.md
  • packages/cli/CHANGELOG.md
  • packages/components/CHANGELOG.md
  • packages/core/CHANGELOG.md
  • packages/core/src/components/product/ProductGrid/ProductGrid.tsx
  • packages/core/src/components/skeletons/ProductGridSkeleton/ProductGridSkeleton.tsx
  • packages/core/src/components/templates/SearchPage/SearchWrapper.tsx
  • packages/core/src/components/ui/ProductGallery/GalleryPageHeightLock.tsx
  • packages/core/src/components/ui/ProductGallery/ProductGallery.tsx
  • packages/core/src/sdk/ui/useScrollRestoration.tsx
  • packages/core/src/styles/global/index.scss
  • packages/core/test/components/skeletons/ProductGridSkeleton.browser.test.tsx
  • packages/core/test/components/templates/SearchPage/SearchWrapper.browser.test.tsx
  • packages/core/test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx
  • packages/core/test/sdk/ui/useScrollRestoration.browser.test.ts
  • packages/diagnostics/CHANGELOG.md
  • packages/lighthouse/CHANGELOG.md
  • packages/sdk/CHANGELOG.md
  • packages/storybook/CHANGELOG.md
  • packages/ui/CHANGELOG.md

Walkthrough

FastStore 4.5.1 updates package changelogs and modifies product skeleton counts, Intelligent Search redirects, gallery height persistence, and scroll restoration. Browser tests cover the new loading, navigation, storage, observer, and restoration behavior.

Changes

Core release and navigation behavior

Layer / File(s) Summary
4.5.1 package release metadata
packages/*/CHANGELOG.md
Adds 4.5.1 release entries and comparison links across the package changelogs.
Loading counts and search redirects
packages/core/src/components/skeletons/ProductGridSkeleton/ProductGridSkeleton.tsx, packages/core/src/components/product/ProductGrid/ProductGrid.tsx, packages/core/src/components/templates/SearchPage/SearchWrapper.tsx, packages/core/test/components/skeletons/*, packages/core/test/components/templates/SearchPage/*
Product skeletons accept page-specific counts. Intelligent Search redirects run from an effect and avoid repeated navigation. Browser tests cover both behaviors.
Gallery height persistence
packages/core/src/components/ui/ProductGallery/*, packages/core/test/components/ui/ProductGallery/*
Gallery height keys include search state, page, and viewport data. Per-page boundaries restore saved heights, observe product mounting, persist measurements, and release locks after products load.
Navigation scroll restoration
packages/core/src/sdk/ui/useScrollRestoration.tsx, packages/core/src/styles/global/index.scss, packages/core/test/sdk/ui/*
Scroll restoration adds PDP anchors, infinite-scroll page restoration, route lifecycle handling, retries, stale-session protection, paint suppression, and test utilities. Browser tests cover lifecycle and helper behavior.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant SearchWrapper
  participant Router
  participant ProductGallery
  participant GalleryPageHeightLock
  participant sessionStorage
  Browser->>SearchWrapper: provide search response
  SearchWrapper->>Router: replace redirect URL once
  ProductGallery->>GalleryPageHeightLock: render page boundary
  GalleryPageHeightLock->>sessionStorage: read persisted height
  GalleryPageHeightLock->>ProductGallery: apply reserved minHeight
  ProductGallery->>GalleryPageHeightLock: render product cards
  GalleryPageHeightLock->>sessionStorage: persist measured height
Loading
sequenceDiagram
  participant Browser
  participant Router
  participant useScrollRestoration
  participant sessionStorage
  participant InfiniteScroll
  Browser->>useScrollRestoration: capture product-link click or popstate
  useScrollRestoration->>sessionStorage: save scroll position and PDP anchor
  Router->>useScrollRestoration: emit route completion
  useScrollRestoration->>InfiniteScroll: rehydrate or reset pages
  useScrollRestoration->>Browser: restore anchor or coordinates
Loading

Possibly related PRs

  • vtex/faststore#3437: Contains the same core changes across skeletons, search redirects, gallery height handling, and scroll restoration.
  • vtex/faststore#3105: Directly overlaps with the ProductGrid changes.
  • vtex/faststore#3195: Updates release changelog entries in the same package files.

Suggested reviewers: lemagnetic, emersonlaurentino

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/sync-dev-with-main-4.5.1

Comment @coderabbitai help to get the list of available commands.

@codesandbox-ci

codesandbox-ci Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

dev was already ahead of the 4.5.1 stable hotfix; do not downgrade
the prerelease cycle when syncing main into dev.
@eduardoformiga eduardoformiga changed the title chore: update dev with main (v4.5.1) chore: update dev with main (keep 4.6.0-dev.0) Aug 11, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@faststore/api

npm i https://pkg.pr.new/vtex/faststore/@faststore/api@029feb6

@faststore/cli

npm i https://pkg.pr.new/vtex/faststore/@faststore/cli@029feb6

@faststore/components

npm i https://pkg.pr.new/vtex/faststore/@faststore/components@029feb6

@faststore/core

npm i https://pkg.pr.new/vtex/faststore/@faststore/core@029feb6

@faststore/diagnostics

npm i https://pkg.pr.new/vtex/faststore/@faststore/diagnostics@029feb6

@faststore/lighthouse

npm i https://pkg.pr.new/vtex/faststore/@faststore/lighthouse@029feb6

@faststore/sdk

npm i https://pkg.pr.new/vtex/faststore/@faststore/sdk@029feb6

@faststore/ui

npm i https://pkg.pr.new/vtex/faststore/@faststore/ui@029feb6

commit: 029feb6

@sonar-workflows

Copy link
Copy Markdown

@eduardoformiga
eduardoformiga merged commit 9cca5ff into dev Aug 11, 2026
11 checks passed
@eduardoformiga
eduardoformiga deleted the chore/sync-dev-with-main-4.5.1 branch August 11, 2026 23:14
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.

1 participant