Title: feat(consent): cookie consent banner and cookie policy by waleedlatif1 · Pull Request #6832 · simstudioai/sim · GitHub
Open Graph Title: feat(consent): cookie consent banner and cookie policy by waleedlatif1 · Pull Request #6832 · simstudioai/sim
X Title: feat(consent): cookie consent banner and cookie policy by waleedlatif1 · Pull Request #6832 · simstudioai/sim
Description: Summary Adds a cookie consent banner (c15t, hosted mode) and a /cookie-policy page. Both are hosted-only: the root layout renders the runtime behind isHosted, alongside the existing GTM/GA gates, so a self-hosted deployment never fetches the chunk, never reaches Sim's consent backend, and never sees the banner. Banner A non-modal card docked bottom-left, opposite the toast stack and wearing the same chrome. It never dims, blocks, or reflows the page; "Customize" expands the same card into per-category switches rather than opening a dialog over the app. Built from Chip/Switch/Label — the runtime is imported from @c15t/nextjs/headless, which leaves c15t's own components and stylesheet out of the bundle entirely. Visibility and the available actions come from the jurisdiction policy the runtime resolves, so the banner is absent where no consent is required (verified: a US visitor gets ui.mode: 'none', a DE/GB visitor gets the banner). Accept and reject render with identical weight on the first layer, which GDPR requires. The CSP bug this uncovered Our own CSP blocked connect-src to the consent backend, and c15t's failure mode for a blocked request is silent: it falls back to an offline policy that shows the banner to every visitor worldwide and records nothing. The backend origin now lives in lib/consent/constants and csp.ts allows it from that single source, so the two cannot drift. Verified end to end: 200 GET /init on load, 200 POST /subjects on accept. Cookie policy /cookie-policy is a third consumer of the shared ProsePage primitive alongside Terms and Privacy, so the three share a layout and cannot drift. The cookie inventory is rendered as tables via a new table LegalBlock kind. The inventory was enumerated empirically from a real page load rather than written from memory. Cross-referenced from the Privacy Policy (whose lastUpdated is bumped), and added to the sitemap, llms.txt, and llms-full.txt. Not added to the footer, per request. Type of Change New feature Documentation Testing bun run type-check, bun run lint:check, and all 29 check:audits pass. New unit test covers the runtime's configuration. Driven in a real browser against the live consent instance: banner shown for DE, absent for US, /init and /subjects both 200, expand/save/reject/reopen all exercised. Reviewers should focus on the copy in cookie-policy-content.tsx (it is legal text — check the retention periods and provider attributions against what we actually set) and on the light token-layer decision in consent-banner.tsx. Known gaps (deliberately not in this PR) Prior blocking is not implemented. GTM, GA, HubSpot, X, and Ahrefs are hardcoded