Sign-in look: the client's logo or the site's name on a dark panel beside the form (whiteLabel.signIn)
On by default with whiteLabel. The login screen and the 2FA screens get the look through AdminLogo and SafeTotpView, which every site already has in its import map: an upgrade needs no edit. allScreens adds one provider (SignInLook) for forgot / reset password, first user and logout; a production start leaves it out when the import map on disk lacks it. Logo and name come from Site settings: no new field, no migration. Language links through GET /api/ipal/admin-language (Payload's own cookie, back to an admin path only). Options: accent, logoMadeFor, languages, svgLogo; whiteLabel.brandAccess 'admin'. The 2FA code boxes get names for screen readers. Reference site and starter: allScreens on. Docs, agent guide, skills, tests. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
e821d52d19
commit
b6c91a3a11
@@ -0,0 +1,72 @@
|
||||
# The panel's sign-in screens: design notes and screenshots
|
||||
|
||||
Design record of `whiteLabel.signIn` (the user-facing page is [white-label.md](../../white-label.md) → "The sign-in
|
||||
screens"). The goal: IAPL's sign-in looks like IAWL's (the WordPress sibling), and both have a place for the client's
|
||||
logo.
|
||||
|
||||
## Files here
|
||||
|
||||
Made with `node scripts/login-page-shots.mjs` (headless Chromium, 1280 × 800 and 390 × 844) against the reference
|
||||
site; `after-*` from a production build with `signIn: { allScreens: true }`, `before-*` from main (1.17.0).
|
||||
|
||||
| Files | What |
|
||||
|---|---|
|
||||
| `before-*.png` | IAPL 1.17.0: login (light, dark, phone, Polish, wrong password), forgot password, 2FA code, 2FA setup; `-logo` = with a logo set |
|
||||
| `after-*-name.png` | the new look with no logo set: the site's name |
|
||||
| `after-*-logo.png` | the new look with a logo (`placeholder-logo.png`, drawn for these pictures) |
|
||||
| `iawl-*.png` | IAWL's sign-in page, copied from its repository (`docs/reviews/white-label/`, made 2026-11-24). Two later changes are not in them: the languages are plain links now (no drop-down with a button), and messages are square boxes with a straight bar |
|
||||
| `placeholder-logo*.png` | the placeholder logos (dark text; white text for `logoMadeFor: 'dark'`) |
|
||||
|
||||
Screens: `login-{light,dark,phone,phone-dark,pl}`, `login-error-{light,phone}`, `forgot-{light,dark,phone}`,
|
||||
`2fa-code-{light,dark,phone}`, `2fa-setup-{light,dark,phone}`. Create-first-user needs a database without users
|
||||
(`--only=first-user`); it uses the same template and was checked by hand, not photographed.
|
||||
|
||||
## What defines IAWL's sign-in page (read from `plugin/assets/sign-in/sign-in.css`, `SignInLook.php`, `Logo.php`, `LanguageSwitcher.php`)
|
||||
|
||||
- **Layout:** two columns, 5 : 6. Left: a dark panel (`#060606`) inset 10 px from the window's edge, 20 px corners,
|
||||
a faint grid (3.5 × 2.5 rem cells, 4 % white lines) and two blue glows (`rgb(0 158 246)`, 22–24 %). Right: a white
|
||||
page with the form, 28 rem wide, centred in its column. No card around the form.
|
||||
- **On the panel**, at the bottom: a label "ADMINISTRATION PANEL" (mono, 14 px, 600, upper case, 0.05 em tracking,
|
||||
`#b2b2b2`, a 5 px blue square before it), then the logo on a white plate (12 px corners, 16 × 20 px padding; the
|
||||
logo fits 240 × 72) or the site's name as text (weight 500, −0.03 em, clamp 36–60 px). Both link to the site.
|
||||
- **Form:** labels above fields, 48 px fields with a 1 px `#80868f` border and 6 px corners, a full-width 50 px blue
|
||||
button (`#0070c0`, hover `#005a9e`, white text), links `#006bb8` underlined, focus ring 2 px `#017bd0`.
|
||||
- **Under the form:** links (lost password, back to the site), the languages as links, a hairline, and the credit
|
||||
"Technology support: Intecion.com" (13 px, muted, centred).
|
||||
- **Messages:** boxes above the form with a 4 px bar on the leading edge: red for errors, green for success.
|
||||
- **Phone (≤ 52 rem):** the panel is a band above the form, bottom corners rounded, the logo 192 × 56.
|
||||
- **Theme:** none: the panel is always dark, the form always light. **Fonts:** Outfit / Inter / Roboto Mono from
|
||||
local files, part of the credit (off with `credit => false`). **Script:** one optional file, the grid light that
|
||||
follows the mouse.
|
||||
- **States:** WordPress's own (errors, lost password, reset with the strength meter, logged out, interim frame);
|
||||
IAWL changes the look only.
|
||||
|
||||
## How IAPL maps it
|
||||
|
||||
| Element | IAPL | Same as IAWL? |
|
||||
|---|---|---|
|
||||
| Split, panel inset and corners, grid, glows, colours | the same numbers (`css.ts`) | yes |
|
||||
| Label, plate, logo box, name as text, link to the site | the same | yes |
|
||||
| Button, link, focus and border colours; field and button heights; 28 rem column | the same | yes |
|
||||
| Phone band at 52 rem | the same | yes |
|
||||
| Languages | links, **on the panel** (top corner; under the brand on a phone), because the form's markup is Payload's and differs per screen | place differs |
|
||||
| Credit line | under the login form, hairline above (login only, as before) | IAWL: every screen |
|
||||
| Dark theme | the form's side follows the admin theme; the panel stays dark | IAWL has no dark form |
|
||||
| Fonts | the admin's own font stack and the system's mono; no font file | differs (no extra request before sign-in) |
|
||||
| Grid light (script) | not built: no script on the sign-in page | differs |
|
||||
| Messages | Payload's own toasts and field errors, unchanged | differs |
|
||||
| Field look | Payload's fields with the shared border colour and height | close |
|
||||
|
||||
## Decisions
|
||||
|
||||
1. **Carried by components every site already has.** A new admin component needs a new import-map entry, and a
|
||||
provider missing from the map blanks the whole panel. So `AdminLogo` prints the panel on the login screen and
|
||||
`SafeTotpView` in front of the 2FA screens; only `allScreens` adds a provider (`SignInLook`), guarded at start.
|
||||
2. **The panel is one self-contained element**, fixed on a desktop and in the flow on a phone, hidden by its own
|
||||
CSS off the minimal template. It therefore works wherever it is printed (inside the login form's wrapper, before
|
||||
a 2FA view, at the top of the body).
|
||||
3. **No new stored data.** Logo and name are Site settings fields that exist since 1.0: no migration. The plate
|
||||
switch (`logoMadeFor`) and the accent are code options; putting them in the panel would add columns on SQL.
|
||||
4. **Payload draws its admin screens in the browser** (the server's HTML body is empty until React runs), so "no
|
||||
flash" means: the panel, its stylesheet and the form appear in the same step. The e2e spec checks that the
|
||||
form's template is never in the page without them.
|
||||
@@ -0,0 +1,48 @@
|
||||
# Changelog draft — the sign-in look (for the next minor, written as 1.18.0)
|
||||
|
||||
To be placed in `docs/CHANGELOG.md` by the release; the version number is the integration session's call.
|
||||
|
||||
## Read before upgrading
|
||||
|
||||
**The panel's sign-in page looks different on every site with `whiteLabel`.** After the update the login screen and
|
||||
the 2FA screens (code, setup) show a dark panel with the client's logo — or the site's name — beside the form, the
|
||||
look IAPL now shares with IAWL. No edit, no `generate:importmap`, no migration, no new env var.
|
||||
Keep Payload's screens: `whiteLabel: { signIn: false }`. Sites without `whiteLabel`: nothing changes.
|
||||
|
||||
## Added
|
||||
|
||||
- **Sign-in look (`whiteLabel.signIn`, on with `whiteLabel`).** A dark panel with the label "Administration panel",
|
||||
the client's logo on a white plate (Site settings → Logo) or the site's name, and the panel's languages as links;
|
||||
the form beside it, in both admin themes; a band above the form on a phone. Logo and name come from Site settings:
|
||||
no env var, **no new field, no schema change** (MongoDB, Postgres, SQLite alike). With nothing set the panel shows
|
||||
the label and the site's host — no Payload or Intecion mark.
|
||||
- **`signIn: { allScreens: true }`** — the same look on forgot / reset password, create first user, logout and
|
||||
"unauthorized". Adds the provider `SignInLook` (one import-map entry: `pnpm payload generate:importmap`). The
|
||||
project starter writes it for new sites. A production start that does not find the entry in `importMap.js`
|
||||
leaves the provider out and logs what to run; the panel keeps working.
|
||||
- **Options:** `signIn.accent` (hex colour of the button, links and focus ring), `signIn.logoMadeFor: 'dark'` (a
|
||||
white logo: no plate), `signIn.languages: false`, `signIn.svgLogo: false` (an SVG logo is not shown on the sign-in
|
||||
screens), `whiteLabel.brandAccess: 'admin'` (only admins change the name, logo and icon in Site settings;
|
||||
field-level access, no schema change). CSS variables `--iapl-signin-*` for a project's `custom.scss`.
|
||||
- **Language links before sign-in:** `GET /api/ipal/admin-language?lng=<code>` writes Payload's language cookie for
|
||||
a supported language and returns to the admin page it was opened from (public; 400 for an unknown language;
|
||||
never redirects off the admin route). Registered only with the sign-in look and `languages !== false`.
|
||||
- **The 2FA code boxes have names** for screen readers ("Digit 2 of 6") and ask a phone for the numeric keyboard
|
||||
(with the sign-in look).
|
||||
- Exports: `SignInPanel`, `SignInLook` (`/admin`); `resolveSignInLook`, `loadSignInBrand`, `signInLogo`,
|
||||
`signInName`, `fitLogo`, `isSvgUpload`, `languageLinks`, `LANGUAGE_NAMES`, `signInCss`, `isHexColour`,
|
||||
`signInProviderActive`, `buildAdminLanguageEndpoint`, `adminPathFromReferer`, `SIGN_IN_LOOK`, `SIGN_IN_STYLE_ID`,
|
||||
`SIGN_IN_LOGO_BOX`, `SIGN_IN_NAME_MAX`, `ADMIN_LANGUAGE_PATH` and their types.
|
||||
|
||||
## Changed
|
||||
|
||||
- `AdminLogo` prints the sign-in panel when the plugin gives it `signIn` (the default with `whiteLabel`); wired by
|
||||
hand without that prop it is the plain logo as before. The logo on the login screen is now shown inside
|
||||
240 × 72 px (it was up to 420 × 120).
|
||||
- The credit line under the login form: full-strength muted colour and a hairline above it (it was 60 % opacity).
|
||||
- The reference site and the starter use `whiteLabel: { signIn: { allScreens: true } }`.
|
||||
|
||||
## Requires project changes
|
||||
|
||||
None. Recommended: `allScreens` (one config line, regenerate the import map). A project with its own CSS for the
|
||||
login screen looks at the result after the update.
|
||||
Reference in New Issue
Block a user