Commit graph

836 commits

Author SHA1 Message Date
Marco Beretta
7e466a498d
🎛️ refactor: Hand Chat Preferences to the Host and the Follow-Up Queue to Jotai (#16604)
* refactor: Supply saveDrafts and isTemporary Through Chat Settings

Both preferences are app-global: the settings dialog writes saveDrafts,
and the chat route and keyboard shortcuts write isTemporary. Every chat
reader (composer, autosave, pasted-text edit, new chat and new convo,
file uploads, submissions, the temporary toggle, landing, run code) now
takes them from the host ChatSettings context, which the app fills from
its store. ChatView still reads saveDrafts from the store while #15911
owns it.

* test: Cover Chat Settings Preferences End to End

* fix: Read the Temporary Flag at Run Time in Run Code

* test: Supply saveDrafts Through Chat Settings in the Hook Specs

* test: Pin the Run Code Retention Flag With a Stable Code Ref

* test: Turn Temporary Chat On Through Its Toggle in the Scenario

* refactor: Move the Queue Run-End Atoms to Jotai

The follow-up queue, its settled receipts and pending enqueue ids, the
pane and parked run-end signals, and the interrupt-drain flag are
written and read only by chat logic (queue drain, steering, the SSE
hook, the queue rail). They now live in store/queue as Jotai atoms with
every consumer converted. The run-end FIFO keeps its nullable one-shot
API as a writable derived atom.

* test: Cover the Chat-Owned Queue State End to End

* test: Give Each Queue Rail Its Own Store in the Split-View Spec

* test: Drop the Parked Run-End Scenario Canary Does Not Meet

* refactor: Keep the Queue State Inside the Chat Feature

The queue atoms and their types move from store/queue to hooks/Chat/queue,
next to the drain that owns them. store/families re-exports the types so
existing imports keep working.

* refactor: Import the Queue Types From the Chat Feature

* test: Scope the Split-View Queue Spec to What Its Harness Proves

* test: Run the Split-View Queue Spec on One Shared Store
2026-10-01 17:47:26 +02:00
Marco Beretta
5a6316ec6a
🪗 fix: Open the Lone Tool Call Directly and Label Settled Commands Ran (#16547)
* fix: Open the Sole Tool Call in a Group and Label Finished Commands as Ran

A tool group with exactly one call opened into a second collapsed row, so
reading the result took two clicks. Tool cards now default open when they
are the only call in their group, through SoleToolContext, while nested
subagent messages reset it. The generic finished label for commands reads
Ran command instead of Finished running.

* fix: Open the Sole Tool Call Inside an Activity Phase

The live and settled activity phase card wraps its tool calls without a
ToolCallGroup, so a phase holding one bash call still opened into a second
collapsed row. The phase now sets SoleToolContext for a single call. The
mock tool-steps scenario matches the Ran command label.

* style: Sort Imports in ToolCallGroup Test

* test: Assert Sole Tool Card Disclosure on a Real BashCall

* test: Add Lone Tool Call Scenario

* test: Match Ran Command Label in Exit Status Tests

* fix: Let an Activity Phase Decide Sole Tool State for Its Groups

* fix: Keep the Reader's Tool Card Choice Apart From the Sole Call Default

Every local-state tool card stored its default and the reader's choice in one
sticky boolean. A sole card stayed open after its group gained a second call,
and a card that remounted while a live batch regrouped forgot that the reader
had closed it. Cards now keep the explicit choice in the per-tool disclosure
atom and derive the default on each render. A generic call that returned no
output but has arguments also opens as the sole call.

* test: Add Multi Call Group Scenario

* fix: Keep the Auto Expand Preference Waiting for Output on Generic Calls

* test: Scope the Multi Call Scenario to Its Tool Cards
2026-10-01 17:44:48 +02:00
Marco Beretta
d9fdfddce9
🗂️ feat: Give File-Type Tiles Their Own Theme Roles (#16603)
* feat: Give File-Type Tiles Their Own Theme Roles

The file chips in the composer, the file table and message attachments drew their tile in one of seven hard-coded hex fills from utils/files.ts and their glyph in raw white, so a theme could recolour neither. Each kind of file now has a file-* fill role and the glyph reads file-ink; every LibreChat theme keeps today's colours, and ClickHouse draws the tiles from Click UI palette steps that keep the white glyph legible. The tile fill travels as a fill utility, the way the trace kinds already pass theirs.

* test: Pin the File Tile Roles in the Composer Tray

* test: Attach File Tile Captures to the Report

* fix: Keep FileIcon's Colour Fill and Take the Role Through fillClassName

* fix: Hold High Contrast File Tiles to AA Against Their Glyph

* fix: Ink the File Upload Spinner With the Tile Glyph Role
2026-10-01 17:44:29 +02:00
lia-by-librechat[bot]
99015144e4
🪀 fix: Stop the Textarea Jump During File Uploads (#16623)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
Co-authored-by: Lia <lia@librechat.ai>
2026-10-01 09:47:34 -04:00
Marco Beretta
d3d9bc9703 🖍️ feat: Give the Remaining Component Colour Literals Theme Roles (#16597)
* feat: Give the Last Component Colour Literals Theme Roles

The default avatar's hairline, the file drop zone's artwork and a dragged badge's lift were literals in Avatar, Icon, MessageIcon, DragDropOverlay and Badge, so no theme could reach them. avatar-edge, the illustration roles and the elevationDrag appearance role now carry them, each defaulting to the literal it replaces in every bundled theme. ClickHouse paints the artwork from Click UI's info ramp.

Canvas, favicon and screenshot code read roles through readThemeColor instead of wrapping channel triplets by hand. The Reasoning fade mask, two comments and dead commented-out SVG fills no longer carry colour literals, and the allowlist is regrouped into nine justified entries.

* test: Pin the Avatar Hairline, Drop Zone Artwork and Drag Lift Roles

* refactor: Export readThemeColor Beside the Theme Atoms

* test: Compare the Avatar Hairline by the Pixel It Paints

* test: Compare the Drag Lift as the Browser Computes It

* test: Attach Drop Zone Artwork Captures to the Report

* test: Pick the Drag Lift Theme From One Init Script

(cherry picked from commit 59a8a31ab2)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16597
2026-10-01 11:50:53 +00:00
Marco Beretta
c664eb8f28 📱 feat: Give the Mobile Drawer One Place for Each Control (#16248)
* feat(client): Give the mobile drawer one place for each control

The drawer put its two global destinations in opposite corners and repeated
one of them under every panel. The marketplace was a bare icon in the top
strip, the hardest thing there to notice; new chat was a large footer button
sitting under prompts, memories and MCP settings alike, none of which it has
anything to do with; and the close toggle wore the chat header's bordered
plate beside two flat icons, so the row read as one control and two
afterthoughts.

They swap. New chat takes the icon slot beside the panel switcher, which is
where the drawer keeps what means the same thing whichever panel is showing,
and its click behaviour moves with it into a component of its own rather than
staying behind in the footer. The marketplace becomes a full-width entry
above the panel content, labelled, in the list where someone already looks
for somewhere to go, and outside the scroller so it stays put while the
panels change under it. The toggle drops to `ghost` like its neighbours. The
footer is left with search alone and stands down entirely on a panel that has
nothing to search, rather than taking its padding out of the list above it.

The drawer now carries a text colour beside its background. Only the panel
nav set one, so the header strip, the new marketplace row and the footer all
inherited black from the document and rendered near-invisible in dark mode,
except where a control happened to name a token itself. That was hidden while
the toggle wore `header-action`, which brought its own.

* fix(client): Keep the mobile drawer clear of the home indicator and apart from its scrim

The footer now renders a safe-area spacer when search is absent, so panel
content no longer runs under the system gesture area on panels with nothing
to search. The marketplace row uses the Button's `row` size instead of
restyling it, which drops its new lint suppression.

The scrim paints the theme's `bg-scrim` role (80% by default) on its own
layer, which separates the drawer by 3:1 in both light palettes, and in dark
mode the drawer draws a `border-xheavy` edge, since no scrim opacity
separates two near-black surfaces. The scrim's focus ring is checked in the
browser instead of by class name.

* fix(client): Paint the mobile scrim's focus indicator above its fill

The scrim's theme fill sits on its own layer, which painted over the
button's inset focus ring, so a keyboard user focusing the scrim with the
chat strip on saw almost none of it. The indicator now draws on a layer
above the fill, in two tones: at the theme's 80% scrim a single dark ring
reaches only 2.3:1 on the light palettes' mid-gray, so a surface band
carries it in light and the focus ring in dark. The scenarios check, in
all four palettes, that the topmost layer at the scrim's edge carries an
indicator with a tone at 3:1 against the fill.

* fix(client): Keep the mobile drawer close toggle on the header's control

The drawer's close toggle is the chat header's open toggle flipping state,
so it keeps the header-action surface and size it shares with that control
rather than going flat like its new neighbours.

(cherry picked from commit 0da898786c)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16248
2026-10-01 11:50:53 +00:00
Marco Beretta
92f730632b 🔁 test: Reload Mid-Reply Reattaches and Finishes (#16598)
(cherry picked from commit 1be8475e6f)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16598
2026-10-01 11:50:53 +00:00
Marco Beretta
8b9c9a7728 🖼️ feat: Give Media Overlays Their Own Theme Roles (#16596)
(cherry picked from commit d2e11ffd0a)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16596
2026-10-01 11:50:53 +00:00
Marco Beretta
d016c5b586 🧩 refactor: Message Parts Host Context (#16591)
(cherry picked from commit 3b91138906)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16591
2026-10-01 11:50:53 +00:00
Marco Beretta
82127a2269 🌅 fix: Paint the Cached Deployment Theme on the First Frame (#16590)
(cherry picked from commit 2d09fed8d6)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16590
2026-10-01 11:50:53 +00:00
Marco Beretta
3d40b03f0f 🌗 feat: Per-Mode Appearance Defaults for Menu and Tooltip Shadows (#16602)
(cherry picked from commit cfeaee13ab)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16602
2026-10-01 11:50:52 +00:00
Marco Beretta
f83c502c16 📐 feat: Menu, tooltip and tab corner theme roles (#16599)
The menu panel, tooltip and tab trigger read menuRadius, tooltipRadius and tabRadius instead of literal corners. The defaults are the old literals, and the ClickHouse theme sets Click UI's genericMenu, tooltip and tabs radii. The not-expressible list drops the three corners and keeps the field fill and ink, the dark menu shadow and the tooltip shadow.

(cherry picked from commit 98efd35024)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16599
2026-10-01 11:50:52 +00:00
Marco Beretta
5b98963ca2 🪆 fix: Resolve theme markers to the nearest themed root (#16589)
The disabled-fill and field-focus variants, and the Field.css edge rules, read the inherited --theme-disabled-style and --theme-field-focus-style properties through style queries instead of matching any ancestor that carries the data-theme-* marker. A root themed with the default style inside one themed with the other now gets its own behavior back, at any depth. The default treatment never depends on style query support.

(cherry picked from commit ca2876f559)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16589
2026-10-01 11:50:52 +00:00
Marco Beretta
5433d5f387 🧾 test: Complete the Click UI Not-Expressible List (#16588)
* feat: Focus ring width and offset theme roles

The global keyboard focus outline and the keyboard-modality text input outline read focusRingWidth and focusRingOffset instead of 2px literals. Both default to 2px, the ClickHouse theme sets Click UI's 2px and 2px, and the drift guard pins those values against Click UI's focus rules.

* test: Complete the Click UI not-expressible list

The parity spec now probes the Dropdown menu shadow, the Tooltip corner and shadow and the Tabs corner. The menu shadow reads the shadowLg role, whose default is the old literal, so ClickHouse matches Click UI in light; the dark app rule, the Tooltip literals and the Tabs corner have no role and are listed with their issues.

* test: Pin the menu panel shadow in the default and ClickHouse themes

(cherry picked from commit d8c4c12dfd)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16588
2026-10-01 11:50:52 +00:00
Marco Beretta
f79ddcf2d6 feat: Focus ring width and offset theme roles (#16587)
The global keyboard focus outline and the keyboard-modality text input outline read focusRingWidth and focusRingOffset instead of 2px literals. Both default to 2px, the ClickHouse theme sets Click UI's 2px and 2px, and the drift guard pins those values against Click UI's focus rules.

(cherry picked from commit 458af5afca)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16587
2026-10-01 11:49:36 +00:00
Lia
bbb58a867e ⛴️ fix: Preserve Canary Sync Resolutions (#16457)
Retain the tracked-file integration outcomes recorded by original canary sync PR #16457.

No new implementation is introduced. Shared and ambiguous corrections are carried by the final sync-resolution commit so the resulting tracked tree equals frozen canary f66ad88e1c.

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16457
Resolution-Sources: ffa54e0259, 7fe6eab03e, 8f64336ee4, 207ee8b0df, 7f3f82f284, e9e5b36bd2, ff3f0f8bef, 6bd657753a, 84a53a4464, f66ad88e1c
2026-10-01 03:46:19 +00:00
Lia
9dc8db0ea8 🛶 fix: Preserve Canary Sync Resolutions (#16361)
Retain the tracked-file integration outcomes recorded by original canary sync PR #16361.

No new implementation is introduced. Shared and ambiguous corrections are carried by the final sync-resolution commit so the resulting tracked tree equals frozen canary f66ad88e1c.

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16361
Resolution-Sources: 6d7ba72b89, 241c692b63, 6113242b7b, 3c8a5703e7, a45be88578, 3789cbf590, 81e038972f, c505db2256, 420760d8b2
2026-10-01 03:46:19 +00:00
Lia
e6d6092448 ⛴️ fix: Reset Agent Search and Wait for Completed Diagram Exports
(cherry picked from commit 67e4609f6a)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16457
2026-10-01 03:46:19 +00:00
Marco Beretta
cd27c01b48 🏷️ feat: Give the Badge Label Its Own Ink and Let the Legacy Dialog Spinner Inherit (#16554)
* feat: Give the Badge Label Its Own Ink and Let the Legacy Dialog Spinner Inherit

The shared Badge inherited the primary ink, so a theme could not label it
in Click UI's muted badge ink without dimming body copy. It now reads a
badge-label color role that defaults to the primary ink and follows it for
a theme that names only that; a hovered or selected badge keeps the primary
ink, which holds AA on those fills. The ClickHouse theme takes Click UI's
badge.opaque.color.text.default, and the Badge label leaves the drift
guard's not-expressible list.

The template's legacy selection spinner painted in text-primary on the
primary fill, dark on dark. It now takes the action's own foreground.

* refactor: Fold the Avatar Glyph Into the Shared Primary Ink Fallback

The default avatar's glyph, the dialog title and the badge label all split
out of the primary ink and follow it for a theme that names only that, so
the avatar keeps one fallback with the others instead of its own copy in
resolveTheme and applyTheme.

* fix: Keep a Disabled Badge in Its Resting Ink on Hover

* fix: Keep a Disabled Selected Badge in the Primary Ink on Hover

(cherry picked from commit ef1aa66812)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16554
2026-10-01 03:46:19 +00:00
Marco Beretta
5b84c4b57f ⏳ feat: Add Ephemeral Retention Mode for Forced Temporary Chats (#13811)
* feat: add ephemeral retention mode for forced temporary chats

Adds RetentionMode.EPHEMERAL, which forces every newly saved chat
temporary: hidden from history and search, given the temporary-chat
expiration, and with the toggle locked on.

Forces isTemporary and applies the temporary expiration in the normal
conversation and message save methods, routes Assistants/Threads
messages through the normal message save, applies the all-data
retention policy to file uploads and shared links, and stamps imports,
forks, and duplicates. Locks the frontend toggle and keyboard shortcut
behind an administrator-enforced badge.

The default temporary mode and the existing all mode are unchanged.

* fix: enforce ephemeral retention when resuming paused chats

* fix: preserve forced retention across pauses and assistant turns

* test: Use Real Module IDs for Installed Package Mocks

* test: Wait for Resumed Retention Persistence

* test: Control Mongo Index Setup in OpenID Fixture

* test: Close Mobile Drawer Before Retention Resume Scenario

* fix: Store Responses API Messages Under the Retention Write Context

Input and output messages were saved with the raw request, so under
ephemeral retention they missed the forced-temporary classification the
conversation received. Route both through getConversationWriteContext
and announce the stored reply as saved.

* fix: Align Resumed Responses With the Parent Retention Deadline

A resumed response was saved with a fresh forced-temporary window while
the re-stamp kept the conversation's earlier deadline, so a chat that
paused again could leave its response stored after the conversation
expired. Stamp the saved response with the parent's deadline.

* fix: Clear Released Bookmark Tags When Forcing a Chat Temporary

stampForcedRetention released a converted chat's bookmark counts but
kept its tags, so deleting that chat before TTL removal decremented the
same tags again and reduced counts owned by other visible chats. Clear
the tags in the conditional conversion update that releases them.

* fix: Store No Bookmark Tags on Forced-Temporary Imports

An ephemeral import, fork or duplicate skipped its tag count increment
but kept the source tags, so deleting the copy before TTL removal
decremented counts owned by other visible chats. Store the same tags the
import counts, which is none for a forced-temporary copy.

* test: Provide the Forced-Temporary Retention Helper to the Header Stacking Mock

* test: Reuse One Admin Login per Worker in Ephemeral Retention Scenarios

* fix: Keep Legacy Temporary Chats Temporary When Forking Under All-Data Retention

* fix: Convert a Resumed Chat Under Ephemeral Retention Before It Can Re-Pause Empty

* fix: Treat a Reloaded Pre-Policy Run as Temporary Once Retention Is Forced

* fix: Stamp Messages with the Deadline a Concurrent Retention Stamp Stored

* fix: Wait for the Startup Config Before Rebuilding a Resumed Submission

* test: Wait for the Resumed Response Row in the Ephemeral Resume Scenario

* test: Provide the Real Command Executor Stamp to the Callbacks Mock

(cherry picked from commit 02a70e9c58)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/13811
2026-10-01 03:46:19 +00:00
Marco Beretta
6df4b8cb9b 🔎 feat: Let Themes Focus Fields by Their Edge and Size Fields and Labels (#16550)
* feat: Let Themes Focus Fields by Their Edge and Size Fields and Labels

Shared fields drew a fixed 40px control that could only focus with the
keyboard ring, and Label a fixed text-sm at leading 1, so a theme could not
draw Click UI's 32px field that swaps its stroke on focus, or its 500
0.75rem/1.5 field label.

Fields now read fieldHeight and fieldFocusStyle: ring keeps today's
keyboard-only ring, border swaps the edge to border-field-focus on any focus
with no ring, mirrored on the root as data-theme-field-focus so the pointer
modality reset leaves it alone. Label reads labelSize, labelLeading and
labelFontWeight. Every default reproduces today's field and label; the edge
color follows focus-control and the label size textSm for a theme that
names only those. The ClickHouse theme takes Click UI's field height,
active stroke and label typography, and the drift guard pins them. The
shared Badge, which no app surface renders, keeps a recorded deviation.

* fix: Keep the Pointer Focus Reset for Edge-Focused Fields

Under fieldFocusStyle border the pointer-modality rule was skipped whole,
so a pointer-focused field lost its outline and ring reset along with the
edge reset. Only the edge reset now depends on the focus style.

* fix: Keep the Forced-Colors Outline and Give SecretInput the Field Roles

Under forced colors the edge color and ring drop out, so suppressing the
outline of an edge-focused field left keyboard focus invisible there. The
suppression now applies outside forced colors only.

SecretInput hard-coded h-10 and was not a shared field, so beside an Input
it kept 40px and missed the theme's focus treatment. It now composes
fieldControl, keeping its trailing padding for the controls; its keyboard
focus becomes the same focus-control ring the other fields draw.

* fix: Give Fields a Vertical Padding Role So a Short Field Keeps Its Line

The field kept a fixed py-2 inside the themed height, so ClickHouse's 32px
field left 14px for a 21px line. Fields now read fieldPaddingY, py-2 by
default; the ClickHouse theme takes Click UI's field.space.y, which fills
its 32px exactly, and the drift guard pins it.

* fix: Keep a 2px Keyboard Focus Perimeter and Respect Scoped Edge-Focus Roots

An edge-focused field showed keyboard focus only as its recolored 1px
edge, under the 2px perimeter the app holds as its focus floor. Keyboard
focus now adds a 1px ring in the same color; pointer focus stays edge-only.

The pointer reset checked only the document root for edge focus, so a
border-focus theme applied to a nested root had its edge reset to the
stock border. It now skips any field under an edge-focus root.

(cherry picked from commit ed6107aa89)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16550
2026-10-01 03:46:19 +00:00
Marco Beretta
0b7d49f829 🪟 feat: Give OGDialog Theme Roles for Its Edge, Padding and Title (#16546)
* fix: Alias the Button Fills to the Inverted Surface and Size the Legacy Dialog Action

A stylesheet that repainted --surface-inverted or its hover no longer
reached primary buttons, because the stock CSS declared their fills from
palette steps. They now read the inverted surface they split from.

A templated dialog's legacy selection action kept a fixed h-10 and the
inverted fill beside the shared cancel Button, so a theme's button height
split the two. It now reads the Button's height and primary fill roles.

* feat: Give OGDialog Theme Roles for Its Edge, Padding and Title

A templated dialog cleared its edge with border-none and set its title at a
fixed text-lg, semibold, display-family heading in the body ink, so a theme
could not draw Click UI's framed dialog or its 700 1.25rem/1.5 title.

OGDialog now reads a stroke width (in border-light), its inline padding and
header gap, and its title's size, leading, weight, family and ink from theme
roles. Every default reproduces today's dialog; the title size, family and
ink follow textLg, displayFontFamily and text-primary for a theme that names
only those. The ClickHouse theme takes Click UI's dialog stroke, space.x,
title gap, title typography and title color, the drift guard pins them, and
the parity probes now read the dialog stroke and scrim.

* fix: Keep the Dialog Title Ink Out of the Verified Mark's Surroundings

The dialog title color was added to the surfaces the verified mark is
measured against, so a theme that named only the title ink took the
verified fallback. It is a text color, not a surface the mark sits on.

* fix: Let Dialog Titles Take the Dialog Title Ink

Seven dialogs set text-text-primary on their OGDialogTitle, which Tailwind
Merge kept over the new dialog-title role, so a theme that gives dialog
titles their own ink reached only some of them. The redundant classes are
gone; the role defaults to the primary ink, so nothing changes by default,
and the design-rule counts for those files drop by the override each
removed.

(cherry picked from commit bddb8f8ab3)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16546
2026-10-01 03:46:19 +00:00
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
Marco Beretta
dd1cb0e5ba 🎚️ feat: Group Model Parameters Into Sections (#16247)
* feat: Group the model parameters and drop the ones that cannot act

The panel rendered a provider's parameter list in the order the definitions
happen to arrive in, so it asked about temperature, then reasoning, then
whether to resend files, with nothing to say which belonged together. The
keys are filed under six headings now, with a count beside each of what this
conversation has changed inside it, which is what the owner scans for before
reaching for Reset. A key this map has never heard of, which is what a
deployment's own customParams look like, keeps its place in the last section
instead of being guessed at or dropped.

Every parameter stays on screen. A settings panel is read as much as it is
edited, and a disclosure trades seeing the current state at a glance for
vertical space that costs nothing to find elsewhere: the headings are
captions rather than buttons, a control is measured against the row it sits
in rather than padded to a fixed block, and only free text takes the full
width. A number, a toggle or a choice says the same thing in half of a 300px
panel, so two sit side by side and the narrow ones in a section come first,
leaving one ragged edge at the bottom instead of a gap beside every
full-width field. Reset and Save As Preset share the closing row. Fifteen
parameters occupy 954px where the same fifteen took 1243px with four of the
six sections shut.

Grouping alone would still show controls that do nothing. A definition can
now declare what it rides along with: OpenAI's reasoning summary, mode and
context travel inside the reasoning object the Responses API takes and are
dropped by the server without it; a thinking budget is read only while
thinking is enabled; a cache lifetime only while the cache is being written.
Those five declare it, the panel judges each one on the companion's
effective value, and a section left with nothing live disappears rather than
standing empty. The rule lives on the definition rather than in the panel so
a deployment defining its own parameters can state one too.

The custom instructions field caps its own rows. It is sized by a shadow
copy of itself, measured as the panel mounts and before the sidebar has
settled on a width, and that measurement can come back as one word per line;
a CSS max-height was hiding the wrong answer rather than correcting it.

No parameter changes what it sends. This drops controls for values the
server was already discarding.

* refactor: Keep every model parameter on screen and drop only empty controls

Hiding a parameter behind a companion toggle judged it by a rule the
client cannot see all of: a reasoningObject endpoint sends the reasoning
fields without the Responses API, adaptive-thinking Claude models ignore
the budget however thinking is set, and a deployment could not declare
the rule in librechat.yaml at all. The panel groups every parameter again
and leaves out only a choice with no options, such as Bedrock's region
when no regions are configured, so no section stands empty. Reset and
Save As Preset share a row while their labels fit and stack when a
translation is too long for the panel.

* test(e2e): Scenarios for the grouped model parameters panel

* fix(client): Wrap a parameter action label longer than the panel

A Spanish Save As Preset label measures 338px on its own against a 282px
row, so stacking the two actions still ran it past the panel. The labels
now wrap inside their buttons.

* fix(client): Scope stretched controls to the panel and say what its counts mean

The shared parameter controls stretched to their parent's height, which
the preset editors' tall columns turned into labels far above their
fields; the panel's cells now stretch their controls instead. The change
count beside a heading is read out as a number of changed settings, and
clearing a default a deployment configured counts as a change.

* test(e2e): Scenario for the preset dialog's label spacing

(cherry picked from commit a78fb3a3a4)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16247
2026-10-01 03:46:19 +00:00
Marco Beretta
d06e7635df 🧩 feat: Ignore Unknown Theme Color Tokens Instead of Dropping the Theme (#16529)
(cherry picked from commit 491ea868da)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16529
2026-10-01 03:46:19 +00:00
Marco Beretta
0eccfbfa58 🎛️ feat: Give the Button Theme Roles for Its Label, Height, Fill and States (#16530)
* feat: Give the Button Theme Roles for Its Label, Height, Fill and States

The Button drew a fixed 500-weight label at 40px and 36px, painted its
primary fill in the inverted surface its checkbox and switch share, focused
in the primary ink, and only dimmed when disabled, so a theme could not
draw Click UI's 400-weight 32px buttons or its #302e32 primary.

Add controlFontWeight, buttonHeight and buttonHeightSm appearance roles and
button-primary and button-primary-hover color roles, which follow the
inverted surface for a theme that names only that. The Button reads them,
focuses in focus-control, presses in the pressed roles and composes the
shared disabled recipe; the defaults reproduce today's button exactly.
Tailwind Merge now knows the new utilities, so a caller's own height or
weight still wins.

SelectTrigger hid its outline on every focus and drew nothing instead; it
now draws keyboard focus in focus-control, like the shared field.

The ClickHouse theme takes Click UI's label weight, button height and
primary fills, and the drift guard pins them and measures the Button.

* fix: Focus the Shared Inputs in the Focus-Control Role and Repair the Button Specs

SecretInput, MultiSearch, InputWithDropDown and InputCombobox drew keyboard
focus in the decorative ring-primary, about 2.3:1 on the dark default canvas.
They now use focus-control, and a guard holds that role at 3:1 on every
control canvas in each theme. The Scrim spec follows the Button's focus role,
and the button-roles scenario opens the Data & Privacy tab by its current name.

* test: Reach the Shared Input Focus Rings by Keyboard

The focus-role guard read component source, which a dead string or a ring on a
non-focusable wrapper would satisfy. Each control is now reached by Tab and
the focused element, or the combobox's ring host while it holds keyboard
focus, is asserted to paint the focus-control ring.

(cherry picked from commit dd5fdf1ff4)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16530
2026-10-01 03:46:19 +00:00
Marco Beretta
5c6578fa25 📏 feat: Give Theme-Sized Controls Their Own Padding and Gap Roles (#16528)
* feat: Give Theme-Sized Controls Their Own Padding and Gap Roles

The theme variants of Button and Chip, CheckboxButton and every composer
control read spaceNormal and spaceCompact, which also pad message rows,
steer bubbles and the composer send button, so a theme could not give its
controls Click UI's button spacing without reshaping the chat.

Add controlPaddingX and controlGap appearance roles, which those controls
read instead. Their defaults are the shared spacing values, a theme that
names only spaceNormal or spaceCompact keeps its controls on them, and the
preset falls back to the shared roles for a stylesheet that predates these.

The ClickHouse theme takes Click UI's button.basic.space.x and space.gap,
and the drift guard pins both values and measures the themed Button's
padding and gap.

* test: Reach the Temporary Chat Chip Through a Sent Message

The header status chip only appears once a temporary chat has its first message, so the scenarios send one, and measure the real message bubble instead of a probe for the shared spacing.

* fix: Let the Control Spacing Roles Replace the Base Gap

Tailwind Merge could not classify px-theme-control-x or
gap-theme-control-gap, so a theme-sized Button kept the base gap-2 beside
the role and a caller's own padding beside both, leaving the winner to
stylesheet order. Register both utilities with their groups.

* fix: Alias the Stock Control Spacing to the Shared Spacing Roles

A stylesheet that set only --theme-space-normal or --theme-space-compact
stopped reaching Button, Chip and the composer controls once the stock CSS
declared the control roles as literals, so the preset's fallback never ran.
The stock declarations now read the shared roles, with the same defaults.

* test: Assert the Control Spacing Utilities Declare Their Own Properties

(cherry picked from commit bdfd3012ea)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16528
2026-10-01 03:46:19 +00:00
Marco Beretta
e1e1d1b19d 🎒 feat: Carry Project Context Across Conversations (#15684)
* 🎒 feat: Carry Project Context Across Conversations

* fix: fail a project attach whose upload hold cannot be released and keep file deletes independent of project cleanup

- Attaching a project file now fails, with nothing attached, when the file's
  temporary upload hold cannot be released, instead of attaching a file that
  can still expire.
- A failed project cleanup after a file delete is logged rather than failing a
  delete that already happened, and a user-wide delete clears that user's
  project references without reading every file first.
- Both resize handles share the orientation-aware grip, so a primary handle in
  a vertical group renders a rotated grip like the alternate one.

* fix: treat an empty tenant id as no tenant in the project file picker

* fix: attach nothing when a project file is deleted while the attach is in flight

* fix: localize project file association failures instead of showing server text

* test: expect a localized reason for a rejected project file association

* fix: scope project file listing to the caller's tenant and name the file limit when attaching an existing file

- Listing a project's attached files now returns not found when the project
  belongs to another tenant, matching the available-file listing and the
  chat context resolver.
- Choosing an existing file for a full project now names the project file
  limit instead of the generic attach error, like the upload path.

* fix: treat an empty tenant id as no tenant in every project tenant check

A caller whose tenant id is an empty string was refused its own tenantless
project when listing attached or available files, because the handlers
compared '' with null. The project handlers and the chat context resolver now
share one comparison that treats an empty tenant id as no tenant, the rule the
project file queries already follow.

* test: wait for the workspace layout swap and the mobile drawer before acting in the long-metadata spec

The desktop title was measured while the phone layout could still be the one
rendered, and the sidebar row menu was opened before the mobile drawer
committed its open state, which closes a menu opened ahead of it. The spec
now waits for the workspace's phone-only sidebar toggle to leave and for the
drawer to drop inert, the same drawer signal the agents helpers use.

* fix: keep the agent context fingerprint of a turn outside any project unchanged

Every turn now passes a project context key into the agent context
fingerprint, and a turn outside any project passed the no-project sentinel,
which changed the digest of every existing no-project checkpoint. An agent
event conversation written before this change then cold-started and reloaded
its history on its next event. The fingerprint now hashes the no-project key
as absent, so those checkpoints keep matching.

* test: load the long-metadata spec at phone width before driving the mobile drawer

The spec crossed back from desktop to phone width without a reload, which
leaves the drawer on the desktop toggle path whose delayed focus handoff to
the close button dismissed the row menu roughly 200ms after it opened. The
spec now reloads at phone width, as a phone arrives, and waits for the
drawer's own focus handoff before opening the menu.

(cherry picked from commit 4062bc3c00)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/15684
2026-10-01 03:46:19 +00:00
Marco Beretta
fdef598853 🧽 fix: Paint Freed Feature Surfaces From Theme Roles (#16517)
* fix: Paint Tool Output Panes With the Code Body Role

The output panes of code execution, file authoring and file reads painted
surface-chat in light and surface-primary-alt in dark. surface-code-body is
that same pair in the default, dark and high-contrast themes, and a theme
that styles its code blocks now styles these panes with them.

* fix: Draw the MCP OAuth Logo and QR Tiles From Fixed Roles

The server logo tile and the QR backdrop were bg-white. They take
surface-fixed and surface-qr, both white in every bundled theme, so a theme
can own them without the QR losing its quiet zone.

* fix: Give TextareaAutosize an Invalid State and Use It for Tool Arguments

The tool-approval edit field flagged invalid JSON with border-red-500, a raw
colour the primitive's owner rule rejects in any semantic form. TextareaAutosize
now draws its border in border-destructive when aria-invalid is set, the
attribute the Skills description fields already pass. ToolApproval sets
aria-invalid and points aria-describedby at the Invalid JSON message, so a
screen reader announces the error as well.

* docs: Record the Image Preview, Artifact Scrollbar and Azure Chip Colours

Adds the image preview's media overlays, the sandboxed artifact document's
scrollbar and the Azure file-source gradient to the theme allowlist.

* test: Cover the Tool Output Pane, Invalid Tool Arguments and OAuth QR Tile

Scenarios for the code-body pane behind a file-authoring card, the
announced invalid state of the tool-approval edit field, and the MCP OAuth
QR backdrop staying white in both modes.

* test: Retry the Output Pane Colour and Set Up the Approval and OAuth Scenarios at Desktop Size

The pane is read with a retrying assertion against the resolved role, since
the card re-renders as highlighting lands. The approval agent and the MCP
Settings panel are reached through side panels the mobile layout keeps in its
drawer, so those two scenarios run at desktop size on the mobile project.

(cherry picked from commit 2f16e6b37b)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16517
2026-10-01 03:46:19 +00:00
Marco Beretta
d8797b227c 🗂️ feat: Give the Table Theme Roles for Header Text, Row Rules and Density (#16489)
* feat: Give the Table Theme Roles for Header Text, Row Rules and Density

The shared table could not take Click UI's shape: its header had no fill of
its own, column names were fixed to text-secondary, rows had no rule and
cells were fixed at 1rem. The header now always carries surface-secondary,
which every consumer already painted, and three roles are added: a
table-header-text color that falls back to a theme's secondary text, a
tableCellSpaceY length that sets cell padding and header height, and a
tableRowStroke width that is 0px by default. Tailwind Merge learns the
new padding and height utilities so a caller's own padding still wins.

The ClickHouse theme sets Click UI's header title color, small-size cell
space and 1px row stroke, and the drift guard pins them.

* fix: Carry the Column-Header Role Into Both Data Tables

Both exported data tables set text-secondary on the header cell or its
label, which beat the new role, so a theme never reached their column
names; they now read table-header-text. The legacy table's row titles keep
text-secondary explicitly, since they are row data rendered through
TableHead. The token falls back to --text-secondary for a stylesheet that
predates it.

* refactor: Give TableHeader a filled Variant Instead of a Caller Override

* feat: Route the Data Tables Through Table Density and a Header Fill Role

The density role reached no real table: every data table passed its own
py-1 or py-2. TableCell and TableRowHeader gain compact and dense sizes,
and TableHead sm, compact and row sizes, all derived from the table cell
space (half and a quarter of it), so the three data tables now read the
role while drawing exactly what they drew before. The virtualized table's
rows default to 32px plus half the cell space, 40px as before.

The virtualized table's self-sticking header cells now paint a
table-header-fill role that defaults to each theme's dialog surface, so
Shared Links and Archived Chats look the same by default and take Click
UI's header fill under the ClickHouse theme.

ClickHouse's cell space becomes Click UI's md value, 1rem: its sizes halve
the same way, so the compact tables land on sm, 0.5rem, the size Click UI
tables default to.

* fix: Re-render Mounted Table Rows When the Themed Row Height Changes

The memoized row compared only its data, selection and cells version, so a
theme switch left mounted rows on their old inline height and the
virtualizer measured that stale geometry. It now compares the height too.

* fix: Size Both Virtualizers From the Themed Row Geometry

The legacy table estimated every row at a fixed 48px while its title cells
now follow the cell space, and the dense row budgeted 32px of content that
is really 2rem of controls. A useTableRowHeight hook gives both the dense
and the titled height from the root size, the cell space and the row rule,
48px and 40px as before, and the legacy virtualizer re-measures when it
changes.

* fix: Measure the Legacy Table's Rendered Rows

The legacy table can be given columns without a title, whose rows are
shorter than a titled row, so the estimate alone could not match them.
Each rendered row now reports its size to the virtualizer, and the titled
height is only the first guess for rows not yet rendered.

* test: Compare Archived Header Space Apart From the Theme's Text Line

ClickHouse now draws text-sm on its own 1.5 line height, so its header is
a pixel taller than the default while keeping the same cell space. Compare
the space around the text line instead of the whole header height.

* fix: Keep the Row Rule Inside the Titled Row Estimate

The title cell draws the rule as its own bottom border inside a fixed
border-box height, so adding the stroke again overestimated every
unmounted titled row by the stroke width. Only the content-sized dense
and compact rows grow by it.

* test: Read the Table Defaults From the Published Stock Stylesheet

The table roles' stock values and the no-rule stroke now live in the
package's defaults.css, which replaces controls.css, and the stock
palette counts the two new table color roles.

(cherry picked from commit cf33a478f2)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16489
2026-10-01 03:46:19 +00:00
Marco Beretta
f51b1a823b 🎚️ feat: Give the Switch Theme Roles for Its Size and Knob (#16486)
* feat: Give the Switch Theme Roles for Its Size and Knob

The shared switch read a fixed 44x24 track and painted its knob with
surface-primary, so a theme could not draw Click UI's 32x16 switch or its
dark knob. Add switchWidth and switchHeight appearance roles, from which
the preset derives the knob size and its travel, and a switch-thumb color
role that falls back to a theme's surface-primary when it names only that.
The defaults reproduce today's switch exactly.

The ClickHouse theme sets Click UI's switch size and indicator colors, and
the drift guard pins them and measures the switch geometry.

* test: Measure the Switch by Layout While the Dialog Zooms In

* test: Choose the Switch Theme per Navigation

* fix: Carry the Legacy Surface Onto the Switch Knob in applyTheme

Themes restored through theme-colors reach the DOM through applyTheme,
not resolveTheme, so the knob fallback has to live in its adapter too.

* fix: Fall Back to the Page Surface for the Switch Knob Without the Role

A consumer whose stylesheet predates --switch-thumb would resolve the knob
to an invalid color; the token falls back to --surface-primary, which it
was painted with before the role.

* fix: Keep a Usable Hit Area Under a Compact Switch

A theme can draw the track at 32x16, which is shorter than a usable
target, so an invisible layer keeps the switch at least 24px tall, and
44px on a coarse pointer. The knob subtracts the track's 4px of border in
px, so it holds at any root font size.

* fix: Let Theme Readers Ignore Unknown Color Roles and Validate the Switch Pair

A definition that names a color role this reader does not know was
rejected whole, so every new role made a stored or yaml theme unreadable
to an older client. A well-formed rgb- name with a valid triplet is now
ignored with a warning, the way unknown appearance tokens are; a
malformed name or value is still rejected.

The switch dimensions must be positive, a px height must exceed the 4px
track border, and a width written in the height's unit must be at least
the height. The preset clamps the derived knob and travel at zero and
never draws the track narrower than it is tall, for mixed units.

* fix: Compare the Switch Pair in One Unit Instead of at an Assumed Root

Mixed px and rem, or em, resolve against sizes the validator cannot see,
so a pair that passed at 16px could collapse at another root. Switch
dimensions are now px or rem, a pair must share a unit, a rem height must
be at least 0.5rem, and the checks compare values in that unit.

* fix: Leave Unknown Color Roles to the Client Reader Option

Canary now ignores a well-formed color role only where the reader may
predate the definition (the client), and keeps the server strict so a
typo in librechat.yaml still drops the theme. Drop this branch's
server-side allowance, its fixture and loader expectations, and the
duplicate knownColors helper the rebase left behind.

* fix: Widen a Compact Switch's Touch Target to 44px

On a coarse pointer the hit layer grew to 44px tall but stayed as wide
as the track, so the 32px ClickHouse switch left a 32 by 44 target.
Center the layer on the track and give it the same touch minimum in
width; the scenario now checks both sides.

* fix: Size the Switch Touch Layer From the Touch Role Instead of a Min Width

min-w does not read the spacing scale, so the coarse-pointer layer never
widened. Give it the touch width outright and measure the tap target as
the track's box together with the layer.

* test: Read the Switch Defaults From the Published Stock Stylesheet

Canary now ships the stock values in the package's defaults.css rather
than the app stylesheet, so the switch roles are declared there and the
stock palette counts the new thumb role.

(cherry picked from commit 21cb1712f5)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16486
2026-10-01 03:46:19 +00:00
Marco Beretta
5d39e0b901 📐 fix: Draw Controls at the Theme Control Radius (#16481)
* fix: Draw Controls at the Theme Control Radius

Dropdown gains a shape prop in Button's vocabulary. Omitted, the trigger
takes the theme control radius, which equals rounded-xl in the default
theme, so the settings selects follow a theme's control corner instead of
its dialog step. The marketplace sort and the prompts filter ask for
shape="default" rather than overriding the radius locally.

The settings nav tabs, the agent builder footer buttons and the builder
action controls move from rounded-xl to the control radius.

The Click UI drift guard now measures primitive color and shape parity
against Click UI's component tokens and holds a floor per mode.

* test: Choose the Theme per Navigation Instead of Stacking Init Scripts

(cherry picked from commit ccd9267262)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16481
2026-10-01 03:46:19 +00:00
Marco Beretta
1d01178c63 🧩 fix: Paint Panel Surfaces From Theme Roles (#16484)
* fix: Paint Panel Surfaces From Theme Roles

The tool dialog's logo tile takes the fixed surface that logo tiles use elsewhere,
and the skill image preview icon takes a series slot like the other categorical
marks. The tools category filter drops a raw emerald border and shows its active
state on the filter icon in the accent role instead; the label still names the
active category.

The avatar cropper's media hint and the SharePoint picker background are recorded
in the theme allowlist.

* test: Cover the Skills Category Filter's Active State

* test: Match the Category Filter Trigger Exactly

(cherry picked from commit 8ce9f58fd3)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16484
2026-10-01 03:46:18 +00:00
Marco Beretta
a50ea26fdf 🫧 fix: Paint Chat Surfaces From Theme Roles (#16483)
* fix: Paint Chat Surfaces From Theme Roles

The code window header and skill output panel stop repainting their
surface-secondary container with a per-mode fill that matched it in every bundled
theme, the drag-and-drop backdrop becomes the theme scrim, the OpenAI file-source
chip takes the primary surface, and the banner drops a stopless dark gradient.

ActionIcon, RetrievalIcon, WrenchIcon and the message ProgressCircle had no
importers and carried fixed Lottie colours, so they are removed. The media,
artwork and exported-document colours that stay fixed are recorded in the theme
allowlist.

* fix: Keep the Drag-and-Drop Backdrop Black Until Scrim Opacity Is a Role

The theme scrim is gray in default light, so at the same alpha it dimmed the page
less than the black backdrop it replaced. The backdrop keeps its original colour
and the allowlist records the scrim-opacity role it waits on.

* test: Cover the Code Window Header Showing Its Panel Surface

* test: Exercise the Code Window Header Through a File-Authoring Card

The mock code interpreter exposes bash_tool, whose card has its own header; a skill
file created by the model opens the file-authoring card that renders CodeWindowHeader.

* fix: Keep the OpenAI File-Source Chip's Dark Opacity

The chip composites over the file's own preview, where surface-primary at 75% darkened
it against the shipped black at 65%. It keeps its colours and joins the code-execution
badge in the allowlist as a media overlay.

(cherry picked from commit 0b80ea5ebf)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16483
2026-10-01 03:46:18 +00:00
Marco Beretta
5961f767fd 🔤 fix: Ship the Theme Font Faces With the Package (#16485)
* fix: ship the Inter, Roboto Mono and Inconsolata faces with the package

Move the woff2 files from client/public/fonts into packages/client/src/theme/fonts
and every @font-face rule (the app's Inter and Roboto Mono faces and
client/src/fonts.css) into theme/fonts.css, which tokens.css imports and the build
copies into dist with the files. Each url() names the file by a new
@librechat/client/fonts/* export: a relative path breaks under Vite with
@tailwindcss/postcss, because Vite inlines the import before Tailwind runs and
Tailwind reports every emitted declaration as coming from the root stylesheet.

The app loads the same files through the same import and still emits them to
assets/fonts with their licences, now read from the package; the $fonts alias is
gone. Inter and Roboto Mono gain their OFL texts beside Inconsolata's. The README's
consumer stylesheet moves the package stylesheet import above @config, where
Vite's inliner no longer skips it. The static checks' bundle freshness test reads a
subpath pattern export as the directory it maps into.

* docs: describe how the theme fonts resolve through the package export

* fix: leave subpath pattern exports out of the bundle freshness check

A pattern such as ./dist/fonts/* names no entry the design rules load, and
reading it as its directory made the freshness check depend on a directory the
synthetic build in suppression-baseline.spec.ts never dates. The scenario's
mirror of the manifest reading skips patterns the same way.

(cherry picked from commit 681515c9e5)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16485
2026-10-01 03:46:18 +00:00
Marco Beretta
01f3e52eee 🪞 fix: Publish the Theme Defaults and Scale Mapping to Package Consumers (#16479)
* fix: publish the theme defaults and scale mapping with the package

Move the radius, font and shadow utility mapping from the app stylesheet into
tokens.css, and the stock values of every theme-owned property (the 94 color
roles, the appearance roles and the brand colors, with the primitive scales they
are written against) into a new defaults.css that tokens.css imports and the
build ships beside it. The app reads both through its existing tokens.css
import, so @librechat/client/theme.css now gives a consumer the same utilities
and values the app renders. controls.css folds into the defaults, and the preset
no longer pins rounded-sm, rounded-md and rounded-lg to --radius.

A new mock scenario compiles the app and a consumer from what each loads,
checks the build output and exports, and compares computed styles in light and
dark; defaults.spec.ts holds defaults.css equal to the runtime themes.

* docs: note that hosts load the stock Inter and Roboto Mono faces

(cherry picked from commit a50612f70f)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16479
2026-10-01 03:46:18 +00:00
Marco Beretta
9689ebf30c ⚡ perf: Keep the Mermaid Chunk Off the Boot Path (#16493)
* perf: keep the mermaid chunk off the boot path

The chunk groups capture each module's dependencies with it, and mermaid
depends on Vite's dynamic-import preload helper, the Buffer and process shims,
DOMPurify, uuid and dayjs. Those landed in the 3 MB mermaid chunk, and because
the boot chunks import them, every page preloaded and evaluated mermaid before
its first API request, on the path to the largest contentful paint.

Two higher-priority groups claim them first (runtime-shims and shared-libs), so
mermaid loads only through useMermaid's dynamic import. A new mock scenario
checks that a chat without diagrams never fetches the chunk and that a diagram
reply still loads and renders it.

* test: wait on the reply and the composer instead of network idle

The app keeps connections open, so network idle never arrives.

(cherry picked from commit 4332187ada)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16493
2026-10-01 03:46:18 +00:00
Marco Beretta
dcd06896f2 🖌️ fix: Apply Controlled Themes Before Paint and Theme Prose Links, Inline Code and QR Backdrops (#16480)
* fix: Apply controlled themes before paint and give prose links, inline code and QR backdrops theme roles

ThemeProvider folds a controlled theme prop change into state during the
render that delivers it and applies the theme in a layout effect, so a
deployment theme, a shared link's theme and the viewer's own theme reach
the root before the commit paints. Storage writes stay after the commit.

Adds rgb-link-prose (link in light, primary text in dark, following a
theme's own link) and registers rgb-surface-qr, and paints inline prose
code with the surface-active-alt and surface-hover-alt roles.

* test: Record the frames a controlled theme paints and the prose and QR roles

(cherry picked from commit 364bf27210)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16480
2026-10-01 03:46:18 +00:00
Marco Beretta
a51a0aad67 🎨 fix: Draw Library Colours From Theme Roles and Record the Exceptions (#16482)
* fix: Draw Library Colours From Theme Roles and Record the Exceptions

PixelCard resolves its variant palettes from theme channel variables when it lays
out pixels, so the image generation placeholder follows the active theme in dark
mode instead of drawing a fixed light slate palette. The SAML glyph and Codey mark
take the text colour.

The new theme/allowlist.md records every colour that deliberately sits outside the
theme (brand marks, artwork, theme definitions, library elevation ink) and why.

* fix: Repaint the Pixel Card When the Theme Changes

The palette is read from theme variables when the pixels are laid out, so a mode
switch or an applied theme left the previous theme's pixels on the canvas. The card
now lays its pixels out again when the root's class or inline variables change.

* fix: Keep the Pixel Card's Decorative Presets as Given

The blue, yellow and pink presets have no theme role that reproduces them, so they
keep their original palettes and are recorded in the allowlist; only the default
palette, the one the app renders, reads theme roles.

* test: Cover the SAML Glyph Following the Button Text Colour

* fix: Lay the Pixel Card Out Again Only When Its Palette Changes

The root's inline style also carries unrelated variables such as the scrollbar gutter
and markdown font size, and relaying the pixels on every write blinked and replayed
an in-progress card. The allowlist now states what it covers and where the skipped
files are tracked.

* test: Key the Pixel Card Palette Mock by Variable Name

(cherry picked from commit f546dc2bee)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16482
2026-10-01 03:46:18 +00:00
Marco Beretta
67323e1797 🌫️ feat: Give the Dialog Scrims Theme-Owned Opacity Roles (#16492)
* feat: Give the Dialog Scrims Theme-Owned Opacity Roles

The three dialog families carried their scrim alpha in each utility
(bg-surface-overlay/80, /90, /65), so a theme could recolor a scrim but
not set how much it dims. Add scrimOpacity, alertScrimOpacity and
modalScrimOpacity, exposed as bg-scrim, bg-scrim-alert and
bg-scrim-modal in the published tokens, defaulting to the 80%, 90% and
65% each family drew.

ClickHouse takes Click UI's 0.75 from dialog.color.opaqueBackground,
cited in the drift guard. A bundled scrim never lifts the page and, on
a light canvas, separates the dialog by 3:1, which is why ClickHouse
dark keeps a black overlay rather than Click UI's lighter gray.

* test: Read the Dialog Scrim Through Its Role Class in the Morph and Settings Scenarios

Both scenarios pinned the old bg-surface-overlay/80 literal: the morph
counted elements carrying it and Settings compared its scrim with a
probe of it, whose color-mix value serializes differently from the
role's rgb(). They now use bg-scrim, the class DIALOG_SCRIM_CLASS
exports.

(cherry picked from commit 2d7133fcb1)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16492
2026-10-01 03:46:18 +00:00
Marco Beretta
1b8801dc07 🔤 feat: Give Display Type and the Type Scale Their Own Theme Roles (#16491)
* feat: Give Display Type and the Type Scale Their Own Theme Roles

Add a displayFontFamily appearance role, which the dialog titles compose
through font-display, and textXs..text2xl and leadingXs..leading2xl,
which the app's text-* utilities now read like the radius and shadow
scales. The defaults are Tailwind's own sizes and line heights and the
UI family, so the default theme is unchanged, and a theme that names
only its fontFamily keeps its headings in it.

ClickHouse takes Click UI's display family, font sizes 1 to 6 and its
1.5 product line height, cited in the drift guard. Basier Square is
named but not self-hosted: it is a commercial face, so browsers without
it fall through to the Inter stack.

* fix: Publish the Display Family Utility With the Theme Tokens

* fix: Keep the ClickHouse 2xl Step Below the Unthemed 3xl

Click UI has no size between 1.25rem and 2rem, and 2rem would overtake
Tailwind's unthemed text-3xl (1.875rem), so a responsive text-2xl to
sm:text-3xl heading shrank as the viewport grew. ClickHouse keeps
LibreChat's 1.5rem for 2xl at Click UI's line height, recorded as a
decision in the drift guard, and a registry test holds every bundled
2xl below 3xl.

(cherry picked from commit 400e4549ca)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16491
2026-10-01 03:46:18 +00:00
Marco Beretta
b2da59f08d 🚦 feat: Give Pressed and Disabled States Their Own Theme Roles (#16487)
* feat: Give Pressed and Disabled States Their Own Theme Roles

Add surface-pressed and surface-inverted-pressed, which IconButton takes
while held under a hover. They default to the hover fills a pointer
press has always shown, and a theme that names only its hovers presses
in them, so the default theme is unchanged.

Add surface-disabled, text-disabled and border-disabled, and a
disabledStyle appearance role: dim keeps the half-opacity treatment,
fill paints a disabled Checkbox, Switch, Field or IconButton in the
disabled roles through the theme-disabled variant. The root mirrors
the choice as data-theme-disabled. ClickHouse fills from Click UI's
disabled and active tokens, cited in the drift guard.

* fix: Ink Disabled Placeholders and Press the Submit Button in the State Roles

* fix: Ignore Color Roles a Client Predates and Fill Every Disabled Composer Slot

A cached client reading a newer server's inline theme rejected the
whole definition over one color role it did not know. The client
reader now ignores a well-formed rgb- role holding a triplet with a
warning, as it already did for appearance keys; the server keeps
rejecting unknown roles, where one is a typo in librechat.yaml.

The disabled fill moves into composerSubmitClasses, so the plain send
and stop buttons in Composer and DuringRunSendButton take it too.

* fix: Share One Disabled Fill Recipe Across Every Shared Control

Select, InputNumber, SecretInput, FilterInput and the Slider thumb only
dimmed under a fill theme. The theme-disabled classes now live in one
disabledFillClasses recipe that every shared control composes, and the
variant also matches Radix's data-disabled so a disabled slider thumb
takes the fill.

The deployment-theme scenario for an invalid theme now serves a
malformed color value, since a well-formed role the client predates is
ignored rather than rejected.

* fix: Fill a Disabled InputNumber Through Its Wrapper

rc-input-number puts the component's classes on a wrapper around the
disabled input, so the theme-disabled variant never matched it. Add a
theme-disabled-within variant for a wrapper that contains a disabled
control, and a disabledWithinFillClasses recipe InputNumber composes;
the input inherits the ink and shows the fill through its transparent
background. The default theme's disabled InputNumber is unchanged.

* fix: Carry the Disabled Roles to Every Shared Disabled Surface

Sweep every shared component that dims when disabled. Button-like
controls (AlertDialog and Dialog footer buttons, DialogTemplate's
select, the MultiSelect trigger) compose the fill recipe. Menu items,
tabs and the send-actions rows keep their surface and take the ink
through disabledInkClasses, as Click UI's genericMenu does, and Label
and FilterInput's floating label follow their control through
peerDisabledInkClasses. The variant also matches aria-disabled rows.
OGDialogTemplate and Button stay with the open PR that owns them.

* fix: Gray the Icons of Disabled Menu Rows Under a Fill Theme

A send-action or menu row's icon owns its color (text-status-warning,
text-text-secondary), so the inherited disabled ink left it bright.
The item ink recipe now recolors descendant icons too.

* fix: Fill the Dropdown Trigger and the OTP Group Under a Fill Theme

The default Dropdown trigger only dimmed, and its disabled:hover resets
tied with the fill; the shared recipe now pins the disabled hover fill
and ink too, and the trigger composes it. InputOTP dims its group with
has-[:disabled], so it takes the wrapper recipe.

* fix: Reach Child-Owned Ink and Slot Edges in the Disabled Recipes

A disabled control's own children, the SelectDropDown labels or a
checkbox glyph, kept their explicit ink, and a disabled OTP group's
slots kept their border. The fill and item recipes now carry the
disabled ink to descendants, the wrapper recipe carries the disabled
edge and ink to the group's parts, and SelectDropDown composes the fill
recipe.

* test: Probe Disabled Row Icons With the Recipe's Descendant Selector

* fix: Give Radio Segments, SecretInput Actions and DropdownPopup Items the Disabled Ink

These three dim their disabled state through a JS branch or Ariakit's
aria-disabled rather than a disabled: utility, so the earlier sweep
missed them. Each composes the item ink recipe, whose opacity reset
outranks the branch's opacity-50.

(cherry picked from commit 83d7afb0d1)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16487
2026-10-01 03:46:18 +00:00
Marco Beretta
228191ee7f 🎯 feat: Give Keyboard Focus Its Own Theme Roles (#16478)
* feat: Give Keyboard Focus Its Own Theme Roles

Add rgb-focus-outline for the app-wide keyboard focus outline and
rgb-focus-control for the shared primitives' focus ring. The defaults
reproduce the default theme exactly: a black and white outline, and
primitive rings in the primary text ink. A theme that names only
rgb-ring-primary keeps drawing its outline in that ring, and one that
names only rgb-text-primary keeps ringing its controls in that ink, so
the data-theme-ring marker is no longer needed.

ClickHouse sets both roles to Click UI outline.default, cited in the
drift guard. Every bundled palette holds both roles at 3:1 on its
canvases. Button keeps its ring until the open PR that owns it lands.

* test: Read the Opaque Ring Layer in the Focus Ring Probe

* fix: Draw the Popover Focus Outline in the Control Focus Role

(cherry picked from commit 7a99b5cef7)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16478
2026-10-01 03:46:18 +00:00
Marco Beretta
15142ab907 🎨 fix: Fall Back From an Invalid Theme in librechat.yaml Instead of Exiting (#16462)
* fix: Fall Back From an Invalid interface.theme Instead of Exiting

A mistake in interface.theme failed the whole librechat.yaml and stopped
the server. The loader now checks the theme with the rules the client
applies before painting it, drops a theme the client would reject with a
warning naming each problem by path, and loads the rest of the config.
Unknown appearance tokens only warn, matching the reader. Startup and
reload behave the same.

The token lists and the validator move to librechat-data-provider so the
client registry and the server check against one list.

* fix: Reject Unknown Bundled Theme Names at Config Load

A misspelled bundled name such as clickhous passed the server and was
rejected only in the browser. The bundled names now live in
librechat-data-provider; the client's theme map is typed against that
list and the loader drops a name outside it with a warning.

(cherry picked from commit 6ec919e67e)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16462
2026-10-01 03:46:18 +00:00
Marco Beretta
79994cd3e9 🧭 test: Pin the ClickHouse Theme to Click UI and Route Focus Through the Ring (#16461)
* test: Pin the ClickHouse Theme to a Click UI v0.12.0 Snapshot

Add clickui.json, the Click UI v0.12.0 tokens the ClickHouse theme cites,
and a drift guard that matches every color, radius, font, shadow and motion
value to its token, naming both on a mismatch. Correct the citations that did
not resolve, set shadow2xs, motionNormal and the light code text from Click
UI, and document the dark scrim as a deliberate deviation.

Draw the global keyboard focus outline in ring-primary under any theme
definition, keeping the default theme's black and white outline and the
high-contrast rule unchanged.

* test: Anchor the Focus Probe Tab on a Focused Sentinel

Tab moves on from the previously focused element after a blur, so it never
reached the prepended probe. Focus a sentinel outside the tab order first.

* test: Require Three RGB Channels in the Click UI Drift Guard

A truncated theme triplet such as '0 138' matched a source whose leading
channels agreed. Compare only complete, finite triplets.

* fix: Follow the Theme Ring Only When the Theme Names One

A theme that leaves rgb-ring-primary to the default resolves it to #595959,
which a dark surface carries at about 2.3:1. The provider now marks the root
with data-theme-ring when the active mode names its ring, and the global
focus outline follows the ring only under that mark; every other theme keeps
the default black and white outline. Each e2e mode also gets its own page
instead of relying on init-script order.

(cherry picked from commit 7a30d2f08c)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16461
2026-10-01 03:46:18 +00:00
Marco Beretta
26b6988355 🧯 fix: Outlast Failed Auth Cache Eviction on Credential Changes (#16435)
* fix: outlast failed auth cache eviction on credential changes

A credential change committed to MongoDB could report success while a
cached auth user document without the new credentialsChangedAt stayed
readable, so an old OpenID access token kept authorizing until the
cache TTL. The Redis-backed auth cache swallowed every failure (Keyv and
KeyvRedis resolve a failed GET as a miss and a failed DEL as a no-op), and
the eviction helpers stopped at the first error.

- The AUTH_USER_DOC namespace opts into throwOnErrors so a failed read or
  delete is visible; every caller of that namespace already catches.
- evictAuthUserDocs attempts every delete even when another fails and
  reports whether a document may still be served; the data-schemas and
  packages/api invalidation paths share it.
- updateUser waits out AUTH_USER_DOC_CACHE_TTL_MS before returning a
  credential change whose eviction was incomplete, so the change is only
  confirmed once no pre-change document can be served. Other updates stay
  best effort, and later revocations are delayed, never skipped.

* fix: record the reverse index before caching an auth user document

A document written before its reverse-index entry was cached without an
index naming it when the index write failed, so eviction could not find
it. Write the index first with a TTL that outlives the documents it names,
and skip the document when the index write fails.

* test: keep real data-schemas helpers in the pinned order spec

* fix: settle the auth cache after revoking reset credentials

Waiting out the cache TTL inside updateUser held the reset before its
session and passkey revocations, so a live refresh token or passkey could
mint an access token issued after credentialsChangedAt during the wait.
updateUser is best effort again; awaitAuthUserDocEviction retries the
eviction and waits one TTL only when it is still incomplete, and both the
web reset controller and the reset CLI call it after revoking sessions and
passkeys, before confirming the reset.

* fix: settle the credential barrier with a margin and on CLI revocation errors

Timers can fire a millisecond early, so the eviction barrier now waits the
cache TTL plus a 100 ms margin. The reset CLI also settles the barrier when
revoking passkeys or sessions throws, since the password is already changed.

* fix: treat an auth cache that cannot delete as not evicted

* fix: keep the reverse index until every document it names is evicted

A failed eviction still deleted the reverse index, so the credential
barrier's retry found no index and reported the cache clear while the
documents an unreadable index or a failed delete left behind stayed
cached. The index is now deleted only after it was read and every document
it names is gone, so a retry can still find what remains.

* fix: treat a malformed auth reverse index as unreadable

* fix: treat a reverse index with a non-string entry as unreadable

(cherry picked from commit 18b6937da3)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16435
2026-10-01 03:46:18 +00:00
Lia
d98ca2b073 ⛴️ test: Check Code Steers in the Canary Thread
(cherry picked from commit d8b9371ad9)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16457
2026-10-01 03:46:18 +00:00
Lia
04461d4cdb ⛴️ fix: Keep MCP App and Speech Limits in One E2E Config
(cherry picked from commit e20558b736)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16457
2026-10-01 03:46:18 +00:00
Marco Beretta
ca8fb372e7 🔌 fix: Reattach a Resume Stream Whose Body Ends Before Final (#16438)
(cherry picked from commit 9ac96c5ca9)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16438
2026-10-01 03:46:18 +00:00
Marco Beretta
f18db2e84e 🧪 test: Cover MCP App Operation Limits in Authenticated Startup Config (#16429)
(cherry picked from commit 626df3fa76)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16429
2026-10-01 03:46:18 +00:00