LibreChat/packages
Marco Beretta eb5d74dbd5 🧑‍🎨 feat: Give the Default Avatar and Avatar Placeholder Theme Roles (#16545)
* feat: Give the Default Avatar and Avatar Placeholder Theme Roles

The default user avatar filled with a literal rgb(121, 137, 255) in Avatar, MessageIcon and the endpoint Icon, and agent and assistant avatars sat on surface-secondary in light and a dark: surface-tertiary override, so no theme could repaint either.

avatar-fill and avatar-text paint the default avatar and its glyph, and avatar-placeholder paints the backdrop behind an agent or assistant image. Every bundled theme reproduces today's pixels. A theme that sets only its surfaces keeps the placeholder on the surface its mode used before the role existed, both when resolved and through the legacy applyTheme path. ClickHouse takes Click UI's avatar fill and text and its muted background.

* test: Pin the Default Avatar Fill With and Without the ClickHouse Theme

The sidebar account avatar falls back to the default avatar when its image fails; with no theme it keeps rgb(121, 137, 255) in both modes and the placeholder keeps the surface its mode used, and under ClickHouse both take the Click UI values.

* fix: Ink Every Default Avatar Glyph With the Avatar Text Role

The sidebar Avatar, the only default avatar the chat renders, still inked its glyph in text-primary, so a theme's avatar-text never reached it and ClickHouse drew a dark glyph where Click UI draws white. Avatar now reads avatar-text, which defaults to each bundled theme's primary text and follows rgb-text-primary in a theme that does not set it, through resolveTheme and the legacy applyTheme path, so every rendered default avatar keeps its pixels.

* fix: Read the Active Mode Off the Root When applyTheme Is Not Told It

applyTheme is exported, and a caller that applies a legacy palette in dark mode without the new mode argument derived the avatar placeholder from the light surface. It now falls back to the root's dark class.

* fix: Keep CSS-Themed Avatars on Their Legacy Source Variables

The avatar text and placeholder defaults were literal triplets, so a consumer theming through --text-primary and the surface variables left avatars on the stock colors. They now alias text-primary, the secondary surface and, in dark, the tertiary surface, resolving to the same pixels by default. applyTheme's mode fallback also reads a dark ancestor, not only the root itself.

* fix: Let the Stylesheet Alias Carry the Document Root Avatar Backdrop

applyTheme wrote the legacy placeholder inline for the mode active when it ran, which then overrode the per-mode stylesheet alias after a dark toggle without a reapply. On the document root the alias already follows the theme's surfaces and the mode, so the placeholder is now derived only for a scoped root, which that alias cannot see.

* fix: Keep a Scoped Legacy Avatar Backdrop Following the Mode

applyTheme wrote a scoped root's avatar placeholder inline for the mode active when it ran, so after a later dark toggle the backdrop stayed on the light surface, where canary's dark:bg-surface-tertiary switched. applyTheme now marks a scoped root with data-theme-scope and the stylesheet points its backdrop at that root's own secondary surface, or its tertiary one under a .dark ancestor, as the document root's alias does. The mode argument is no longer needed and is removed.

(cherry picked from commit 3ac6a0af37)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16545
2026-10-01 03:46:19 +00:00
..
api 🧩 feat: Ignore Unknown Theme Color Tokens Instead of Dropping the Theme (#16529) 2026-10-01 03:46:19 +00:00
client 🧑‍🎨 feat: Give the Default Avatar and Avatar Placeholder Theme Roles (#16545) 2026-10-01 03:46:19 +00:00
data-provider 🧑‍🎨 feat: Give the Default Avatar and Avatar Placeholder Theme Roles (#16545) 2026-10-01 03:46:19 +00:00
data-schemas ⛴️ test: Make Passkey Ordering Fixtures Deterministic 2026-10-01 03:46:19 +00:00