Skip to content

LTRAC-2085: fix(core) - Refresh the cart shipping form after its actions - #3254

Merged
jorgemoya merged 1 commit into
canaryfrom
LTRAC-2085/fix/cart-shipping-form-refresh
Sep 30, 2026
Merged

jorgemoya merged 1 commit into
canaryfrom
LTRAC-2085/fix/cart-shipping-form-refresh

Conversation

@jorgemoya

Copy link
Copy Markdown
Contributor

Linear: LTRAC-2085

What/Why?

The cart shipping estimator didn't update after its own actions. After "View shipping options", "Add shipping", or a quantity change, the new options or selection only appeared after a full page reload.

Root cause: ShippingForm seeds its useActionState and useState from props once. updateShippingInfo returns prevState, so the new address, quote, and selection never reach the form. The server re-render sends fresh props, but the mounted form ignores them.

Fix: key ShippingForm on the server's shipping state (address, options, selected option, showShippingForm). The form remounts only when that state actually changes. A failed action leaves it in place, so validation errors still show.

E2E impact: the shipping specs wrapped every step in try { expect } catch { reload } (the old CATALYST-1685 TODOs). That hid the bug, and each step burned a 5s wait first. Updating cart quantity … new quote was hitting its 30s timeout on every attempt, which kept E2E Functional Tests (default) red on every PR. This PR removes the fallbacks, so the specs now assert the real behavior.

This is one piece of LTRAC-2085. The other flaky default failures (account wishlists/addresses, etc.) are not addressed here.

Testing

Run locally against the E2E test store (next build + next start, chromium, --retries=0):

  • With the fix: shipping.spec.ts passed 3/3, then 9/9 with --repeat-each=3. The quantity test takes ~12s, down from ~30s (timeout).
  • Control (same new specs, client.tsx reverted): 3/3 fail. Each one sees getByLabel('Shipping options') stay hidden right after "View shipping options".

Migration

In core/vibes/soul/sections/cart/client.tsx, add a key to ShippingForm. See the changeset for the snippet.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b5e708

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 Patch

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

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
catalyst Ready Ready Preview Sep 29, 2026 11:09pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Bundle Size Report

Comparing against baseline from ca143ac (2026-09-29).

No bundle size changes detected.

@jorgemoya
jorgemoya marked this pull request as ready for review September 29, 2026 22:07
@jorgemoya
jorgemoya requested a review from a team as a code owner September 29, 2026 22:07
ShippingForm seeds useActionState from props once, and updateShippingInfo
returns the previous state, so "View shipping options", "Add shipping", and
quantity changes left the form stale until a full page reload. Key the form
on the server's shipping state so it remounts with fresh props when that
state changes.

Drop the try/catch reload fallbacks from the shipping E2E tests. They masked
this bug and each burned a 5s wait, pushing the quantity test past its 30s
timeout on every CI run.

Refs LTRAC-2085
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 98 99 99 99

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 100 91 100 100
Accessibility 95 98 95 98
Best Practices 100 100 100 100
SEO 88 100 100 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 0.5 s 0.6 s 0.5 s 0.8 s
CLS 0.039 0.183 0.039 0
FCP 0.3 s 0.3 s 0.3 s 0.4 s
TBT 0 ms 70 ms 0 ms 10 ms
Max Potential FID 40 ms 90 ms 40 ms 60 ms
Time to Interactive 0.3 s 0.7 s 0.3 s 0.7 s

Full Unlighthouse report →

@jorgemoya
jorgemoya added this pull request to the merge queue Sep 30, 2026
Merged via the queue into canary with commit 75aa709 Sep 30, 2026
19 checks passed
@jorgemoya
jorgemoya deleted the LTRAC-2085/fix/cart-shipping-form-refresh branch September 30, 2026 14:17

This branch was successfully deployed

1 active deployment
Preview — 3b5e7081 Deployed Sep 29, 2026 by vercel[bot]
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