Fix cookie consent banner — permanently hidden #9

Closed
opened 2026-06-09 18:32:06 +00:00 by glow · 3 comments
Owner

The CookieConsent component (src/components/cookie-consent.tsx) uses const visible = useSignal(false) with no logic to ever set it to true.The commented-out logic checks for a consent cookie but is commented:// const visible = useSignal(!document.cookie.includes('consent=1'));This means:- The consent banner never appears- No consent cookie is set for essential/non-essential tracking- GDPR/CCPA liability if analytics/ads go liveFix: uncomment and wire the real visibility check. Or wire a real consent manager (CookieYes, Osano, etc.).

The CookieConsent component (`src/components/cookie-consent.tsx`) uses `const visible = useSignal(false)` with no logic to ever set it to true.The commented-out logic checks for a consent cookie but is commented:```// const visible = useSignal(!document.cookie.includes('consent=1'));```This means:- The consent banner never appears- No consent cookie is set for essential/non-essential tracking- GDPR/CCPA liability if analytics/ads go liveFix: uncomment and wire the real visibility check. Or wire a real consent manager (CookieYes, Osano, etc.).
glow closed this issue 2026-06-09 19:39:41 +00:00
Author
Owner

Fixed in commit 71dab7c.

Changes:

  • Added useVisibleTask$ to check document.cookie on client mount
  • Banner now shows when no consent or rejected cookie is present (first visit)
  • Accept sets consent=1 (1-year), Decline sets consent=rejected (1-year), both hide the banner
  • Removed stale stub comments about manual wiring

Build passes (SSG: 21 pages, lint clean).

Closes #9

Fixed in commit 71dab7c. Changes: - Added `useVisibleTask$` to check `document.cookie` on client mount - Banner now shows when no consent or rejected cookie is present (first visit) - Accept sets `consent=1` (1-year), Decline sets `consent=rejected` (1-year), both hide the banner - Removed stale stub comments about manual wiring Build passes (SSG: 21 pages, lint clean). Closes #9
Author
Owner

Reopening — the initial commit (71dab7c) added the useVisibleTask$ check but left visible = useSignal(false). During SSR the component returns null before the task ever runs. Need to initialize to true so SSR renders the banner, then the visible task hides it client-side if consent already exists.

Reopening — the initial commit (71dab7c) added the `useVisibleTask$` check but left `visible = useSignal(false)`. During SSR the component returns `null` before the task ever runs. Need to initialize to `true` so SSR renders the banner, then the visible task hides it client-side if consent already exists.
glow reopened this issue 2026-06-09 19:48:44 +00:00
glow closed this issue 2026-06-09 19:48:59 +00:00
Author
Owner

Fixed in 8fd185b. Root cause: useSignal(false) caused SSR to return null on line 25 before useVisibleTask$ could run. Changed to useSignal(true) — SSR now renders the banner, and the visible task hides it client-side if consent already exists. Closes #9.

Fixed in 8fd185b. Root cause: `useSignal(false)` caused SSR to return `null` on line 25 before `useVisibleTask$` could run. Changed to `useSignal(true)` — SSR now renders the banner, and the visible task hides it client-side if consent already exists. Closes #9.
Sign in to join this conversation.
No labels
bug
feature
improvement
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
glow/first-home-diy#9
No description provided.