Skip to content

frontend(fix): ship the consent banner in the static HTML so it paints with the page - #590

Closed
Ducksss wants to merge 2 commits into
mainfrom
claude/happy-pascal-75c9d9
Closed

Ducksss wants to merge 2 commits into
mainfrom
claude/happy-pascal-75c9d9

Conversation

@Ducksss

@Ducksss Ducksss commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to the finding in #583 (issue #523). On a first visit to the landing page, the consent banner's description <p> was the final LCP entry at 360, 412 and 430px. Its LCP area is slightly larger than the H1's there, and ConsentBanner rendered nothing until the post-hydration consent effect, so on a throttled phone it painted about 1.9s after FCP.

This PR puts the banner in the static HTML so it no longer waits for hydration:

  • ConsentBanner also renders during SSR and the first client render, while consent is still unread (undefined). That copy is marked data-consent-banner="pending". Once React reads consent, behaviour is unchanged: null for a stored choice or a privacy signal, the live banner otherwise.
  • Hidden by default. One unlayered rule in globals.css hides the pending copy unless <html> carries data-consent-undecided. A late, failed or missing script can only delay the banner; it can never flash it at someone who already chose. Visitors without JavaScript never see it.
  • Pre-paint reveal. A 1.2 KB inline script right after the banner markup sets that attribute only when resolveConsent() would return null: no GPC/DNT signal and no stored choice. It first waits for the banner's web font (immediately if it is already loaded), so the banner never paints in the fallback face and reflows at the swap. It reads storage but never writes it.
  • Buttons work before hydration. The script records a click and hides the banner, and ConsentBanner applies the choice through setConsent() when React takes over, so every write still goes through one place. If the bundle never arrives, the banner can still be dismissed, and nothing is stored.

No copy, layout, role, label or DOM-order change. The banner stays fixed and keeps zero CLS.

