Merge claude/cookie-button-bottom: the cookie button never moves; the footer keeps room under its last row (owner's option 3)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-12-01 12:08:57 +01:00
co-authored by Claude Opus 5.5
20 changed files with 763 additions and 321 deletions
@@ -56,11 +56,13 @@ before analytics or marketing consent — check the project's choice in "Project
decision is from an older Policy version must see it at once. A click on a button before hydration
counts (the checks above click as soon as the button is visible).
7. Cookie button (1.17.2, consent.md → "Where the cookie button sits"): after a decision, on a long page, a short
page and a page with a form, desktop and phone width — the button is in the bottom corner of the window at the
top, in the middle and with the footer in view (it must not ride up on the footer); scrolled to the very end it
lies on no link or button (it may step up a little); Tab reaches it and Enter reopens the banner. A footer whose
corner is all links: `side="right"` or a larger `--ipal-cookie-button-offset`. A project scroll handler or a
button rendered inside the footer → remove (AGENT.md §7).
page and a page with a form, desktop and phone width (also 360 px) — the button is in the bottom corner of the
window at the top, in the middle, with the footer in view and at the very end: it must not move at all. At the
very end nothing of the footer is under it and the last footer link can be tapped (the footer has grown a little:
`[data-ipal-cookie-space]` on it). Before a decision and while the banner is open the footer has its own padding
only. Tab reaches the button and Enter reopens the banner. A project scroll handler, a button rendered inside
the footer or hand-made bottom padding for it → remove (AGENT.md §7). Too much or too little room:
`--ipal-cookie-button-space` on the footer; none: `reserve={false}`.
The script needs buttons with `data-ipal="accept"` / `"reject"` — the plugin's
`CookieBanner` has them in every `settings` mode (`inline`, `modal`, `detailed`). A custom banner in the project violates AGENT.md §7.
@@ -165,9 +165,10 @@ Fifteen ready blocks and ten page templates. **Use a library block (or a variant
|---|---|---|
| `ConsentProvider` | `@intecion/ipal-kit/client` | Consent provider: `{ texts, cookieMap?, logEndpoint?, nonce?, cookieValue?, gpc?, maxAgeDays? }` (`gpc`: Global Privacy Control `'honour'` default / `'ask'` / `false`; `maxAgeDays`: re-ask period, default 180; withdrawal also removes the panel's listed storage keys and tells Meta / TikTok / Clarity) (`nonce`: CSP nonce for the banner's first-paint script; `cookieValue`: optional server-read consent cookie → exact HTML, dynamic pages) — consent state, cookie, Consent Mode, deleting cookies after consent is withdrawn, optional POST of the decision to the log (`'/api/ipal/consent'`). Wrap the layout once; required by the banner, `Analytics`, `ConsentScript`. |
| `CookieBanner` | `@intecion/ipal-kit/client` | Consent banner + category settings: `settings: 'inline' \| 'modal' \| 'detailed'`, `controls`, `equalChoice` (recommended `true`), `order`, `settingsActions`, `icon`, `classNames`, `firstPaint` (default `true`: in the server HTML, decided before the first paint by an inline script; pages stay static), `nonce`; colours from `--ipal-*` CSS vars. Do not write your own banner. |
| `CookieButton` | `@intecion/ipal-kit/client` | Floating button that reopens the cookie settings (withdrawing consent); hidden while the banner is visible. Fixed in the bottom corner of the window on every page (1.17.2: it no longer climbs above the footer); at the very end of the page it steps just above a link or button it would keep covered. Props `className`, `side` (`'left' \| 'right'`), `clear` (selector of controls to free at the page end, default `COOKIE_BUTTON_CLEAR`; `false`), `avoid` (placement before 1.17.2: selector it lifts above — `COOKIE_BUTTON_AVOID` = footer; `false` = never move). Tokens `--ipal-cookie-button-offset`, `--ipal-cookie-button-inset`. Type `CookieButtonProps`. |
| `CookieButton` | `@intecion/ipal-kit/client` | Floating button that reopens the cookie settings (withdrawing consent); hidden while the banner is visible. Fixed in the bottom corner of the window on every page and never moves (1.17.2: it no longer climbs above the footer). While it is shown the footer gets just enough bottom padding for its last row to end above the button (measured; the footer's own padding counts; nothing where the corner is empty; made before the first paint for a returning visitor). Props `className`, `side` (`'left' \| 'right'`), `reserve` (selector of the block that gets the room, default `COOKIE_BUTTON_RESERVE` = footer; `false` = none), `avoid` (placement before 1.17.2: selector it lifts above — `COOKIE_BUTTON_AVOID`). Amount by hand: `--ipal-cookie-button-space` on the footer (`0` = none). Tokens `--ipal-cookie-button-offset`, `--ipal-cookie-button-inset`. Type `CookieButtonProps`. |
| `COOKIE_BUTTON_AVOID`, `bottomOverlap(tops, viewportHeight)` | `@intecion/ipal-kit/client` | Footer selector for the placement before 1.17.2 (`<CookieButton avoid={COOKIE_BUTTON_AVOID} />`); pixels the footer covers at the bottom of the screen (how far the button moves up then) |
| `COOKIE_BUTTON_CLEAR`, `stepAbove(button, obstacles, max)` | `@intecion/ipal-kit/client` | Default selector of controls the cookie button frees at the end of the page; how far a box must move up to lie on none of the given boxes (0 = stays, also when no free place within `max`) |
| `COOKIE_BUTTON_RESERVE`, `COOKIE_BUTTON_SPACE_ATTRIBUTE`, `reserveCookieButtonSpace(options)` | `@intecion/ipal-kit/client` | Default selector of the block that gets room for the cookie button (the footer); the attribute that marks it while the room is there; the function that measures and applies (or, with `release: true`, removes) it — options type `CookieButtonSpaceOptions` (`selector`, `side`, `button?`, `release?`, `sheet?`). For a button of your own |
| `consentDecidedScript({ version?, gpc?, cookieName? })` | `@intecion/ipal-kit` | JavaScript statements for an inline script: leave `true` in `d` when the browser holds a current consent decision (as `readConsentRecord` decides). The shared start of the plugin's pre-paint scripts |
| `TOTP_TEXTS`, `TOTP_VIEW_TITLE` | `@intecion/ipal-kit` | en/pl texts of the 2FA screens (`totpPlugin:*`, merged by `twoFactor`) and their tab title |
| `ConsentScript` | `@intecion/ipal-kit/client` | Loads an external script (`src` or `code`) only after consent for `category` — for vendors without Consent Mode (chat, Plausible etc.). Inside `ConsentProvider`. |
| `CookieTable` | `@intecion/ipal-kit/rsc` | Server Component: cookie table for the cookie policy page — `{ rows, labels?, locale?, categories?, caption?, classNames?, storageColumn?, storageTypes? }`; `rows` from `getCookieTable()`; a **Type** column when a row is local / session storage (`storageColumn: 'auto' \| boolean`). |
@@ -35,12 +35,14 @@ the header, 200 with it. (2) A front end that posted to `/api/form-submissions`
and global its own write rule (`adminOrEditor`). (4) If the project has `tests/routes.ts`: `update`, judge, commit.
**→ 1.17.2, cookie button (CHANGELOG 1.17.2; PROGRAMISTA §6, item 83; consent.md "Where the cookie button sits") — nothing is required:**
visitors now see the "cookie settings" button in the bottom corner of the window on every page; it no longer moves up
above the footer. Look at the end of a page on a phone: the button must lie on no link (it steps up by itself; a
footer corner full of links → `side="right"` or a larger `--ipal-cookie-button-offset`). The placement before:
`cookieButton={<CookieButton avoid={COOKIE_BUTTON_AVOID} />}` on `SiteProviders`. A project that passes `avoid` (a
selector or `false`) or `className` keeps what it had. A project e2e that expects the button above the footer:
update it.
visitors now see the "cookie settings" button in the bottom corner of the window on every page; it never moves and
no longer rides up above the footer. While it is shown the footer is a little taller (about 40 px on the reference
site), so its last row ends above the button. Check the end of a page on a phone and on desktop: nothing under the
button, the last footer link can be tapped. Bottom padding a project added by hand for the button: remove it (the
plugin counts existing padding, so it is not doubled, but it is no longer needed). Amount by hand:
`--ipal-cookie-button-space` on the footer (`0` = none); no room: `reserve={false}`. The placement before:
`cookieButton={<CookieButton avoid={COOKIE_BUTTON_AVOID} />}` on `SiteProviders`. A project e2e that expects the button
above the footer, or an exact footer height after a decision: update it.
**→ 1.17.1:** (1) `src/proxy.ts`: replace the matcher literal with
`['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)']` (i18n.md "Next matcher"; `iapl-doctor` rule `proxy-matcher`).