Skip to content

test(chore): mint Linux visual baselines - #373

Merged
Ducksss merged 1 commit into
claude/analytics-consent-gatefrom
visual-baselines/claude-analytics-consent-gate-30250481879
Jul 27, 2026
Merged

Ducksss merged 1 commit into
claude/analytics-consent-gatefrom
visual-baselines/claude-analytics-consent-gate-30250481879

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Auto-generated by the visual-baselines workflow. Commits the per-platform frontend snapshot baselines so the visual-regression suite compares (instead of skipping) on the CI gate.

@vercel

vercel Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
payload-components-97bf Ready Ready Preview, Comment Jul 27, 2026 8:41am

@github-actions
github-actions Bot requested a review from Ducksss as a code owner July 27, 2026 08:39
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/ducksss-projects?upgradeToPro=build-rate-limit

@Ducksss
Ducksss merged commit 1ef3b51 into claude/analytics-consent-gate Jul 27, 2026
1 of 3 checks passed
Ducksss pushed a commit that referenced this pull request Jul 27, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Ducksss pushed a commit that referenced this pull request Jul 27, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Ducksss added a commit that referenced this pull request Jul 27, 2026
…#372)

* privacy(feat): gate all third-party analytics behind explicit consent

Closes the gap the PR audit left open: GA4, Vercel Analytics/Speed Insights and
PostHog all loaded on first paint, so an EU visitor had GA4 cookies set before
any interaction. Honouring GPC/DNT (shipped in #352) narrowed that but could not
close it, because GA4 was mounted regardless.

AnalyticsShell now renders nothing until consent is 'granted'. On a first visit
there is no GA4 script, no Vercel bundle, no PostHog beacon and no stored
identifier. State lives in src/lib/consent.ts under `pc_consent`; ConsentBanner
collects the choice and /privacy documents the stack and can withdraw it.

Three things worth calling out:

- A browser privacy signal is a decision, not a prompt. GPC (binding under the
  CCPA) or DNT resolves to 'denied' and the banner never renders.
- Withdrawal reloads. Unmounting AnalyticsShell does not unload a third party
  that is already running — gtag stays initialised on window and keeps
  collecting — so setConsent reloads on granted -> denied. It also clears
  pc_distinct_id, so opting out erases the identifier instead of freezing it.
  This was caught by the e2e spec, not by review.
- The banner is fixed-positioned, so it costs no layout shift on the landing
  page's LCP content.

Testing: specs that assert on analytics or capture visual baselines grant consent
up-front via tests/e2e/consent.ts, which keeps the banner out of every snapshot —
only the two landing baselines changed, and only because /privacy was added to
the footer. The axe suites deliberately run without consent, so the banner is
held to the same a11y bar as the rest of the site.

Verified: lint clean, tsc clean, 341 int tests, and e2e — consent 6/6, a11y
10/10, frontend 39/39, templates 60/60, templates-visual 62/62, components-visual
69/69, blog 5/5, geo 13/13. blog-index visual baselines fail identically on clean
origin/dev (stale darwin snapshots, unrelated to this change).

Co-Authored-By: Claude Opus 5 <[email protected]>

* test(chore): mint Linux visual baselines (frontend) (#373)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* privacy(fix): erase the identifier on a privacy signal and reload other tabs

Both found by CodeRabbit on #372 — the first substantive AI review this repo has
had on a dev-targeted PR since .coderabbit.yaml listed `dev` as a base branch.

resolveConsent() returned 'denied' for a GPC/DNT visitor without clearing a
pc_distinct_id that an earlier opt-in may have stored. It was never sent while
denied, but it survived to re-link the visitor to their previous identity if they
later opted back in. A signal is now treated exactly like an explicit
withdrawal.

subscribeToConsent() notified React on a cross-tab change but never reloaded.
That is the same defect the reload in setConsent exists to prevent, one tab over:
a tab that already mounted GA4 keeps gtag initialised on window and keeps
collecting, because unmounting AnalyticsShell cannot unload it. A withdrawal
elsewhere now tears this tab down too.

Both are covered by new specs that fail without the fix: a privacy signal
arriving after an opt-in must leave no identifier, and withdrawing in one tab
must strip the Google tag from a second tab that already had it.

Verified: lint clean, tsc clean, 341 int tests, consent e2e 8/8.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Ducksss
Ducksss deleted the visual-baselines/claude-analytics-consent-gate-30250481879 branch August 3, 2026 08:49

This branch was successfully deployed

1 active deployment
Preview – payload-components-97bf — d657943c Deployed Jul 27, 2026 by vercel[bot]
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.

1 participant