First-visit LCP at 360/412/430px drops by about 0.7s on a Lighthouse-like throttled phone (3.36–3.39s → 2.63–2.67s on the final commit, on main and on #583), with CLS unchanged at every width. Returning visitors are unchanged.

Two decisions for the maintainer

  1. Copy (option C). I have not changed the banner copy; consent text needs your sign-off. With frontend(fix): let the hero H1 rise without fading so it counts as LCP #583 merged, a tighter description is the one change that makes first-visit LCP equal FCP at zero CLS: the H1 stays the LCP element. Measured candidates are below. The change is one existing key's English value, and the Crowdin, site-i18n and i18n:check gates stay green with it.
  2. Font wait. Waiting for the web font is what keeps the banner at zero CLS. On the slow profile it costs about 1.2s of LCP compared with revealing at first paint (variant A1). A1 makes LCP equal FCP, but its fallback-face paint reflows at the font swap: CLS 0.0175 → 0.0453 at 412px and 0.0021 → 0.0074 at 430px. The brief made zero CLS a constraint, so this PR ships the wait. Dropping it is a few-line change in consentBannerRevealScript if you'd rather take the LCP.

Options evaluated

Option First-visit LCP at 360/412/430 (throttled, on #583) CLS Verdict
A. Static HTML + pre-paint reveal, waiting for the font (this PR) 3.25s → 2.53–2.62s; the banner paints when Geist arrives, not at hydration unchanged Shipped
A1. Same, revealed at first paint 3.25s → 1.27–1.37s (= FCP) 412px: 0.0175 → 0.0453, 430px: 0.0021 → 0.0074 Not shipped: breaks the zero-CLS constraint
B. Tighter layout on narrow screens Only text-xs (12/16px) gets the paragraph under the H1 at every width — Not shipped: smaller consent text is a legibility cost; every other layout change only reflows the text
C. Shorter copy "Tighter rewrite" stays under the H1 at every width from 320 to 767px. With #583 + this PR: first-visit LCP is the H1 at FCP at all four widths (1.30–1.32s vs 2.56–2.57s with the current copy), CLS unchanged (scratch build, never committed; table below) unchanged Not shipped; your call

Why layout alone can't fix it: a paragraph's LCP area is roughly its widest line × line count × line height. Changing width or padding just reflows the text into more, shorter lines (or fewer, longer ones). Only the font size, the line height or the text itself moves the area. B and C also only change which element is largest. On main without #583, the faded H1 isn't an LCP candidate at all, so a smaller banner would still be the late LCP entry there. A works with or without #583.

Measurements

Method. Production builds (E2E_PORT=<port> pnpm build:e2e), each served by its own next start and loaded side by side:

Each load used Playwright 1.62.1 and Chromium 151.0.7922.34, with one cold browser context per load, and the build order rotated every iteration. The profile approximated Lighthouse mobile: 4× CPU, 150 ms RTT, 1.6 Mbps down / 750 Kbps up, DPR 1.75, a mobile UA and touch, at viewports 360×800, 390×844, 412×823 and 430×932. Analytics origins were blocked through CDP.

Buffered PerformanceObservers for largest-contentful-paint, paint and layout-shift were installed by an init script. The final LCP entry is reported with the region its element belongs to. "First visit" means a clean profile; "returning visitor" means localStorage.pc_consent = 'denied' was set by an init script before load. Δ is the median of per-iteration paired differences, with a bootstrap 95% CI.

Final commit (6 paired iterations, 192 loads, 0 console errors, run while the machine was busier, so absolute times sit about 0.2s above the run below):

main → this PR, first visit (banner shown)

Width FCP LCP before LCP after Δ LCP (95% CI) LCP element before → after CLS before → after
360 1,440 3,364 2,626 −770 (−874 to −714) banner <p> 0.0008 → 0.0008
390 1,452 2,448 2,434 +10 (−24 to +28) H1 0.0009 → 0.0009
412 1,470 3,370 2,648 −724 (−840 to −704) banner <p> 0.0175 → 0.0175
430 1,522 3,368 2,626 −742 (−860 to −690) banner <p> 0.0021 → 0.0021

main → this PR, returning visitor (pc_consent stored)

Width FCP LCP before LCP after Δ LCP (95% CI) LCP element before → after CLS before → after
360 1,494 2,414 2,436 −6 (−24 to +26) H1 0.0008 → 0.0008
390 1,516 2,418 2,450 +24 (−6 to +58) H1 0.0009 → 0.0009
412 1,508 2,446 2,442 −12 (−42 to +26) H1 0.0175 → 0.0175
430 1,470 2,414 2,416 +6 (−38 to +44) H1 0.0021 → 0.0021

#583 → #583 + this PR, first visit (banner shown)

Width FCP LCP before LCP after Δ LCP (95% CI) LCP element before → after CLS before → after
360 1,456 3,360 2,648 −774 (−806 to −702) banner <p> 0.0008 → 0.0008
390 1,498 1,524 1,448 −74 (−116 to −2) H1 0.0009 → 0.0009
412 1,518 3,390 2,674 −760 (−858 to −690) banner <p> 0.0175 → 0.0175
430 1,444 3,364 2,636 −716 (−808 to −598) banner <p> 0.0021 → 0.0021

#583 → #583 + this PR, returning visitor (pc_consent stored)

Width FCP LCP before LCP after Δ LCP (95% CI) LCP element before → after CLS before → after
360 1,516 1,550 1,498 −40 (−80 to ±0) H1 0.0008 → 0.0008
390 1,526 1,542 1,494 −24 (−62 to +36) H1 0.0009 → 0.0009
412 1,520 1,524 1,520 −24 (−74 to +10) H1 0.0175 → 0.0175
430 1,464 1,452 1,488 +34 (−44 to +72) H1 0.0021 → 0.0021

This PR vs variant A1 (12 paired iterations on #583, first visits; 480 loads). This run used the revision just before the pre-hydration click hand-off. At load time that hand-off only attaches one listener, and the final-commit run above reproduces the same deltas. One load was dropped: a JS chunk failed with net::ERR_NETWORK_CHANGED, the host's network changing, so that page never hydrated.

Width LCP: #583 LCP: + this PR LCP: + A1 (no font wait) CLS: #583 CLS: + this PR CLS: + A1
360 3,252 2,530 1,346 0.0008 0.0008 0.0008
390 1,356 1,288 1,334 0.0009 0.0009 0.0011
412 3,268 2,530 1,272 0.0175 0.0175 0.0453
430 3,250 2,622 1,368 0.0021 0.0021 0.0074

Why the font wait costs time on this profile. At 412px the 94 KB document finishes at 1.94s, and Geist (68 KB) and Geist Mono (70 KB, also preloaded) both finish at about 2.2–2.4s. FCP is at ~1.2s and the banner's own bytes arrive before it, so A1 can paint at FCP but only in the fallback face.

Side effect, observed but not a goal. First-visit FCP is ~90 ms earlier with this PR (1,170 vs 1,262 ms, 12-iteration run), so at 390px on #583, where the H1 is LCP, LCP improves by ~80 ms too. Returning visitors, whose script exits early, show no change. My unverified guess is that document.fonts.load() during parsing starts Geist's font-display timer before the first layout.

Options B and C: the paragraph's text area against the H1's (Range-based probe on the live DOM, reduced motion; Chrome's LCP size for the banner runs ~2% above this probe, the H1's ~0.5%):

Variant 360 390 412 430
Current copy +5.4% −4.4% +0.7% +4.1%
B: text-xs (12/16px) below sm −27.0% −37.2% −34.6% −31.7%
B: leading-snug (19.25px) +2.1% −7.3% −2.3% +1.0%
B: Privacy link on its own line +5.4% −4.4% +0.7% −17.1%
B: card padding p-3 −7.6% +0.3% +4.1% −14.5%
C: trim filler words −12.4% −1.0% −3.4% −3.4%
C: tighter rewrite −11.0% −22.9% −20.3% −20.3%

Width sweep, 320–767px in 1px steps:

  • Current copy: the paragraph outsizes the H1 at 52 widths (320, 339–364, 395–396, 411–433).
  • "Trim filler words": outsizes it at 395–396px, within the probe's bias.
  • "Tighter rewrite": stays under it everywhere, by at least 6.5%.

Candidate copy for your review:

  • Current: We use Google Analytics and PostHog to see which components and docs people actually use. Decline and neither one loads — no cookie, no identifier. Page-speed measurement runs either way and stores nothing.
  • Trim filler words: We use Google Analytics and PostHog to see which components and docs get used. Decline and neither loads — no cookie, no identifier. Page-speed measurement runs either way and stores nothing.
  • Tighter rewrite: Google Analytics and PostHog show us which components and docs get used. Decline and neither loads: no cookie, no identifier. Page-speed checks run either way and store nothing.

Both candidates keep all four disclosures: which tools, why, what Decline does, and what runs regardless.

Tighter rewrite, measured. A scratch build of #583 + this PR + the tighter copy, throttled, 4 paired iterations, first visits:

Width LCP: #583 + this PR LCP: + tighter copy Element with tighter copy CLS: #583 + this PR CLS: + tighter copy
360 2,566 1,300 H1 at FCP, 4/4 0.0008 0.0008
390 1,296 1,310 H1 at FCP, 4/4 0.0009 0.0009
412 2,564 1,316 H1 at FCP, 4/4 0.0175 0.0175
430 2,572 1,320 H1 at FCP, 4/4 0.0021 0.0021

Accessibility and consent semantics

  • Same banner. Same markup, role (region labelled by its title), accessible names, focus styles and DOM position (last in <body>), and still position: fixed.
  • Operable earlier. The buttons are real, enabled buttons from the first paint. Before this PR, nothing could be operated until hydration.
  • Nothing loads before an explicit opt-in. A click before hydration only hides the banner and queues the choice; setConsent() applies it when React runs. GPC/DNT visitors and stored choices never see the banner, and neither do visitors without JavaScript, who have nothing to consent to.
  • axe coverage unchanged. a11y.e2e and templates-a11y.e2e still run without consent. They now wait for the hydrated banner (expectConsentBannerReady), because a visible banner no longer implies hydration.
  • /docs hydration recovery. On main, /docs pages throw React fix(privacy,test): expire every parent cookie domain, correct two stale test claims #418 (fixed by frontend(fix): give Fumadocs the public pathname so docs pages hydrate #585). React's recovery re-renders the root, which clears attributes on <html>. Sampled every animation frame, the banner still went straight from pending to live with no hidden frame, in 6 of 6 throttled runs and 2 unthrottled ones.

Tradeoffs

  • Bytes. +2.7 KB raw / +1.5 KB gzipped per page HTML (banner markup plus the inline script), +78 bytes of CSS. The other CSS chunks are byte-identical.
  • Text-only crawlers. The banner copy is now in every page's static HTML, hidden unless revealed. Crawlers that ignore CSS see it as boilerplate at the end of <body>.
  • Duplicated read logic. The inline script repeats resolveConsent()'s read logic as a string. tests/int/consent-reveal.int.spec.ts runs both against the same stubbed browser for 90 visitor shapes, and also pins the font wait, the font-failure fallbacks and the click hand-off.
  • Slow networks. The banner can appear up to one font-load after FCP, where A1 would show it at FCP.

Test plan

  • pnpm lint, pnpm format:check, pnpm i18n:check, pnpm exec tsc --noEmit
  • pnpm run test:int: 894 passed, 1 skipped, across 65 files. The new tests/int/consent-reveal.int.spec.ts (100 tests) was mutation-checked: dropping the GPC check fails 6 parity cases, and dropping the font wait fails the wait test.
  • Production e2e on the final build, E2E_PORT=3182 PLAYWRIGHT_SERVER_MODE=production pnpm test:e2e with consent, a11y, frontend, templates-a11y and webkit-landing: 251 passed, 1 skipped (the Linux-only visual baseline). After the last test edit, consent.e2e was re-run: 14/14.
  • Dev-mode consent.e2e: 13/14. The one failure, "withdrawing deletes the GA cookies the opt-in created", fails the same way on main (ac916f5) in dev mode, so it is not from this PR. The _ga values it finds are real GA-issued ones, because main's suite still loads the real gtag.js; frontend(fix): keep GA4 on the production hosts and the e2e suite offline #586 stubs it. It passes in production mode.
  • CI release-gate (the full e2e run, including visual baselines). Not run locally. The banner never appears in the visual specs, which either grant consent or render chrome-free previews, and every CSS chunk except the globals.css one is byte-identical to main.

Interactions with open PRs

Refs #523

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • The consent banner now appears in static page content for visitors who haven’t made a choice, and can be dismissed before the page finishes loading. Their choice is applied once the page is ready.
    • Visitors with a saved consent choice or privacy signal aren’t shown the banner. Visitors without JavaScript aren’t prompted.
  • Tests
    • Added coverage for banner visibility, early choices, and accessibility checks.

…s with the page

On first visits the banner's paragraph out-sizes the landing H1 at 360,
412 and 430px, and because ConsentBanner rendered nothing until the
post-hydration consent effect, it became the final LCP entry about 1.9s
after FCP on a throttled phone.

The banner now renders during SSR and the first client render, marked
data-consent-banner="pending". A rule in globals.css hides that pending
copy unless <html> carries data-consent-undecided. A small inline script
right after the banner sets the attribute only when resolveConsent() would
return null (no GPC/DNT signal, no stored choice), and only once the
banner's web font is ready, so the banner never paints in the fallback
face and then reflows at the swap. It stays fixed and keeps zero CLS.

The buttons work before hydration: the script records a click and hides
the banner, and ConsentBanner applies it through setConsent() when React
takes over, so every write still goes through one place. Returning,
GPC/DNT and no-JS visitors never paint the banner.

Tests: an int spec holds the inline script to resolveConsent() across 90
visitor shapes and pins the font wait and the click hand-off. consent.e2e
covers the pre-hydration banner and click, the hidden copy for decided and
GPC visitors, and no-JS visitors. The axe specs wait for the hydrated
banner. contributing.mdx records the new rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 11:24
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
payload-components Ready Ready Preview Oct 3, 2026 12:30pm UTC
payload-components-97bf Ready Ready Preview Oct 3, 2026 12:30pm UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: Ducksss/payload-components/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f3345fa7-017a-45c4-874d-26c0e598d9ed
📥 Commits

Reviewing files that changed from the base of the PR and between ce1118a and 81dc276.

📒 Files selected for processing (9)
  • content/docs/contributing.mdx
  • src/app/globals.css
  • src/components/site/ConsentBanner.tsx
  • src/lib/consent.ts
  • tests/e2e/a11y.e2e.spec.ts
  • tests/e2e/consent.e2e.spec.ts
  • tests/e2e/support/consent.ts
  • tests/e2e/templates-a11y.e2e.spec.ts
  • tests/int/consent-reveal.int.spec.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: Ducksss/payload-components/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 800fced8-930f-49a2-9444-24962e4b8564

📥 Commits

Reviewing files that changed from the base of the PR and between ac916f5 and ce1118a.

📒 Files selected for processing (9)
  • content/docs/contributing.mdx
  • src/app/globals.css
  • src/components/site/ConsentBanner.tsx
  • src/lib/consent.ts
  • tests/e2e/a11y.e2e.spec.ts
  • tests/e2e/consent.e2e.spec.ts
  • tests/e2e/consent.ts
  • tests/e2e/templates-a11y.e2e.spec.ts
  • tests/int/consent-reveal.int.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The consent banner is now included in static HTML and revealed by an inline script when consent is undecided. Pre-hydration choices are queued and applied after hydration. Integration and end-to-end tests cover reveal conditions, choice handoff, and hydrated-banner checks.

Changes

Consent Banner Lifecycle

Layer / File(s) Summary
Static banner reveal and eligibility
src/lib/consent.ts, src/app/globals.css, tests/int/consent-reveal.int.spec.ts
The inline script checks consent signals and stored choices, handles font readiness, and queues valid pre-hydration clicks. CSS hides the pending banner unless the HTML attribute marks consent as undecided. Integration tests cover these behaviors.
Banner rendering and choice handoff
src/components/site/ConsentBanner.tsx, tests/e2e/consent.ts, tests/e2e/consent.e2e.spec.ts
ConsentBanner renders pending markup and the reveal script. After hydration, it applies any queued choice through setConsent. End-to-end tests cover pre-hydration interactions, consent signals, and no-JavaScript behavior.
Hydration-aware test and contributor guidance
tests/e2e/a11y.e2e.spec.ts, tests/e2e/templates-a11y.e2e.spec.ts, content/docs/contributing.mdx
Accessibility and template tests wait for the hydrated banner. Contributor guidance describes the static markup, reveal behavior, queued choices, and related tests.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  actor Visitor
  participant Browser
  participant consentBannerRevealScript
  participant ConsentBanner
  participant setConsent
  Visitor->>Browser: Clicks the decline button
  Browser->>consentBannerRevealScript: Dispatches the click event
  consentBannerRevealScript->>Browser: Queues denied and hides the banner
  Browser->>ConsentBanner: Hydrates the component
  ConsentBanner->>ConsentBanner: Reads the queued choice
  ConsentBanner->>setConsent: Applies denied
Loading

Merge Risk: ⚪ Minimal · up to ce111

The consent banner now ships in static HTML and is revealed only for undecided visitors. Choices made before hydration are applied afterward. No concrete merge-blocking risk was identified.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to ce111

A consent choice recorded before hydration can overwrite a later opt-out from another tab, allowing consent-gated tracking to resume. The impact is limited to the visitor’s browser, and active browser privacy signals still block tracking.

Retained concerns

  • Medium · security · inferred: A grant queued before hydration can overwrite a newer opt-out from another tab. The hydration effect persists the queued value before reading current consent, so delayed hydration can restore granted state and make consent-gated analytics eligible again.
Security review details

Security Blast Radius

  • inferred — The identified failure concerns a visitor’s same-origin consent storage, shared across tabs and reused on later loads. Restoring granted state can enable GA4 and PostHog tracking in tabs that consume that state. It does not establish cross-user or server-side privilege escalation.

Security Findings and Attack Paths

  • inferred — With hydration delayed, tab A can queue Accept while storage remains undecided. A later Decline in tab B stores denied. When tab A hydrates, it unconditionally writes the older queued grant over that denial. Without an active privacy signal, consent readers then resolve granted. This is a consent-ordering failure requiring competing browser actions, not a demonstrated remote exploit.

Trust Boundaries and Controls

  • observed — The queued property is writable by same-page scripts; its consumer validates the value but does not authenticate the writer or check freshness. The inline script contains no interpolated user content. Independently resolving current privacy signals still prevents the queued grant from enabling consent-gated analytics while such a signal is active.

Resilience and Maintainability Implications

  • observed — Existing denial handling clears analytics storage and cookies and reloads after withdrawal from granted state. Subscribed tabs also reload on a granted-to-denied storage event. These controls remain valuable but do not reconcile a queued grant consumed before subscription. The inspected browser handoff test covers delayed persistence of Decline, not an intervening cross-tab denial.

Hardening Proposals

  • proposed — Define conflict precedence for queued consent and current shared state. Bind deferred choices to a state version or equivalent freshness check, reject stale grants after a newer opt-out, and recheck privacy signals at consumption so hydration does not silently supersede current privacy authority.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: serving the consent banner in static HTML so it can paint before hydration.
Description check ✅ Passed The description explains the change, rationale, tradeoffs, measurements, and test results in detail. It does not use the template’s exact Verification, Registry Checklist, or Notes sections, but it in…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Resolve the move of tests/e2e/consent.ts to tests/e2e/support/consent.ts
from #592: carry this branch's expectConsentBannerReady helper and its
expect/Page imports onto the moved file, and point the a11y,
templates-a11y, and consent specs at the new path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Ducksss

Ducksss commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #598. Tightening the banner's description keeps the H1 as the mobile LCP element, so LCP equals first paint: 1.36–1.47 s at 360–430 px on a throttled-phone profile. That beats the ~2.6 s here, and it needs neither the inline reveal script nor the duplicated consent-read logic. The branch stays up for reference, and the measurement method from this PR was reused.

@Ducksss Ducksss closed this Oct 4, 2026
Ducksss added a commit that referenced this pull request Oct 4, 2026
…bile LCP (#598)

On a first visit at 360-430px, the consent banner's description paragraph
could out-size the landing H1. Because the banner paints after hydration, it
then became the final LCP entry, about 3.4s on a throttled phone. Since #583
the H1 is opaque from first paint. A tighter description keeps the banner below
the H1's area, so LCP stays at first contentful paint.

The new copy keeps all four disclosures: which tools, why, what Decline does,
and what runs regardless. It replaces the static-HTML banner approach in #590,
which reached about 2.6s with 576 added lines.

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

2 active deployments
Preview – payload-components-97bf — 81dc276f Deployed Oct 3, 2026 by vercel[bot]
Preview – payload-components — 81dc276f Deployed Oct 3, 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.

2 participants