events 3.9.0, website 1.9.0, accounts 1.10.0: the church's details from Accounts everywhere

- Events: the Accounts profile's name, logo, icon, colours and contact details win over
  Events' own settings while Accounts is connected (pages, emails, WhatsApp, PDFs); Settings
  shows them read-only with a link to Accounts. The Accounts logo is copied for PDFs (PNG
  and JPEG). Fixes Events keeping its old church after a demo scenario load.
- Website: a background per homepage section in the church's colours; "More info" instead
  of "Register" for events without registration; the shared colour field.
- Accounts: the shared colour field in Church profile.
- @crosscode/ui 0.4.0: ColourField and isHexColour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 00:46:39 +02:00
co-authored by Claude Opus 5.5
parent 799c193fe1
commit 8055e1ec62
41 changed files with 843 additions and 120 deletions
@@ -5,6 +5,7 @@ import {
SECTION_TYPES, SECTION_VARIANTS, TEMPLATE_HEADERS, TEMPLATE_HOME_ORDER, TEMPLATE_STYLE, TEMPLATE_VARIANTS,
defaultDesign, defaultVariant, headerIsTransparent, isRecommended, isVariant, switchTemplate,
} from '../src/site/variants.js';
import { cleanDesign } from '../src/site/snapshot.js';
describe('section variants (WEBSITE-1.0-PLAN §3, decision 16)', () => {
it('has the 26 confirmed variant ids', () => {
@@ -101,3 +102,20 @@ describe('switching template', () => {
assert.deepEqual(switchTemplate(there, 'heritage').design, defaultDesign('heritage'));
});
});
describe("a section's own background", () => {
it('stays with its section through a template switch, whether the order moves or not', () => {
const start = defaultDesign('heritage');
start.home = start.home.map((e) => (e.section === 'events' ? { ...e, background: 'brand' as const } : e));
const moved = switchTemplate(start, 'bold').design;
assert.equal(moved.home.find((e) => e.section === 'events')?.background, 'brand');
assert.deepEqual(moved.home.map((e) => e.section), defaultDesign('bold').home.map((e) => e.section));
assert.equal(moved.home.filter((e) => e.background).length, 1);
});
it('is kept by cleanDesign only when it is one of the church-colour choices', () => {
const d = cleanDesign({ template: 'clean', variants: {}, home: [{ section: 'welcome', hidden: false, background: 'tint' }, { section: 'events', hidden: false, background: 'hot-pink' }], style: {} });
assert.equal(d.home.find((e) => e.section === 'welcome')?.background, 'tint');
assert.equal('background' in d.home.find((e) => e.section === 'events')!, false);
});
});