Admin follow-ups: localised stats tab title, scanner names, close label, favicon hint

- Statistics view: the browser-tab title follows the admin language.
  Payload's custom-view meta.title is one plain string and its custom-view
  metadata ignores i18n, so the view renders <DocumentTitle> (/admin) with the
  translated title; it re-applies the title while the view is open because
  Next streams the English metadata in after hydration. adminDocumentTitle()
  adds admin.meta.titleSuffix the way Payload does.
- Cookie scanner: CookieIntegration.label may be { en, pl, ... }. The built-in
  names without a product name come from the shared admin texts
  (cookieIntegration*, cookieSourceProject); the scan endpoint answers in the
  request's admin language and stored source names use the scanning editor's.
- Maintenance notice: getConstructionMode(locale) returns `locale`; the "x"
  close button gets a screen-reader name "Close" / "Zamknij" (locale and
  closeLabel props; constructionCloseLabel exported).
- Favicon: FaviconCheck (/admin, afterInput on Site settings -> Site icon)
  warns in the admin language when the image is under 48x48 or not square,
  without blocking the save; validateFaviconField shares faviconProblems().
- Docs, AGENT.md and skills: the above, plus Next.js 16.4.1 or later as the
  minimum safe version (AGENT.md 4.11, ipal-setup, ipal-upgrade).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-27 16:31:46 +01:00
co-authored by Claude Opus 5.5
parent 6f32ea4cdb
commit 546806fe39
35 changed files with 428 additions and 70 deletions
+7
View File
@@ -410,6 +410,13 @@ separate. The panel's language is what each user picks in *Account → Language*
format in the admin language; `defineTexts({ en, pl })` declares a text set whose Polish keys
must match the English ones; `ADMIN_LANGUAGES` lists the plugin's languages;
`applyAdminI18n(config)` is the config step itself (already applied by `ipalKit`).
- **Browser-tab title of a custom admin view:** Payload takes a view's `meta.title` as one
plain string and never translates it (its custom-view metadata ignores `i18n`), so the
server-rendered title stays in that one language. Render `<DocumentTitle title={…} />`
(`@intecion/ipal-kit/admin`) in the view with the translated title; after the page loads
the tab follows the admin language. `adminDocumentTitle(title, config.admin.meta.titleSuffix)`
builds the same "Title - Suffix" Payload would. The statistics view does this already:
its tab reads *Statystyki* in the Polish panel.
- **Wording rules** for every label you add: [dev/admin-ux.md](./dev/admin-ux.md).
- **Verify:** switch *Account → Language* to Polski — every plugin global, collection and
view reads in Polish; `pnpm test` runs `test/adminUx.test.ts` in the plugin.