Theme key 'theme', storage keys in the cookie scanner, type in the cookie list
- Theme choice in localStorage under 'theme' (next-themes' key and values)
instead of 'ipal-theme'. ThemeScript moves an old choice before the first
paint and removes the old key; useTheme / ThemeSwitcher do the same
without the script. ipalKit({ theme: { storageKey } }) sets an own key,
which reaches ThemeScript through getSiteShell().theme and <html
data-theme-storage>.
- The cookie scanner declares the theme key (Theme choice: local storage,
necessary, until changed or site data is cleared) when the theme switch
is on, so Scan cookies finds it without a crawl.
- Cookies -> Cookie list rows get a Type (cookie / local storage / session
storage, default cookie, shared by every language), filled by scan, review
and approval. The detailed settings window and <CookieTable> show it with
English and Polish defaults; the approval page marks storage entries.
- Migration: adds cookie_settings_cookies.storage (DEFAULT 'cookie') and
cookie_settings_locales.detail_labels_storage, nothing else.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6998b44431
commit
b5368cdc61
@@ -8,6 +8,39 @@ versions at once, go through every "Requires project changes" section in order,
|
||||
version you have. A new release = a new section at the top; we remove the oldest ones only
|
||||
once there are more than 20.
|
||||
|
||||
## Unreleased
|
||||
|
||||
The theme choice moves to the standard `theme` key, the cookie scanner declares the plugin's own browser-storage
|
||||
key, and the cookie list tells cookies from browser storage.
|
||||
|
||||
### Changed
|
||||
- **Theme key** `ipal-theme` → **`theme`** (`THEME_STORAGE_KEY`), the key and `light` / `dark` values next-themes uses.
|
||||
Visitors keep their choice: `<ThemeScript>` moves an old `ipal-theme` value to the new key before the first paint
|
||||
(no flash) and removes the old key; `useTheme` / `<ThemeSwitcher>` do the same on pages without the script
|
||||
(`migrateThemeStorage`, `LEGACY_THEME_STORAGE_KEY`). A project that also runs next-themes now shares the key —
|
||||
set `ipalKit({ theme: { storageKey } })` to keep them apart.
|
||||
|
||||
### New
|
||||
- **`theme.storageKey`** option (`ThemeOptions`): `getSiteShell().theme.storageKey` → `<ThemeScript>` →
|
||||
`<html data-theme-storage>` (`THEME_STORAGE_ATTRIBUTE`) → `useTheme` / `<ThemeSwitcher>`; both also take `storageKey`.
|
||||
- **Cookie scanner declares browser storage**: the theme choice (*Theme choice*, on when Site settings → Theme →
|
||||
*Allow theme toggle* is on) as **necessary**, local storage, "until changed or site data is cleared" — so
|
||||
**Scan cookies** finds it without a crawl.
|
||||
- **Type in the cookie list**: *Cookies → Cookie list* rows have **Type** (`storage`: cookie · local storage ·
|
||||
session storage, default cookie, shared by every language), filled by scan, review and approval. The detailed
|
||||
settings window shows it for storage entries (heading: *Settings window → Cookie list headings → Type*);
|
||||
`<CookieTable>` adds a **Type** column when the list has a storage entry (`storageColumn`, `storageTypes`,
|
||||
`COOKIE_STORAGE_LABELS`). `CookieTableRow.storage`, `texts.details.storage` / `.storageTypes`, type `ConsentStorage`.
|
||||
The approval page marks storage entries.
|
||||
|
||||
### What projects must update
|
||||
1. **Migration (Postgres / SQLite):** `pnpm payload migrate:create cookie-storage-type` — it only adds
|
||||
`cookie_settings_cookies.storage` (enum, `DEFAULT 'cookie'`) and `cookie_settings_locales.detail_labels_storage`.
|
||||
Existing rows become *Cookie*: set the type of storage rows by hand. MongoDB: nothing to do.
|
||||
2. A project that reads `localStorage.getItem('ipal-theme')` itself: use `THEME_STORAGE_KEY` (or `documentThemeStorageKey()`).
|
||||
3. Cookie list: after the next **Scan cookies**, approve the new *theme* entry; remove an old *ipal-theme* row from
|
||||
*Cookies → Cookie list* once the site runs this version.
|
||||
|
||||
## 1.14.4
|
||||
|
||||
Cookie texts in every language without retyping them, and one **Cookies** entry in the admin instead of three.
|
||||
|
||||
Reference in New Issue
Block a user