Skip to content

CMP Update#258

Merged
marythought merged 2 commits intoopentdf:mainfrom
Connor-Byram:cmp-update
Mar 20, 2026
Merged

CMP Update#258
marythought merged 2 commits intoopentdf:mainfrom
Connor-Byram:cmp-update

Conversation

@Connor-Byram
Copy link
Contributor

@Connor-Byram Connor-Byram commented Mar 20, 2026

  • deprecated REACT cookie manager
  • added Google CMP code
  • replaced Osano config id for new configuration
  • added compliance links to footer
  • updated CSS sheet to style new links and get rid of old cookie banner styling

Summary by CodeRabbit

  • New Features

    • Added legal links in the footer (Terms, Privacy, Cookie) and a Preferences button.
  • Changes

    • Updated consent and analytics initialization and default storage settings.
    • Removed the on-site cookie-consent banner and hidden the external consent widget; adjusted footer layout and styling.

@Connor-Byram Connor-Byram requested review from a team as code owners March 20, 2026 18:59
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly overhauls the website's cookie and privacy consent mechanisms. It transitions from a custom, React-based cookie consent solution to a more integrated approach utilizing Google's consent mode and an updated Osano CMP. The changes aim to improve compliance with privacy regulations and streamline the user experience related to data consent, while also updating the visual presentation of legal information in the footer.

Highlights

  • Consent Management Platform (CMP) Update: Updated the website's consent management by deprecating the React cookie manager and integrating Google CMP code, along with an updated Osano configuration.
  • Footer Compliance Links: Enhanced the website footer with new compliance links for Terms, Privacy, and Cookie Policy, including a direct option to manage cookie preferences.
  • CSS Refactoring: Refactored the CSS to remove styling for the old cookie banner and introduce new styles specifically for the updated legal footer section.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

Replaces a custom cookie-consent/banner implementation with Osano: updates Osano script URL and GA bootstrap (local gtag pushing to dataLayer with expanded consent keys and settings), hides Osano widget via CSS, removes Root consent/analytics side-effects, and updates footer HTML to include legal links and an Osano “Preferences” button.

Changes

Cohort / File(s) Summary
Consent & Analytics Config
docusaurus.config.ts
Replaced initial Osano script include with updated osano.js src; replaced inline GA bootstrap to a local function gtag() pushing to window.dataLayer; expanded gtag('consent','default', ...) with personalization_storage, functionality_storage, security_storage, added wait_for_update: 500, and added gtag("set", ...) calls (ads_data_redaction, url_passthrough); updated footer markup to <div class='legal-container'> and appended Virtru Terms/Privacy/Cookie links plus an Osano Preferences button.
Styling
src/css/custom.css
Removed custom cookie-consent banner styles (including dark-mode overrides); added .osano-cm-window__widget { display: none; } to hide Osano widget; added .legal-container layout and button/image rules; ensured .footer__copyright { width: 100%; }.
App Root
src/theme/Root.tsx
Removed cookie-consent banner, related imports, consent helper, and navigation-based pageview tracking; eliminated direct window.gtag/window.dataLayer usage; simplified Root to render children only.
Global Types
src/globals.d.ts
Added global augmentation for Window with dataLayer: any[], gtag: (...args:any[]) => void, and Osano: any; added export {} to ensure module scope.
sequenceDiagram
    participant Browser
    participant Site as Site (Root)
    participant Osano
    participant DataLayer as dataLayer/GA

    Browser->>Site: Load page (no custom cookie banner)
    Site-->>Browser: Render children
    Browser->>Osano: Load updated Osano script
    Osano-->>Browser: Determine consent (ad/analytics/personalization/functionality/security)
    Osano->>DataLayer: Push consent update (respecting wait_for_update: 500)
    Browser->>DataLayer: gtag() pushes events/pageviews when consent permits
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped in swift, the banner put away,

Osano hums, decisions find their say,
dataLayer listens, gtag learns the tune,
Legal links gleam under a privacy moon,
A rabbit winks — consent now in bloom.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'CMP Update' is vague and generic, using non-specific terminology that doesn't clearly convey the scope or nature of the changes to someone scanning history. Consider a more descriptive title such as 'Replace cookie consent manager with Google CMP and update footer compliance links' to better communicate the primary changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully replaces the deprecated React cookie manager with Google's Consent Mode Platform (CMP) via Osano, updates the configuration, and adds new compliance links to the footer. My review includes suggestions to improve accessibility for the new footer links, enhance code maintainability by removing a temporary comment and redundant CSS, and restore TypeScript type declarations for better long-term stability.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
docusaurus.config.ts (1)

69-72: Please verify this Osano script is the production profile.

The inline note reads like a launch-only override. Before merge, confirm this URL is the CMP config bound to docs.opentdf.io; otherwise the live site can ship the wrong consent copy/categories.

