feat(ui,manager): looks: light / dark / device, palettes and styles, chosen in the manager's profile menu (platform-v2 step 6.15)

- @xenia/ui theme.js: a look = mode (light | dark | system) + palette (data-palette) + style (data-style); applyLook /
  getStoredLook (per device), 'system' resolved with matchMedia and followed live, so a palette is just a light and a
  dark token block; applyTheme kept for older callers (keeps palette and style)
- tokens.css: 'Palettes' (first: Nord, light + dark, every colour and the nav rail) and 'Styles' (first: sharp: small
  corners, 1.5px borders, flat cards); --x-border-width used by every component and Tailwind's 'border'
- contrast test: every palette in both modes (+ the nav rail); it caught the default rail's active item at 3.7:1 -> 5.5:1
- manager: the saved look applied at start (was light only); profile menu -> Look: Light / Dark / Device, Colours
  (Xenia, Nord), Shapes (Rounded, Sharp), applied at once and kept on this device
- e2e: manager_look.mjs (every page in light and dark, no large near-white area in dark, contact sheets; 'nord-sharp'
  adds that look; in run-all), manager.mjs 'look:' (dark at once, kept after a reload, Device follows the device)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 00:30:24 +02:00
co-authored by Claude Opus 5.5
parent f383060bad
commit 2b44d55f81
14 changed files with 468 additions and 38 deletions
+19
View File
@@ -809,6 +809,25 @@ try {
r.check(`${tl} the profile: a PIN of 2 digits is refused before saving`, (await page.getByTestId('profile-dialog').textContent()).includes('4 to 6 digits'))
await page.keyboard.press('Escape')
r.check(`${tl} the side rail is drawn with the nav tokens`, await page.getByTestId('sidebar').evaluate(el => getComputedStyle(el).backgroundColor) === 'rgb(17, 94, 89)')
// ── 6.15: the look from the profile menu (mode, palette, style), kept on this device ──
const lk = 'look:'
const attr = n => page.evaluate(k => document.documentElement.getAttribute(k), n)
await page.getByTestId('user-menu').click()
await page.getByTestId('look-mode').locator('[data-value="dark"]').click()
r.check(`${lk} Dark applies at once`, await attr('data-theme') === 'dark' && await page.getByTestId('sidebar').evaluate(el => getComputedStyle(el).backgroundColor) === 'rgb(4, 47, 46)')
await page.getByTestId('look-palette').locator('[data-value="nord"]').click()
await page.getByTestId('look-style').locator('[data-value="sharp"]').click()
await page.reload()
await page.getByTestId('sidebar').waitFor({ timeout: 10_000 })
r.check(`${lk} Nord, sharp and dark are kept after a reload`, await attr('data-theme') === 'dark' && await attr('data-palette') === 'nord' && await attr('data-style') === 'sharp'
&& await page.locator('.x-btn').first().evaluate(el => getComputedStyle(el).borderRadius) === '4px')
await page.getByTestId('user-menu').click()
await page.getByTestId('look-mode').locator('[data-value="system"]').click()
r.check(`${lk} "Device" follows the device (light here)`, await attr('data-theme') === 'light' && await attr('data-theme-choice') === 'system')
await page.getByTestId('look-mode').locator('[data-value="light"]').click()
await page.getByTestId('look-palette').locator('[data-value="default"]').click()
await page.getByTestId('look-style').locator('[data-value="rounded"]').click()
await page.keyboard.press('Escape')
await page.goto(`${APP}/reports/technical`)
await page.getByText('Log files', { exact: true }).click()