12 lines
2.0 KiB
Markdown
12 lines
2.0 KiB
Markdown
# Stable theme at startup
|
|
|
|
The old page painted a hardcoded purple sidebar before `app-runtime.js` applied the selected theme. Its partial early bootstrap only set some CSS variables; the legacy sidebar still used a hardcoded gradient, defaults were missing when no theme was saved, and the background setting wrote `--sun-ui-background` while CSS read `--sun-ui-bg`.
|
|
|
|
The existing theme editor and presets now live in `public/core/brand-theme.js`, loaded synchronously in the document head. It reads and normalizes the stored theme once, supplies the same defaults used by the editor, and installs the theme styles before the body is parsed. Explicit CSS precedence keeps later legacy styles from replacing those colors. The background setting now updates the variable actually used by the page. Preset preview, save/cancel and cloud updates are retained.
|
|
|
|
A brief Caterium loading surface covers intermediate legacy layouts until DOM initialization finishes. Initial sidebar transitions are disabled during this step; normal interactions keep their transitions. No company data or account settings are changed. The service worker release is `v83-20260917-theme-first-paint`.
|
|
|
|
`tests/theme-startup.spec.mjs` holds the main runtime request and checks that default/custom theme colors remain identical before and after it loads, on desktop and mobile. It also verifies preview isolation, save, reload and cloud updates. The Playwright server now explicitly serves the repository's `public/` directory. Running the existing tests against the actual page exposed unescaped catalog names in an early legacy renderer; those fields now use the existing escaping helper. Tests that inject individual modules with mocked dependencies now use an explicit same-origin fixture, isolated from real auth timers. The theme, XSS and idle integration tests load the complete application.
|
|
|
|
Validation: `npm run check:deploy` passed; Playwright reported 50 passed and two skipped. The desktop application and its appearance settings were also inspected in a browser.
|