* feat: Give the Checkbox Theme Roles for Its Fill and Corner
The shared checkbox painted no fill when unchecked and drew the rounded-sm
corner every small control shares, so the ClickHouse theme could not reach
Click UI's checkbox.color.background.default fill or its 0.125rem
checkbox.radii.all corner.
A checkboxRadius appearance role sets the corner and follows radiusSm, the
corner it drew before, when a theme names that and not this. A
checkbox-fill color role paints an unchecked box only when the new
checkboxFillStyle role is fill; the default transparent style keeps every
default theme pixel-identical, and the fill follows surface-primary when a
theme omits it. Checkbox and CheckboxGlyph read both roles.
The ClickHouse theme sets Click UI's fill and corner, and both entries
leave the drift guard's not-expressible list with their probes pinned to
match.
* test: Spell Each Checkbox Scenario Tag Literally
* test: Pin the Theme Cache Digest Built From the New Resolver
* feat: Let a theme reshape the sign-in field and button
The sign-in floating-label field, the submit button and their shared corner read the new authFieldHeight, authButtonHeight and authControlRadius appearance roles, whose defaults reproduce the 44px field, 48px button and 16px corner. The corner follows radius2xl when a theme names only that. The ClickHouse theme draws them at Click UI's single field and button size with the button's square corner.
* fix: Size the sign-in button by its height role alone
A fixed height with vertical padding left a short theme height less room than the label. Specs now expect the role classes on the sign-in field.
* fix: Keep the reset label and password controls inside a themed field height
The reset request label rests in the middle of the field instead of 12px from its top, and the password field's reveal and copy buttons size from the sign-in field height, 4px off its edges and never under 24px. Both keep their stock positions and sizes.
* fix: Hold the password field controls inside the padding it reserves
The reveal and copy buttons stop growing at the stock 2.25rem, so a taller sign-in field keeps them clear of the typed value.
* feat: Let a theme reshape the second-factor and reset-success actions
The 2FA verify and reset-success continue buttons read authActionHeight and authActionRadius, which follow the sign-in button's height and corner when a theme names those and otherwise the Button height and radiusLg they drew, so the stock screens are unchanged and ClickHouse draws them at 32px with its 4px corner.
* test: Reach the second-factor screen through a pending sign-in
* fix: Rest the reset label inside a minimum-height field and keep the action corner on radiusLg
The reset request label rests from an inset that centers it 2px low as before but never past the field's bottom edge, and the other sign-in actions resolve their corner before the sign-in corner is derived from radius2xl, so a theme that names only radius2xl keeps radiusLg on them.
* feat: Route Every Prompt Category Icon Through a Per-Slot Role
* test: Retry Category Icon Reads While the Prompt List Settles
* fix: Carry the Renamed Category Icon Role to Its Slot 4 Name
* fix: Carry the Renamed Category Icon Role Through Every Color Reader
* fix: Keep Renamed Color Roles Out of the Unknown Token Warnings
* feat: Give Prompt Category Icons a Purpose Color Role
* fix: Keep Token Formatting and Skip Hover on Touch in the Category Icon Scenario
* test: Refresh the Theme Resolver Pin After Rebasing on the Avatar Ink Change
* feat: Derive the Theme Cache Version and Close the Color Token Drift
* feat: Add a Button Padding Role for the Default Size
* test: Run the Boot Script Through the Version Injection
* fix: Retain Signed-Out Provenance and Tighten Token Declarations
* refactor: Route Stylesheet Colours Through Theme Variables and Gate CSS Literals
* fix: Run the Colour Check Through Its Own Script
* fix: Read Numeric Fallbacks Inside Colour Function var() in the Colour Literal Check
* feat: Add 10, 11, 13 and 15px Steps to the Theme Type Scale
* test: Prove the Off-Scale Type Steps in the Mock Harness
* style: Sort cn Imports
* refactor: Name the 13 and 15px Steps 1xs and 1sm
* test: Probe the Type Step Roles Instead of Unused Utilities
* feat: Quiet Prompt Editor Boxes, Table Columns and Destructive Buttons for a Theme
* fix: Outrank the Cell Border Color With the Column Rule Share
* fix: Keep the First Table Cell's Outer Edge Under the Inset Share
* fix: Keep the Batched Edit Divider on the Light Border
* fix: Keep Web Search Source Row Separators on the Light Border
* fix: Quiet the Result Switcher Divider and Keep the RTL Table Edge
* fix: Resolve Table Edges by Cell Direction and Keep the Variables Card Opaque in Details
* fix: Draw Table Frame Edges in Logical Terms So Direction Needs No Selector
* fix: Keep Soft Destructive Hover and Pressed Tints Above 4.5:1
* feat: Let a Theme Quiet Decorative Borders
* test: Cover the Chrome and Inset Border Roles in the Mock Harness
* fix: Draw the Selected Category Tab Edge at the Chrome Share
* fix: Route Chips, Subtle Icon Buttons and Hover Rings Through the Chrome Share
* fix: Draw the Remaining Inner Card Dividers at the Inset Share
* feat: Add a Focus Role for Rows Inside Content
* test: Cover the Subtle Focus Role in the Mock Harness
* test: Probe the Subtle Focus Role Through Its Theme Variable
* test: Focus the Probe to Read the Subtle Focus Utility
* test: Read the Subtle Focus Ring From Its Utility Property
* fix: Ring the Subagent Progress Disclosure in the Subtle Focus Role
* feat: Layered Surface Roles for the ClickHouse Theme
Adds purpose-named roles for the chat canvas, user message, cards, sidebar rows, settings tabs, menu panels, composer and search pill. Each follows the surface it painted before, so the default theme is unchanged; ClickHouse steps them apart with Click UI tokens.
* fix: Align Sticky Phase Headers, Boot Routes, and Row Fades With the Layer Roles
* fix: Cover Trailing Slash and Bare Dashboard Paths in the Boot Canvas Route
* fix: Match Boot Canvas Routes Case-Insensitively
* test: Expect the User Message Role on Other-Author Turns
* test: Expect the User Message Role on the Subagent Briefing
* feat: Tooltip, error alert and artifact preview theme roles
* test: Cover the Tooltip Theme Roles in the Mock Harness
* fix: Lighten the Dark Document Tile and Leave the Preview Color Scheme Alone
* fix: Let the Artifact Preview Frame Follow the System Scheme and Ink Autofill in the Field Text
* feat: Size Roles for the Select List
The Select list drew a fixed max-h-96 and min-w-[8rem], the last hard-coded sizes among the ten shared primitives. They are now the listMaxHeight and listMinWidth appearance roles, defaulting to 24rem and 8rem. The ClickHouse theme sizes the list by its trigger and keeps the 24rem cap, since Click UI caps it only at the viewport's available height.
* test: Resize the Select List From a Reference Theme
* feat: Give the Mobile Drawer Edge a Role and Move the Last Page Colours Onto Roles
The mobile drawer drew its edge with dark-only border utilities, the web source caption with gray-900 and white, the prompt panel's mobile backdrop with black at 20%, and the Insights agent picker popover with a dark-only override, so no theme could reach them.
drawer-edge paints the drawer's trailing edge: the drawer's own fill in light, where the scrim already separates it, and border-xheavy in dark, so dark mode keeps today's edge; a theme that sets only those two roles keeps the edge its mode drew. The source caption reads the media overlay roles, the prompt panel backdrop takes the page scrim the mobile drawer uses, and MultiSelect gains a widget surface that the Insights picker uses in place of its dark override.
* test: Pin the Drawer Edge Role in Both Modes and Under a Theme
* test: Write the Drawer Edge Scenario Tags Out Whole
* fix: Type the Drawer Edge Fallback So the Theme Resolver Stays Checkable
resolveTheme spreads every role fallback into one object literal, and each untyped conditional spread doubles the union the checker builds. One more pushed tsc for packages/client past CI's 6 GB heap. Typing the fallback as Partial<IThemeRGB> keeps it from adding to that union; a full check now peaks at about 4 GB.
* feat: Size roles for the shared primitives
Button's xs, lg and icon squares, the large title input, the checkbox, menu, select and dialog icons and the switch's hit area read new size roles whose defaults are the fixed sizes they drew, and the menu row corner reads radiusLg. The ClickHouse theme takes Click UI's single button size, its small icon button and its checkbox and icon sizes. A spec pins the strict count of theme-driven primitives at eight of ten and what the other two still hard-code.
* fix: Hold the switch hit area to the target minimum in width and scan stylesheet colors
* test: Read every raw palette hue in the primitive guard
* test: Exempt only theme role fallbacks in the primitive guard
* feat: Tab minimum width role and a wider fixed-size guard
The primitive guard now also reads absolute arbitrary sizes, ring-offset palettes and 4 and 8 digit hex colors. The Tabs trigger's 100px minimum becomes the tabMinWidth role, which the ClickHouse theme sets to 0 so tabs size by their label as in Click UI.
* fix: Keep app icon buttons and their companions on the button size role
The passkey rename input keeps the field height, and the agent builder panel headers size their back button and balancing spacer from size-theme-button, so a theme that changes the button height keeps those rows aligned.
* fix: Size menu glyphs from the icon role and floor touch targets at the minimum target size
* fix: Let menu glyphs fill their slot and keep the dialog close target at the minimum size
* test: Probe the menu glyph inside a flex row, as DropdownPopup renders it
* fix: Hold icon button squares to the minimum target size
* fix: Bound the icon and checkbox size roles to the room their layouts leave
iconSize takes 0.75 to 1.25rem, iconSizeLg 1 to 2rem and checkboxSize 1 to 1.5rem, so a theme can retune them without shrinking a checkbox below the box it was or pushing an icon past the inset it sits in.
* fix: Hold the icon-only Dropdown and header spacers to the minimum target size
* fix: Floor the button size roles at the target minimum and let callers replace the control height
* test: Move the unknown appearance markers off the new title field height
* fix: Size the compact step, the exported Dialog and the combobox icons from roles
The Button and Dropdown compact recipes read a buttonHeightCompact role, the exported Dialog's action buttons and close glyph read buttonHeight and a bounded iconSizeMd, Combobox icons follow iconSize, and the checkbox callers drop their fixed sizes so checkboxSize reaches them. minTargetSize may no longer exceed buttonHeight or fieldHeight, so the target floor never pulls icon buttons out of line with the fields beside them.
* fix: Size the collapsed Combobox square from the control height role
* fix: Hold every Button size and the collapsed Combobox to the target minimum
* fix: Let section header buttons keep their own text height
* test: Treat a zero size as a reset in the primitive guard
* fix: Enforce the target size at the roles instead of on every Button
A minimum height on every Button size grew callers that draw a smaller control on purpose, such as the sortable table header (h-auto) and the 20px artifact and attachment row actions. The floors come off the Button sizes and icon squares; a theme that sets minTargetSize may instead not size any button or field below it, and the new Button size roles keep their 24px floor.
* fix: Check the control and large field heights against the target floor
* fix: Hold the target floor at a fixed 24px and floor the large field height
* fix: Keep the passkey rename field on the button height and drop the fixed MCP checkbox size
* fix: Size the Combobox check glyph from the icon role and scope the README floor claim
* feat: Field fill and ink theme roles
Fields ink their value in a new field-text role, which follows text-primary, and a theme whose fieldFillStyle appearance role is fill paints them in a new field-fill role, which follows surface-primary. The default transparent style keeps every field clear, read from the nearest themed root through a style-query variant. The ClickHouse theme fills and inks fields with Click UI's field tokens, which empties the not-expressible list.
* fix: Ink the TimePicker value in the field role and type the field colors
* fix: Keep field ink and state fills over the field fill
Field-variant Dropdown triggers no longer swap to the primary ink on hover, and the field fill variant carries a single class's weight so hover, open and disabled fills paint over it.
* test: Count the field roles beside the media overlay roles
* fix: Type the color fallbacks as one object and keep a disabled field's fill under the pointer
resolveTheme spread about twenty fallbacks typed as role-or-empty unions; each union spread doubled the type checker's work, and the field roles pushed the client typecheck past the CI heap. Typing them as IThemeRGB drops its memory from 3.3GB to 0.65GB. A fill theme with the default dim disabled style also keeps a disabled field's fill under the pointer.
* 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
* 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
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
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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