If helpful, I can sketch an env-backed constant here so stage/prod IDs do not get hand-edited in main.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docusaurus.config.ts` around lines 69 - 72, The Osano CMP script URL in
docusaurus.config.ts (attributes.src on the tagName "script" entry) appears to
be a launch-time override; verify that the provided URL is the production
profile bound to docs.opentdf.io and replace it with the confirmed production
Osano config if it is not. If you want safer deployments, externalize the Osano
ID/URL into an environment-backed constant (e.g., process.env.OSANO_CMP or a
config constant used in docusaurus.config.ts) and reference that constant for
attributes.src so stage/prod values are not hand-edited in main.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docusaurus.config.ts`:
- Around line 236-240: The new footer anchor tags for 'Terms', 'Privacy', and
'Cookie Policy' open targets in a new tab but lack rel hardening; update each
<a> element (the anchors with hrefs 'https://www.virtru.com/terms-of-service/',
'https://www.virtru.com/privacy-policy/', and
'https://www.virtru.com/cookie-policy') to include rel="noopener noreferrer"
alongside target="_blank" to match the rest of the external footer links.
- Line 242: Replace the anchor element that triggers Osano.cm.showDrawer with a
focusable button: change the element to <button type="button"
onclick="Osano.cm.showDrawer('osano-cm-dom-info-dialog-open')">Preferences <img
src="/img/privacyoptions.svg"></button> (serve the SVG locally by adding
privacyoptions.svg to the static/img/ directory). Also add CSS rules mirroring
.legal-container a (cursor, hover text-decoration, focus styles) to a new
.legal-container button selector in src/css/custom.css so the button visually
matches the anchor and remains keyboard-accessible.

---

Nitpick comments:
In `@docusaurus.config.ts`:
- Around line 69-72: The Osano CMP script URL in docusaurus.config.ts
(attributes.src on the tagName "script" entry) appears to be a launch-time
override; verify that the provided URL is the production profile bound to
docs.opentdf.io and replace it with the confirmed production Osano config if it
is not. If you want safer deployments, externalize the Osano ID/URL into an
environment-backed constant (e.g., process.env.OSANO_CMP or a config constant
used in docusaurus.config.ts) and reference that constant for attributes.src so
stage/prod values are not hand-edited in main.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e8ba7fc-e5e3-46fe-ba1b-9b2c41ca342c

📥 Commits

Reviewing files that changed from the base of the PR and between ed65e02 and 0f332f5.

📒 Files selected for processing (3)
  • docusaurus.config.ts
  • src/css/custom.css
  • src/theme/Root.tsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/css/custom.css (1)

213-233: Add keyboard-visible affordance for the legal preferences button.

Line 227 only styles :hover. Add :focus-visible so keyboard users get equivalent feedback.

Proposed CSS tweak
 .legal-container button {
   color: var(--ifm-link-color);
   background: none;
   border: none;
   cursor: pointer;
 }
-.legal-container button:hover { text-decoration: underline; }
+.legal-container button:hover,
+.legal-container button:focus-visible { text-decoration: underline; }
+.legal-container button:focus-visible {
+  outline: 2px solid var(--ifm-color-primary);
+  outline-offset: 2px;
+}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/css/custom.css` around lines 213 - 233, The button in .legal-container
currently only provides a hover state (.legal-container button:hover) and needs
an equivalent keyboard-visible affordance; add a :focus-visible rule (e.g.,
.legal-container button:focus-visible) that mirrors the hover styling (such as
text-decoration: underline and any outline or box-shadow for accessibility) so
keyboard users receive the same visual feedback as mouse users, and ensure the
rule targets the same .legal-container button selector to keep behavior
consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/css/custom.css`:
- Around line 213-233: The button in .legal-container currently only provides a
hover state (.legal-container button:hover) and needs an equivalent
keyboard-visible affordance; add a :focus-visible rule (e.g., .legal-container
button:focus-visible) that mirrors the hover styling (such as text-decoration:
underline and any outline or box-shadow for accessibility) so keyboard users
receive the same visual feedback as mouse users, and ensure the rule targets the
same .legal-container button selector to keep behavior consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0b48fd3f-33ee-456e-b739-5c19ec45435f

📥 Commits

Reviewing files that changed from the base of the PR and between be2f758 and b03302a.

📒 Files selected for processing (3)
  • docusaurus.config.ts
  • src/css/custom.css
  • src/globals.d.ts
✅ Files skipped from review due to trivial changes (1)
  • docusaurus.config.ts

Copy link
Contributor

@marythought marythought left a comment

Choose a reason for hiding this comment

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

🚀

@marythought marythought merged commit 1ed492d into opentdf:main Mar 20, 2026
6 checks passed
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.

2 participants