From dd36870b9f65011af75c9304f059a314600c6888 Mon Sep 17 00:00:00 2001 From: Yonie <164077864+Isaiahriveraa@users.noreply.github.com> Date: Tue, 24 Nov 2026 15:26:07 -0800 Subject: [PATCH 1/3] feat(shop): wave the checkout lines in on the first visit Held items, the Venmo pay panel, and the confirm form pop in on arrival, using the shared list wave. The title and countdown stay still so the time left is readable from the first frame. --- frontend/src/pages/ShopCheckout.jsx | 26 ++++++++++++++---------- frontend/src/pages/ShopCheckout.test.jsx | 19 +++++++++++++++++ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/frontend/src/pages/ShopCheckout.jsx b/frontend/src/pages/ShopCheckout.jsx index 91293728..8221e3f4 100644 --- a/frontend/src/pages/ShopCheckout.jsx +++ b/frontend/src/pages/ShopCheckout.jsx @@ -10,6 +10,8 @@ Expected Response Information: Hold details, the pending purchase, or a clear no import { useCallback, useEffect, useState } from "react"; import { Link, useNavigate, useParams } from "react-router-dom"; +import usePageEntrance from "../hooks/usePageEntrance"; +import { entranceIndexStyle } from "../utils/pageEntrance"; import { useAuthContext } from "../context/AuthContext"; import { useShopCart } from "../context/ShopCartContext"; import { formatCents } from "../utils/shopFormat"; @@ -127,6 +129,8 @@ export default function ShopCheckoutPage() { const [notice, setNotice] = useState(null); const [isBusy, setIsBusy] = useState(false); const [nowMs, setNowMs] = useState(() => Date.now()); + const entering = usePageEntrance(); + const checkoutClass = `shopCheckout baseContainer${entering ? " pageEntrance--enter" : ""}`; const loadHold = useCallback(async () => { setLoadState("loading"); @@ -275,12 +279,12 @@ export default function ShopCheckoutPage() { } if (loadState === "loading") { - return
Loading your checkout…
; + return
Loading your checkout…
; } if (loadState === "signin") { return ( -
+

Sign in to continue

Sign in to see your held items and finish your purchase.

@@ -324,7 +328,7 @@ export default function ShopCheckoutPage() { if (purchase) { return ( -
+

Your purchase is submitted

Thanks for buying Informatics merch!

@@ -343,7 +347,7 @@ export default function ShopCheckoutPage() { const secondsLeft = formatCountdown(remainingMs); return ( -
+

Checkout

{isOpen && ( @@ -385,8 +389,8 @@ export default function ShopCheckoutPage() { )}
    - {hold.lines.map((line) => ( -
  • + {hold.lines.map((line, index) => ( +
  • {line.quantity} × {line.name}, size {line.size} {formatCents(line.unitPriceCents * line.quantity)} {isOpen && ( @@ -409,7 +413,7 @@ export default function ShopCheckoutPage() {

    {isOpen && ( -
    +

    Pay with Venmo

    @@ -435,7 +439,7 @@ export default function ShopCheckoutPage() { )} {isOpen && ( -
    +
    diff --git a/frontend/src/pages/ShopCheckout.test.jsx b/frontend/src/pages/ShopCheckout.test.jsx index 71f35d6b..90e50dbf 100644 --- a/frontend/src/pages/ShopCheckout.test.jsx +++ b/frontend/src/pages/ShopCheckout.test.jsx @@ -9,6 +9,7 @@ import { act, cleanup, fireEvent, render, screen, waitFor, within } from "@testi import { MemoryRouter, Route, Routes } from "react-router-dom"; import { ShopCartProvider } from "../context/ShopCartContext"; import ShopCheckoutPage from "./ShopCheckout"; +import { resetPageEntranceForTests } from "../utils/pageEntrance"; const auth = vi.hoisted(() => ({ isAuthenticated: true, signIn: vi.fn() })); vi.mock("../context/AuthContext", () => ({ useAuthContext: () => auth })); @@ -77,6 +78,7 @@ function storedCart() { } beforeEach(() => { + resetPageEntranceForTests(); auth.isAuthenticated = true; auth.signIn.mockReset(); vi.spyOn(window, "scrollTo").mockImplementation(() => {}); @@ -408,3 +410,20 @@ describe("ShopCheckoutPage", () => { expect(storedCart()).toHaveLength(2); }); }); + + test("waves the checkout lines in on the first visit, leaving the title and timer still", async () => { + mockApi({ + [`GET /api/v1/shop/holds/${holdId}`]: response({ status: "success", hold: hold() }), + }); + renderCheckout(); + + expect(await screen.findByRole("heading", { name: "Checkout" })).toBeInTheDocument(); + const main = document.querySelector("main.shopCheckout"); + expect(main).toHaveClass("pageEntrance--enter"); + const lines = [...document.querySelectorAll("li.shopCheckout__line")]; + expect(lines).toHaveLength(2); + expect(lines[0]).toHaveClass("pageEntrance__listItem"); + expect(lines[0].style.getPropertyValue("--entrance-i")).toBe("0"); + expect(lines[1].style.getPropertyValue("--entrance-i")).toBe("1"); + expect(document.querySelector(".shopCheckout__timer")).not.toHaveClass("pageEntrance__listItem"); + }); From 0408f54200e284043a6f272a520cf3e70feb37ff Mon Sep 17 00:00:00 2001 From: Yonie <164077864+Isaiahriveraa@users.noreply.github.com> Date: Tue, 24 Nov 2026 15:33:49 -0800 Subject: [PATCH 2/3] refactor(shop): opt checkout into the shared entrance wrappers Early-return states share the class hook so the first-visit flag is only read once. Held lines, the Venmo panel, and the confirm form use the list wrapper; the title and countdown stay still. --- frontend/src/pages/ShopCheckout.jsx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend/src/pages/ShopCheckout.jsx b/frontend/src/pages/ShopCheckout.jsx index 8221e3f4..1c460a0f 100644 --- a/frontend/src/pages/ShopCheckout.jsx +++ b/frontend/src/pages/ShopCheckout.jsx @@ -10,8 +10,7 @@ Expected Response Information: Hold details, the pending purchase, or a clear no import { useCallback, useEffect, useState } from "react"; import { Link, useNavigate, useParams } from "react-router-dom"; -import usePageEntrance from "../hooks/usePageEntrance"; -import { entranceIndexStyle } from "../utils/pageEntrance"; +import { EntranceList, usePageEntranceClass } from "../components/PageEntrance"; import { useAuthContext } from "../context/AuthContext"; import { useShopCart } from "../context/ShopCartContext"; import { formatCents } from "../utils/shopFormat"; @@ -129,8 +128,7 @@ export default function ShopCheckoutPage() { const [notice, setNotice] = useState(null); const [isBusy, setIsBusy] = useState(false); const [nowMs, setNowMs] = useState(() => Date.now()); - const entering = usePageEntrance(); - const checkoutClass = `shopCheckout baseContainer${entering ? " pageEntrance--enter" : ""}`; + const checkoutClass = usePageEntranceClass("shopCheckout baseContainer"); const loadHold = useCallback(async () => { setLoadState("loading"); @@ -389,8 +387,9 @@ export default function ShopCheckoutPage() { )}
      - {hold.lines.map((line, index) => ( -
    • + + {hold.lines.map((line) => ( +
    • {line.quantity} × {line.name}, size {line.size} {formatCents(line.unitPriceCents * line.quantity)} {isOpen && ( @@ -406,6 +405,7 @@ export default function ShopCheckoutPage() { )}
    • ))} +

    @@ -413,7 +413,8 @@ export default function ShopCheckoutPage() {

    {isOpen && ( -
    + +

    Pay with Venmo

    @@ -436,10 +437,7 @@ export default function ShopCheckoutPage() {
    - )} - - {isOpen && ( - +
    @@ -517,6 +515,7 @@ export default function ShopCheckoutPage() {
    + )} {notice &&

    {notice}

    } From 21411883027860597c80444a6ce29276f37ecbd3 Mon Sep 17 00:00:00 2001 From: Yonie <164077864+Isaiahriveraa@users.noreply.github.com> Date: Tue, 24 Nov 2026 16:00:41 -0800 Subject: [PATCH 3/3] fix(shop): wait until checkout has loaded before waving the lines in --- frontend/src/pages/ShopCheckout.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/ShopCheckout.jsx b/frontend/src/pages/ShopCheckout.jsx index 1c460a0f..2a11c9b4 100644 --- a/frontend/src/pages/ShopCheckout.jsx +++ b/frontend/src/pages/ShopCheckout.jsx @@ -128,7 +128,7 @@ export default function ShopCheckoutPage() { const [notice, setNotice] = useState(null); const [isBusy, setIsBusy] = useState(false); const [nowMs, setNowMs] = useState(() => Date.now()); - const checkoutClass = usePageEntranceClass("shopCheckout baseContainer"); + const checkoutClass = usePageEntranceClass("shopCheckout baseContainer", { onceKey: "checkout", ready: loadState !== "loading" }); const loadHold = useCallback(async () => { setLoadState("loading");