Branding: a separate logo for dark mode #459

Merged
jcoffey-dev merged 1 commits from feat/410-dark-logo into main 2026-11-18 20:54:13 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev cbb08a569b Branding: a separate logo for dark mode
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 12m27s
A custom logo was a single value per level, so a logo drawn for a light
background was all a dark page could show, while the built-in inbuxa logo
adapts (its wordmark is drawn in the current text color). Requested in
community t/304.

Each level can now hold a logo for dark mode too: logoDark on a domain and
on a tenant, logoUrlDark on x:Enterprise (branding spec BT-27). Each is
written and read like the level's own logo (BT-3, BT-4) and changed by
whoever can change that logo (BT-24, BT-25). GET /logo?theme=dark resolves
the chain with each level offering its dark logo first, then its own, so a
domain's own logo still beats the server-wide dark one. Without
theme=dark, or with any other value, a dark logo is never served, and email
always uses the light logo (BT-9).

The built-in sign-in and RSVP pages ask for theme=dark when they show dark
(the sign-in page's theme parameter, else the system's preference);
minified and gzipped copies rebuilt with resources/scripts/minify_html.sh.
The served schema has the three fields with descriptions, next to each
logo on the Branding, domain and tenant forms, so inbuxa Admin offers them.
The privacy catalog needs no entry (plain strings).

The new fields are stored at x:Enterprise version 1, x:Domain version 2 and
x:Tenant version 1, after every existing field; records stored before read
back without a dark logo. A server from before this reads a newer record's
fields up to its own and ignores the rest, so it still loads the object
(and drops the dark logo if it saves it again).

Refs inbuxa-webmail#101 (the webmail will ask for theme=dark too).

Test: unit tests for the order of candidates (a level's own logo beats a
less specific level's dark logo, a light page never gets a dark one, an
unusable dark logo falls back to the level's own) and for the stored
format (domains, tenants and the server-wide branding saved at the old
versions read back without a dark logo; saved now, with it). The branding
system test gains acceptance test 19: /logo?theme=dark serves the domain's
own logo over the server-wide dark one, then the domain's dark logo once
its tenant administrator sets it; /logo and ?theme=sepia serve the light
one; an invalid logoDark is refused naming the field; a tenant
administrator can't set logoUrlDark.
2026-11-18 13:40:36 -07:00