mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-18 14:08:21 +00:00
33 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
11fdcf4f43
|
🧩 refactor: Move Phase Label Ticker Into Chat Package (#18179)
- refactor: Move Phase Label Ticker Into Chat Package - test: Give Phase Entrance Scenarios Unique IDs |
||
|
|
4f0ef1941f
|
🫁 fix: Ease Context Usage Popover Size Transitions (#18160)
* 🫁 fix: Ease Context Usage Popover Size Transitions Expanding snapped the card to its wide width in one frame; collapsing snapped it narrow first, reflowed the details into one column and made the card taller than it had been before rolling up. - The popover owns the card width and eases it at the pace of the roll it travels with. - The details hold the wide card's width through both rolls, so the card uncovers one settled layout. - The per-tool breakdown and the usage sections roll instead of jumping. - A press inside the card pins it, so a control that shrinks it from under the pointer no longer closes it. * 🫁 fix: Restart the Details Width Hold on Every Opening A collapse reversed midway kept the details mounted with their mount-time hold already spent, so they reflowed to the narrowing card, flashed one column and gave the roll a taller height to snap back from. The hold is now keyed to the open state and restarts with each opening. A card that opens already expanded resizes nothing, so it no longer holds: with a classic scrollbar on a viewport-capped card the held width could sit across the two-column threshold from the settled one. --------- Co-authored-by: Lia <lia@librechat.ai> |
||
|
|
3aea181547
|
🌱 refactor: Move Conversation Starters Into the Chat Package With a Starter Button Variant (#17805)
* refactor: Move Conversation Starters Into @librechat/chat With a Starter Button Variant The welcome screen's suggested first messages render through a package component built on a new starter Button variant instead of a raw button. The app keeps resolving which starters apply (agent, spec, assistant) and sends the chosen text. * test: Pin the Starter Variant Under the ClickHouse Reference Theme A starter takes its fill and ink from the theme roles in light and dark, so a theme that repaints the surface repaints the chip. * fix: Cap the Starter Width at the Call Site, Not in the Button Variant The Button primitive spec rejects fixed sizes in the variant recipe, so the 16rem cap moves to the package component that lays the chips out. * fix: Keep the Starter Stagger Ahead of the Unlayered Fade Rule The unlayered fade-in rule sets the animation shorthand, which resets the delay and fill mode a layered utility sets, so every chip animated at once. The variant now declares the whole animation in one utility, and the cap scenario asserts the computed delay and fill mode. * fix: Ship the Starter Fade From the Shared Tailwind Preset The starter variant referenced a keyframe that only the app stylesheet defines, so a host using the published preset would get no entrance. The keyframe and its staggered animation now live in the preset next to the loading dots, and the variant uses the animate-starter-in utility. * chore: Retest Against Current Dev |
||
|
|
84a36630a0
|
📊 refactor: Move the Context Usage Popover Into @librechat/chat (#17799)
* refactor: Move the Context Usage Popover Pieces Into @librechat/chat * test: Cover the Context Usage Pieces in the Chat Package * fix: Ship the Collapsible Animations With the Shared Tailwind Preset * test: Keep the Expanded Breakdown Choice Across Remounts * test: Assert the Absent Compaction Hint by Its Fixed Copy * refactor: Give Collapsible and HoverCard the Breakdown Disclosure Styles * test: Cover the Breakdown Roll and Remembered Choice in the Browser * chore: Retest Against Current Dev |
||
|
|
03f1b76db5
|
🪄 refactor: Compose Chat Package Styles From Shared Primitive Variants (#17760)
* refactor: Compose Message Toolbar Styles From Shared Button and Label Variants * test: Cover an Open Fork Menu Holding the Message Toolbar Visible * refactor: Compose Composer File Styles From Shared Primitives * refactor: Compose Summary, Collapsible Text and Subagent Activity Styles From Shared Button Presets * fix: Draw the New Button Variants From Theme Radius and Height Roles * test: Find the Held-Open Scenario's Replies Inside the Message List * fix: Restore the Feedback Note and Fork Checkbox Looks Through Primitive Variants * refactor: Compose the Message Nav Chevrons With the Disabled Ink Recipe |
||
|
|
69b3a7cac6
|
🎛️ refactor: Move the Code Tool Selects onto Dropdown and Remove Select (#17432)
Some checks are pending
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 Vote Gate / Gate (push) Waiting to run
Codegraph E2E Votes / vote (shard 1/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 10/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 2/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 3/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 4/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 5/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 6/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 7/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 8/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 9/10) (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/chat (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
* feat: Let Dropdown work inside dialogs and take the field list roles Inside a dialog the list renders in place, so the dialog's focus trap and aria-hidden pass no longer cut it off, and it layers above the dialog. A field Dropdown's list now takes listMinWidth, listMaxHeight and the icon size role, and is never narrower than its trigger. * refactor: Move the code tool selects onto Dropdown and remove Select and Combobox The four code tool settings selects were the last users of the Radix Select, and Combobox, its only other consumer, had none. Their tests and the nested popover scenarios now drive the Dropdown. |
||
|
|
1b00402178
|
🔲 refactor: Route Picker Panels Through Theme Radius Roles (#17186)
* refactor: Route Picker Panels Through Theme Radius Roles * test: Refresh the Theme Cache Pin for the Compact Panel Role |
||
|
|
d738fa43b4
|
📏 feat: Cap the Select List at the Popover's Available Height (#16938) | ||
|
|
74e682b7a3
|
🎯 fix: Hold Default Button Heights and the Dialog Close Button at the 24px Target (#16928)
Some checks failed
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/chat (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) Has been cancelled
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Has been cancelled
* fix: Hold Button Heights and the Dialog Close Button at the 24px Target * fix: Write a Zero Button Height as a Length the Target Floor Can Compare * test: Let the Delete Dialog Settle Before Measuring Its Close Glyph * test: Pin the Theme Cache Digest the Rebased Resolver Emits |
||
|
|
32d781e58a
|
☑️ feat: Give the Checkbox Theme Roles for Its Fill and Corner (#16958)
* 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 |
||
|
|
b2c635aa30
|
👆 a11y: Show Hover-Revealed Actions to the Touchscreen on a 2-in-1 (#16943)
* fix: Keep Hover-Revealed Row Actions Visible Wherever a Finger Can Reach * fix: Apply the Coarse-Pointer Reveal to the Composer Palette and Model Menu * test: Assert the Reveal on an Earlier Reply, Not the Always-Visible Latest One * test: Read the Timestamp From the Hovered Reply's Own Row * fix: Hide Until Hover Only Where Hover Exists and No Pointer Is Coarse |
||
|
|
e7484a223b
|
📐 feat: Let a Theme Reshape the Sign-In Field and Button (#16939)
* 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. |
||
|
|
16d62f2910
|
♿ a11y: Name the Global Focus Outline on Tabs, Table Rows and Dropdown (#16870) | ||
|
|
41825b7bb9
|
🧬 fix: Derive the Theme Cache Version and Align Color Tokens (#16819)
* 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 |
||
|
|
cd5dd94dec
|
📝 feat: Visible Prose Markers and Composer Shape Roles for ClickHouse (#16736) | ||
|
|
f156160c99
|
📏 feat: Size Roles for the Select List (#16714)
* 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 |
||
|
|
7baa814868
|
📐 feat: Size Roles for the Shared Primitives (#16617)
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
* 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 |
||
|
|
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
|
||
|
|
443d27ba32 |
🎋 fix: Reconcile Canary Promotion Static Checks
Move the existing marketplace spacing, pressed state and reduced-motion handling into shared primitive recipes. Supply loading-dot animation delays through a CSS custom property in the published preset. Remove only the five resolved suppression entries and apply the five CI-reported formatting corrections. Add focused regression coverage for GitHub CI; no local tests, builds, lint checks or typechecks were run, as requested. |
||
|
|
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
|
||
|
|
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
|
||
|
|
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
|
||
|
|
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
|
||
|
|
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
|
||
|
|
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
|
||
|
|
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
|
||
|
|
1e7b4a9bbd |
🎨 feat: Check Color Tokens and Class Existence (#16041)
* 🎨 feat: Check Color Tokens and Class Existence
Moves the Tailwind colors out of createTailwindColors() and into
packages/client/src/theme/tokens.css as `@theme inline`, published as
@librechat/client/theme.css and imported by the app's stylesheet. Runtime theme
switching is unchanged: each token still resolves to the custom property
ThemeProvider rewrites, and `@theme inline` is what keeps it out of a frozen
variable. The palette scales are closed, so an undeclared shade is no longer a
color.
Reading the tokens is what lets @shadcn/lint check them, so no-unknown-classes
goes on and no-raw-colors gains undeclared-token detection. Between them they
found dead classes the app has been shipping: 59 `token-`-prefixed color
classes that generate nothing, `transition-color`, `scrollbar-hide`,
`pointer-cursor`, `mt-text-sm`, `dark:gpt-dark-gray`, `-ml-0.9`, `-mt-0.8`,
`transition-width` and `overflow-anchor-none`, all repaired or removed here.
The library's own config gains tailwindcss-animate, since its components write
`animate-in` and the accordion keyframes.
* 🧽 refactor: Delete the Plain `*-token-*` Rules the Tokens Replace
`client/src/style.css` defined `.text-token-text-{primary,secondary,tertiary}`,
`.border-token-border-{light,medium}` and `.bg-token-surface-secondary` as plain rules,
so the 63 call sites this pull request renamed were painting their token rather than
nothing. The rules have no consumer left once the names are gone, and they sat outside
`@layer utilities`, where an unlayered rule beats every utility on the same property:
keeping them would hold that cascade for any class attribute that reintroduced a name.
Deleting them is what lets the variants written beside those classes apply — the entity
avatars take `dark:bg-surface-tertiary` in dark mode, and the two action-header fields
take `hover:border-border-heavy` on hover.
Two files the rename touches carried lint debt the changed-file gate attributes to this
pull request once they appear in the diff: `ActiveSetting.tsx` was an unreferenced mock
component whose hard-coded copy fails `i18next/no-literal-string`, and `Retrieval.tsx`
computed a `vectorStores` value nothing reads. Both are removed. `tokens.spec.ts` takes
its `structuredClone` polyfill and its Tailwind module loader through imports, which
`@typescript-eslint/no-require-imports` requires of a TS file.
* ✅ test: Cover the Token Utilities From a Browser
Whether an element still takes its token color after the plain rules are gone is only
answerable in a rendered page, so the four behaviours this change turns on get a tagged
scenario in the mock harness: the account-menu email resolves `--text-secondary` instead
of inheriting the menu's primary text color, a theme definition installed at load
recolors that same row to its own value (what `@theme inline` exists for), the mention
menu's frame resolves `--border-light` rather than falling back to `currentColor`, and
the login email field transitions `color`/`border-color` for 200 ms instead of `all`,
which is what `transition-color` left it doing. Each reads the theme's custom properties
through the browser rather than restating a hex, so the same assertions hold in light
mode, dark mode and mobile emulation.
* 🩹 test: Settle the Shell Before Locating the Account Button
Probing `nav-user` visibility straight after `goto` reports the desktop sidebar as absent,
because nothing has rendered yet, and the fallback then waited on the mobile-only header
toggle until the test timed out — the two account-menu scenarios failed that way on both
desktop projects while passing on mobile. Waiting for the composer first settles the shell,
and the fallback click carries a timeout so a missing toggle fails fast instead of hanging.
* 🩹 test: Open the Drawer Before Reaching the Account Button
Below `md` the account button renders inside the drawer's own header, off-canvas until
the toggle opens it: a locator calls it visible, a click waits for it to stop moving, and
the two account-menu scenarios timed out on the mobile project. The toggle is `md:hidden`,
so its own visibility is the layout probe — click it when it is there, then the button is
reachable in both layouts.
* 📝 docs: Point the Theme Setup and the Lint Contract at What Ships
The theme README's setup still told a consumer to rebuild the color map in
`theme.extend.colors` — the map this change deletes — and never mentioned the published
stylesheet, so following it leaves the semantic utilities ungenerated. Steps 3 and 4 now
import `@librechat/client/theme.css` and the config keeps only content, dark mode and the
preset, with the removal called out as the breaking change it is.
`CLAUDE.md` said five design rules run and that `no-unknown-classes` stays off because the
repository is on Tailwind 3.4; this change enables it. That section now describes six rules,
what the rule cannot see and therefore what the `allow` list is for, that `no-raw-colors`
also reports an undeclared token, and the distinction a reviewer needs for this diff: a
raised suppression count usually means a new override, but a rule that starts resolving
class names it used to skip reports styling the tree already carried.
* 🩹 fix: Publish the Token Stylesheet as a File, Not a Folder
tsdown's `copy` reads `to` as a destination directory, so `{ from: 'src/theme/tokens.css',
to: 'dist/theme.css' }` produced `dist/theme.css/tokens.css` — a directory where the
package's `./theme.css` export pointed, which makes
`@import '@librechat/client/theme.css'` fail for every consumer of the published package.
The copy now keeps the file's name in `dist` and the export maps `./theme.css` onto
`./dist/tokens.css`; `require.resolve('@librechat/client/theme.css')` answers with that
file after a build. The app is unaffected either way, because `client/src/style.css`
imports the tokens from source so a lint or CI run needs no prior build — which is exactly
why nothing here noticed.
* 🎨 fix: Give the Bash Command Pane the Code Surface Role
Repairing `dark:bg-gray-950` by swapping in this palette's darkest shade kept the pane on a
raw value: `gray-900` is a scale entry, so no theme — custom, high contrast, or a future
one — can recolor a surface that every other code pane takes from `surface-code`
(`DiffView`, the user-turn code bars). It now takes that role in both modes, which also
drops the light/dark split the element carried for no reason.
Appearance moves with it: dark goes to `#212121` instead of `#0d0d0d`, light to `#f7f7f8`
instead of `#ececec`, matching the diff pane directly above it in the same card.
* 🩹 fix: Stop Hand-Copied Tailwind Rules From Outranking Their Utilities
`client/src/style.css` carried a block of Tailwind's own v2/v3 output copied in by
hand — `.hidden`, `.overflow-y-auto`, `.overflow-x-auto`, `.truncate`,
`.text-ellipsis`, `.animate-spin`, `.grow` and a `--tw-*`-based `.transform`. Under
v3 those sat beside the generated utilities and lost to anything later in the sheet.
Under v4 the utilities live in `@layer utilities` and these rules do not, so they beat
every utility for their property, variants included: `hidden sm:flex` and
`hidden md:flex` resolve to `display: none` at every width.
Two surfaces were gone because of it. The welcome screen's disclaimer
(`Chat/Footer.tsx`, `hidden … sm:flex`) never appeared, and the header's right-hand
control cluster (`hidden items-center gap-2 md:flex`) took the bookmark menu and the
temporary-chat toggle with it. `scenarios/welcome-disclaimer.spec.ts`,
`scenarios/temporary-chat-icon.spec.ts` and `bookmarks.spec.ts` fail on the parent
branch's build and pass here; nothing else in the style-sensitive e2e set changes.
Tailwind generates every declaration removed here, so the only behavioural difference
is `overflow: overlay`, which the copies set and which Chrome has aliased to `auto`
for years and other engines never implemented.
* 📝 docs: Load the Documented Tailwind Config From the Documented Stylesheet
v4 reads no config file unless a stylesheet says so, and the setup's step 3 imported the
tokens without an `@config` line, so the config step 4 tells a consumer to write — the
preset, the `content` globs, class-based dark mode — never applied. Both of this
repository's own entries carry the directive (`client/src/style.css`,
`packages/client/src/theme/theme.css`); the example now does too, and step 4 says that the
file only takes effect through it.
* ✅ test: Cover the Token Checks and the Published Stylesheet From a Browser
Two `@scenario`-tagged specs for what this change turned on. The first asks the
flat config, through a stdin probe, what a caller hears for a class Tailwind
cannot generate (`transition-color`) and for a colour token nobody declared
(`bg-surfce-primary`): both rules report, both name the spelling the author
meant, and the correctly spelled neighbours stay silent, which is what makes the
report about those two classes rather than about the probe. The second resolves
the `./theme.css` export the way a bundler does and asserts it lands on a file
that declares the `@theme inline` tokens and ships inside the package's `files`
— the export resolved to a directory once, and a consumer's `@import` is where
that failed.
* 🩹 fix: Record the Backlog the Rebase Brought Into the Enabled Rules
The 28 `dev` commits this stack caught up with added styling to three files the
full-tree sweep lints, and the recorded counts predate them: `ToolApproval.tsx`,
`Chat/Trace/Viewer.tsx` and the `TemplateTable.tsx` mockup reported through the
baseline, which is what the ESLint config regression gate compares. Those
violations are `dev`'s existing styling arriving in the rules' scope, so they
are recorded rather than restyled, and the count in CLAUDE.md follows.
* 🩹 fix: Ship the Animation Plugin With the Preset Consumers Load
The components published here write `animate-in`, `fade-in-0`, `zoom-in-95` and
`slide-in-from-*` — dialogs, popovers and dropdowns — and those are
`tailwindcss-animate` utilities. The plugin was registered only in
`packages/client/tailwind.config.js`, which is neither exported nor in the
package's `files`, so a consumer following the documented setup loaded the
preset and got no CSS for any of them: the surfaces appeared without their
motion and nothing said why.
The preset registers the plugin, `tailwindcss-animate` joins `tailwindcss` and
`tailwind-merge` as a peer dependency, and the consumer contract says so. The
new `@scenario:the-published-preset-generates-the-components-animations`
compiles the preset the way a consumer's build does — no app config — and
requires CSS and keyframes for each of those classes, with `p-4` as the control.
* 🩹 fix: Point the Documented Consumer Globs at the Files That Ship
Step 4 of the theme README handed a consumer
`./node_modules/@librechat/client/dist/**/*.js` as the content glob that reaches
this package. `tsdown.config.mjs` sets `fixedExtension: true`, so `dist` holds
`index.mjs` and `index.cjs` and never a `.js` — the glob matched zero files. A
consumer following the documented setup scanned only their own `src`, so every
utility that appears exclusively in a published component (dialog, menu, button
surfaces) was generated for nobody. The SPA never saw it: `client/tailwind.config.cjs`
scans `../packages/client/src`, the source, not the built package.
The glob now reads `dist/**/*.{js,mjs,cjs}`, and a scenario reads it back out of
the README rather than restating it, so the prose and the shipped file names
cannot drift apart again: it resolves the globs against the built package and
asserts they match every javascript module the export map points into `dist`,
and that those modules really do carry class names to find.
Against the previous README the same glob expansion matches `[]`; against this
one it matches `dist/index.mjs` and `dist/index.cjs`.
* 🩹 fix: Settle the Baseline, the Peer Metadata and the Comment the Rules Left
Three records that disagreed with the code they describe, all of them surfaced
by this pull request's own CI lane on a81c4a3.
`eslint-suppressions.json` recorded 10 `no-restyle` violations for
`client/src/components/Chat/AddMultiConvo.tsx` while the file has 9: the base
branch repaired one (`blur-sm` → `blur-xs` in a3e450de) without re-recording,
and this branch's baseline commit replayed the stale count over it. The
suppressions validator reads the whole baseline once the file is in the diff, so
it failed the Static Checks job with exactly that line. `npm run lint:design:prune`
drops the unused one; the trailing newline the runner strips is restored.
`package-lock.json` never received the two peers `packages/client/package.json`
declares: `tailwindcss` (added on the base branch) and `tailwindcss-animate`
(added here). The resolved tree was already correct — `tailwindcss-animate@1.0.7`
is hoisted — but the workspace entry's `peerDependencies` block disagreed with
its manifest. `npm install --package-lock-only` adds the two lines and changes
nothing else.
`eslint.config.mjs` still explained, four lines above the rule, that
`no-unknown-classes` "is deliberately not enabled" because "this repo runs
tailwindcss 3.4 with a JS preset". It is enabled at error on line 268, and the
comment beside the rule already says why that is now answerable.
* 🩹 fix: Import the Token Stylesheet Where the Consumer Probe Compiles
The standalone-consumer scenario compiled `@import 'tailwindcss'` plus the
package's config and nothing else, which is where the colours used to come from:
`createTailwindColors()` spread them into `theme.extend.colors`. They are
declared in `tokens.css` as `@theme inline` now, so that entry emitted no
`border-border-light` at all — compiled here, the class count is 0 — and the
divider fell back to `currentColor`, failing the e2e lane on shard 3 with the
text ink (`rgb(200, 0, 0)`) where the border role belongs.
The probe now imports the published token stylesheet between Tailwind and the
config, which is step 3 of the theme README and what a consumer following it
writes; the path comes from the package's own `./theme.css` export so it cannot
drift from what ships, and the build guard requires that file too. With the
import the utility compiles as
`border-color: rgb(var(--border-light) / var(--border-light-alpha, 1))`, and the
radius assertions are untouched: `rounded-sm` still resolves
`calc(var(--radius, 0.5rem) - 0.375rem)`.
The scenario joins this change's acceptance contract, because the invariant it
now protects is this one's: a consumer gets the package's colours from the
stylesheet, not from a config block.
* 🧽 refactor: Stop the Dashed Avatar Border From Depending on Emission Order
Both avatar placeholders carried `border-border-medium` and `border-black` on
one element. Same specificity, so the winner is whichever Tailwind emits last,
and compiling this tree's own config puts `.border-black` at line 3021 and
`.border-border-medium` at 3042 — the token wins today, which is why the
placeholders looked unchanged through the rename. Nothing states that order,
so a change in how Tailwind sorts utilities would silently turn the border
black.
`border-black` is deleted at both sites. The border keeps painting
`border-border-medium` exactly as it does now, and the recorded counts do not
move: neither file has a `no-raw-colors` entry, and the suppressions validator
stays green over the 74-file diff.
* 🎞️ fix: Preserve Component Animations When Integrating Canary
* 🎛️ fix: Let Shared Primitives Own Input and Tab Styling
* 🔗 fix: Preserve Auth Link Color Transitions
* 🧪 test: Verify Auth Link Color Transitions
* fix: Preserve Semantic Color Enforcement and Consumer Setup
* fix: Preserve Consumer Tailwind Palettes
* fix: Copy the Compatibility Palette Into the Docker Client Build
---------
Co-authored-by: berry-13 <berry-13@users.noreply.github.com>
(cherry picked from commit
|
||
|
|
cb78d894a9 |
🌊 refactor: Upgrade the Client to Tailwind v4 (#15996)
* 🌊 refactor: Upgrade the Client to Tailwind v4
Moves client/ to tailwindcss 4.3.3 through @tailwindcss/postcss, keeping the
JS config via `@config` so createTailwindColors(), the theme preset and the
high-contrast variant stay exactly as they are.
Renames the utilities whose meaning changed (outline-none -> outline-hidden,
shadow-sm -> shadow-xs), the ones v4 removed (flex-shrink-0 -> shrink-0,
flex-grow -> grow, blur-0 -> blur-none, ring-opacity-N -> a /N color modifier)
and the tailwindcss-radix variants, whose plugin generates nothing under v4, to
the data attributes Radix already sets. Restores the two preflight defaults v4
changed (border-color, ::placeholder) so the upgrade carries no visual change.
Verified by compiling the app's CSS under both versions: every class the source
uses that v3 generated, v4 generates too, and each declaration difference is a
v4 representation (logical properties, color-mix alpha, theme variables) with an
equal computed value.
* 🩹 fix: Keep the v4 Upgrade Invisible Where Review Found It Was Not
Four findings against this pull request, all of them defaults v4 changed under a
tree written against v3:
- v4 moved the blur scale up a step: its `blur-sm` is 8px where v3's was 4px,
and 4px is now `blur-xs`. Nothing in either Tailwind config overrides the
scale, so all six surviving small-blur sites rendered at twice their radius.
They are renamed `blur-xs`/`backdrop-blur-xs`.
- The high-contrast block reset `--tw-ring-opacity`, a variable v4 does not read,
and its comment named `ring-opacity-50`/`ring-opacity-20`, classes this change
deleted. Compiling the converted controls through this tree's own Tailwind
shows the slash modifier baking the alpha into `--tw-ring-color` as a
`color-mix(...)` — the ring measured `oklab(0 0 0 / 0.5)` in the mode that
promises full strength. The block now re-declares the ring colour, and the
same probe measures `rgb(0 0 0)`.
- `ResizableHandle` and its `Alt` twin carry a bare `border`, which v4 paints
with `currentColor`. The app's compatibility shim covers that inside the SPA
but is not part of the published stylesheet, so a standalone consumer drew a
text-coloured hairline around a `border-medium` grip. Both handles now name
`border-border-light` — the same #e3e3e3 the shim resolves to, and it follows
the active theme.
- `tailwindcss` was a devDependency only, while the published components emit
`outline-hidden`, `shadow-xs` and `origin-(--radix-…)`. A Tailwind 3 host
installed the package with no warning and silently lost focus suppression and
popup transform origins. `^4.3.3` is now a peer, like `tailwind-merge`, and the
consumer contract says so.
Two consequences of rebasing onto `dev` are settled here as well. The 28 commits
this branch caught up with added styling to eleven files the upgrade touches, so
their `no-restyle` counts are re-recorded: those violations are `dev`'s existing
code arriving in this pull request's lint scope, not new debt, and the diff shows
which file each belongs to. And `TemplateTable.tsx` goes back to exactly what
`dev` has: it is an unrendered mockup carrying six literal strings the i18n rule
rejects, so renaming its one `radix-state-open:` class would have pulled six
pre-existing errors into this lane for a component nothing mounts. It is the one
file the rename skips, and the reason is here rather than in a suppression.
Six `@scenario`-tagged specs read what the app paints: the 4px blur on the
artifact scrim, the ring resolving to the opaque ink token under high contrast
and to a `color-mix` without it, the handle's border following the theme in dark
mode rather than inheriting `currentColor`, a focused control keeping an outline
under forced colours, the restored v3 border and placeholder defaults, and npm
refusing the packed tarball beside Tailwind 3 with ERESOLVE.
* 🧱 fix: Keep v4's Cascade Layers and Revived Classes Out of the Rendering
Two mechanisms let the upgrade change what the app paints, and each one had more
sites than the reports that found it.
Tailwind 4 emits every utility inside `@layer utilities`, and an unlayered
declaration beats a layered one whatever its specificity. The SPA's hand-written
element and bare-pseudo rules used to lose to utilities by being element
selectors; they started winning. Measured in a browser against the compiled
stylesheet, before and after: a `<p class="my-4">` computed `0px` margins instead
of `16px`, a themed `<select>` fell back to square corners, a white background,
16px text and 40px of native arrow padding instead of `rounded-lg`, transparent,
14px and `px-2`, and a keyboard-focused control painted a 2px black outline over
the ring `focus-visible:outline-hidden` was supposed to leave alone. The `select`
rule, the `blockquote…p, pre { margin: 0 }` reset and the two bare focus rules now
sit in `@layer base`. `.dark :focus-visible`, the `code, pre` font `!important`
reset and the `.hidden`/`.overflow-*` class overrides stay unlayered: those are
meant to beat utilities, and layering them would change behaviour.
Tailwind 3 generated nothing for classes it could not parse, so a number of them
were dead markup; Tailwind 4 honours them. Compiling the same sources under 3.4.1
and 4.3.3 and diffing the generated selectors (2,412 vs 2,435) turns up 27 v4-only
tokens, 12 of which are this upgrade's own renames and 15 of which already existed
on `dev`. Those 15 are restored to what v3 painted: the artifact panel keeps its
150 ms desktop open and 300 ms mobile close rather than 350 ms and 250 ms, the
continue icon stays 12px rather than 76px, agent avatars keep their borderless
edge, file rows and the files side panel stay fluid rather than jumping to 25rem
and 7.5rem, a dialog that sets no `max-w` stays full width, the source rails keep
the scrollbar they had, the composer's control row stops declaring a container,
and the dropdown keeps the height, transform origin and destructive icon colour it
actually had. Each one is a design decision someone wrote and never saw; they are
catalogued for deliberate adoption in berry-13/LibreChat#67 instead of switching
on inside an invisible upgrade.
The reverse direction is clean: of the 70 selectors only v3 emits, every one is
extractor noise — JavaScript negations (`!visible`, `!table`, `!running`) its regex
mistook for important-prefixed classes, and a bare `animate-none` it split out of
`motion-reduce:animate-none`. No class is lost.
Four scenarios cover the two invariants: a paragraph keeps its margin utility, a
focused control shows only its ring, a native select keeps its token styling, and
the classes v3 ignored stay inert — the last one reading the artifact panel's
150 ms and then walking the stylesheets the page loaded to assert no rule exists
for any of the ten revived tokens.
`AddMultiConvo.tsx`'s `no-restyle` count drops 10 → 9, the entry the previous
commit's class removal left unpruned, and `AgentDetail.spec.tsx` loses the blank
line that deleting an assertion left behind — both were failing CI on the previous
head.
`FileListItem` is deleted rather than edited. It carried one of the `w-100` rows,
and nothing renders it: `FileList.tsx` imports it beside a commented-out line and
renders `FileListItem2` instead. Keeping it would have kept a `w-100` rule in the
stylesheet the scenario asserts is empty, and dragged its six unlocalized literals
into this lane — the same reason `TemplateTable` went earlier. Its dead import and
`no-restyle` entry go with it, as does an unused size map in `agents.tsx` that the
avatar never read.
* 🧹 fix: Stop the App's Own `.hidden` From Outranking `md:flex`
`client/src/style.css` declared `.hidden { display: none }`, a duplicate of the
utility Tailwind already emits. Unlayered, it outranked every layered variant that
reveals an element, so `hidden … md:flex` and `hidden … md:block` stayed hidden at
every width: the header's desktop cluster — export/share, the trace button,
temporary chat — never appeared, and the composer's MCP control lost the label its
accessible name comes from, which is why `e2e/specs/mock/activity-labels.spec.ts`
timed out waiting for a button named "MCP Servers" while the same suite passes on
the base branch.
Measured in a browser against the compiled stylesheets, `<span class="hidden
md:block">MCP Servers</span>` inside a button at 1280px:
| Stylesheet | computed display | button name |
|---|---|---|
| Tailwind 3 | `block` | `MCP Servers` |
| Tailwind 4, rule present | `none` | *(empty)* |
| Tailwind 4, rule deleted | `block` | `MCP Servers` |
Deleting it is the whole fix: Tailwind generates the identical `.hidden`, inside
`@layer utilities` where the responsive variants can win. `.overflow-x-auto` and
`.overflow-y-auto` stay unlayered with a note — they deliberately override the
utility of the same name with `overlay`, no source pairs them with a variant that
would need to win back, and both computed values are identical under either major.
`@scenario:the-desktop-header-shows-its-controls` opens a chat at 1280px, requires
the export/share control to be visible, narrows to 500px where it must be hidden,
and widens again.
* 🔗 fix: Let a List Link Keep the Utility That Unstyles It
`client/src/mobile.css` paints every list link blue, bold and underlined. `li a`
is two element selectors, so under Tailwind 3 any class beat it — which is how
the source cards in `verticals.tsx` and the skill file viewer, both carrying
`no-underline`, actually looked. Unlayered under v4's cascade layers it outranked
the utility instead, and those links came back underlined and bold.
`li a` moves into `@layer base`. `p.whitespace-pre-wrap a` does not: at (0,1,2) it
already outranked a single class under v3, and layering it would be the behaviour
change. Measured in a browser against both compiled stylesheets, a
`<li><a class="no-underline">`: Tailwind 3 computes `text-decoration-line: none`
with `font-weight: 700`, and the fixed Tailwind 4 build computes the same, while
the paragraph link keeps its underline in both.
`@scenario:a-list-link-keeps-its-no-underline-utility` paints both links through
the stylesheet the app loaded and asserts the utility wins on the carded one, the
plain one keeps its underline, and the bold the rule owns survives.
* fix: Carry the v4 Upgrade Across What Dev Added
Rebasing onto dev brought seven commits, and three of them land styling and a
test this upgrade has to account for.
ToolCall.tsx and McpOAuthDialog.tsx arrived written in v3 class order, which
prettier-plugin-tailwindcss rejects under v4. Both are reordered, with no class
added or removed. Textarea.tsx already carried the same drift and was the only
file in this branch's own diff against dev still failing the rule, so it is
reordered here as well.
dialog-scrim-role.spec.ts pins the new OGDialog scrim by string-comparing
getComputedStyle().backgroundColor against an rgba literal. Tailwind 4 compiles
a slash modifier to color-mix(in oklab, ...), which Chromium reports as
oklab(L a b / alpha), so all four scenarios would read oklab(0.463999 ... / 0.8)
where they expect rgba(89, 89, 89, 0.8). The paint is unchanged and only the
serialization moved, so readScrim now rounds the computed color through a 1x1
canvas, which returns the same sRGB channels for either spelling. The
expectations stay written as the rgba a reader can check against the palette,
and the spec keeps testing the color rather than its text form.
Dev's change also deleted the overlay this file used to render beside its
content, which was one of its recorded no-restyle violations, so the backlog
entry drops from 8 to 7.
* fix: Give the Primitives the Focus and Elevation Their Callers Were Restating
The design-rule gate reads a renamed utility as a swapped violation, so every
v3 name the upgrade rewrote on a primitive (outline-none to outline-hidden,
shadow-sm to shadow-xs, radix-state-open: to data-[state=open]:) failed it.
Fix the call sites instead of re-recording them:
- Button, Input, Textarea, SecretInput and AnimatedTabs already hide the
outline on the focus state that shows one, so the restated class goes.
- TextareaAutosize, TooltipAnchor, OGDialogContent, OGDialogClose,
OGDialogTitle and CollapsibleTrigger take focusOutline="hidden" for a
caller that draws its own indicator.
- Alert takes elevation="raised" for the auth notices and message errors
that carried a shadow.
- The presets trigger's open fill moves to the Radix Trigger that stamps
data-state; the parameters anchor's never matched, so it is dropped, as is
the MCP config inputs' one-off shadow.
Two controls had lost their keyboard outline under v4, where outline-hidden
sets --tw-outline-style: none and outline-2 reads it: the files table's name
cell gets it back, and the admin settings trigger drops the dead outline for
the ring Button already draws.
* test: Compile the Code Typography Spec With Tailwind v4
The spec dev added in #16146 ran tailwindcss as a PostCSS plugin, which v4
moved to @tailwindcss/postcss. Compile style.css the way the app does, with
source(none) and an inline source standing in for the raw content the v3
config override supplied, and bridge Node's structuredClone into jsdom for
the compiler. The assertions are unchanged and still fail when style.css
restates the code font with !important.
* test: Cover the Focus Outlines the Primitives Now Own
Adds two scenarios beside the upgrade's other focus checks: the files table's
name cell draws its 2px keyboard outline again, and a control that opts into
focusOutline="hidden" drops the browser outline while forced colors still
repaints the transparent one.
* fix: Keep OGDialog's Entrance From Sliding In Half a Width
v4 compiles translate-x-[-50%] and translate-y-[-50%] to the translate
property, which tailwindcss-animate's enter and exit keyframes compose with
through transform instead of replacing as they did in v3. The surface's
slide-in-from-left-1/2 and slide-in-from-top-[48%] therefore started every
OGDialog half its width to the left of centre and slid it across, where v3
started it 2% of its height below its resting place. Name only that 2% in
each direction, which reproduces v3's motion over the centering translate.
Found by #16068's dialog-scrim-role scenarios, which sample the dialog's
position mid-entrance and failed against the upgraded build.
---------
Co-authored-by: berry-13 <berry-13@users.noreply.github.com>
(cherry picked from commit
|
||
|
|
925db2e85f |
🪞 feat: Expand Agent Cards Into Their Detail Dialog (#15798)
* feat: Sort Modes and Mine Filter for the Agent Marketplace List
Adds two query parameters to `GET /api/agents`:
- `sort` — one of newest | oldest | popular | author, validated against
an allowlist since the value reaches a `$sort`/`$lookup` pipeline.
- `mine=1` — narrows the list to agents authored by the caller, applied
on top of the ACL-resolved accessible set rather than instead of it.
`newest`/`oldest` remain a plain `.find()` but now order on `createdAt`
instead of `updatedAt`. This endpoint refreshes S3 avatars through
`updateAgent`, which advances `updatedAt` — the very field the cursor
compared against — so an agent could cross a page boundary mid-scroll
and drop out of the caller's flattened list. Two indexes back the new
ordering.
`popular` counts favorites through an equality `$lookup` and validates
tenancy after the join. `author` resolves the same contact the card
renders — support_contact, then the user holding the OWNER ACL grant —
so the ordering matches what the reader actually sees. Both compute
their key inside the pipeline, so the cursor compares against the
computed field and the key is stripped before the rows are returned;
the response shape is unchanged.
Behaviour note: a request that sends no `sort` now comes back ordered by
`createdAt` descending rather than `updatedAt` descending.
* feat: Denser Agent Marketplace Grid with Sort and Mine Controls
Rebuilds the marketplace chrome around a denser grid. The hero block
gives way to a sticky header carrying the title, a live agent count and
a compact search field; category tabs become pills; and the grid follows
the available width instead of a fixed two-column layout, so a wide
window shows more than two agents per row.
Adds two controls to the category header, next to the category they act
on: a sort dropdown and an "only agents I created" switch. Both mirror
into the URL (`?sort=`, `?mine=1`) so a filtered view can be linked and
restored, and the default sort is omitted from the URL to keep it clean.
Switching the filter on inside Top Picks moves to All, where authored
agents can actually appear, since nothing writes `is_promoted` yet.
Since `popular` recomputes its count per request, pinning or unpinning
invalidates only the popular pages, and marks them stale rather than
refetching under a reader who is mid-scroll.
* feat: Agent Marketplace Refresh with Shared-Layout Detail Morph
Clicking an agent card now expands that card into the details dialog instead
of fading an unrelated panel over the grid, and the dialog contracts back into
the card it came from.
The morph is a framer-motion shared-layout handoff with `layoutCrossfade`
disabled, so the projection hides the relegated card nodes itself: the card
keeps its box, the grid never reflows, and no field is ever drawn twice. Card
and dialog keep genuinely different layouts and only the fields they share
travel — surface, avatar, name, category pill, creator row and the blurb.
The pill moves from the card's upper right to the dialog's upper left, the
avatar grows, the name zooms between the two type sizes, the creator moves out
of the footer to under the name, and the blurb is handed over at the dialog's
width so the surface's clip reveals the lines the card had no room for. The
dialog's own controls — close, "About this agent", Pin, Copy Link, Start Chat —
are introduced after the geometry is under way and leave the way they came in.
The dialog's content lives inside the morphing surface, whose sections are
projection nodes, so nothing stretches or spills outside the expanding box.
`layoutDependency` pins measurement to selection changes, which keeps the
virtualized grid's per-scroll rerenders from measuring every card. The page dim
is owned by the grid rather than the dialog's overlay so it can run its full
range across a contraction that outlives the dialog's mount, and the source
card is raised above its neighbours until the surface is home.
`OGDialogContent` gains `bare` and `forceMount` so a caller can own a dialog's
geometry and animation while Radix keeps focus trapping, Escape, the scroll
lock and the aria wiring. Reduced motion skips the morph and opens the dialog
outright; focus still returns to the card that opened it.
Also in the marketplace header: the admin settings trigger takes the bordered
`outline` variant so it matches the search field beside it, and the search
field's clear button declares its own colour instead of inheriting the
document's, which made the glyph invisible in dark mode.
* style: Square Off the Search Clear Button's Hover Fill
Its hover fill inherited the button recipe's `rounded-lg`, which on a 32px
square read as a pill inside the search field; `rounded-md` keeps the chip
subordinate to the field's own 8px corner.
* fix: Adjudicate Review Findings on the Marketplace Refresh
Four demonstrated defects from the review round on a10b31c0:
Surface radius came from a literal 16px repeated at both morph endpoints, so
`--theme-surface-radius` could not move the marketplace's corners even though
every other surface follows it. The card and dialog surfaces now carry
`rounded-theme-surface`, and the projection — which can only hold a corner
steady while it scales if it owns the radius as a number — is fed the resolved
token, read once per morph rather than per card or per frame.
The morph's page dim restated `bg-black/80` in feature code, duplicating an
appearance decision that belongs to the dialog primitive. `OriginalDialog` now
exports `DIALOG_SCRIM_CLASS` and both the Radix overlay and the grid's animated
backdrop consume it, so the scrim has one owner again. The scrim's colour is
still a literal in the primitive: making it a theme role changes every dialog
in the app and is not this PR's to decide.
`ErrorDisplay` narrowed on `Error` and kept only `message`, but an `AxiosError`
*is* an `Error`, so `response.status`, `response.data` and `code` — the fields
the classification runs on — were discarded for every real request failure. A
500 was therefore labelled non-transient `generic` with automatic recovery
disabled, and 404s rendered as errors instead of the neutral empty state. Only
a bare string needs wrapping now. Its regression test delivers the failure the
way axios does, as an `Error` instance, which the previous object-literal
fixtures never exercised.
`useAutoRetry.retryNow` did not cancel the pending backoff: resetting `attempt`
to 0 while it was already 0 is a no-op, so the effect never re-ran, its timer
stayed armed, and the scheduled attempt still fired after a manual or
connectivity-driven retry had gone out — a duplicate request that also spent a
backoff step. The schedule is now a value that changes on every retry, so each
one cancels and restarts it.
* fix: Keep a Morphed Card's Corner on the Radius Token
The resolved radius was handed to the surfaces only for the duration of a
morph. The projection keeps a `borderRadius` once it owns it, so dropping the
value on the way out left a morphed card pinned to whatever the theme was when
it was opened, and a later theme change moved every corner in the grid except
that one. The list resolves the token once for all its cards instead and
re-resolves it when the theme rewrites the root.
* perf: Page the Marketplace's Popular and Author Sorts in the Database
Two demonstrated defects from the review round on a10b31c0.
`sort=popular` loaded every accessible agent into application memory on every
page, queried favorites for that complete id set, sorted the whole array in
JavaScript and then kept the requested slice, so a 32-item page scaled with the
whole marketplace and the next cursor repeated all of it. The ordering is now
split at the only place it can be: agents somebody favorited, which is at most
as large as the favorites themselves, and the count-0 tail, which is ordered by
`_id` alone and therefore pages as an indexed range scan with the limit applied
by the database. The favorite counts no longer carry a marketplace-sized `$in`,
and the count key is per tenant, so a missing and an explicitly null `tenantId`
are one tenant rather than two.
Measured on 300 accessible agents, 4 of them favorited, `limit: 10`: page one
returned 314 documents to the process before and 19 after, page two the same
314 before and 19 after. Walking the whole list at `limit: 7` produces the
identical id order in both implementations.
The `author` pipeline joined the owner ACL entry and the owner user in order to
sort by the resolved display name, projected neither, and left
`getListAgentsHandler` to await `attachOwnerContacts`, which queried the same
ACL entries and the same users again for the page it had just ordered. The
pipeline now resolves `owner_contact` on exactly the tiers
`resolveAgentOwnerContact` applies — a support contact means no owner contact,
and without a joined owner account there is none either, even with a
denormalized `authorName` — and marks the row. `attachOwnerContacts` skips
marked rows, strips the marker, and so performs no query at all for an
author-sorted page.
`$$REMOVE` is rejected by DocumentDB, so "no contact" arrives as an explicit
null the list method drops before the row leaves.
The dropped popular-sort test asserted that a row deleted between the candidate
scan and the full fetch still yielded a usable cursor; it drove that state by
mocking `Agent.find` for one call, which the single ordered segment no longer
performs.
* fix: Keep Throttled Loads Recovering and the Skeleton on the Radius Token
Two findings from the review round on cdb91f4.
The marketplace query deliberately retries a 408 and a 429 twice
(`data-provider/Agents/queries.ts`) and leaves the longer backoff to the error
card, but the card classified both as `generic`, where `autoRetry` is false —
so a throttled or timed-out load stopped recovering after those two attempts
even though every layer above had called it retryable. A 408 now takes the
`timeout` copy that already describes it, and a 429 gets its own transient
kind rather than borrowing "Server Error" for a status the server answered
deliberately.
`GridSkeleton`'s placeholder card kept `rounded-2xl` while the real card moved
to `rounded-theme-surface`, so under any theme that sets a different surface
radius the corners jumped the moment the skeleton was replaced.
* fix: Read the Author Sort's Owner From Agent ACL Entries
The author sort joined every ACL entry sharing the agent's _id and picked the earliest full-bit user entry, so a REMOTE_AGENT owner entry left behind by an ownership transfer decided both the sort key and owner_contact. attachOwnerContacts counts only AGENT entries, so an author-sorted row could name a different owner than the same agent's card in any other sort mode. The filter now asserts the resource type.
* chore: Drop the Marketplace Strings the Refresh Orphaned
The rewritten grid, card and error card no longer render the old detail panel's copy, so com_agents_description_card, com_agents_error_loading, com_agents_error_searching, com_agents_results_for and com_agents_see_more had no reader left and the unused-i18n-keys static check failed. Only the English file is edited; the other locales are automated.
* fix: Recover on Window Focus and Move the Marketplace Query Contract Into packages/api
Three findings from the review at 9f59cad8.\n\nThe list query's sort allowlist and mine normalization were behavior in a CJS controller, which api/ is not supposed to hold; resolveMarketplaceListQuery now owns the contract in packages/api beside AgentSortOption, and v1.js keeps the call.\n\nuseAutoRetry promised recovery when the view is looked at again but only listened for visibilitychange, so a window that lost and regained focus with the tab still visible never recovered - terminal once the backoff was spent. It now also tracks focus/blur, counted once per activation so a tab switch that fires both events retries once.\n\nThe aggregation predicate helpers returned Record<string, unknown>, which the repository prohibits for new code and which accepts any misspelled operator; they return a concrete expression union instead.
* fix: Move Owner-Contact Resolution Out of the CJS Service and Open Mine Links on All
`api/server/services/Agents/ownerContact.js` had grown the resolved-row filtering, the
marker cleanup and the owner ACL pipeline, all behaviour, inside `/api`. The service is
now the wiring the boundary asks for: `attachAgentOwnerContacts`
(`packages/api/src/agents/ownerContact.ts`) takes its database reads from the caller, and
the owner query itself is a data-schemas method, `getFirstOwnerIdsByResource`, beside the
`OWNER_ACL_PERMISSION_BITS` the marketplace's author sort already resolves against. The
aggregation casts stringified ids, because `$match` does no schema casting and a caller
outside data-schemas has no Mongoose ObjectId to hand it.
A restored or shared `/agents?mine=1` carries no path category, so it resolved to
`promoted` and answered the caller's own agents with the near-always-empty
promoted-and-mine intersection; turning the same filter on from Top Picks navigates to
`/agents/all`. It now defaults to `all` whenever the filter is on, so both routes to the
intent agree.
The conversation-starter buttons dropped their hard-coded `rounded-xl`, so they take the
shared `Button`'s shape like the dialog's other controls instead of mixing two.
`e2e/specs/mock/scenarios/` carries one tagged Playwright test per acceptance scenario:
sorting and paging, the mine filter and its link, failure recovery, and the card-to-dialog
morph, its focus return, its single scrim and its radius.
* feat: Morph the Agent Description Word by Word and Retime the Whole Transition
The card clamps the description to three lines and the dialog shows all of it,
so handing the paragraph over as one block slid the card's wrapping into place
and then swapped it for the dialog's. Every word the card showed now travels
from where that paragraph wrapped it to where this one does, and the lines the
clamp hid fade in where they land. The words are written to directly through CSS
transitions rather than re-rendered: a description is hundreds of independently
positioned spans, the compositor can carry them without a frame of JavaScript
each, and a transition can be interrupted mid-flight where a keyframe animation
restarts. Assistive technology still reads the copy once, from a flat string;
the spans are decoration and are hidden from it.
The identity block moved into the scroll region, the contact took the old
Pin/Copy Link corner, and those two controls moved next to Start Chat. Title and
description centre on the avatar while the copy is shorter than it, and top-align
once it outgrows it - pure CSS, no measurement.
Timings collapse onto one clock. A single ease-out-cubic and one open budget
drive the surface, the page dim, the identity fields and the words, so nothing
reads as a second animation that happens to have been started alongside the
first:
open 300ms surface, identity fields, dim
words 210ms (0.7 of the open: a word crosses a fraction of the box's
distance, and sliding copy cannot be read)
close 280ms 70ms handover, then a 210ms contraction
word return 70ms the whole handover; nothing else is moving on the way back
The close is two phases because the surface cannot contract until this dialog
unmounts and gives it back. Only the handover is spent with the box still, so it
stays short, and the dim now leaves on the click rather than on the unmount -
that is what answers the click while the geometry is still waiting. The dim
ramps linearly across each direction: an ease-out on an alpha spends two thirds
of its range in the first third of its time, and a scrim at 80% black already
looks black at half of it, so the page read as fully dim while the box was still
growing.
The words move and only move - no blur, no per-word delay, no scaling. A word
broken across two lines has no single box to fly from, so it is left to the
fade, and a paragraph showing different copy than the card (a background refresh
can land one) is refused outright rather than flying every word in from the
wrong place. Reopening inside the handover turns the words around instead of
leaving them parked in the card's wrapping.
* fix: Keep the Loaded Rows Mounted While the Marketplace Retries
A failure or an empty result was rendered in place of the list. With pages
already loaded that collapsed the list's scrollable height, so the browser
clamped the scroll position to the shorter document, and the remount that
followed a recovery ran the layout effect again and started the list at the
top: a transient cursor-page failure sent someone browsing deep in the
marketplace back to the first row.
The rows now stay mounted and the placeholder follows them, which also means
the end of the list stays reachable while a failure is held — so paging is
suspended until it clears, leaving the retry and its backoff to the error card
instead of re-requesting the page that just failed on the next scroll.
* test: State the Morph and Retry Scenarios as What the Reader Sees
Two scenario assertions described the implementation rather than the behaviour.
The detail-dialog description is now painted per word beside one screen-reader
copy of the same text, so matching the copy exactly resolved to both nodes. The
scenario asserts the paragraph that carries the description instead of counting
the nodes that spell it out.
The retry scenario pinned the scroll position to the pixel, which moves by
whatever the card rendered below the list occupies. It now anchors on the row
the reader had reached still being on screen, with the position staying deep
rather than clamped back to the first row.
* fix: Show the Retry Instead of a Skeleton, and Keep Cursors Readable
Two failures a marketplace reader could hit.
A held failure has no data of its own, so the retry that clears it made the
list pending again and filled the viewport with skeleton cards above the error
card. The card's status, countdown and action ended up below the fold, so the
recovery the card was reporting was the one thing not on screen. The skeleton
is now suppressed while a failure is held: the card owns the waiting state for
the request it describes.
The sort cursor carries `primary` and `secondary`, which an instance predating
sort modes cannot read - it reads `updatedAt` and `_id`, builds an Invalid Date
from their absence, and the query Mongo rejects surfaces as a 500 in the middle
of someone's scroll during a rolling deployment. Cursors now carry that pair as
well, describing the same row, so an older instance continues its own
updated-time ordering from where the page ended. The popular mode built its
cursor from a synthetic row, so it now carries the projected document instead.
* fix: Keep a Cursor Readable Only by a Server That Implements Its Order
Four review findings, and one rule behind three of them: state belongs to
whoever owns it, and a cursor belongs to the ordering it describes.
A sort cursor carried a legacy `updatedAt`/`_id` pair unconditionally, so an
older instance reached during a rolling deployment could parse a cursor from
`oldest`, `popular` or `author` and resume its own `updatedAt` walk from a
boundary row that ordering never produced - skipping agents and repeating
others. The pair is now emitted only for `recent`, whose `updatedAt` descending
plus `_id` ascending order is exactly what the legacy decoder implements. Every
other sort omits it and an old instance rejects the cursor outright, which is
the same argument the surrounding comment already made about not inventing a
date.
Marketplace avatars were refreshed from a separate newest-sorted query capped at
1,000 rows, run before the page the caller actually asked for. A user with more
accessible S3-backed agents than that cap saw broken avatars on every
`oldest`, `popular` or `author` page, and the 30-minute cache suppressed the
next attempt. The requested page is now queried first and its own uncovered
S3-backed rows are refreshed; the cache records which ids it covered, so an
entry written for one page no longer stands in for rows it never touched. The
selection, the cap and the cache merge live in `packages/api/src/agents`, with
the controller reduced to the call.
The detail dialog reached into `~/store` to clear the conversations a
multi-conversation session left open. That state is the app's, not the
marketplace's, so `MarketplaceProvider` performs the reset and the dialog asks
for it through the host context; the hook throws rather than defaulting to a
no-op, because a silent miss is the bug it exists to prevent.
With rows kept mounted, a failed background or cursor page put its retry card at
the end of a list several viewports tall - a marketplace that had quietly
stopped loading looked healthy. The card is now pinned to the bottom of the
scroll frame while rows exist, so its status, countdown, retry and reload link
are on screen wherever the reader is; with no rows there is nothing to pin it
over and it remains the whole of the page.
Two findings are rejected rather than patched. Popularity pagination recomputes
counts per request, so an agent that gains favourites mid-walk can cross above
the cursor and be missed; the walk is stable within a count, and backward drift
is deduplicated by the client. Making it exact requires a ranking snapshot, and
the favourites subdocument carries no per-favourite timestamp to snapshot from
(`packages/data-schemas/src/schema/user.ts:163-171`), so the fix is the
materialized counter tracked in berry-13/LibreChat#11; the guarantee is now
stated in the method instead of implied. Author sorting computes its key from
the ACL and user joins, so its cursor predicate cannot move ahead of them
without a stored sortable owner key - a schema change with a backfill, not a
pipeline reordering.
* docs: Track the Popularity Walk's Skipped Row as Its Own Issue\n\nThe method pointed only at the materialised-counter issue, which tracks the cost\nof recounting favourites per page. The row an upward drift drops from the rest of\nthe walk is a correctness problem that survives whether or not the cost is ever\naddressed, so it is tracked separately and the comment cites both: what can be\nmissed, and what pinning a ranking would take.
* fix: Let a Cursor Be Read by the Version That Implements Its Order
The previous round gated cursor *encoding* so only `recent` emits the legacy
`updatedAt`/`_id` pair, and left decoding rejecting it. That breaks the opposite
rollout direction: a page served by an older instance, followed by a request
reaching this one, produced an unreadable cursor, so the walk restarted at page
one - and `fetchAllAgentPages` concatenates without cycle detection, so
alternating instances can loop without finishing. Decoding now accepts the
legacy pair for `recent`, whose ordering this version implements, and still
rejects it for the sorts whose ordering it does not. The invariant is the same
one, read from the other side.
Refreshing a presigned avatar URL went through a timestamped update, so
maintenance advanced `updatedAt` - the sort key of the default walk - and an
agent below an active cursor could cross above it and vanish from the rest of
that walk. Avatar writes now go through `updateAgentAvatar`, which sets the
avatar alone with timestamps disabled.
The avatar orchestration the last round left in the controller - the
page-coverage cache decision, the refresh failure policy, the cache merge and
the persistence call - moved to `packages/api/src/agents/avatars.ts` with the
cache, the refresh and the update injected. The CJS controller holds the wiring
and one call.
On the client, the retry card was pinned to the bottom of the scroll frame and
rendered after the whole list, so it was visible but last in keyboard order:
`handleKeyDown` mounts and focuses each next card, so reaching Retry meant
traversing every loaded agent. It now renders before the rows and pins to the
top of the frame. A bottom pin cannot survive the move - sticky bottom only
holds an element whose flow position is below the viewport - so the pin
direction follows the DOM order rather than the reverse.
Two more from the same reading. `keepPreviousData` leaves the previous scope's
pages in `data` while a replacement loads or fails, and the failure branch
bypasses the pending guard, so a failed "My agents" request could render its
error over clickable agents from the scope the user had left; those rows are no
longer treated as current. And because a virtual row is keyed by its first
agent, a refetch that reorders the list unmounts the focused card: focus is now
restored to the same agent, and only when the unmount is what dropped it.
* fix: Make a Cursor Name Its Ordering, and Refuse the Ones It Cannot Honor
Third round on the same seam, so this stops patching it. A cursor now names the
ordering it was produced under, and is honored only by a reader that implements
that ordering; one that cannot be honored is an error rather than a silent
restart. `recent` keeps emitting the legacy `updatedAt`/`_id` pair, so old
instances still read its cursors, and a legacy-only payload counts as the
`recent` ordering: usable there, a mismatch everywhere else. Decoding reports
usable, ordering-mismatch or unreadable; `getListAgentsByAccess` raises instead
of paging from the start, and the controller answers 409
`{"error":"cursor_ordering_mismatch"}` through a mapper in `packages/api`.
That closes the direction this round found: a first page served by an old
instance for `sort=newest` produced a cursor this version rejected, and the
rejection fell back to page one, so the infinite query appended a second first
page - duplicated and out of order. The client now treats the 409 as "this walk
came from another ordering", drops the pages it holds and refetches from the
first page in the ordering the user asked for, once per request signature so a
mixed-version deployment cannot loop.
The author sort ordered by raw display name, so `Zoe` came before `alice` in a
list whose whole purpose is alphabetical. It sorts on a `$toLower` key now, and
the cursor carries that same normalized value - otherwise the ordering and the
pagination boundary disagree about where the page ended.
Avatar refresh coverage was a flat id list under one renewing TTL, so a page
refreshed at minute 0 stayed marked covered until minute 59 if another page was
refreshed at minute 29, and the set grew for the length of the walk. Coverage is
now a per-id deadline map: an id is covered only while its own deadline holds,
expired ids are dropped on read and write, the retained set is bounded with
nearest-expiry eviction, and the entry's TTL follows the furthest deadline it
still holds.
On the client, the retry card was pinned but in flow, so it displaced every
loaded row by its own height when a late page failed and put them back on
recovery. It sits in a zero-height sticky host now, keeping the three
constraints that pull against each other: first in keyboard order, visible at
any scroll position, and no layout space. Both of the traps that shape it are
written down - a flex child stretches to its container's cross size, so the
card's background collapses without `items-start`, and the stacking level has
to clear the cards' own click overlay.
An agent removed from the list while its dialog was open kept Pin, Copy Link,
the starters and Start Chat live, so Start Chat could navigate to a deleted
agent and Pin could persist a stale id. Absence from the loaded pages is not
proof of deletion - paging and sorting move rows out of the window - so the
captured id is revalidated against the per-agent endpoint, which enforces
access; only 403 and 404 mark it unavailable, the dialog says so, and its
actions go with it. A transient failure leaves the agent actionable.
* fix: Version an Ordering When Its Comparison Changes
Normalizing the author sort changed what "ordered by creator name" means while
still calling that ordering `author`, so the immediately previous
implementation would accept a cursor from this head and resume under
case-sensitive comparison: page one ending at `alice` let a later page skip
`Zoe`, which compares before the cursor under the old rules. The ordering
identity now carries a version alongside the mode - `author` at 2, everything
else at 1 - matched exactly on decode, with an absent version read as 1 so
cursors already in flight keep working for every mode whose semantics did not
change. The rule is written where the version lives and where it is encoded:
bump it when a comparison changes, or an older reader resumes a walk under
semantics that no longer exist. `popular` and `recent` were audited and left at
1; their comparisons are untouched.
A next-page request answering `cursor_ordering_mismatch` reset the walk
correctly, but the grid had already filed that error as a next-page failure,
and it clears those only when the replacement holds more pages than the prefix
it replaced. A restart yields exactly one page, so the error card stayed up over
a perfectly good first page, and its retry called `fetchNextPage`, which does
nothing when that page has no cursor. The query layer now reports the reset it
performed, and the grid drops the held failure when that reset's page-one
request succeeds. Ordinary failures keep the hold-until-success rule that stops
the card from remounting and resetting its own backoff on every attempt.
The dialog revalidates the selected agent when its row leaves the loaded
window, and that request is authoritative - but the dialog kept rendering the
snapshot it opened with, so a refresh that both edited an agent and moved it out
of the window left a stale description and stale starters on screen, and a
starter could launch with text the owner had replaced. It now prefers the row
the list holds, then the revalidated agent, and keeps the snapshot only for the
case neither can answer.
While that check was in flight the action controls were unmounted, so focus on
Pin, Copy Link, Start Chat or a starter fell to a detached element outside the
modal and was not restored afterwards. They stay mounted and are marked
`aria-disabled` for the duration, which is also why they are not natively
disabled: disabling the focused element blurs it, reaching the same bug by
another route. `CopyLink` takes that state and guards its activation, so the
control keeps focus, announces as disabled, and cannot copy a link to an agent
whose existence is still being checked.
* fix: Put a Bumped Ordering's Boundary Where an Old Reader Cannot Find It
Versioning the ordering identity only protects a reader that knows to look at
the version. An instance deployed before versioning existed ignores unknown
fields and reads `primary`/`secondary` straight out of the payload, so an
author cursor from this version - whose boundary is a lowercased name - was
still resumable under the case-sensitive comparison it replaced: page one
ending at `alice` let that reader skip `Zoe`.
An ordering past version 1 now nests its boundary under `boundary`. A reader
that predates versioning finds no boundary it recognizes and fails closed
instead of walking the wrong comparison, and a reader that knows about versions
knows where to look. Version 1 keeps the flat shape, which is what keeps every
cursor already in flight readable across a deployment, and `recent` keeps its
legacy pair. A flat boundary claiming a version past 1 did not come from this
encoder, so it is unreadable rather than trusted.
Verified against the running API: an author page emits
`{sort, version: 2, boundary: {primary, secondary}}` with no top-level boundary
fields, the next page continues it with no overlap, and both a flattened
boundary and a version-1 author cursor answer 409 `cursor_ordering_mismatch`.
* fix: Let an Author Cursor Carry the Key the Database Ordered By
The author sort orders on `authorSortKey`, the `$toLower` of the display name,
and the row handed to the encoder already carries that key. The encoder
lowercased it a second time in JavaScript, which normalizes what the database
does not: `$toLower` is defined over ASCII and leaves `Émile` (U+00C9)
uppercase, so the boundary was written as `émile` (U+00E9) and the next page's
`$match` skipped every key in between - `Üwe` (U+00DC) disappeared from the
walk entirely, with `has_more` false and an empty page to show for it.
The computed key is now serialized as it stands. The ordering's comparison is
untouched - `$sort` still reads the same `$toLower` key - so the version stays
at 2: a cursor already in flight from the previous head decodes to the same
boundary it did before and resumes the same walk, rather than being refused for
an ordering change that did not happen.
Reproduced and verified in `agent.spec.ts`: two agents whose contact names are
`Émile` and `Üwe`, paged one at a time, lost the second row before this change
and both pages now return their row; 231 tests in that suite pass.
* fix: Give the Recovery Card Its Own Band Instead of the Rows' Space
The retry card was a zero-height sticky host painted over the list, so whatever
it covered was still focusable with nothing to show for it: a focus ring under
an opaque card is no focus ring, and on a narrow viewport the card covers the
first row entirely. Reproduced across desktop light, desktop dark and mobile -
the focused card's box intersected the card's box at the top of the list and
again halfway down it.
The host now takes the card's own measured height, so the rows begin below the
band rather than under it, and the scroll position absorbs that reserve: someone
reading deep in the list keeps the row they were on, and at the top - where
there is nothing to absorb it with - the rows are what moves, which is the point.
`scroll-padding-top` covers keyboard navigation, so a Tab into a row the card
would cover scrolls it clear, and a row the reader had already scrolled past is
pulled out from under the card when it takes focus. Only the focused card moves;
the reader's scroll position is otherwise left alone.
The card's height is measured rather than assumed because it grows with its
status, its countdown and its eventual reload link, and the reserve follows it.
Verified on this head with a rebuilt client: `@scenario:focused-card-stays-visible-under-the-retry`
fails before this change and passes after it in all three projects, with
`@scenario:pagination-failure-keeps-the-loaded-rows` and
`@scenario:retry-keeps-the-error-card-on-screen` still passing beside it -
the rows, their height, the reader's place and keyboard order are unchanged.
`client/src/components/Agents`: 13 suites / 155 tests pass; `npx tsc --noEmit` clean.
* fix: Keep the Grid Under an Open Dialog, and the Author Boundary a String
Three findings on one head, two of them variants of the same rule - a recovery
state must not take away what the reader is using.
The pending-results branch replaced the whole grid with the loading skeleton,
and the grid is what owns the detail dialog and the element focus returns to. A
refresh with no data of its own - a reset cache, a revalidation after the rows
were dropped - therefore tore an open dialog down mid-flight. The skeleton is
now one of the placeholders the grid renders *inside* itself, beside the
recovery card and the empty state, so the host stays mounted and the dialog
survives its own results being refetched.
A scope change is different: the grid is keyed on the query scope, so a
debounced search or a restored history entry legitimately remounts the rows and
the dialog goes with the list it belonged to. What must not go with it is the
focus it held: the browser drops focus on `document.body`, so the next Tab
starts at the top of the page rather than at the marketplace. The panel takes
focus in exactly that case - focus already elsewhere, the search field being
typed in, is left alone, because only `body` means nobody holds it.
The dialog also read the revalidated agent as the whole agent, and the per-agent
VIEW response carries no `category` (`api/server/controllers/agents/v1.js`), so
an agent that moved out of the loaded window lost its badge. The revalidated
fields are laid over the captured row instead: fresh where the endpoint speaks,
captured where it is silent.
Last, an author cursor's boundary was coerced with `String()`, and coercion is
not validation: a missing or non-string `primary` became the ordinary key
`'undefined'` and resumed the walk partway through the alphabet instead of
answering 409. The date and number modes fail on their own casts; the string
mode now requires a string.
Each is pinned by a regression that fails on the parent commit: the dialog
surviving a refresh and the panel taking focus back
(`AgentGrid.integration.spec.tsx`), the category surviving revalidation
(`VirtualizedAgentGrid.test.tsx`), and four non-string author boundaries
answering `unreadable` (`agent.spec.ts`). `client/src/components/Agents`:
13 suites / 157 tests pass; `packages/data-schemas` `agent.spec.ts`: 232 tests
pass; `npx tsc --noEmit` clean in both workspaces.
* fix: Merge an Avatar Refresh Into the Entry That Is There, Not the One It Read
Every list page for one user reads the refresh entry before its list query, then
spends the S3 round trips of a whole page before writing back. Two pages in
flight together therefore merge into the same snapshot, and the later write drops
the coverage and refreshed URLs the other one added, so the next response that
contains those agents presigns and persists them again.
The merge now re-reads the entry immediately before the write, which narrows the
overlap to that gap instead of the whole refresh. A read that fails keeps the
caller's snapshot, leaving the previous behaviour in place rather than losing the
refresh that just succeeded.
* docs: Say Which Default the Sort Contract Actually Describes
Both the shared type and the grid prop claimed the server falls back to `newest`
when a request omits `sort`. It does not: `resolveMarketplaceListQuery` leaves an
absent or unknown mode undefined, and `getListAgentsByAccess` then serves
`recent`, the most-recently-edited order the agent selector and the mention menu
depend on. `newest` is the marketplace's default, which is why the grid sends it
explicitly.
The grid now names the constant the dropdown already exports instead of
repeating the literal, so the marketplace default has one definition.
* fix: Keep Rich Agent Descriptions Rendering After the Marketplace Rewrite
The rewrite replaced the card and detail views that `Description` had just been
wired into, so an agent whose description is markup lost it: the card printed the
tags as text and the dialog no longer rendered the links or images at all.
The card strips the copy with `getPlainDescription`, which is what it showed
before and what the word morph can measure, since that morph walks text nodes.
The dialog renders markup through `Description` again and hands the paragraph
over whole rather than word by word, because there are no words to measure in a
sanitized fragment. A plain description still morphs.
* fix: Answer a Marketplace Failure Without Taking Away What Is in Use
Twelve findings over three rounds, and most of them are one rule: a recovery
state must not remove what the reader is holding, and a lever the code invents
belongs to whoever runs the deployment.
Focus, three times. The effect that takes focus back after a scope change fired
on the initial marketplace mount as well, because a fresh navigation also leaves
`document.body` focused - so arriving at the page started reading below the
heading, the search field and the filters. It now compares the scope key against
the previous render and never acts on the first one. A successful Retry removes
the recovery card with the focused button inside it; focus moves to the results
panel first, and only when it was inside the card, so a reader who has moved on
is not yanked back. And when the access check settles 403/404, the dialog's
actions are removed under the same rule: focus goes to the status that explains
why they are gone, which is now programmatically focusable, rather than to the
document.
A dialog opened after the owner edited an agent used to keep the cached copy
while re-enabling its actions, so a conversation starter could launch a chat with
text that had already been replaced. Both selected-agent branches now lay the
revalidated fields over the captured row through one helper - fresh where the
per-agent response speaks, captured where it is silent, which is why it is a
merge and not a replacement.
Two operator levers ship as configuration, each defaulting to today's behaviour:
`endpoints.agents.avatarRefresh.coverageLimit` for how many per-agent S3 refresh
deadlines one user's pages remember, and `interface.marketplace.retryDelaysMs`
for the recovery cadence - an empty sequence leaves only the manual Retry, which
is why the reload affordance goes with it. That closes berry-13/LibreChat#24,
which had deferred the retry policy.
The avatar path also stopped losing work and stopped overwriting owners. Two
pages refreshing the same user's avatars both read before either wrote, so the
later write dropped the other's coverage and both pages re-signed inside the
advertised window; merges for one key are serialized, with the re-read left in
the critical section because that is what makes separate processes converge. A
rejecting cache write used to discard URLs that had been signed successfully and
answer with the expired paths; it is best-effort now. And a viewer's in-flight
refresh could land after the owner replaced that avatar: `updateAgentAvatar`
takes the avatar the caller read and only writes while the stored one still
matches, with the skipped agent's stale URL left out of the response.
Two smaller ones. A malformed `popular` cursor carrying `-1` or `1.5` passed
validation and walked an incomplete or duplicated page instead of answering 409;
counts are discrete, so the boundary must be a non-negative integer. And a rich
description rendered inside the paragraph the plain text morphs in, which is
invalid nesting once the sanitized markup carries blocks of its own - the rich
branch is a block, and both share one set of motion props.
Last, `attachAgentOwnerContacts` took a Mongo `$in` filter and a projection
string, which put the storage engine in `packages/api`'s public contract. It now
takes owner ids, and `findOwnerContactUsers` in `packages/data-schemas` owns the
query.
Every fix is pinned by a regression that fails on the parent commit. Locally:
`client/src/components/Agents` 13 suites / 170 tests, `packages/api`
`src/agents/{avatars,ownerContact}` 29 tests, `packages/data-schemas`
`{agent,user}.methods` 330 tests, `api/server/controllers/agents/v1` 146 tests;
`npx tsc --noEmit` clean in `client`, `packages/api`, `packages/data-schemas` and
`packages/data-provider`.
* fix: Hand Focus Back When a Removal Takes It, Not When a Retry Starts
Recovery moved focus at the moment the request went out, which is the wrong
event: a retry that fails again leaves the card on screen, so the reader lost the
button they were still using. Focus is only in danger when the thing holding it
is removed - and the DOM says so plainly, because the browser drops focus on
`document.body` in that commit.
The grid now watches for that: one effect recovers focus when a scope change
remounted the rows or a cleared failure removed the recovery card, and only while
nobody holds focus. The card's retry goes back to being just a retry, and the
recovery band is the measured wrapper again, its bottom gap included.
Two regressions in `AgentGrid.integration.spec.tsx` pin the distinction: focus
lands on the results when a successful retry removes the focused button, and
stays on the button when the attempt fails again - the latter fails on the
previous commit, which yanked focus to the panel while the card was still there.
`@scenario:recovery-hands-focus-back-to-the-results` states it in a real browser,
where focus after a removal is the browser's decision rather than jsdom's.
`client/src/components/Agents`: 13 suites / 171 tests pass; `npx tsc --noEmit`
clean in `client` and `e2e`.
* style: Declare the Serialization Test's Cache as the Constant It Is
The forward reference the mock cache needed while it was assembled in two steps
is gone, so `let` only tripped `prefer-const` in CI's ESLint lane.
* fix: Bind a Cached Avatar URL, a Joined Owner and a Morph's Styles to What They Describe
Four defects from one round, each in a subsystem this branch introduced, and each
the same shape: a value was keyed by the thing it was near rather than the thing
it was about.
A signed URL belongs to an avatar, not to an agent. Coverage keyed on the agent
id alone meant that when an owner replaced one S3 image with another, the viewer's
page was skipped as covered and the controller pasted the cached URL for the old
file over the freshly loaded path - so that viewer kept seeing a removed avatar
for the rest of the window, while the owner saw the new one. Entries now carry the
filepath they were signed for, coverage only counts while that filepath is still
the one on the row, and a refresh pass records what it checked. Entries written
before the binding existed cannot be checked, so they are treated as uncovered
and signed again rather than replayed.
An owner belongs to a tenant. The author sort joins `aclentries` and `users` with
`$lookup`, which does not run the models' tenant middleware, so a stale or
imported principal id resolved to another tenant's user and that name came back as
`owner_contact` - a name the ordinary resolver, which goes through tenant-scoped
methods, never returns. Both joins now match the agent's tenant, with missing and
null treated as the one tenantless scope this file already uses for favourite
counts.
`support_contact` is `Schema.Types.Mixed`, and `$ifNull` passes a number or an
object straight into `$trim`, which rejects it and fails the whole aggregation. A
single malformed legacy row therefore turned every author-sorted page in that
scope into a 500, while `attachAgentOwnerContacts` shrugged the same value off.
Every display operand is now checked for BSON string type first, which leaves the
tier logic unchanged because it already rejects the empty string as a name.
A compositor hint belongs to the animation that needed it. When revalidated copy
arrived mid-morph, the previous effect's cleanup cancelled the settle timer and
the same-phase guard returned before clearing anything, so every reused word kept
`will-change: transform` and its transition for the lifetime of the dialog. One
cleanup now clears the spans it owns on every path - a same-phase change, a phase
change, an unmount - and the refreshed copy arrives at rest instead of replaying
an opening morph.
Two further reports on this round are accepted rather than fixed, with the
reasoning on their threads: the coverage merge is serialized per key inside a
process and not across replicas, because a dropped merge costs signing work the
next page redoes and never a wrong URL - the comment that claimed convergence now
says so - and the rolling-deployment window where a parent-version server ignores
`sort` and `mine` is transient, read-only and self-correcting, while the capability
handshake its remedy needs does not exist in this platform.
Each fix is pinned by a regression that fails on the parent commit:
`refreshes covered agents when their avatar filepath changes` and two siblings in
`packages/api/src/agents/avatars.spec.ts`, `does not resolve an owner user from
another tenant during author sorting` and `tolerates non-string support contact
values while sorting and paging` in `packages/data-schemas`, and `clears word
animation styles when refreshed copy changes during the morph` in
`AgentDetailContent.spec.tsx`. Locally: `client/src/components/Agents` 13 suites /
172 tests, `packages/api` avatars 26, `packages/data-schemas` agent + documentdb
298, `api/server/controllers/agents/v1` 146; `npx tsc --noEmit` clean in `client`,
`packages/api` and `packages/data-schemas`.
* fix: Cover the Path the Refresh Wrote, and Keep Pin Focusable While It Saves
Two findings, both about state that moved on while something kept pointing at
where it used to be.
Coverage recorded the filepath a refresh *started* from, while the write that
followed stored the newly signed one. The next page therefore loaded a row whose
path no coverage entry named, so a successful re-sign guaranteed another
per-agent pass and another cache write inside the window it had just claimed -
the opposite of what coverage is for. Coverage now names the path that was
persisted, because that is what a later page reads, and the cached URL keeps the
path the page in hand still carries, because that is the row it applies to. The
merge no longer requires those two to agree: they are different questions, and
insisting they match is what dropped the freshly signed URL.
A refresh that found nothing to change writes nothing, so its coverage keeps the
path the row already had; that case is now stated as its own test rather than
standing in for the one above.
Pin stayed a control while it worked. Activating it from the keyboard used to set
`disabled` on the button that had focus, and a disabled control leaves focus
navigation, so focus fell to the document until the favourite mutation settled.
It keeps `aria-disabled` and `aria-busy` with a guarded handler instead - the same
shape Copy link, Start chat and the starters already use - so the reader stays on
the control they pressed and a second Enter cannot queue a duplicate toggle.
Both are pinned by regressions that fail on the parent commit: `covers the path
it persisted, so the row it wrote is not signed again` in
`packages/api/src/agents/avatars.spec.ts` (two signing calls where one is
correct), and `keeps focus on Pin while the favorite mutation is busy and ignores
repeated activation` in `AgentDetailContent.spec.tsx` (focus on the document, no
`aria-disabled`). Locally: `client/src/components/Agents` 13 suites / 173 tests,
`packages/api` avatars 27, `api/server/controllers/agents/v1` 146; `npx tsc
--noEmit` clean in `client` and `packages/api`.
* fix: Join the Author's Owner the Way DocumentDB Can, and Leave Retry Focusable
Two findings, and the first is a compatibility rule this branch already carries as
an invariant. Scoping the author joins to the tenant used `$lookup` with
`let`/`pipeline`, which Amazon DocumentDB 5.0 rejects — this repository records
that in `prompt.getPromptGroup.spec.ts` — so selecting Author on such a
deployment would have failed the aggregation and answered 500. The joins are
plain `localField`/`foreignField` again, and the tenant scope is applied to the
joined arrays with `$filter` afterwards: the same isolation, expressed in
operators that survive the target. `documentdb.spec.ts` now fails if either
marketplace lookup goes back to the correlated form, so the next person to reach
for it is told by a test rather than by production.
The shared retry control had the focus fault the pin control just lost.
Activating Retry sets `isRetrying`, whose native `disabled` drops the focused
button out of focus navigation; when that attempt fails the card stays mounted,
the grid's handoff never runs — it only fires when a cleared failure removes the
card — and the reader is left with focus nowhere, beside a card they cannot Tab
into. `RetryableError` keeps the button focusable with `aria-disabled`,
`aria-busy` and a guarded handler, same label, spinner and dimming as before.
The marketplace's existing assertion that the control is `disabled` while
retrying pinned the mechanism rather than the behaviour, so it now states what a
reader gets: busy, still focusable, and a second press that does nothing.
`@scenario:recovery-hands-focus-back-to-the-results` covers both outcomes in a
real browser — focus stays on Retry when the attempt fails, and moves to the
results when the success removes the card — because jsdom blurs neither and that
is exactly how this escaped.
Pinned by `keeps marketplace author lookups in the DocumentDB-compatible form`
and `flags a correlated $lookup let/pipeline form` in
`packages/data-schemas/src/methods/documentdb.spec.ts`, which report four
offending stages on the parent commit, and by `keeps the retry control focusable
and blocks a second activation while retrying` in
`packages/client/src/components/RetryableError.spec.tsx`. Locally:
`packages/data-schemas` agent + documentdb 300 tests, `packages/client`
components + hooks 292, `client/src/components/Agents` 13 suites / 173 tests;
`npx tsc --noEmit` clean in `client`, `packages/client`, `packages/data-schemas`
and `e2e`.
* test: Ask Where Focus Is, Not Which Box It Sits In
The failed-attempt half of the recovery focus scenario asserted that focus was
inside the card's `role="alert"`, which the retry control has never been in: the
alert is the icon, title and detail, and the actions are its sibling, so the
assertion described the DOM rather than the behaviour and failed on all three
projects.
It now asks the only question that matters - the control the reader pressed still
has focus - and lets whichever attempt lands next, theirs or the card's backoff,
be the removal that hands focus to the results.
* test: Count the Morph's Scrim by the Class Both Layers Carry
The base moved OGDialog's scrim from a literal `bg-black/80` to the
`surface-overlay` role, so the morph's backdrop follows it through the shared
constant. The scenario counted layers by the old literal and by black channels,
which after the move would have found no scrim at all, and could only ever have
caught a duplicate dim in the themes whose overlay is black.
It now counts the class the overlay and the morph's backdrop both carry, and
treats any full-viewport layer at alpha 0.3 or above as a second dim, so the
light theme's gray scrim is covered by the same assertion.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFLKexs5HyzqT6H8B9oQqJ
* fix: Keep the Avatar Cache Contract in packages/api, and the Grid Mounted
The list controller was reading the avatar cache entry itself: it checked that a
cached value carried both a filepath and a url, that the row still named S3, and
that the filepath still matched, then wrote the signed URL onto the row. That is
behaviour in a CJS file under /api, and it split the cache contract across two
layers, so a later change to the entry shape would have had to be made in both.
`applyCachedAvatarUrl` now owns that decision beside the code that writes the
entry, and the controller passes the entry through.
The grid was keyed on the active category. Its own scope key already carries the
category, so the key only forced a remount that the scope change was about to
handle anyway, and it took the open detail dialog and its focus-return target
with it. The replacement grid starts with an empty previousScopeKeyRef, so it
reads its first render as a mount rather than a scope change and never hands
focus back, leaving it on the document.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFLKexs5HyzqT6H8B9oQqJ
* fix: Supply the Marketplace Host From the Shell, and Order Two Keys by What Reads Them
The marketplace provider took the app's conversation reset from `~/store` itself.
Wrapping that in a context did not make it a host boundary, because the feature
was still the side reaching for shell state, and the feature could not have moved
to its own workspace without the conversation store coming along. The route now
builds the reset and passes it in, and the provider only carries it. The base did
not have this coupling; it arrived with the host context.
The favourites index led with `favorites.agentId`, a multikey field the popular
sort only ever tests for existence. With it first, the count could not seek into
the caller's tenant and scanned favourites across all of them, which is the work
proportional to the whole corpus that a page is supposed to avoid. Tenant first
bounds it.
The author aggregation compared ACL timestamps through raw field paths. The
resolver it has to agree with sorts the same three keys, where a missing field
reads as null, but a missing field path in a comparison expression is undefined,
which BSON orders below null. An imported entry that omitted `grantedAt` would
therefore win outright and hand the author page a different owner than every
other list order. The timestamps are now read through `$ifNull`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFLKexs5HyzqT6H8B9oQqJ
---------
Co-authored-by: hoangtrongthai-dtvn <thai.hoang2@dac-datatech.vn>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit
|
||
|
|
5c72d4146e
|
📱 fix: Fit the Tool Library and Skills Pickers to Small Screens (#16067)
* 📱 fix: Fit the Tool Library and Skills Pickers to Small Screens The Tool Library dialog assumed a viewport wide enough for its 224px navigation rail: below `md` the rail took more than half of a 390px screen and the card grid was squeezed into the remainder. The rail is now `md`-only, and the same kind and view navigation renders as a horizontally scrollable chip row under the search field. Card and row actions were hover-only, so Configure, Favorite and Remove were unreachable on a touch screen. They stay hidden until hover only where hover exists (`@media (hover: hover)`), and are always visible otherwise. The Skills picker header put the create button, the filter field and the view radio on one row, where the field collapsed to 50px beside a `shrink-0` radio. The view radio and the create button now sit on the title row, the create button flush right, and the filter field owns the row below them. The dialogs fill the viewport below `md` and switch `vh` to `dvh`, so mobile browser chrome no longer cuts off the bottom of the panel. * ♿ fix: Gate Hidden Tool Actions on Touch, Not on Hover Hiding an action until hover has to ask whether a finger can reach it, and `(hover: hover)` does not answer that: on a 2-in-1 it is true because it describes the trackpad, while the touchscreen sits right next to it. Tool cards and tool rows gated their Configure, Favorite and Remove controls on that query, so a finger user of such a device saw no actions at all. `packages/client/tailwind.preset.cjs` already carries `touch` for this exact distinction, `(any-pointer: coarse)` rather than `(pointer: coarse)`. This adds its inverse, `no-touch`, and gates the hidden state on it, so the hide applies only where no coarse pointer exists at all and hover no longer takes part in the decision. * 📐 fix: Split the Skills Header Onto Two Rows Below md The Skills header put the create button, the filter field and the view radio on one row. The radio's segments are `whitespace-nowrap`, so the group never narrows below 261px, and the field — `flex-1`, basis 0 — absorbed the shortfall and measured 50px on a 390px screen. Below md the radio and the create button now take the first line, the create button flush right, and the field takes the second. From md the row is exactly what it was: create button, field, category, radio. One DOM order serves both through `order-*`, so the radio and the create button each exist once. * 🧷 fix: Let the Skills View Radio Wrap Instead of Clipping The three view segments carry `whitespace-nowrap` and `px-4`, so the group has a hard 261px minimum in English and more in longer locales. On a 360px phone that group and the 42px create button exceed the dialog, which is `overflow-hidden`, and the trailing option becomes unreachable. The group now uses the primitive's `wrap` variant and may shrink, so the segments flow onto a second row; at 390px they still occupy one. `wrap` reproduced `inset-y-1` by assuming the group had no vertical padding, so turning it on for a `p-1` group shrank the moving indicator by 8px and left it floating inside its segment. It now measures that padding from the first row's offset, which leaves an unpadded group's geometry unchanged. * 🧪 test: Cover the Small-Screen Tool Library and Skills Header Ten mock-harness scenarios for the behaviour this branch changes, one per acceptance scenario id, asserting rendered geometry and computed styles rather than class strings. The tool library file covers a phone viewport (the dialog fills it, the rail is gone, the chip row filters, and no card crosses the viewport edge — the 744px grid-column overflow), the action gate on all three pointer profiles (visible with a coarse pointer, hover-gated with a mouse, revealed by keyboard focus), the selected tool row, and the unchanged desktop rail. The skills file covers the two-row header below md, the wrapped view radio at 320 and 280 CSS px with every option inside the dialog and the indicator on its checked segment, and the single desktop row. * 🧪 test: Pin the Scenario Contexts and Settle Their Geometry The verifier runs every tagged test in three projects, one of which is a touch phone, so the mouse scenarios asserted a mouse on a device that reports a coarse pointer, and the desktop rail on a 412px screen. They now pin their own viewport and pointer instead of inheriting the project. Geometry and opacity were also read mid-animation: the dialog scales as it opens, which put its left edge at 1.5px rather than 0, and the actions fade over the shared motion duration, which caught keyboard focus at 0.84. Both now poll for the resting value. With nothing selected the skills section offers only the dashed empty-state card, whose accessible name carries the hint line, so the exact-name locator for Add skill never matched. * 📏 fix: Keep the Tool Library Shell and Its Body the Same Height Giving the shell an explicit `md:h-[88vh]` while the body kept its 840px ceiling let the two disagree: on a viewport taller than about 955px the difference became dead space below the catalog, 216px at 1280x1200, and below `md` the full-height sheet left 293px on a 744x1133 tablet. The body carries the height from `md` again, the way it did before this change, so the shell wraps it. Below `md` the shell stays the full-bleed sheet and the body is capped to the same `100dvh`, which it needs because its `h-full` resolves against a grid area sized to the whole catalog. Measured shell and body heights now agree exactly: 840 at 1280x1200, 757 at 1280x860, 1133 at 744x1133 and 844 at 390x844, with the catalog still scrolling inside its own container. * 🎯 fix: Keep the Search Field Clear of the Dialog Close Button `md:px-6` on the search row is a responsive variant, so it is emitted after the base utilities and reset the `pr-12` that reserves room for the close button: on desktop the row's right padding dropped from 48px to 24px and the field ran 16px underneath the button. It now sets only the left side at `md`. Measured gap between the field's right edge and the button: 8px at 1280x860 and at 390x844, with no vertical overlap. Asserted inside the phone-viewport and desktop-rail scenarios rather than as a new id, since it is the same surface. * ⌨️ fix: Read the Skills Header in Tab Order and Keep the Chip Row Draggable Two defects with the same shape: a control that the eye can reach and the keyboard or the mouse cannot. The Skills header used `order-*` to serve both layouts from one DOM order, which left tab order disagreeing with the visual order from `md`: focus went from the rightmost radio group back to the create button and then into the middle. The breakpoint now selects the DOM order instead, the way the marketplace dialog already selects its rail, so each layout reads in the order it renders. Every control is still built once, so there is one radio group and one create button at any width. The mobile chip row hid its scrollbar unconditionally. A narrow desktop window is below `md` as well, and there a wheel scrolls the page rather than the row, so Made by you and Favorites could not be reached with a mouse at all. The hiding is now gated on `touch`, the same `(any-pointer: coarse)` query the rest of this branch uses. Measured: desktop DOM order create, field, radio and mobile radio, create, field, each matching its layout; `scrollbar-width` resolves to `auto` in a 520px mouse window whose row overflows, and to `none` on a touch phone. * 👆 fix: Give the Touch Layout Touch Geometry Two findings with one cause: the coarse-pointer layout inherited the mouse layout's geometry after this branch changed what it shows and in what order. Card actions no longer fade out where a finger can reach them, but they are absolutely positioned over the card's content, so on touch they covered the last line of a three-line description for as long as the card was on screen - an overlap that used to be transient. The card now reserves a strip for them there, `touch:h-36` with `touch:pb-9` on the content, which keeps all three lines. The chip row is that layout's primary navigation and exists only where a finger is what reaches it, yet its chips were about 30px tall and its create control 32px, while the repository already exposes the 44px `theme-control-touch` size for this. Both now carry that floor through `touch:`, and the mouse layout keeps its compact sizing. Measured on a 390x844 touch profile: all eight chips 44px, the card 144px, and the description's box clear of the action cluster. Both are asserted in the phone-viewport and touch-action scenarios. |
||
|
|
0da30ed479
|
👆 style: Thumb-Sized Send Button on Touch Devices (#15979)
* 👆 fix: Thumb-Sized Send Button on Touch Devices
* fix: floor the submit target wherever touch is reachable, not only on a coarse primary pointer
---------
Co-authored-by: Lia <lia@librechat.ai>
|
||
|
|
8144574b43
|
♿ feat: High Contrast Light and Dark Appearance Modes (#15178)
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 / 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
* refactor: read status fill labels from the theme token Feature call sites paint the label on bg-surface-destructive, bg-surface-submit and the bg-status-*-strong fills with the raw text-white utility, while the shared Button, IconButton and Toast primitives already use text-text-on-status. The token exists so the label colour can differ per theme mode, and hard-coding white pins it. Point every call site at text-text-on-status, and compose DeleteIconButton onto the Button destructive variant rather than re-declaring the fill classes. Five call sites paired a status fill with the wrong token entirely (text-text-secondary, text-text-inverted) or used the non-strong hue as a solid fill; those move to the -strong fill with the on-status label. Tooltip.css and the app stylesheet copy of the same rule read colour from --text-primary instead of literal black and white, and the dead outline: var(--bg-surface-hover) in Dropdown.css becomes a real 2px token outline, since that variable is not declared anywhere and the focus ring never rendered. --text-on-status is 255 255 255 in both shipped themes, so this is a no-op for the light and dark palettes. * feat: add high contrast light and dark appearance modes Adds two appearance modes to the theme setting for users who need more than the standard palettes, plus contrast resolution for the system mode. The palettes are complete IThemeRGB maps rather than partial overrides, because a token left to fall back to defaultTheme or darkTheme would reintroduce a mid-grey the mode exists to eliminate. They resolve as a built-in ThemeDefinition that outranks a deployment's custom theme, since a contrast choice is an accessibility need rather than a branding preference. Text clears WCAG AAA on every surface it can render on, including the hover and active fills. Borders, rings and series marks clear the 3:1 non-text floor. Solid fills clear AAA against both their label and the page, which is what the per-mode text-on-status token buys: each mode paints its fills on the far side of its own canvas, dark fills under a white label on white and bright fills under a black label on black, so the two ratios coincide instead of pulling apart. The system mode now follows prefers-contrast the same way it already follows prefers-color-scheme, so a user who has switched on Increase contrast or Contrast themes gets the accessible palette without first finding this setting. isDark reports high-contrast-dark as dark; isHighContrast answers what the user picked, which is what the theme toggle preserves when it flips the scheme; resolvesToHighContrast answers whether the palette applies. The icon toggle keeps a contrast choice when it flips the scheme, and announces which of the four states it landed in. * feat: cover the non-tokenized chrome in high contrast The token layer reaches every IThemeRGB surface, but a good deal of the stylesheet predates it and holds literals the palette cannot move. Under html.high-contrast: The typography variable block is 32 hard-coded hex values, and message content carries prose dark:prose-invert, so the invert half is what dark mode reads. Both halves now resolve from tokens: prose links were 3.77:1 on a black canvas and 5.40:1 on a white one, and every rule and border in the set sat below the 3:1 non-text floor in one mode or the other. The highlight.js palette is raw hex and tops out at AA, worst cases 4.84:1 for dark attributes and 5.32:1 for the alpha-blended dark comment; these reuse the palette's own hues at AAA on each canvas. Focus perimeters go to 3px and read the ink token rather than literal black and white. Selection was left to UA system colours and is now an explicit inversion. Ring opacity is pinned at full strength for the controls that halve their own. Popover and tooltip elevation trades a black shadow, which separates against nothing on a black surface, for a token border. Prose links carry an underline so they are not distinguished by colour alone. The switch track, the scrollbar thumb and track, the markdown structure borders and the body background that .dark pins to #212121 all move onto tokens. * feat: draw panel and dialog edges in high contrast Adds a high-contrast: Tailwind variant to the shared preset, so styling can be scoped to the contrast modes the way dark: is scoped to the dark class. Deliberately not named contrast-more, which Tailwind already ships as the raw prefers-contrast media query: this follows the resolved app mode, so it covers an explicit choice as well as the OS preference. Two surfaces rely on a colour step that high contrast removes. The sidebar's right edge is a resize separator that is transparent until hovered, which is fine where surface-primary-alt carries the boundary but leaves no edge at all when both sides are the same pure white or black. Dialogs are borderless and lean on a black shadow, which separates against nothing on a black canvas. Both now draw a real edge in the contrast modes only. The dialog change sits in the Radix content primitives and the two shared templates so the feature dialogs inherit it, plus the settings panel, which is Headless UI and bypasses them. OGDialogTemplate carries border-none, so the variant restores the border style as well as the width. * fix: address PR review bot findings chatgpt-codex-connector: Move the syntax palette into semantic theme tokens. The highlight.js colours were raw hex in style.css, so a palette change had to be made twice and neither copy was covered by the registry's completeness check or any contrast test. They are eight rgb-syntax-* tokens now, declared across all four theme maps and consumed as CSS variables, which lets the whole high-contrast block for highlight.js go away. Two guardrails come with them: the contrast modes assert AAA for every syntax role on the code surface, and the stylesheet is pinned to the runtime themes with no hard-coded hex allowed in an .hljs rule. Two values could not be carried over literally: the dark comment and meta colours were alpha-blended whites, so they are stored as the flattened equivalents over the #212121 code surface. Everything else, including the dark code text, renders byte-identical to before. Declare Tailwind as a preset dependency. The preset ships as a raw file through the ./tailwind-preset export while tailwindcss is only a devDependency, so require('tailwindcss/plugin') could fail to resolve for a consumer under pnpm or Yarn PnP. Dropped the require instead of adding a peer dependency, since Tailwind accepts a plain function in plugins and the wrapper only adds option handling this variant does not use. Route remaining solid controls through semantic status roles. The assistant builder kept bg-red-600/bg-red-700 and bg-green-500 with text-white, which the built-in palette cannot reach, leaving them below the mode's contract at roughly 2.28:1 for the green controls. All five now use the destructive and submit surfaces with the on-status label, and the two that also suppressed their focus ring get a semantic one. * fix: address second round of PR review bot findings chatgpt-codex-connector: Migrate the builder submit to semantic status colors. AssistantPanel's submit button kept btn-primary, which hardcodes #10a37f and white in style.css, alongside a raw green hover and focus border. It uses the submit surface with the on-status label now, and drops btn-primary rather than fighting its specificity. Left .btn-primary itself alone: restyling every primary button in the app is not this PR's business. Give provider avatars contrast-safe brand colors. The white glyph sat at 2.30:1 on OpenAI green, 2.45:1 on Anthropic tan and 3.41:1 on GPT-4 purple. brands was a single theme-wide set, and a brand fill has to carry a glyph and stand out from the canvas, both of which flip between modes, so one set cannot serve both at enhanced contrast. ThemeModeDefinition takes an optional brands block now, resolved after the theme-wide set, and high contrast declares dark tints under a white glyph for light and bright tints under a black glyph for dark. Worst pair is 8.76:1 for both the glyph and the silhouette, with provider hues still recognisable. Brand validation is shared between the two levels rather than duplicated. Raise active-surface contrast against the canvas. The active fills sat at 1.48:1 and 1.98:1 on white, 1.93:1 and 2.91:1 on black, and since every ink token collapses to one colour here, dozens of call sites were left conveying the selected state with a sub-3:1 fill alone. The fills now clear 1.4.11 at 3.14:1 to 4.29:1. That costs the AAA label on those two fills, and the trade is unavoidable: above the luminance where a fill clears the 3:1 state floor, its own label cannot reach 7:1, and below it the state disappears. No integer grey satisfies both. 1.4.11 is Level AA and 1.4.6 is Level AAA, so the state wins and the labels land at 4.89:1 to 6.69:1. The spec now separates canvas and hover surfaces, which keep AAA, from the active fills, which assert the state floor and an AA label. * fix: address third round of PR review bot findings chatgpt-codex-connector: Drop the overriding btn-primary class from Select. My previous round assumed Tailwind utilities would win here by source order; they do not. In the built stylesheet .btn-primary sits at byte 136886 and .bg-surface-submit at 69233, equal specificity, so the hardcoded green won and that button had never followed the palette. Removed btn-primary, the same way as the submit button beside it. Preserve contrast mode when theming Mermaid output. isDark collapses a contrast mode onto the same boolean, so the cache key was unchanged across light to high-contrast light and an already-rendered diagram survived the switch untouched. Both diagram paths take the resolved contrast now: the cache key gains a suffix, and the config carries themeVariables built from the contrast palette, since Mermaid's own neutral and dark themes hold a palette no theme token can reach. Diagrams render on the canvas with ink nodes, ink edges and ink labels, which is 21:1 for every mark and label. Artifact diagrams go through the same helper: getMermaidFiles takes the flag, switches the generated document to Mermaid's base theme, which is the only built-in that honours themeVariables, and paints the page with the contrast canvas instead of the fixed #212121 or #FFFFFF. The helper returns undefined outside the contrast modes, so standard themes keep their current rendering exactly. * fix: publish resolved contrast through theme context chatgpt-codex-connector: notify consumers when system contrast changes. Under `system` the contrast comes from a media query, so `theme` stays `system` when the OS preference flips and React has nothing to rerender on. The listener I added last round only touched the root element, which is enough for CSS but not for anything computing from the resolved value: the Mermaid cache key and the artifact files would have kept the old palette while the rest of the app switched. ThemeContext exposes `highContrast` now, held as state and set wherever the mode is applied, which covers both an explicit choice and a media change. `useMermaid` and `useArtifactProps` read it from context instead of deriving it locally. `resolvesToHighContrast` stays exported as the predicate the provider itself resolves with. The existing media-change test now also asserts the context value moves, not just the class on the root, since the DOM assertion alone passed before this fix. * fix: publish the resolved scheme through theme context too chatgpt-codex-connector: publish resolved scheme changes through context. Same staleness as the contrast case, one field over. With the mode at `system` and contrast already on, an OS colour-scheme change reapplied the DOM palette but `setHighContrast(true)` was a no-op and `theme` stayed `system`, so no consumer rerendered and the diagram hooks kept the previous `isDark` result. This half predates the PR: those hooks derived the scheme from `theme` before it too, so a scheme flip under `system` has never reached them. ThemeContext exposes `resolvedMode` alongside `highContrast`, both set wherever the mode is applied. The two diagram hooks read the scheme from context instead of calling isDark themselves. The other isDark call sites are left alone: none of them cache, so they recompute whenever something else rerenders them, and sweeping every consumer onto the context value is a wider change than this PR should carry. * fix: address sixth round of PR review bot findings chatgpt-codex-connector: Restore a visible focus cue for dropdown options. `.select-item` blanks its own outline with `outline: none !important`, so the contrast focus rule never landed and the navigated option was marked only by a surface-hover fill at 1.48:1 on white and 1.93:1 on black. Hover stays deliberately soft in these palettes, since it is transient and can afford an AAA label, so the cue has to be a perimeter: a 3px inset outline on the active and focused option, matching the !important it has to beat. Verified with real keyboard navigation that the outline resolves to the ink colour in both modes. Apply contrast tokens to artifact controls. getMermaidFiles took the contrast flag last round but still built its controls from the standard palettes, whose fixed greys leave the zoom label below AAA and whose 10%-alpha border and divider sit below the 3:1 non-text floor against a pure canvas. The controls now come from the same tokens as the diagram: canvas fill, ink border and label, the active surface for hover, and no shadow, since a black shadow separates against nothing there. * fix: ignore undefined brand overrides when resolving a theme chatgpt-codex-connector: ignore undefined mode brand overrides. Partial<IThemeBrands> lets a key be present with undefined, and the brand validator accepts it, so spreading a mode block over the inherited set could overwrite a brand with nothing. Colors survive this because mapColors skips undefined, but every brand token is written to the DOM unconditionally, so the avatar would have lost its fill instead of falling back the way a partial theme promises. Both spreads now drop undefined entries, which covers the theme-wide set as well as the mode block, and keeps ResolvedThemeDefinition.brands honest about being fully populated. * fix: address eighth round of PR review bot findings chatgpt-codex-connector: Guard media queries during server rendering. The state initializers I added read prefers-color-scheme and prefers-contrast synchronously during render, so a server-rendered provider threw before producing markup. That was a regression: nothing in the provider read a media query during render before. Both reads go through a helper that returns false without a window, the way the storage helpers already tolerate its absence, so the server renders the light palette with no contrast override and hydration applies the real values. The subscription effect is guarded too, which also covers a host that has no matchMedia at all. Keep Mermaid pie slices distinct in contrast mode. My own regression: the contrast variables set primaryColor, secondaryColor and tertiaryColor to the canvas, and mermaid derives pie1 through pie3 from those, so every slice collapsed into the background and into its neighbours. The pie slots come from the palette's series ramp now, which is the categorical scale already built to clear the mark floor on that canvas and stay separable under simulated deuteranopia. Twelve slots wrap over seven, as mermaid's own palettes do. Remove the raw white override from bookmark submit. The save button passed text-white into the shared submit variant, which tailwind-merge resolved in favour of the local class, leaving white on the bright submit fill at 1.40:1. Dropped the override so the variant's token applies. Preserve the high-contrast canvas in screenshot exports. The export chose between two fixed colours, so a contrast export was filled with #171717 instead of the mode's canvas. It reads the resolved canvas token now, with the old pair as the fallback. Theme markdown artifact previews in contrast modes. useArtifactProps forwarded the appearance only to the mermaid branch. getMarkdownFiles takes it now and appends a contrast block derived from the palette; being unconditional it also outranks the sheet's own prefers-color-scheme query, so an explicit contrast choice is honoured whatever the OS reports. * fix: migrate agent version controls to semantic status roles chatgpt-codex-connector: migrate agent-version controls to semantic status roles. The active-version marker and the Restore action used raw green fills with text-white, about 2.28:1 and 3.30:1, and the built-in palette cannot reach either. The marker takes the strong success fill with the on-status label, and Restore takes the submit surface, matching the assistant builder migration. Also finished the rest of that component's active-version treatment rather than leaving it half migrated: the card border and tint, the title, and the Current chip now use the success subtle, border and strong roles. The same indicator was expressing one state through both raw and semantic colour otherwise. ToolCard's native badge and selected tick were the same shape, raw emerald under white, so they move to the strong success fill too. Left alone: the HTTP method badges in ActionsTable/Columns.tsx, the tool-kind colours in items/icons.ts, and CategoryFilter's active border. Those are categorical identity rather than status, so mapping them onto status roles would be wrong; they need the treatment provider brands got, which is its own change. * fix: address tenth round of PR review bot findings chatgpt-codex-connector: Use opposing ink for pie-section labels. My own regression from the slice fix: the series ramp deliberately sits on the far side of the canvas so slices are visible, which makes the canvas ink the wrong colour for a label drawn inside one. Section labels take the on-status ink now, the same colour the palette uses for a label on any solid fill, while the title and legend keep the canvas ink because they are drawn on the canvas. Preserve the blue initializing status in standard themes. Also mine, from the first round: I moved this dot to bg-status-info-strong, and the strong info slot is a neutral grey in both standard palettes, so a blue indicator turned grey. Back on bg-status-info, with the pulse taking the on-status ink so it inverts with the fill rather than being a fixed white. Route action method badges through contrast tokens. I declined this last round as categorical identity rather than status; the reviewer's framing is better. The series ramp is precisely the home for categorical identity, it is contrast-checked per mode, and its slots are separable under simulated deuteranopia, so the verbs map onto it while staying close to their conventional colours. `delete` keeps a red by taking the error role, since destructive genuinely is a status. * fix: seed published theme values without reading a media query chatgpt-codex-connector: defer media-query resolution until after hydration. Guarding window stopped the crash but left the server and the first client render disagreeing: the server produced light and false while the client resolved the OS preferences during that same first render, so any child reading the published values hydrated against different context. Both are seeded from the mode string alone now. An explicit mode needs no query, so it publishes immediately and stays consistent with isDark; only system starts at the light palette with no contrast override, on both sides, and applyThemeMode publishes the resolved values from its effect after hydration. The pre-existing localStorage read in getInitialTheme has the same shape of problem for `theme` itself, but changing where the stored mode is read is a wider change than this and belongs on its own. * fix: address eleventh round of PR review bot findings chatgpt-codex-connector: - keep the active version timeline rail opaque so it clears the 3:1 mark floor in both high contrast modes instead of compositing to ~2:1 - balance the dark success fill (#088759) so the selected-tool marker, the timeline rail and the prompt-version chip keep a visible silhouette on the #212121 panel while the white label stays at WCAG AA - include the resolved scheme and contrast in the mermaid cache key even when a custom theme is supplied, so a contrast switch re-renders * fix: address twelfth round of PR review bot findings chatgpt-codex-connector: - select mermaid's base theme ahead of a caller-supplied theme in the contrast modes, after the config spread, so the contrast variables actually reach the diagram - ship the tooltip and popover contrast edges in the package stylesheets they belong to, so a consumer importing @librechat/client gets them * chore: sort imports in the theme registry, provider and specs * fix: override the markdown preview table header in contrast modes The appended contrast block answered the ink, the canvas and the cell borders but not the thead tint, so an explicit contrast choice on the opposite OS scheme left white text on #f6f8fa or black text on #161b22. The header now takes the palette canvas and reads through its bold cells and border, and a new guardrail asserts every colour the base sheet sets inside prefers-color-scheme is answered by the override. * fix: address thirteenth round of PR review bot findings chatgpt-codex-connector: - keep an OS-requested contrast when the scheme toggle runs under the system mode, by reading the resolved contrast rather than the stored appearance name - move the unchecked switch track into the theme token registry so the shared Switch keeps its track for consumers of @librechat/client, and drop the SPA-only high-contrast overrides it no longer needs * fix: address fourteenth round of PR review bot findings chatgpt-codex-connector: - migrate agent and assistant validation states off raw red utilities and onto the destructive text and border roles, so the messages, the field outlines and the required markers follow the contrast palettes - theme the file-source badges with series slots and the status label ink instead of fixed blue and yellow fills behind an alpha * fix: paint the loading canvas from the resolved appearance The bootstrap in index.html read the stored mode's scheme but not the OS contrast, so system plus prefers-contrast: more flashed the standard-dark #0d0d0d behind the pure-black palette for the whole application load. An unset mode also painted white on a dark OS, though getInitialTheme resolves it as system. Both branches now resolve the same way the theme provider does, and a new spec runs the shipped script to prove it. * fix: theme the markdown renderer failure message The notice painted when the marked CDN does not load carried an inline color:#e53e3e, the one colour the appended contrast block could not reach, leaving it at 4.13:1 on the high-contrast light canvas. It is a .markdown-error rule now, which the base sheet declares with the current red and the contrast block overrides with the palette's destructive ink. * fix: address PR review bot findings chatgpt-codex-connector: - Route shortcut, steer, warning, and help-link states through semantic theme roles. - Add contrast-safe Mermaid Gantt variables for task, status, section, grid, and label states. - Theme Mermaid artifact render failures with destructive text colors. - Apply native color-scheme behavior through ThemeProvider and restore host values. * fix: address follow-up PR review findings chatgpt-codex-connector: - Route conflicting shortcuts through the semantic warning border. - Give checked composer capabilities opaque semantic series borders. - Move search results and their fade onto the presentation token. - Restore a visible semantic focus ring on the virtualized results list. * fix: address third-round review findings * fix: address fourth-round review findings * fix: align accessibility theme after dev rebase * fix: address PR review bot findings chatgpt-codex-connector: - Route the steer and queue identities through semantic `status-warning` / `status-info` roles in `Chat/Steering/identity.ts`, so the receipt label, its pulse dot and every Zap/Clock mark move with the theme instead of staying pinned to amber-500/600 and cyan-500. Fixes the high-contrast light failures (3.19:1 label text, 1.97:1 and 2.43:1 marks) and the default light label, which was also below the 4.5:1 text floor. - Pair each Monaco theme with the canvas it paints in `ArtifactCodeEditor`, so the transparent `@monaco-editor/react` loading view no longer flashes the light `surface-code` fill before the `vs-dark` editor mounts outside high contrast. * fix: declare the new dev theme tokens in the high contrast palettes dev added rgb-text-muted and the two chart widget tokens after this branch last rebased. The high contrast palettes did not name them, so the widget canvas and muted text fell back to the standard themes' greys, which the palette coverage spec caught. Both modes now take the plain canvas, pure ink and a pure-ink edge, and the contrast tables cover the new tokens. * style: sort imports in the specs this branch touched The added imports put ArtifactCodeEditor, ShortcutRecorder and OptionToggle out of the repo's import order, which the static-checks import-sort gate rejected. * fix: address fifth-round review findings chatgpt-codex-connector: - Preserve the pressed treatment on a disabled OptionToggle, so a tool made programmatic-only keeps showing the Intent state aria-pressed still reports. - Expose high contrast from the auth appearance control: the scheme toggle preserves contrast but never introduces it, so a logged-out user had no way to reach the palette. Adds a contrast toggle beside it, and the scheme toggle now shows the scheme rather than duplicating the contrast glyph. - Resolve system contrast from prefers-contrast: custom and forced-colors: active as well as more, since a Windows Contrast Theme never reports more. Mirrored in the index.html loading bootstrap and the theme README. - Route the remaining raw palette utilities through theme roles: agent success checks (Action, AdvancedPanel, ToolSection) to status-success, the favorited tool star to series-4, the orchestration Beta pill to brand-purple, the temporary-composer accent to series-6, and the pending quote marks to status-info. - Override the legacy btn-neutral chrome in the contrast block, whose hard-coded edge and hover fill sat at 1.1:1 and 2.09:1 on the new canvases. Rebased onto dev. * fix: mark the selected tab and theme placeholder ink in contrast modes Two states rendered invisibly under the high contrast palettes, both verified in a browser before and after: - Radix tab triggers mark selection with `surface-tertiary`, which is the plain canvas here, so the selected Settings section computed to the same rgb(0 0 0) fill as every unselected sibling. Give it the same inset perimeter `.select-item` already uses for its navigated option. - Tailwind preflight paints `::placeholder` with the raw gray-400 #999696, and a field that omits a `placeholder:` utility inherits it: the Custom Instructions textarea measured 4.06:1 on the black canvas and 3.08:1 on the white one, both under the 1.4.3 floor for what is ordinary text. Route it through `text-secondary`, which is pure ink in both palettes. * fix: mark selection with a perimeter and lighten the contrast selected fills The selected fill was carrying WCAG 1.4.11 on its own, which forced it dark enough (#8c8c8c light, #5c5c5c dark) that its own label capped at 6.25:1 and 6.69:1 — under the AAA these modes exist for, and visibly heavy on the light canvas. The `.select-item` rule already showed the better answer: mark the state with a `text-primary` perimeter at 21:1 and let the fill stay light. Generalise that rule to the two families it missed — every other Ariakit menu, whose navigated row carried only a `surface-hover` fill at 1.48:1 on white, and any row painted with the selected-surface role — then lighten the fills behind it: #e3e3e3 / #d4d4d4 light and #2b2b2b / #3d3d3d dark, all four AAA under their label. `-alt` meets `surface-hover`, as it does in the standard palettes. Inline `span` is excluded so a highlighted citation passage is not boxed per wrapped fragment. The palette contract moves with it: `activeFills` is now held to an AAA label rather than to 3:1 against the canvas, which the perimeter discharges. * fix: address sixth-round review findings chatgpt-codex-connector: - Ship the selected-state contrast with the package. The lightened `surface-active` fills only work because a perimeter marks the selection, and that perimeter lived in the SPA stylesheet, which `tsdown` never publishes — so `TimePicker`, `SelectDropDown`, `MultiSelect`, `InputWithDropDown`, `Badge` and `DataTable` gave an external consumer a 1.28:1 fill and nothing else. The perimeters and the placeholder ink now live in `packages/client/src/theme/highContrast.css`, imported by `ThemeProvider`; `style.css` keeps only what is genuinely SPA-only. The Ariakit selector also widened from four menu roles to `[data-active-item]`, and picked up `[data-state='selected']` for package data-table rows. - Give Monaco selections a contrast-safe highlight: a focused selection now inverts the canvas (`text-primary` on `surface-primary`), matching `::selection`, because Monaco draws no perimeter. Weaker emphases share `surface-hover-alt` behind the ink find-match border. - Populate Mermaid's separate `git0`-`git7` branch palette from the series ramp. Eight slots against a seven-slot ramp, so the last takes the ink rather than repeating branch one; labels take the canvas, since the ramp sits on its far side. - Debounce the two appearance controls separately. They are independent settings, so light -> high-contrast dark is one flip of each, and the shared 500ms window swallowed the second click. - Route sharing principal badges (USER/GROUP/ROLE) through series-1/7/6. - Apply the selected contrast mode to Office artifacts. The backend document picks its palette from `prefers-color-scheme` alone, so an explicit mode inverted whenever the OS disagreed. `withOfficeContrast` re-declares its `:root` tokens and pins `color-scheme` from inside the head. * fix: address seventh-round review findings chatgpt-codex-connector: - Restore the citation highlight. The perimeter rule skips `span` so a wrapped passage is not boxed per fragment, which left the inline highlight on the lightened fill alone. It inverts now instead — the same treatment the mode gives `::selection`, 21:1 and with no geometry to wrap. - Underline non-prose links. The 1.4.1 rule only reached `.markdown` and `.prose`, so the auth resend actions and in-dialog help links were colour-only against ink that is under 3:1 from them. It now also covers the shared `text-link` role, including the ones rendered as a `button`, and moved to the package stylesheet since that role is shared. MCP server descriptions style their anchors through an `[&_a]` variant rather than a class of their own, so they get the underline at the call site — running text, so it applies in every theme, not just the contrast ones. - Route the selected tool card through `status-success` instead of `emerald-500/60` over a 6% fill, which composited to about 1.7:1 and left a selected card with a weaker edge than an unselected one. * fix: keep helper hints opaque in the contrast modes chatgpt-codex-connector: the `opacity-40` default-value hints composite pure ink to about #999 on the white canvas (2.85:1) and #666 on the black one (3.66:1), so small active labels missed even AA under a palette that contracts for AAA. They take `high-contrast:opacity-100` now — the variant this branch already added and `MessageNav` already uses — rather than a new token: every text role is the same pure ink in these palettes, so there is no muted colour to fall back to and the hierarchy is carried by size and the parentheses. The mobile artifact drag handle gets the same treatment: it is a control, so 1.4.11 applies, and a 40% ink bar does not clear 3:1. The two remaining `opacity-40` sites are left alone deliberately — `AssistantTool` dims a disabled row, which WCAG exempts, and the `MarketplaceCatalog` empty-state glyph is `aria-hidden` decoration. * style: sort imports in the two parameter controls this branch touched * fix: soften the temporary-chat accent outside the contrast modes Moving the accent to `series-6` swapped a 60%-alpha `violet-800` edge for a full-strength one, and series-6 is a saturated #7e23cd on the light palette and #ab68fe on the dark one — the composer read as a warning rather than a quiet mode hint. Half alpha in the standard palettes, opaque only under `high-contrast:`, which is the one place the edge has to clear the 3:1 non-text floor. |
||
|
|
c3a429ddcd
|
🎨 feat: Add Versioned Theme Foundation (#14709)
* 🎨 feat: Add Versioned Theme Foundation * 🧩 fix: Keep Theme-Aware Chip Actions Consistent * 🎛️ fix: Preserve Default Theme Geometry * 🪪 fix: Keep Theme Identity in Sync * 🧭 docs: Define Theme Styling Policy * 🧹 chore: Sort Theme Imports * 🧵 fix: Preserve Theme Compatibility Contracts * 🛡️ fix: Harden Theme Compatibility Boundaries * 🧵 fix: Publish Theme Appearance Preset * 🐳 fix: Include Theme Preset in Docker Build * 🪢 fix: Preserve Legacy Theme Compatibility * 🧭 fix: Harden Theme Lifecycle Boundaries * 🧱 fix: Align Theme Appearance Defaults * 🧬 fix: Record Persisted Theme Provenance * 🧭 fix: Preserve Theme Transition State * 🧷 fix: Preserve Legacy Theme Contracts |