Cookie button never moves; the footer gets room under its last row while the button is shown
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]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
fb92b357e8
commit
3821174be4
+18
-13
@@ -12,21 +12,26 @@ once there are more than 20.
|
||||
## 1.17.2 — (draft, not released)
|
||||
|
||||
### Changed
|
||||
- **What an existing site's visitors see: the "cookie settings" button stays in the bottom corner of the window**
|
||||
([consent.md → Where the cookie button sits](./consent.md#where-the-cookie-button-sits-1172)). Until now it moved
|
||||
up by the visible part of the footer: on a phone with a tall footer it ended at the top of the screen (over the
|
||||
header), on a short page in the middle of it. Now it is in the same corner on every page and at every scroll
|
||||
position. Only at the very end of the page, where it would keep a footer link or a button covered with no way to
|
||||
scroll past, it steps up just above it (on the reference site: 71 px on a phone, nothing on desktop). No layout
|
||||
shift, same look, keyboard and screen-reader access unchanged; the side inset now adds the device's safe-area inset.
|
||||
**Nothing to do; an existing site gets it by updating.** The placement before:
|
||||
`<CookieButton avoid={COOKIE_BUTTON_AVOID} />` (on `SiteProviders`: `cookieButton={…}`). A site that already passes
|
||||
`avoid` (a selector, or `false` = never move) or `className` keeps its behaviour. A project e2e test that expects the
|
||||
button above the footer needs an update.
|
||||
- **What an existing site's visitors see: the "cookie settings" button stays in the bottom corner of the window and
|
||||
never moves; the footer is a little taller while it is shown**
|
||||
([consent.md → Where the cookie button sits](./consent.md#where-the-cookie-button-sits-1172)). Until now the button
|
||||
moved up by the visible part of the footer: on a phone with a tall footer it ended at the top of the screen (over
|
||||
the header), on a short page in the middle of it. Now it is in the same corner on every page and at every scroll
|
||||
position. So that it covers nothing at the very end of a page, the footer gets bottom padding while the button is
|
||||
shown — just enough for its last row to end above the button (measured: the footer's own padding counts, an empty
|
||||
corner gets nothing; on the reference site 42–43 px on phones and desktop). Not before a decision, not while the
|
||||
banner is open. No layout shift: for a returning visitor the room is made before the first paint. Same look,
|
||||
keyboard and screen-reader access unchanged; the side inset now adds the device's safe-area inset.
|
||||
**Nothing to do; an existing site gets it by updating.** No room: `<CookieButton reserve={false} />`; an amount of
|
||||
your own: `--ipal-cookie-button-space` on the footer (`0` = none, also per breakpoint); the placement before:
|
||||
`<CookieButton avoid={COOKIE_BUTTON_AVOID} />` (on `SiteProviders`: `cookieButton={…}`). A site that passes a
|
||||
selector in `avoid` keeps its behaviour. A project e2e test that expects the button above the footer, or an exact
|
||||
footer height after a decision, needs an update.
|
||||
|
||||
### Added
|
||||
- `CookieButton` prop `clear` (selector of controls freed at the end of the page; `false` = off), `COOKIE_BUTTON_CLEAR`,
|
||||
`stepAbove` (`/client`).
|
||||
- `CookieButton` prop `reserve` (the block that gets the room; `false` = off); `COOKIE_BUTTON_RESERVE`,
|
||||
`COOKIE_BUTTON_SPACE_ATTRIBUTE`, `reserveCookieButtonSpace` (`/client`, type `CookieButtonSpaceOptions`);
|
||||
`consentDecidedScript` (root); the token `--ipal-cookie-button-space`.
|
||||
|
||||
## 1.17.1 — security fixes from the IAWL review; the panel's sign-in look; the sending method is chosen
|
||||
|
||||
|
||||
Reference in New Issue
Block a user