Skip to content

feat(scripts): add consent manager ui and internationalization#2650

Merged
matthewvolk merged 1 commit intocanaryfrom
feat/consent-manage-ui-and-intl
Oct 28, 2025
Merged

feat(scripts): add consent manager ui and internationalization#2650
matthewvolk merged 1 commit intocanaryfrom
feat/consent-manage-ui-and-intl

Conversation

@matthewvolk
Copy link
Copy Markdown
Contributor

Warning

Depends on #2643

What/Why?

Adds a consent manager UI and internationalization by integrating the C15T CookieBanner and ConsentManagerDialog with Catalyst components. The update includes:

  • A cookie banner for first-time visitors
  • A full-screen dialog for managing preferences based off C15T's native component
  • i18n via next-intl

Testing

  • First visit: banner offers accept, reject, or customize
  • Accept/reject: consent persists; closes dialog
  • Customize: opens dialog with accordion list; checkbox per category
  • Saved preferences persist and the banner no longer appears
  • Translations use the new "ConsentManager" i18n keys

Confirm the ConsentManagerProvider from @/lib/consent-manager is added to your root layout.

Migration

  1. New files:

    • core/components/consent-manager/consent-manager-dialog.tsx — dialog and widget
    • core/components/consent-manager/cookie-banner.tsx — banner component
  2. Layout updates:

    • Add ConsentManagerProvider around app content
    • Render CookieBanner
    • Render ConsentManagerDialog
  3. i18n updates:

    • Add "ConsentManager" translations under Components.ConsentManager.Common, .CookieBanner, .Dialog, and .ConsentTypes
  4. Breaking changes:

    • None; add ConsentManagerProvider, CookieBanner, ConsentManagerDialog, and translations to your layout
  5. Integration:

import { ConsentManagerProvider } from '@/lib/consent-manager';
import { CookieBanner } from '@/components/consent-manager/cookie-banner';
import { ConsentManagerDialog } from '@/components/consent-manager/consent-manager-dialog';

// In your layout, ensure this is wrapped by NextIntlClientProvider
<ConsentManagerProvider>
  <YourOtherProviders>
    <CookieBanner />
    <ConsentManagerDialog />
    {/* rest of your app */}
  </YourOtherProviders>
</ConsentManagerProvider>
  1. i18n keys to add:
    • Components.ConsentManager.Common.*
    • Components.ConsentManager.CookieBanner.*
    • Components.ConsentManager.Dialog.*
    • Components.ConsentManager.ConsentTypes.*

@matthewvolk matthewvolk requested a review from a team October 27, 2025 19:00
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Oct 27, 2025

🦋 Changeset detected

Latest commit: 0d39631

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 27, 2025

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

Project Deployment Preview Comments Updated (UTC)
catalyst-b2b Ready Ready Preview Comment Oct 28, 2025 10:13pm
catalyst-canary Ready Ready Preview Comment Oct 28, 2025 10:13pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
catalyst Ignored Ignored Oct 28, 2025 10:13pm

Copy link
Copy Markdown
Contributor

@jorgemoya jorgemoya left a comment

Choose a reason for hiding this comment

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

LGTM!

<ConsentManagerProvider>
<NuqsAdapter>
<StreamableAnalyticsProvider data={streamableAnalyticsData} />
<Providers>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unrelated but I wonder if we should remove Providers and just inline everything here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah honestly I was thinking the same thing

@matthewvolk matthewvolk force-pushed the feat/consent-manage-ui-and-intl branch from 1f03d80 to 0d39631 Compare October 28, 2025 22:12
@matthewvolk matthewvolk added this pull request to the merge queue Oct 28, 2025
Merged via the queue into canary with commit 416796f Oct 28, 2025
11 checks passed
@matthewvolk matthewvolk deleted the feat/consent-manage-ui-and-intl branch October 28, 2025 22:16
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