From 8fc4b60bf6924939273719cde320e9cb232c2295 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 2 Aug 2026 19:55:00 +0000 Subject: [PATCH 1/3] Fix cookie settings banner wasting horizontal space on mobile Scope close-button clearance padding to the text block only so action buttons span the full banner width; the close control stays overlaid. --- src/features/cookieConsent/ui/CookieConsentBanner.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/features/cookieConsent/ui/CookieConsentBanner.tsx b/src/features/cookieConsent/ui/CookieConsentBanner.tsx index 68cd5d02..b1f51e45 100644 --- a/src/features/cookieConsent/ui/CookieConsentBanner.tsx +++ b/src/features/cookieConsent/ui/CookieConsentBanner.tsx @@ -96,10 +96,15 @@ export const CookieConsentBanner: React.FC = ({ sx={{ alignItems: { xs: "stretch", sm: "center" }, justifyContent: "space-between", - pr: isSettingsView ? 4 : 0, }} > - + Date: Sun, 2 Aug 2026 19:56:30 +0000 Subject: [PATCH 2/3] docs(cookie-consent): fix stale Thanos reference in banner JSDoc --- src/features/cookieConsent/ui/CookieConsentBanner.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/cookieConsent/ui/CookieConsentBanner.tsx b/src/features/cookieConsent/ui/CookieConsentBanner.tsx index b1f51e45..b4365165 100644 --- a/src/features/cookieConsent/ui/CookieConsentBanner.tsx +++ b/src/features/cookieConsent/ui/CookieConsentBanner.tsx @@ -25,7 +25,7 @@ type CookieConsentBannerProps = { onAcceptAll: (event: React.MouseEvent) => void; onRejectNonEssential: (event: React.MouseEvent) => void; onClose: (event: React.MouseEvent) => void; - /** Visual surface used by optional dismiss effects (e.g. Thanos disintegrate). */ + /** Visual surface used by optional dismiss effects (e.g. DOM disintegrate). */ surfaceRef?: React.Ref; }; From da848ed0a12a57cc5650fa5a97ddfae86f665ac4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 2 Aug 2026 19:58:29 +0000 Subject: [PATCH 3/3] fix(cookie-consent): freeze settings view before close side effects Capture isSettingsView before onClose/accept handlers run so the dismiss animation does not flash initial consent copy when the parent sets settingsOpen=false synchronously. --- .../CookieConsentBannerWithDismissEffect.tsx | 5 +- ...kieConsentBannerWithDismissEffect.test.tsx | 49 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/features/cookieConsent/ui/CookieConsentBannerWithDismissEffect.tsx b/src/features/cookieConsent/ui/CookieConsentBannerWithDismissEffect.tsx index 5fd76f0c..fa6b255f 100644 --- a/src/features/cookieConsent/ui/CookieConsentBannerWithDismissEffect.tsx +++ b/src/features/cookieConsent/ui/CookieConsentBannerWithDismissEffect.tsx @@ -52,13 +52,16 @@ export const CookieConsentBannerWithDismissEffect: React.FC< return; } + const settingsViewAtDismiss = isSettingsView; + setFrozenSettingsView(settingsViewAtDismiss); + const persisted = action(); if (persisted === false) { + setFrozenSettingsView(null); return; } isDismissingRef.current = true; - setFrozenSettingsView(isSettingsView); onBeginDismiss(); void (async () => { diff --git a/src/features/cookieConsent/ui/__tests__/CookieConsentBannerWithDismissEffect.test.tsx b/src/features/cookieConsent/ui/__tests__/CookieConsentBannerWithDismissEffect.test.tsx index cb9f1c4f..a19f6826 100644 --- a/src/features/cookieConsent/ui/__tests__/CookieConsentBannerWithDismissEffect.test.tsx +++ b/src/features/cookieConsent/ui/__tests__/CookieConsentBannerWithDismissEffect.test.tsx @@ -3,6 +3,7 @@ import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { SnackbarProvider } from "notistack"; import type * as Notistack from "notistack"; +import { useState } from "react"; import { describe, expect, it, vi } from "vitest"; import type * as SharedHooks from "#/shared/hooks"; @@ -127,6 +128,54 @@ describe("CookieConsentBannerWithDismissEffect", () => { expect(onCompleteDismiss).not.toHaveBeenCalled(); }); + it("keeps settings view frozen while close dismiss animation is pending", async () => { + disintegrateMock.mockClear(); + const user = userEvent.setup(); + + const SettingsCloseHarness = () => { + const [isSettingsView, setIsSettingsView] = useState(true); + + return ( + + + true)} + onRejectNonEssential={vi.fn()} + onClose={() => { + setIsSettingsView(false); + }} + onBeginDismiss={vi.fn()} + onCompleteDismiss={vi.fn()} + /> + + + ); + }; + + render(); + + await user.click( + screen.getByRole("button", { name: "COOKIE_SETTINGS_CLOSE" }), + ); + + expect(screen.getByText("COOKIE_SETTINGS_TITLE")).toBeInTheDocument(); + expect( + screen.getByRole("button", { name: "COOKIE_SETTINGS_CLOSE" }), + ).toBeInTheDocument(); + + await waitFor(() => { + expect(disintegrateMock).toHaveBeenCalledTimes(1); + }); + + resolveDisintegrate?.(); + await waitFor(() => { + expect( + screen.queryByText("COOKIE_SETTINGS_TITLE"), + ).not.toBeInTheDocument(); + }); + }); + it("still completes dismiss and shows a warning when the animation fails", async () => { disintegrateMock.mockClear(); enqueueSnackbarMock.mockClear();