Owner, 2026-12-01, after the review of fb92b35: option 3, "miejsce pod stopką" — the button stays in its corner at
all times and covers nothing; the page gets room under its last row.
- Removed: the step up at the end of the page (`clear`, COOKIE_BUTTON_CLEAR, stepAbove; never released).
- New: while the button is shown, the last footer (`reserve`, COOKIE_BUTTON_RESERVE; no footer: <body>) gets bottom
padding, measured: button height + offset + safe area + 8 px, minus what is already free under the lowest text or
control in the button's column. The footer's own padding counts (no double space); an empty corner gets nothing.
Not before a decision, not while the banner is open, gone with the button; `reserve={false}` turns it off,
`--ipal-cookie-button-space` on the footer sets the amount (0 = none, per breakpoint).
- No layout shift: on a static page <CookieButton> renders an inline script that makes the room before the first
paint for a visitor who already decided — in a constructed style sheet, so the server's markup is untouched and
React hydrates without a mismatch; after hydration the same function moves it onto the element.
- consentDecidedScript: the shared start of the banner's and the button's pre-paint scripts.
- avoid={COOKIE_BUTTON_AVOID} is still the placement before 1.17.2 (no room then).
Tests: test/cookieButtonPlacement.test.ts rewritten (24); reference e2e on desktop, 390 px and 360 px phones, light
and dark, five pages: the corner at every scroll position, nothing under the button at the very end, every footer
link clickable, layout shift < 0.001, the room before hydration.
Docs: consent.md, AGENT.md, skills, PROGRAMISTA item 83, changelog draft 1.17.2.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
31 lines
1.4 KiB
TypeScript
31 lines
1.4 KiB
TypeScript
// Server-safe exports (logic, types, helper). Client components (banner,
|
|
// provider, hook) are exported separately via ./client to keep the RSC/client
|
|
// boundary clean.
|
|
export {
|
|
ACCEPT_ALL_CONSENT,
|
|
CONSENT_CATEGORIES,
|
|
DEFAULT_CONSENT,
|
|
REJECT_ALL_CONSENT,
|
|
} from './categories.js'
|
|
export type { ConsentCategory, ConsentState } from './categories.js'
|
|
export { CONSENT_CATEGORY_LABELS, consentCategoryOptions } from './categoryLabels.js'
|
|
export { buildConsentLogCollection, buildConsentLogEndpoint, CONSENT_LOG_MAX_BYTES, CONSENT_LOG_PATH, CONSENT_LOG_SLUG, readCappedBody } from './consentLog.js'
|
|
export type { ConsentLogOptions } from './consentLog.js'
|
|
export { consentBannerScript, consentDecidedScript } from './firstPaint.js'
|
|
export type { ConsentBannerScriptOptions } from './firstPaint.js'
|
|
export { CONSENT_FALLBACK, CONSENT_FALLBACK_PL, consentFallback, getConsentTexts, getCookieTable } from './getConsentTexts.js'
|
|
export type { CookieTableRow } from './getConsentTexts.js'
|
|
export { setDefaultConsent, updateConsent } from './googleConsent.js'
|
|
export { GPC_CATEGORIES, GPC_HEADER, gpcFromHeaders, gpcFromNavigator, gpcWellKnown, resolveConsent } from './gpc.js'
|
|
export type { GpcMode, ResolvedConsent } from './gpc.js'
|
|
export {
|
|
CONSENT_COOKIE,
|
|
CONSENT_MAX_AGE,
|
|
CONSENT_VERSION,
|
|
newConsentId,
|
|
parseConsent,
|
|
readConsentRecord,
|
|
serializeConsent,
|
|
} from './storage.js'
|
|
export type { ConsentStorage, ConsentTexts } from './texts.js'
|