LibreChat/api/server/routes/__tests__
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
..
config.rum.spec.js 💌 feat: Authenticate RUM Proxy Exports (#16114) 2026-09-20 05:25:26 -04:00
config.spec.js 🎨 feat: Pick the Deployment Theme in librechat.yaml (#16286) 2026-10-01 03:46:17 +00:00
convos-duplicate-ratelimit.spec.js 📬 fix: Show Background Results Still Waiting for the Agent (#16363) 2026-09-26 09:22:35 -04:00
convos-import.spec.js 📏 refactor: Add File Size Limits to Conversation Imports (#12221) 2026-03-14 03:06:29 -04:00
convos.spec.js 🔔 feat: Unseen Reply Indicators, Reply Notifications, and Mark as Unread (#15025) 2026-10-01 03:46:16 +00:00
grants.spec.js ⛩️ feat: Admin Grants API Endpoints (#12438) 2026-03-30 16:49:23 -04:00
insights.spec.js 🩻 feat(insights): Scope Insights to Authorized Agents (#15549) 2026-09-04 20:16:58 -04:00
keys.spec.js 🔱 chore: Harden API Routes Against IDOR and DoS Attacks (#11760) 2026-02-12 18:08:24 -05:00
ldap.spec.js
mcp.spec.js 🧩 feat: MCP Apps support (#13831) 2026-10-01 03:46:16 +00:00
memories.spec.js 🧠 fix: Return 400 for Invalid Memory Keys (#14618) 2026-09-06 04:34:06 +02:00
messages-content-edit.spec.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00
messages-delete.spec.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00
messages-feedback.spec.js 🔭 feat: Conversation Trace Viewer (#15869) 2026-09-13 00:56:52 -04:00
messages-get-real-validation.spec.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00
messages-get.spec.js 🔭 feat: Conversation Trace Viewer (#15869) 2026-09-13 00:56:52 -04:00
messages-subagent-thread.spec.js 🔭 feat: Conversation Trace Viewer (#15869) 2026-09-13 00:56:52 -04:00
roles.spec.js ⚡ perf: Skip Role Route Capability Probe for Own and Default Roles (#14073) 2026-07-02 10:45:41 -04:00
rum.spec.js 💌 feat: Authenticate RUM Proxy Exports (#16114) 2026-09-20 05:25:26 -04:00
share.spec.js ⏳ fix: Separate Temporary and General Chat Retention (#15734) 2026-09-08 11:22:54 -04:00
static.spec.js
traces.spec.js 🔭 feat: Conversation Trace Viewer (#15869) 2026-09-13 00:56:52 -04:00