Skip to content

feat: reloadOnRevoke option, modal close button, compliance docs - #98

Open
DaSchTour wants to merge 4 commits into
mainfrom
feat/revoke-reload-ux
Open

feat: reloadOnRevoke option, modal close button, compliance docs#98
DaSchTour wants to merge 4 commits into
mainfrom
feat/revoke-reload-ux

Conversation

@DaSchTour

Copy link
Copy Markdown
Member

Summary

  • feat(core): Adds reloadOnRevoke config option. Already-loaded third-party scripts can't be unloaded once consent is withdrawn — when enabled, revokeAll() and consent-downgrading applyChoices() calls (accepted → declined) reload the page after logging/dispatch complete (sendBeacon/keepalive-fetch survive navigation). Never triggered by first consent or accept-all.
  • fix(ui): Adds a visible close (×) button to the settings modal, mirroring the existing banner close-button pattern. Fixes an accessibility gap where the modal could previously only be exited via overlay click or Escape. Uses the existing data-action delegation and a new optional modal.close translation key (added to all 7 bundled locales).
  • docs: Adds a clearly visible EU/EEA warning that mode: 'opt-out' is CCPA-only and unlawful under GDPR/ePrivacy for EU/EEA visitors, in both docs/compliance.md and the README.
  • docs: Adds a "Layer-1 button parity" subsection explaining that the strictest CNIL/Garante readings expect identical accept/reject button colours, not just identical size, with the concrete --km-secondary / --km-secondary-text CSS override to equalize them.

Test plan

  • bun run test — 121/121 tests pass (6 new consent-manager tests for reloadOnRevoke, 3 new UI tests for the modal close button)
  • bun run typecheck — clean
  • bun run build — succeeds (ESM + UMD)

🤖 Generated with Claude Code

DaSchTour and others added 4 commits July 17, 2026 11:27
…rade

Already-loaded third-party scripts (analytics, ads, ...) can't be unloaded
from a running page once consent is withdrawn or a previously accepted
category is declined. reloadOnRevoke (default false) reloads the page as
the standard industry remedy, firing after logging/dispatch so
sendBeacon/keepalive-fetch delivery survives the navigation. Never
triggered by first consent or accept-all.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The settings modal could previously only be left via overlay click or
Escape, with no on-screen affordance — an accessibility gap. Adds a
close (×) button in the top corner, mirroring the existing banner
close-button pattern (buildCloseButton / km-banner__close), that returns
to the banner view via the existing data-action delegation. aria-label
comes from the new optional modal.close translation key (default
"Close"), added to all bundled locales.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Documents the mode config option in the README and adds a clearly
visible warning in both the README and docs/compliance.md: opt-out mode
is intended for CCPA-style jurisdictions only, since DSGVO Art. 6(1)(a)
and ePrivacy Art. 5(3) require prior opt-in consent in the EU/EEA (and
the UK under PECR).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ings

Most DPAs accept the banner's primary/secondary button styling since
both buttons are equally sized, equally weighted, and both on Layer 1.
The strictest CNIL/Garante/DSK readings expect identical colour, not
just identical size — document the nuance in docs/compliance.md and
point to it from the README theming section, with the concrete
--km-secondary / --km-secondary-text override to equalize the buttons.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ui/keksmeister-banner.ts 91.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 2.03kB (2.79%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
keksmeister-Keksmeister-esm 39.95kB 1.06kB (2.73%) ⬆️
keksmeister-Keksmeister-umd 34.91kB 972 bytes (2.86%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: keksmeister-Keksmeister-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
keksmeister.js 1.06kB 39.95kB 2.73%

Files in keksmeister.js:

  • ./src/i18n/en.ts → Total Size: 1.56kB

  • ./src/core/consent-manager.ts → Total Size: 7.4kB

  • ./src/ui/keksmeister-banner.ts → Total Size: 14.52kB

  • ./src/i18n/de.ts → Total Size: 1.73kB

view changes for bundle: keksmeister-Keksmeister-umd

Assets Changed:

Asset Name Size Change Total Size Change (%)
keksmeister.umd.cjs 972 bytes 34.91kB 2.86%

Files in keksmeister.umd.cjs:

  • ./src/i18n/en.ts → Total Size: 1.6kB

  • ./src/core/consent-manager.ts → Total Size: 7.61kB

  • ./src/ui/keksmeister-banner.ts → Total Size: 14.97kB

  • ./src/i18n/de.ts → Total Size: 1.77kB

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