LibreChat/api/server/routes
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
..
__test-utils__ 🔔 feat: Unseen Reply Indicators, Reply Notifications, and Mark as Unread (#15025) 2026-10-01 03:46:16 +00:00
__tests__ 🎨 feat: Pick the Deployment Theme in librechat.yaml (#16286) 2026-10-01 03:46:17 +00:00
admin 🔑 feat: Passkey Authentication with WebAuthn Sign-In and Management (#14715) 2026-10-01 03:46:16 +00:00
agents 🥢 fix: Fit MCP App Snapshots Within Message Documents (#16299) 2026-10-01 03:46:17 +00:00
assistants 📿 fix: Inspect Stored File Locators Per Message (#15841) 2026-09-11 16:47:48 -04:00
files 🥡 fix: Delete Storage and Embeddings With Owned Agent Files (#16007) 2026-09-17 02:59:25 +00:00
types
accessPermissions.js 🩻 feat(insights): Scope Insights to Authorized Agents (#15549) 2026-09-04 20:16:58 -04:00
accessPermissions.sharePolicy.test.js
accessPermissions.test.js
actions.js
apiKeys.js
auth.2fa-ratelimit.test.js 🔑 feat: Passkey Authentication with WebAuthn Sign-In and Management (#14715) 2026-10-01 03:46:16 +00:00
auth.cloudfront.test.js 🔑 feat: Passkey Authentication with WebAuthn Sign-In and Management (#14715) 2026-10-01 03:46:16 +00:00
auth.cross-site.test.js 🔑 fix: Keep Passkey Sign-In Reachable When Email Login Is Disabled (#16254) 2026-10-01 03:46:16 +00:00
auth.js 🔑 fix: Keep Passkey Sign-In Reachable When Email Login Is Disabled (#16254) 2026-10-01 03:46:16 +00:00
auth.reset-password-ratelimit.test.js 🔑 feat: Passkey Authentication with WebAuthn Sign-In and Management (#14715) 2026-10-01 03:46:16 +00:00
balance.js
banner.js
categories.js
code-environments.js 🧲 feat: Attach or Leave a Workspace on a Saved Chat (#16124) 2026-09-25 10:08:28 -04:00
code-environments.test.js 🧲 feat: Attach or Leave a Workspace on a Saved Chat (#16124) 2026-09-25 10:08:28 -04:00
config.js 🎨 feat: Pick the Deployment Theme in librechat.yaml (#16286) 2026-10-01 03:46:17 +00:00
convos.js 🔔 feat: Unseen Reply Indicators, Reply Notifications, and Mark as Unread (#15025) 2026-10-01 03:46:16 +00:00
endpoints.js 🧳 feat: Register Principal-Owned Code Environments (#15365) 2026-08-30 19:33:19 -04:00
index.js 🔌 feat: OpenAPI spec and docs for the public Agents API (#15928) 2026-09-16 13:50:05 -04:00
insights.js 🩻 feat(insights): Scope Insights to Authorized Agents (#15549) 2026-09-04 20:16:58 -04:00
keys.js
mcp.js 🧩 feat: MCP Apps support (#13831) 2026-10-01 03:46:16 +00:00
memories.js 🧠 fix: Return 400 for Invalid Memory Keys (#14618) 2026-09-06 04:34:06 +02:00
memories.test.js 🧠 fix: Return 400 for Invalid Memory Keys (#14618) 2026-09-06 04:34:06 +02:00
messages.js 🔭 feat: Conversation Trace Viewer (#15869) 2026-09-13 00:56:52 -04:00
models.js
oauth.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
oauth.state.test.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
oauth.test.js 🔐 fix: Redirect OAuth Browser Navigations Instead of Rendering JSON (#15440) 2026-08-31 21:13:47 -04:00
openapi.js 🔌 feat: OpenAPI spec and docs for the public Agents API (#15928) 2026-09-16 13:50:05 -04:00
presets.js 📿 fix: Inspect Stored File Locators Per Message (#15841) 2026-09-11 16:47:48 -04:00
presets.test.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00
projects.js
prompts.js ⚡ perf: Avoid Parallel Full and Paged Prompt Loading on Startup (#15031) 2026-08-25 21:21:17 -04:00
prompts.test.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00
roles.js
rum.js 💌 feat: Authenticate RUM Proxy Exports (#16114) 2026-09-20 05:25:26 -04:00
schedules.js 🛎️ fix: Preflight MCP Readiness for Scheduled Chats (#15782) 2026-09-09 22:18:45 -04:00
search.js
settings.js 📌 feat: Unified Pinned Section With Sidebar Drag Interactions (#15057) 2026-09-11 10:41:05 -04:00
share.js 📿 fix: Inspect Stored File Locators Per Message (#15841) 2026-09-11 16:47:48 -04:00
skills.js 🖊️ fix: Persist Skill Subfile Edits (#16362) 2026-09-26 22:02:10 -04:00
skills.tenant.test.js
skills.test.js 🖊️ fix: Persist Skill Subfile Edits (#16362) 2026-09-26 22:02:10 -04:00
static.js
tags.js
traces.js 🔭 feat: Conversation Trace Viewer (#15869) 2026-09-13 00:56:52 -04:00
user.js 📧 feat: add email address change (#14597) 2026-10-01 03:46:16 +00:00
user.verify-ratelimit.test.js 📧 feat: add email address change (#14597) 2026-10-01 03:46:16 +00:00