LibreChat/packages
Marco Beretta 27f78bc3c7 🎨 feat: Pick the Deployment Theme in librechat.yaml (#16286)
* feat: pick the deployment theme in librechat.yaml

Add `interface.theme` to the config schema, accepting a bundled theme name
or an inline theme definition. The interface loader passes it through, the
pre-login config payload carries it so the login page paints it, and a
DeploymentTheme wrapper around ThemeProvider resolves and validates it and
applies it without persisting it over the user's stored theme.

* fix: restore the user theme when the deployment theme is withdrawn

Move the pre-login interface selection out of the /api route into
buildPreLoginInterface in packages/api, so the route only wires it up.

When an authenticated config drops interface.theme (a principal override
tombstoning it), hand ThemeProvider the user's stored theme instead of
clearing to the LibreChat palette. The e2e scenarios now cover inline and
invalid themes, the withdrawn case, and high-contrast precedence.

* fix: read a legacy stored theme behind a corrupt stored definition

* perf: rebind the deployment theme observer on a cache add, not every event

useIsFetching recomputed the fetch count across every query on each cache
event, which slowed streamed renders enough to break the highlight-throttle
scenario. Subscribe to the query cache and re-render only when a startup
config query is rebuilt.

* test: wait for the composer after sign-in so mobile runs pass

* fix: keep deployment themes whole and restore legacy themes as legacy

A principal override with an inline theme merged into the base theme,
keeping the base's other mode, brands and tokens; interfaceConfig.theme
now replaces whole during override merging.

A withdrawn deployment theme restored a legacy-source stored theme as a
versioned definition, dropping its colors in dark mode; it now goes back
through ThemeProvider's legacy color path.

* fix: persist the user's theme changes after the deployment theme is withdrawn

Persistence now stays off only while a deployment theme is applied and for
the render that restores the stored theme, so later changes through the
theme API are saved again.

* refactor: derive deployment theme persistence from the current theme

(cherry picked from commit f0cbc9a3c0)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16286
2026-10-01 03:46:17 +00:00
..
api 🎨 feat: Pick the Deployment Theme in librechat.yaml (#16286) 2026-10-01 03:46:17 +00:00
client 🎨 style: Semantic Colour Roles for Builder, Tools and Sharing Surfaces (#16294) 2026-10-01 03:46:17 +00:00
data-provider 🎨 feat: Pick the Deployment Theme in librechat.yaml (#16286) 2026-10-01 03:46:17 +00:00
data-schemas 🎨 feat: Pick the Deployment Theme in librechat.yaml (#16286) 2026-10-01 03:46:17 +00:00