mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-21 15:33:45 +00:00
231 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
491ea868da
|
🧩 feat: Ignore Unknown Theme Color Tokens Instead of Dropping the Theme (#16529) | ||
|
|
dd5fdf1ff4
|
🎛️ 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. |
||
|
|
bdfd3012ea
|
📏 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 |
||
|
|
4062bc3c00
|
🎒 feat: Carry Project Context Across Conversations (#15684)
* 🎒 feat: Carry Project Context Across Conversations
* fix: fail a project attach whose upload hold cannot be released and keep file deletes independent of project cleanup
- Attaching a project file now fails, with nothing attached, when the file's
temporary upload hold cannot be released, instead of attaching a file that
can still expire.
- A failed project cleanup after a file delete is logged rather than failing a
delete that already happened, and a user-wide delete clears that user's
project references without reading every file first.
- Both resize handles share the orientation-aware grip, so a primary handle in
a vertical group renders a rotated grip like the alternate one.
* fix: treat an empty tenant id as no tenant in the project file picker
* fix: attach nothing when a project file is deleted while the attach is in flight
* fix: localize project file association failures instead of showing server text
* test: expect a localized reason for a rejected project file association
* fix: scope project file listing to the caller's tenant and name the file limit when attaching an existing file
- Listing a project's attached files now returns not found when the project
belongs to another tenant, matching the available-file listing and the
chat context resolver.
- Choosing an existing file for a full project now names the project file
limit instead of the generic attach error, like the upload path.
* fix: treat an empty tenant id as no tenant in every project tenant check
A caller whose tenant id is an empty string was refused its own tenantless
project when listing attached or available files, because the handlers
compared '' with null. The project handlers and the chat context resolver now
share one comparison that treats an empty tenant id as no tenant, the rule the
project file queries already follow.
* test: wait for the workspace layout swap and the mobile drawer before acting in the long-metadata spec
The desktop title was measured while the phone layout could still be the one
rendered, and the sidebar row menu was opened before the mobile drawer
committed its open state, which closes a menu opened ahead of it. The spec
now waits for the workspace's phone-only sidebar toggle to leave and for the
drawer to drop inert, the same drawer signal the agents helpers use.
* fix: keep the agent context fingerprint of a turn outside any project unchanged
Every turn now passes a project context key into the agent context
fingerprint, and a turn outside any project passed the no-project sentinel,
which changed the digest of every existing no-project checkpoint. An agent
event conversation written before this change then cold-started and reloaded
its history on its next event. The fingerprint now hashes the no-project key
as absent, so those checkpoints keep matching.
* test: load the long-metadata spec at phone width before driving the mobile drawer
The spec crossed back from desktop to phone width without a reload, which
leaves the drawer on the desktop toggle path whose delayed focus handoff to
the close button dismissed the row menu roughly 200ms after it opened. The
spec now reloads at phone width, as a phone arrives, and waits for the
drawer's own focus handoff before opening the menu.
|
||
|
|
2f16e6b37b
|
🧽 fix: Paint Freed Feature Surfaces From Theme Roles (#16517)
* fix: Paint Tool Output Panes With the Code Body Role The output panes of code execution, file authoring and file reads painted surface-chat in light and surface-primary-alt in dark. surface-code-body is that same pair in the default, dark and high-contrast themes, and a theme that styles its code blocks now styles these panes with them. * fix: Draw the MCP OAuth Logo and QR Tiles From Fixed Roles The server logo tile and the QR backdrop were bg-white. They take surface-fixed and surface-qr, both white in every bundled theme, so a theme can own them without the QR losing its quiet zone. * fix: Give TextareaAutosize an Invalid State and Use It for Tool Arguments The tool-approval edit field flagged invalid JSON with border-red-500, a raw colour the primitive's owner rule rejects in any semantic form. TextareaAutosize now draws its border in border-destructive when aria-invalid is set, the attribute the Skills description fields already pass. ToolApproval sets aria-invalid and points aria-describedby at the Invalid JSON message, so a screen reader announces the error as well. * docs: Record the Image Preview, Artifact Scrollbar and Azure Chip Colours Adds the image preview's media overlays, the sandboxed artifact document's scrollbar and the Azure file-source gradient to the theme allowlist. * test: Cover the Tool Output Pane, Invalid Tool Arguments and OAuth QR Tile Scenarios for the code-body pane behind a file-authoring card, the announced invalid state of the tool-approval edit field, and the MCP OAuth QR backdrop staying white in both modes. * test: Retry the Output Pane Colour and Set Up the Approval and OAuth Scenarios at Desktop Size The pane is read with a retrying assertion against the resolved role, since the card re-renders as highlighting lands. The approval agent and the MCP Settings panel are reached through side panels the mobile layout keeps in its drawer, so those two scenarios run at desktop size on the mobile project. |
||
|
|
cf33a478f2
|
🗂️ 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. |
||
|
|
21cb1712f5
|
🎚️ 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. |
||
|
|
ccd9267262
|
📐 fix: Draw Controls at the Theme Control Radius (#16481)
* fix: Draw Controls at the Theme Control Radius Dropdown gains a shape prop in Button's vocabulary. Omitted, the trigger takes the theme control radius, which equals rounded-xl in the default theme, so the settings selects follow a theme's control corner instead of its dialog step. The marketplace sort and the prompts filter ask for shape="default" rather than overriding the radius locally. The settings nav tabs, the agent builder footer buttons and the builder action controls move from rounded-xl to the control radius. The Click UI drift guard now measures primitive color and shape parity against Click UI's component tokens and holds a floor per mode. * test: Choose the Theme per Navigation Instead of Stacking Init Scripts |
||
|
|
8ce9f58fd3
|
🧩 fix: Paint Panel Surfaces From Theme Roles (#16484)
* fix: Paint Panel Surfaces From Theme Roles The tool dialog's logo tile takes the fixed surface that logo tiles use elsewhere, and the skill image preview icon takes a series slot like the other categorical marks. The tools category filter drops a raw emerald border and shows its active state on the filter icon in the accent role instead; the label still names the active category. The avatar cropper's media hint and the SharePoint picker background are recorded in the theme allowlist. * test: Cover the Skills Category Filter's Active State * test: Match the Category Filter Trigger Exactly |
||
|
|
0b80ea5ebf
|
🫧 fix: Paint Chat Surfaces From Theme Roles (#16483)
* fix: Paint Chat Surfaces From Theme Roles The code window header and skill output panel stop repainting their surface-secondary container with a per-mode fill that matched it in every bundled theme, the drag-and-drop backdrop becomes the theme scrim, the OpenAI file-source chip takes the primary surface, and the banner drops a stopless dark gradient. ActionIcon, RetrievalIcon, WrenchIcon and the message ProgressCircle had no importers and carried fixed Lottie colours, so they are removed. The media, artwork and exported-document colours that stay fixed are recorded in the theme allowlist. * fix: Keep the Drag-and-Drop Backdrop Black Until Scrim Opacity Is a Role The theme scrim is gray in default light, so at the same alpha it dimmed the page less than the black backdrop it replaced. The backdrop keeps its original colour and the allowlist records the scrim-opacity role it waits on. * test: Cover the Code Window Header Showing Its Panel Surface * test: Exercise the Code Window Header Through a File-Authoring Card The mock code interpreter exposes bash_tool, whose card has its own header; a skill file created by the model opens the file-authoring card that renders CodeWindowHeader. * fix: Keep the OpenAI File-Source Chip's Dark Opacity The chip composites over the file's own preview, where surface-primary at 75% darkened it against the shipped black at 65%. It keeps its colours and joins the code-execution badge in the allowlist as a media overlay. |
||
|
|
681515c9e5
|
🔤 fix: Ship the Theme Font Faces With the Package (#16485)
* fix: ship the Inter, Roboto Mono and Inconsolata faces with the package Move the woff2 files from client/public/fonts into packages/client/src/theme/fonts and every @font-face rule (the app's Inter and Roboto Mono faces and client/src/fonts.css) into theme/fonts.css, which tokens.css imports and the build copies into dist with the files. Each url() names the file by a new @librechat/client/fonts/* export: a relative path breaks under Vite with @tailwindcss/postcss, because Vite inlines the import before Tailwind runs and Tailwind reports every emitted declaration as coming from the root stylesheet. The app loads the same files through the same import and still emits them to assets/fonts with their licences, now read from the package; the $fonts alias is gone. Inter and Roboto Mono gain their OFL texts beside Inconsolata's. The README's consumer stylesheet moves the package stylesheet import above @config, where Vite's inliner no longer skips it. The static checks' bundle freshness test reads a subpath pattern export as the directory it maps into. * docs: describe how the theme fonts resolve through the package export * fix: leave subpath pattern exports out of the bundle freshness check A pattern such as ./dist/fonts/* names no entry the design rules load, and reading it as its directory made the freshness check depend on a directory the synthetic build in suppression-baseline.spec.ts never dates. The scenario's mirror of the manifest reading skips patterns the same way. |
||
|
|
a50612f70f
|
🪞 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 |
||
|
|
75bb1899fc
|
test: Count Derived Scrim Tokens as Theme-Owned (#16512)
The stylesheet-ownership check added in #16480 required every declared color token to be a theme key of its own, so the scrim tokens from #16492, which compose the surface-overlay role with a scrim opacity role, failed it once both landed on canary. A token is now owned when a variable its value reads is one a theme can set. |
||
|
|
364bf27210
|
🖌️ fix: Apply Controlled Themes Before Paint and Theme Prose Links, Inline Code and QR Backdrops (#16480)
* fix: Apply controlled themes before paint and give prose links, inline code and QR backdrops theme roles ThemeProvider folds a controlled theme prop change into state during the render that delivers it and applies the theme in a layout effect, so a deployment theme, a shared link's theme and the viewer's own theme reach the root before the commit paints. Storage writes stay after the commit. Adds rgb-link-prose (link in light, primary text in dark, following a theme's own link) and registers rgb-surface-qr, and paints inline prose code with the surface-active-alt and surface-hover-alt roles. * test: Record the frames a controlled theme paints and the prose and QR roles |
||
|
|
f546dc2bee
|
🎨 fix: Draw Library Colours From Theme Roles and Record the Exceptions (#16482)
* fix: Draw Library Colours From Theme Roles and Record the Exceptions PixelCard resolves its variant palettes from theme channel variables when it lays out pixels, so the image generation placeholder follows the active theme in dark mode instead of drawing a fixed light slate palette. The SAML glyph and Codey mark take the text colour. The new theme/allowlist.md records every colour that deliberately sits outside the theme (brand marks, artwork, theme definitions, library elevation ink) and why. * fix: Repaint the Pixel Card When the Theme Changes The palette is read from theme variables when the pixels are laid out, so a mode switch or an applied theme left the previous theme's pixels on the canvas. The card now lays its pixels out again when the root's class or inline variables change. * fix: Keep the Pixel Card's Decorative Presets as Given The blue, yellow and pink presets have no theme role that reproduces them, so they keep their original palettes and are recorded in the allowlist; only the default palette, the one the app renders, reads theme roles. * test: Cover the SAML Glyph Following the Button Text Colour * fix: Lay the Pixel Card Out Again Only When Its Palette Changes The root's inline style also carries unrelated variables such as the scrollbar gutter and markdown font size, and relaying the pixels on every write blinked and replayed an in-progress card. The allowlist now states what it covers and where the skipped files are tracked. * test: Key the Pixel Card Palette Mock by Variable Name |
||
|
|
2d7133fcb1
|
🌫️ feat: Give the Dialog Scrims Theme-Owned Opacity Roles (#16492)
* feat: Give the Dialog Scrims Theme-Owned Opacity Roles The three dialog families carried their scrim alpha in each utility (bg-surface-overlay/80, /90, /65), so a theme could recolor a scrim but not set how much it dims. Add scrimOpacity, alertScrimOpacity and modalScrimOpacity, exposed as bg-scrim, bg-scrim-alert and bg-scrim-modal in the published tokens, defaulting to the 80%, 90% and 65% each family drew. ClickHouse takes Click UI's 0.75 from dialog.color.opaqueBackground, cited in the drift guard. A bundled scrim never lifts the page and, on a light canvas, separates the dialog by 3:1, which is why ClickHouse dark keeps a black overlay rather than Click UI's lighter gray. * test: Read the Dialog Scrim Through Its Role Class in the Morph and Settings Scenarios Both scenarios pinned the old bg-surface-overlay/80 literal: the morph counted elements carrying it and Settings compared its scrim with a probe of it, whose color-mix value serializes differently from the role's rgb(). They now use bg-scrim, the class DIALOG_SCRIM_CLASS exports. |
||
|
|
400e4549ca
|
🔤 feat: Give Display Type and the Type Scale Their Own Theme Roles (#16491)
* feat: Give Display Type and the Type Scale Their Own Theme Roles Add a displayFontFamily appearance role, which the dialog titles compose through font-display, and textXs..text2xl and leadingXs..leading2xl, which the app's text-* utilities now read like the radius and shadow scales. The defaults are Tailwind's own sizes and line heights and the UI family, so the default theme is unchanged, and a theme that names only its fontFamily keeps its headings in it. ClickHouse takes Click UI's display family, font sizes 1 to 6 and its 1.5 product line height, cited in the drift guard. Basier Square is named but not self-hosted: it is a commercial face, so browsers without it fall through to the Inter stack. * fix: Publish the Display Family Utility With the Theme Tokens * fix: Keep the ClickHouse 2xl Step Below the Unthemed 3xl Click UI has no size between 1.25rem and 2rem, and 2rem would overtake Tailwind's unthemed text-3xl (1.875rem), so a responsive text-2xl to sm:text-3xl heading shrank as the viewport grew. ClickHouse keeps LibreChat's 1.5rem for 2xl at Click UI's line height, recorded as a decision in the drift guard, and a registry test holds every bundled 2xl below 3xl. |
||
|
|
83d7afb0d1
|
🚦 feat: Give Pressed and Disabled States Their Own Theme Roles (#16487)
* feat: Give Pressed and Disabled States Their Own Theme Roles Add surface-pressed and surface-inverted-pressed, which IconButton takes while held under a hover. They default to the hover fills a pointer press has always shown, and a theme that names only its hovers presses in them, so the default theme is unchanged. Add surface-disabled, text-disabled and border-disabled, and a disabledStyle appearance role: dim keeps the half-opacity treatment, fill paints a disabled Checkbox, Switch, Field or IconButton in the disabled roles through the theme-disabled variant. The root mirrors the choice as data-theme-disabled. ClickHouse fills from Click UI's disabled and active tokens, cited in the drift guard. * fix: Ink Disabled Placeholders and Press the Submit Button in the State Roles * fix: Ignore Color Roles a Client Predates and Fill Every Disabled Composer Slot A cached client reading a newer server's inline theme rejected the whole definition over one color role it did not know. The client reader now ignores a well-formed rgb- role holding a triplet with a warning, as it already did for appearance keys; the server keeps rejecting unknown roles, where one is a typo in librechat.yaml. The disabled fill moves into composerSubmitClasses, so the plain send and stop buttons in Composer and DuringRunSendButton take it too. * fix: Share One Disabled Fill Recipe Across Every Shared Control Select, InputNumber, SecretInput, FilterInput and the Slider thumb only dimmed under a fill theme. The theme-disabled classes now live in one disabledFillClasses recipe that every shared control composes, and the variant also matches Radix's data-disabled so a disabled slider thumb takes the fill. The deployment-theme scenario for an invalid theme now serves a malformed color value, since a well-formed role the client predates is ignored rather than rejected. * fix: Fill a Disabled InputNumber Through Its Wrapper rc-input-number puts the component's classes on a wrapper around the disabled input, so the theme-disabled variant never matched it. Add a theme-disabled-within variant for a wrapper that contains a disabled control, and a disabledWithinFillClasses recipe InputNumber composes; the input inherits the ink and shows the fill through its transparent background. The default theme's disabled InputNumber is unchanged. * fix: Carry the Disabled Roles to Every Shared Disabled Surface Sweep every shared component that dims when disabled. Button-like controls (AlertDialog and Dialog footer buttons, DialogTemplate's select, the MultiSelect trigger) compose the fill recipe. Menu items, tabs and the send-actions rows keep their surface and take the ink through disabledInkClasses, as Click UI's genericMenu does, and Label and FilterInput's floating label follow their control through peerDisabledInkClasses. The variant also matches aria-disabled rows. OGDialogTemplate and Button stay with the open PR that owns them. * fix: Gray the Icons of Disabled Menu Rows Under a Fill Theme A send-action or menu row's icon owns its color (text-status-warning, text-text-secondary), so the inherited disabled ink left it bright. The item ink recipe now recolors descendant icons too. * fix: Fill the Dropdown Trigger and the OTP Group Under a Fill Theme The default Dropdown trigger only dimmed, and its disabled:hover resets tied with the fill; the shared recipe now pins the disabled hover fill and ink too, and the trigger composes it. InputOTP dims its group with has-[:disabled], so it takes the wrapper recipe. * fix: Reach Child-Owned Ink and Slot Edges in the Disabled Recipes A disabled control's own children, the SelectDropDown labels or a checkbox glyph, kept their explicit ink, and a disabled OTP group's slots kept their border. The fill and item recipes now carry the disabled ink to descendants, the wrapper recipe carries the disabled edge and ink to the group's parts, and SelectDropDown composes the fill recipe. * test: Probe Disabled Row Icons With the Recipe's Descendant Selector * fix: Give Radio Segments, SecretInput Actions and DropdownPopup Items the Disabled Ink These three dim their disabled state through a JS branch or Ariakit's aria-disabled rather than a disabled: utility, so the earlier sweep missed them. Each composes the item ink recipe, whose opacity reset outranks the branch's opacity-50. |
||
|
|
7a99b5cef7
|
🎯 feat: Give Keyboard Focus Its Own Theme Roles (#16478)
* feat: Give Keyboard Focus Its Own Theme Roles Add rgb-focus-outline for the app-wide keyboard focus outline and rgb-focus-control for the shared primitives' focus ring. The defaults reproduce the default theme exactly: a black and white outline, and primitive rings in the primary text ink. A theme that names only rgb-ring-primary keeps drawing its outline in that ring, and one that names only rgb-text-primary keeps ringing its controls in that ink, so the data-theme-ring marker is no longer needed. ClickHouse sets both roles to Click UI outline.default, cited in the drift guard. Every bundled palette holds both roles at 3:1 on its canvases. Button keeps its ring until the open PR that owns it lands. * test: Read the Opaque Ring Layer in the Focus Ring Probe * fix: Draw the Popover Focus Outline in the Control Focus Role |
||
|
|
6ec919e67e
|
🎨 fix: Fall Back From an Invalid Theme in librechat.yaml Instead of Exiting (#16462)
* fix: Fall Back From an Invalid interface.theme Instead of Exiting A mistake in interface.theme failed the whole librechat.yaml and stopped the server. The loader now checks the theme with the rules the client applies before painting it, drops a theme the client would reject with a warning naming each problem by path, and loads the rest of the config. Unknown appearance tokens only warn, matching the reader. Startup and reload behave the same. The token lists and the validator move to librechat-data-provider so the client registry and the server check against one list. * fix: Reject Unknown Bundled Theme Names at Config Load A misspelled bundled name such as clickhous passed the server and was rejected only in the browser. The bundled names now live in librechat-data-provider; the client's theme map is typed against that list and the loader drops a name outside it with a warning. |
||
|
|
7a30d2f08c
|
🧭 test: Pin the ClickHouse Theme to Click UI and Route Focus Through the Ring (#16461)
* test: Pin the ClickHouse Theme to a Click UI v0.12.0 Snapshot Add clickui.json, the Click UI v0.12.0 tokens the ClickHouse theme cites, and a drift guard that matches every color, radius, font, shadow and motion value to its token, naming both on a mismatch. Correct the citations that did not resolve, set shadow2xs, motionNormal and the light code text from Click UI, and document the dark scrim as a deliberate deviation. Draw the global keyboard focus outline in ring-primary under any theme definition, keeping the default theme's black and white outline and the high-contrast rule unchanged. * test: Anchor the Focus Probe Tab on a Focused Sentinel Tab moves on from the previously focused element after a blur, so it never reached the prepended probe. Focus a sentinel outside the tab order first. * test: Require Three RGB Channels in the Click UI Drift Guard A truncated theme triplet such as '0 138' matched a source whose leading channels agreed. Compare only complete, finite triplets. * fix: Follow the Theme Ring Only When the Theme Names One A theme that leaves rgb-ring-primary to the default resolves it to #595959, which a dark surface carries at about 2.3:1. The provider now marks the root with data-theme-ring when the active mode names its ring, and the global focus outline follows the ring only under that mark; every other theme keeps the default black and white outline. Each e2e mode also gets its own page instead of relying on init-script order. |
||
|
|
f1d8d8ae9c
|
🧭 feat: Palette Show All Catalogs, MCP Status and Composer Polish (#16422) | ||
|
|
81e038972f | 🛶 chore: Include Latest Canary Features in Sync | ||
|
|
f568a4ba30
|
💬 refactor: ChatForm UI redesign with unified palette (#14473)
* 💬 refactor: ChatForm UI redesign with unified palette Replace the scattered composer controls (badge row, tools dropdown, attach menu, floating steer chips) with one system: a searchable palette with favourites, a composer bar holding active tools plus effort and speech controls, a tray staging files and manual context, and a queue rail that buffers messages while a reply is running. Collapses the 94 development and review-fix commits of PR #14473 into one commit so the branch could be rebased onto dev once; the upstream merge of this pull request is a squash merge either way. The pre-rebase history is kept locally at tag prerebase-backup (afde3e4b9a). * fix: finish the dev rebase of the composer redesign The rebase onto dev left four defects the merge itself produced, plus one review finding the branch had never answered: - ChatForm's `min-w-0` JSX comment lost its closing brace, so the file did not parse at all. - `useSteering` carried both dev's local draft consumer and the host-injected one under the same name; the host's `consumeDraft` owns the storage key autosave actually parked on, so the local copy is gone. - `useUploadOptions` kept dev's `awaitingAgentProvider` gate after the merge replaced the block that derived `isSavedAgent`; the predicate is back, from the same `isEphemeralAgentId` the shared allowance helper uses. - `MessagesView` still reserved a band for the in-flight steer overlay and read `steerOverlayHeightFamily`, which nothing writes now that pending steers render inside the streaming reply. The reservation is gone and `ScrollButton`'s lift is optional; composer panels keep standing the button down through `composerOverlayCountFamily`. - The aggregate MCP chip keyed on `mcp:pinned`, which a server literally named `pinned` also produces (`mcp:${serverName}`), so both entries shared one React key and one packing slot. It uses a key outside that namespace. Also drops the locale keys whose only consumers the redesign deleted, ports dev's extracted-text delivery path into `useAttachExisting` (every attach-existing surface routes through it now), repoints the mock e2e built-in helpers at the palette, and repairs test fixtures the merge left stale (a query mock that blanked agent metadata, a Jotai store mismatch, an ambiguous tray query, an ephemeral-agent fixture standing in for a saved one). * test: cover the composer redesign's acceptance scenarios end to end Twelve mock-harness scenarios, one `@scenario:` tagged test each, over the behaviours this change is accountable for: the single searchable palette (open, search, favourite across a reload, keyboard-only operation), the composer bar and tray (active tool chip, a staged file riding with the message, a per-turn thinking level that applies to the next turn only), the queue rail (Enter buffers during a run and drains after it, keyboard reorder changes the send order, the draft survives run completion), and the composer's portaled surfaces (Stop reaches the run from inside a portal, a pending tool approval in the bar resumes the run). Two contract scenarios are deliberately absent, with reasons: split-pane Stop isolation is not runtime-reachable because `ChatRoute` mounts one pane, and code-approval mode mid-run needs an attached stateful code environment the mock lab does not configure, so dev's `ChatForm.approvalMode` unit spec stays its coverage. * fix: make the composer's acceptance run and the whole client suite green The first verification run of the twelve scenarios passed six and failed six, and the full client jest suite (which CI runs sharded, unlike the diff-scoped local precheck) failed fourteen tests. One of each group was a real defect; the rest were queries and fixtures still aimed at surfaces the redesign replaced. Defects: - `useQueueDrain` held its send lock after a revealed queued turn settled, so the next server-owned row could never be selected. The reveal path now owns its own lock and releases it when the revealed turn clears. - `ChatForm` recomputed the during-run slot without `consumeComposer` in its dependency list, and still carried a landing flag the host prop replaced. Tests and lab: - The five `ChatForm.attachments` focus cases now drive the palette dialog and the tray's quote chips instead of the deleted attach menu and quote popup, with the same strict focus assertions; the harness gains the `main` landmark the palette portals into, and the touch fixture a complete `matchMedia`. - `Palette.spec` no longer closes a hoisted `jest.mock` factory over a later `const`; `useSteering.spec` follows dev's toast wording. - The six failing scenarios were repointed at what this lab actually renders: uploads go through the palette's local-computer row, the reasoning control needs `interface.parameters`, the queued-row contract is the row and its drain rather than a control the submit consumes, the palette's keyboard path uses a built-in the lab grants, the slow-reply wait uses the fixture's chunk marker, and the approval scenario selects its agent through the builder flow the passing approval specs use. * fix: close the eight findings Codex raised on the rebased head Codex reviewed the rebased heads and reported eight issues; all eight were real. Two of them concern code this session added. Behaviour: - A custom or OpenRouter endpoint that declares neither `paramDefinitions` nor a `reasoningFormat` no longer gets a reasoning control inferred from the generic settings list. Capability now has to be declared (a reasoning-key parameter definition, a non-disabled `reasoningFormat`, or a known reasoning provider as the default params endpoint); a `disabled` format always resolves nothing, and every consumer — the composer control, the pre-send validation and the server — asks the same resolver, so a gateway backed by a non-reasoning model can no longer offer a level the turn would fail on. - Restoring a queued attachment keeps its `llmDeliveryPath`, so an extracted document is routed as its text rather than as raw provider content. - The placeholder-to-durable reasoning migration now requires this pane's own live submission, so opening another conversation from a new chat no longer carries the pending level into it. The created/sync case it was written for still carries. - The queue rail treats an acknowledged server-owned row as an ordering boundary: local rows still reorder among themselves, a server-owned row cannot move, and a move that would cross one is refused out loud — the queued-turn API has enqueue, list and cancel only, so a client-side reorder across that boundary could not be made authoritative. - The palette resolves an agent's skill scope with `resolveAgentSkillsScope` instead of treating an empty list as an open catalog, and the attach target resolves `useResponsesApi` with `resolveUseResponsesApi`, matching what the run will actually do. Policy: - The reasoning-override behaviour moved out of the CJS middleware into `packages/api/src/modelSpecs/reasoningOverride.ts`, which returns a discriminated result; the middleware is wiring again, and the behavioural cases moved with it. - `showComposerTips` and `showFilesDialog` are Jotai atoms now, the tips preference keeping its storage key and reaching the composer as a prop. * fix: make the redesigned composer reachable from the mock e2e helpers CI's Playwright shard failed four `file-provisioning` tests on this branch because the shared upload helpers still clicked `#attach-file-menu-button` and `#attach-file-button`, entry points the redesign removed — attaching now goes through the palette, which also owns the file input. Both helpers drive the palette now, `uploadViaLegacyOption` mapping its two destination names onto the palette rows that route to the code environment and the vector store, and the specs that drove the old surfaces directly (`code-upload`, `thread-renderers`, `unified-upload`) follow. Also closes the last client/server disagreement the acceptance run exposed: a custom endpoint that declares a reasoning key in `paramDefinitions` had that declaration merged into the provider defaults and then discarded by model-name inference, so the composer offered a level for `mock-model-a` that the server rejected with "Invalid reasoning override". An explicitly declared key now selects the merged setting before inference, while an undeclared generic custom or OpenRouter target still resolves nothing. The twelfth acceptance scenario is rescoped: a paused approval keeps the composer usable and resumes to completion, but the composer-hosted approval panel and chip are not asserted, because the pending action is keyed by the stream's conversation id while the composer stays bound to the new-chat sentinel — in code byte-identical to dev, and mirroring the write onto the sentinel did not surface the panel. Tracked at berry-13/LibreChat#39. * test: finish the acceptance run and keep the client typecheck green - The thinking scenario read `reasoningOverride` from a `userMessage` wrapper the chat request does not have; the trace shows the request carrying `{ key: 'effort', value: 'max' }` at the root, so the assertion reads it there. Source behaviour was already correct. - The approval scenario timed out on mobile because the Agent Builder drawer stayed open after selecting the agent and swallowed the pointer events meant for the composer; it now closes the sidebar and waits for the drawer to go inert before sending. - Two specs typed a named custom endpoint's label as an `EModelEndpoint`, which CI's client typecheck rejects (the label is exactly what the case is about). All twelve acceptance scenarios now pass in desktop light, desktop dark and mobile emulation. * fix: close the nine findings Codex raised on the verified head Two were defects in code this session added while closing earlier findings: - A reasoning key declared in `paramDefinitions` but absent from the generic settings list was accepted as capability and then never inserted, so the resolver exposed and validated the generic `reasoning_effort` instead. A declared key is now appended to the effective settings and resolved before any fallback, for `effort`, `thinkingLevel` and `thinkingBudget` alike. - The queue's reorder guard validated from the destination row's own index, so `target === index` rejected every pointer drag and only keyboard reordering worked. It validates the dragged row's identity now; the server-owned boundary, its announcement and the disabled grips are unchanged. The rest: - Stop no longer falls through to the document-wide control once a focused pane has been resolved: focus in an idle pane while another generates used to abort the other pane's run. - `PendingSteers` is mounted once in `MessagesView`, above the renderer switch, so a sent or failed steer keeps its in-flight, retry and send-as-new surface with `FLAT_THREAD` off, where the recursive renderer had none and the composer no longer carries a fallback. - The file-list policy moved out of the CJS route into `packages/api/src/files/list.ts`, and its cap is `interface`-level config (`fileListLimit`, default 100) instead of a literal in the route. - The steer-arm confirmation window is `interface.steerArmConfirmationTimeoutMs` with its current 10s as the default, travelling the same path as the other client-consumed timings. - The pause predicates judge the active branch's tail rather than the last assistant in array order, so an inactive sibling branch can no longer enable or disable the inline escalation control. * fix: move persisted reasoning validation into api package * fix: restore composer entry points and defaults * style: normalize reasoning helper formatting * test: open mobile sidebar before account menu * test: use settled sidebar layout for mobile account menu * test: handle empty mobile sidebar in account scenario * test: target account menu in mobile drawer * fix: keep composer surfaces and mobile drawer reachable * fix: let thread approvals receive pointer events * fix: stabilize composer steering and shortcuts * fix: commit queue drags and centralize file modal * fix: return a canceled steer's text to the composer Canceling a pending steer dropped the words the user had written: the bubble disappeared and nothing carried the text back, so a reclaim that the server confirmed still lost the message. Hand the reclaimed text to `pendingComposerTextByConvoId`, which the composer already drains on its first render, and append rather than overwrite when the composer holds a draft the user typed while the cancel request was in flight. * fix: close the six findings Codex raised on the pre-rebase head Pending steers keyed off the Recoil conversation id, which lags the route during warm-cache navigation, so the surface could sit at the destination thread's tail while its Cancel and Escalate acted on the source run. It now keys off the rendered tree, as the mount window already does. Arming a steer removes the control that was activated, dropping keyboard focus on the document body. `useSteerEscalate` already exposes `onArmed` for exactly that; the bubble now passes one that moves focus to the row's Cancel action. Opening the file manager from the account menu left its dialog with no opener: the modal rejects an active element inside a menu, and nothing supplied a fallback, so closing it returned focus to the body. The opener is published alongside the open flag and cleared on close, which keeps the shortcut path's composer-focus behaviour intact. A steer the server rejected was swept into the queue with no marking, and the run-end drain then sent those words as a fresh turn without the user touching Retry or Send as new. Converted failures now carry `needsExplicitSend`, which the drain skips the same way it skips a row the rail is mid-edit on. The queued-turn reconciliation window was a hard-coded 60s, unreachable by an operator behind a slow proxy or a delayed read replica. It ships as `interface.queuedTurnReconciliationTimeoutMs` with that value as default, beside the steer arm timeout it belongs with. Reasoning-override shape validation moved to `parseReasoningOverrideRequest` in packages/api, leaving the middleware to map a rejection onto its own error response. * fix: keep the composer's reasoning level in step with the parameters panel `stableConversation` memoized the conversation without any reasoning field in its key, so editing the level in the Parameters panel produced a new conversation object that every listed dependency ignored. The composer went on showing the old level while the next ordinary send already used the new one. * test: stop the sidebar helper waiting for a drawer desktop never renders `ensureSidebarOnScreen` measured `#mobile-drawer` whenever the sidebar had no Pinned region. Desktop renders no drawer, and `boundingBox()` on a locator that matches nothing waits for it, so every scenario that reached that branch at a desktop viewport timed out instead of continuing. Check for the drawer's absence rather than measuring it. * test: open the mobile drawer from its inert state, not its geometry A closed drawer stays mounted and keeps its layout box, so measuring the Pinned region reported it on screen while every control inside was still untappable. `inert` is the state the component actually sets when it closes, so the helper reads that and clicks the header opener before anything else measures. * fix: return a canceled steer whole, through one recovery boundary A steer that stops being a steer was handed back three different ways, and each one lost something. The immediate cancel wrote `steer.text` into the composer handoff atom, dropping the attachments, quoted excerpts, manual skill picks and reasoning override that `settleReclaimed` then deleted with the pending object. The cancel that won its race against its own POST cleared the pending marker and restored nothing at all, so those words disappeared. A definitively rejected steer could only be resent unchanged, because the row offering to edit it was gone. Give the recovery one boundary. `useSteerRehome` hands the whole steer to the composer through the guarded restore the queue rail already uses, and converts it into an ordinary queued follow-up when the composer refuses: a draft in the box, another chat on screen, a paused question, or a composer that unmounted while the reclaim was in flight. The chip goes either way, since a pending row claiming the server still holds the words is a lie once they live somewhere else. The composer is a sibling of the message list rather than its ancestor, so the thread had no way to reach that restore. The pane's host now holds the reference and both sides read it there, which also means a reclaim resolving after the composer is gone refuses instead of writing into a dead form. Because the restore refuses rather than overwrites, a draft typed while a cancel is in flight is no longer glued to the returned steer; the steer becomes its own queued message and the draft is left as typed. * test: drive the surfaces these scenarios actually reach Four scenarios were failing against surfaces the user never touches. The approval scenario clicked Approve on the thread's copy of the pending card. The composer's review panel floats over the tail of the thread and owns the batch submit, so that copy sits behind it and the click retried until the test timed out. Drive the panel instead; the thread card stays asserted as the record of the request. The palette scenario counted rows the moment the dialog painted, then expected clearing the filter to restore that number. The catalog arrives in waves: the MCP server list is released by the app-wide warmup timer and the skills catalog only starts fetching once the dialog's open effect has run, so the count kept climbing under the test. Wait for the last wave and for the count to hold still, then snapshot. The sidebar helper opened the mobile drawer twice through two signals that disagree. It waited for `inert` to clear, which happens on a state commit several frames ahead of the slide, then fell through to a bounding box still reading off-screen and clicked the opener again, into a machine already opening. One open, through `inert`, then wait for the drawer to settle in the viewport. Splitting the cancel scenario follows the recovery change: an empty composer takes the steer back, and a staged draft keeps the box while the steer becomes a queued message of its own. * fix: hold a server-rejected steer for an explicit send Editing a definitively failed steer falls back to the queue when the composer will not take it. Queued like any other follow-up, the run-end drain would send it the moment the reply finished, which turns the server's refusal into an automatic new turn carrying the payload it refused. Mark that fallback the way the rest of the rejected-steer path is marked, so the row waits for the user to send it. * test: restore two assertions this branch broke while rewriting specs Both specs were updated for the redesigned surfaces and both lost a step they needed, and both fail deterministically in CI as a result. thread-fold pressed Enter mid-run and waited for a queued row, under a comment claiming Enter queues by default. It does not: the default during-run action is steer, so Enter produced a pending steer and the queued row the next line waits for could never appear. Ctrl/Cmd+Enter is what takes the other action, which is the one this test needs. mcp-oauth-readiness asserted on the server card's Cancel button straight after clicking Connect. Connect opens the OAuth dialog over the panel, and it is modal, so while it is open the card underneath is marked aria-hidden and Cancel is not in the accessibility tree at all, which is why the failure reads "element(s) not found" rather than "not visible". The rewrite dropped the dismissal the previous flow performed; restore it as a helper both call sites share. * test: reach the account menu without the pinned section The two account-menu tests borrowed `ensureSidebarOnScreen`, which also settles the Pinned section's placement for the pinned specs. They never touch that region, and on a run where an earlier test left a pinned conversation the section exists but has not been laid out yet, so both tests spent fifteen seconds polling it and failed on the wait rather than on anything they assert. Give them a helper that does only what they need: open the mobile drawer from `inert`, the one signal that distinguishes a closed drawer from an open one while it stays mounted, then wait for the slide to reach the viewport. Desktop renders no drawer and needs nothing. * test: open the drawer by what it shows, not one early read The helper decided once, from a single read of `inert` taken right after navigation. On a fresh mobile load the drawer can still be mounting, so that read reports a state the app has not settled into, the helper returns believing the drawer is open, and the account menu inside it is never shown. Retry against the thing the caller actually needs, the account menu being visible, re-checking before each attempt. While the drawer is open its control is labelled "Close sidebar", so the retry cannot toggle it shut. * fix: keep the composer observing MCP authorization where its tools apply The old badge row mounted its provider with observeToolAuthorization set whenever the composer showed ephemeral tools, so on a plain endpoint the chat kept MCP connection status and discovered tools in the query cache. The redesigned composer mounts the same provider without the prop, so it defaults to off and nothing on the chat side loads that state any more. The Agent Builder's tool library reads that cache. With it empty, every server reads as Unknown with no tools, and clicking one opens its detail dialog offering to connect instead of adding it to the agent. Pass the same gate the badge row used: showTools is the old showEphemeralBadges expression. * test: let the palette close before reopening it, and name what is asserted enableBuiltinTool pressed Escape and returned while the palette was still animating out. A caller that reopened it straight away resumed the same popover, scroll offset included, so the Attach rows at the top sat outside the virtualized window and upload helpers timed out looking for them. Wait for the dialog to be gone before returning. The staged-file assertions matched the bare file name, which the palette now also lists under recent uploads while it closes; scope them to the tray they are about. The OAuth dialog dismissal waited for a title built from the server's display name, but the dialog is titled with the server name. * feat: make the queued-send lock expiry configurable The per-pane lock that stops the run-end drain and an explicit Send now from submitting the same queued message twice gives up a broken claim after a fixed 60 seconds. Until then every drain and every Send now for that pane is refused, and a deployment had no way to tune that window. Expose it as interface.queuedSendLockTimeoutMs beside the queued-turn reconciliation timeout, defaulting to the same 60 seconds so nothing changes unless an operator sets it. The interface loader copies each field explicitly, so the value is added there too; without that line a configured value would never reach the client. * fix: decline interrupt-and-steer while reasoning is staged With a reasoning choice staged, the Interrupt & steer row is disabled, but its keyboard chord still reached interruptSteer, which fell back to interruptAndSend: it aborted the run and threw away the partial answer the action promises to keep. A staged reasoning choice belongs to a new generation that a steer into the live one cannot carry, so decline the chord exactly as the row does, the same way the function already declines while paused on an approval. The words stay in the composer, where Enter queues them as a turn of their own. * fix: wake the queue drain when a late steer retry is queued Retry marks a failed steer sending, and a sending steer is kept out of the run-end sweep so its own POST settles it. When the run finishes while that POST is in flight, the drain spends its one-shot signal on a queue the steer is not in yet; the late ack or NO_ACTIVE_RUN then moves it into the queue, where it sat until the user sent it by hand or another run ended. Every other late conversion re-posts the last completed run end through the composer's rewakeDrain. The retry lives in the thread, so the composer now publishes that function through the same host it already uses to hand a reclaimed steer back to the draft, and the retry calls it after converting. It stays a no-op unless the run completed cleanly and no newer signal is armed, or when no composer is mounted. * fix: honour thinking-budget ranges wider than 200,000 The request-scoped reasoning override capped thinkingBudget at 200,000 in the shared schema. An operator's paramDefinitions may advertise a wider range, and the composer renders it, but every value above the cap was dropped by the control's parse and rejected by the server's before the range-aware check could run. That check already exists: resolveReasoningOverride validates the value against the endpoint's resolved range. Drop the fixed ceiling so the resolved range is the bound, keeping the integer and lower-bound rules. The new case covers both directions on a custom endpoint whose range goes to 500,000. * refactor: persist the preliminary reasoning override through the shared helper The agents controller validated the request's reasoning override with the schema itself before writing the preliminary user message. That is behavior in the CJS layer, and it duplicated resolvePersistedReasoningOverride, which @librechat/api already exports and BaseClient already uses for the same field. Call the helper instead. A preliminary message is always a fresh turn, so it is never an edit or a compaction. The two controller specs that replace @librechat/api with a hand-built mock now take the real helper. * fix: clear the file manager's state at the session boundary The file manager's open flag and its opener live in Jotai's default store, which outlives the authenticated route. A file manager left open at logout reopened for the next account, still holding a ref to the previous session's unmounted opener. Reset both in useClearStates, next to the other composer state this branch already clears there. * fix: decline interrupt-and-steer on the first turn while reasoning is staged * test: read the phone layout from the viewport and keep the drawer open * fix: name both reasons a queued message cannot be edited yet * test: reuse a published file through the composer palette * style: move the composer onto the design-system rules * style: move the file row's new layout styles into classes * fix: keep the composer's reused thumbnails, focus ring and disabled dimming intact * fix: bring a steer back when its deferred cancel does not remove it * fix: treat a run as over only when every pane holding it is idle * refactor: pass enter-to-send into the composer from its host * feat: make the palette's recent-file count configurable * fix: let a file already in the composer be reattached at the limit * test: hide the chip before replaying a deferred cancel * refactor: restore the resume request through one packages/api facade * fix: keep a conversation's staged reasoning across a visit to another model * fix: keep a connected MCP server's variables configurable from the palette * fix: resolve every pane-scoped shortcut through the pane holding focus * refactor: keep every reasoning-override decision out of the /api wiring * perf: skip paging the skill catalog for an agent that can show no skill * test: type the reasoning snapshot the override helper records * test: pin the applied budget and the untouched parameters in the override specs * style: give the stop button the send button's shared submit recipe * fix: name only the newline key when no chord sends * fix: name the stop key only once the stop control can act * fix: clear every staged reasoning selection at sign-out * fix: stop advertising send-now while staged reasoning forces a queue * fix: resolve the reasoning target of an ephemeral agent in the composer and the request * test: type the staged reasoning the sign-out spec seeds * fix: check the composer will take a queued row before discarding its parked copy * style: carry the composer's classes onto Tailwind v4 * style: sort the composer's classes in Tailwind v4 order * fix: return a refused queued row to the durable queue instead of memory * i18n: localize the whole attachment-limit message * refactor: validate the reasoning override inside the packages/api facade * style: give the composer's submit slot its own IconButton variant * test: pin the submit slot to IconButton's submit variant * test: stub the seen-state hook the rebased MessagesView now calls * fix: turn file search on for an embedded file attached through the shared hook * chore: record the composer's design-rule counts against the rebased base * fix: keep the composer's container query inert under Tailwind v4 * test: point the v4 focus scenarios at the redesigned composer's controls * fix: keep a re-queued row on its own lineage after the run ends * test: assert a re-queued row carries its lineage * refactor: pass the dictation preferences into the composer from its host * test: read the usage atom from the store the ask hook renders under * fix: read a pending steer's pause from its own pane's branch * a11y: keep focus on the quote chips until the last one is removed * fix: keep staged reasoning for the next message across a manual compaction * test: expect focus on the remaining quote chip after removing one of two * style: sort the imports the canary rebase merged * refactor: remove the side-panel files table the account menu replaced * fix: settle a retried steer's late ack against a racing cancel A cancel clicked while the retry POST was in flight left the optimistic marker unread: the ack re-minted a live chip and injected words the user had asked back, and a failed retry after that cancel lost them entirely, because the failure path maps chips the optimistic cancel had removed. The ack path now defers to the marker the way the composer's does, the failure path re-adds the chip before settling it, and the queued row a late ack produces binds its recovery identity only under protocol v2, the same default the composer's degradation path trusts. * fix: strip a replayed reasoning override that no longer validates on resume A paused turn's reasoning override is replayed onto its resume request and then validated as if it were fresh client input, so an operator changing the endpoint's reasoning config between pause and approve made the checkpoint permanently unresumable with a 400. The replay now marks the request, and a replayed override that fails validation is stripped so the resume proceeds on defaults; a fresh override that fails is still rejected. * refactor: derive the enforced spec fields inside the modelSpecs facade The set of keys an enforced model spec locks is the input contract of the reasoning-override refusal rule, and deriving it in the route middleware left the policy untestable from packages/api and free to diverge from the facade that owns the rest of the preset application. applyModelSpecPreset now returns the enforced fields beside the private ones it applies, and the middleware consumes them. * fix: restore the pre-override parameters when a resume degrades Stripping a replayed reasoning override that no longer validates removed only the metadata field, while the resume had already replayed the paused turn's model parameters with the override applied into the endpoint option, so the provider still received what validation had refused. The strip now inverts the application from the replayed base: the recorded pre-override value returns and the thinking flag the override forced on comes off. * fix: resolve the effective responses route for upload targets The attach target returned the conversation or agent's saved useResponsesApi flag, so an Azure chat auto-routed to the Responses API by responsesApiRouting preflighted its uploads against the chat completions route and lost provider-document uploads. The resolver now applies resolveEffectiveUseResponsesApi with the endpoint, model, web-search state and routing policy, the same resolution the during-run upload target makes. * fix: name the interrupt chord in the hint only while it still interrupts The during-run hint advertised Alt+Enter Interrupt & send even when the chord had been claimed: a submitMessage rebound to Alt+Enter, a chord yielded to a global shortcut, or shortcuts disabled altogether each make the keydown resolver return something else. The hint now reads the same resolver verdict the during-run send button does and omits the chord it no longer owns. * test: assert the unseen count the scenario adds rather than a zero baseline The tab title counts every unseen conversation, and a shared verification run leaves legitimately-unseen conversations from earlier scenarios behind, so the three title-count scenarios failed on other scenarios' leftovers instead of the behavior they seed. Each now reads its baseline and asserts the count it adds and clears. * test: hold the unseen count to its direction on the mobile project The away poll that lights a dot also discovers conversations the client had not counted yet, so on the mobile project the title count can jump past any baseline taken mid-test. Opening still has to clear this conversation's contribution and an away reply still has to raise the count, which is what the assertions now hold. * test: enable the MCP Apps server through the redesigned palette The MCP Apps integration spec still drove the old composer's MCP Servers menu, which the redesign replaced with toggleable rows in the attach-and-tools palette; the lane failed on the missing menu on every run. The helper now opens the palette, waits for the server wave, and flips the row's pressed state. * fix: preserve numeric reasoning defaults on blur * test: reopen persisted code cards before checking highlights * test: follow the current file manager navigation * fix: offer only reasoning options a request override can carry * fix: keep the favorited copy when skills share a name * fix: restore composer focus by the interaction that closed the palette * test: expect a keyboard close to refocus the composer on every project * chore: re-record the design-rule backlog on the rebased composer * chore: drop the files table and label the rebase brought back * test: tolerate other projects' unseen conversations when marking one unread * test: open the file table header scenario from the account menu * fix: let the stop shortcut reach a hidden stop control from a dialog * fix: keep staged reasoning out of tool-limit recovery and MCP App turns * fix: degrade a queued turn's stale reasoning override instead of dead-lettering it * fix: refresh the attach target when web search changes the route * fix: re-arm the run-end drain after moving a steer to the queue * test: hover the MCP row before reaching its revealed Connect action * test: pick the parts scenario's MCP server from the tools palette * fix: cancel a recovered row's parked steer only after the composer takes it A recovered row's only durable copy is the steer parked on the server, and once its run has ended nothing can re-create it, so a composer that refused the row after the cancel left the words in memory until the next reload. The composer now takes the words first; a cancel that then fails holds the row out of the run-end drain instead of sending it a second time. * fix: name only the idle composer affordances that act * fix: keep steer escalation off until the pane owns the rendered conversation The branch tail that decides whether a run is paused is keyed by the pane's conversation, which can still name the previous chat while a cached one renders. Until the pane catches up, a pause on any cached branch now keeps Escalate disabled instead of reading a missing or foreign tail as unpaused. * fix: route the host's Enter and auto-send preferences into the composer's nested hooks ChatForm takes enterToSend and autoSendText from its host, but useTextarea, DuringRunSendButton and both speech engines still read the store atoms, so a host whose values differ advertised one behavior while the handlers ran another. Pass the host values through instead. * fix: settle a browser dictation take only after its final transcript lands stopListening resolves on the recognizer's end event, after the final result reached useSpeechRecognition's reducer but before React committed it, so the take settled while the composer still held the interim text. Settle from an effect declared after the transcript effect, off a state update queued behind the result. * fix: drop a restored reasoning override the current setting no longer offers The staged override was only checked for a matching parameter key, so a value restored after a capability change on the same target stayed staged, blocked live steering, and was dropped at send time. Validate it against the setting's options and range. * test: scan the attach and tools palette for accessibility The a11y suite still opened the removed tools dropdown. Open the palette instead, and add a scenario that runs Axe over the open palette. * fix: make the palette's virtualized list the grid that owns its rows The rows sat under a wrapper grid behind react-virtualized's scroller, which always renders aria-label and aria-readonly and so could not be made presentational. Axe reported both the disallowed attribute and the grid's invalid child. The scroller is now the labelled grid, with a rowgroup holding the rows. * fix: state the palette grid's row total and each row's position Only the rows in view are mounted, so without aria-rowcount and aria-rowindex assistive technology reads the rendered window as the whole grid. * fix: key an empty destination's pending steers to the route An empty tree has no message naming its conversation, so the pending-steer surface fell back to the chat context, which still names the source chat during warm navigation, and its controls acted on the source run. Fall back to the chat's messages key, which follows the route. * fix: keep assistant uploads available when the file config fails Assistants upload directly and never needed the destination policy, which is why the replaced AttachFileChat rendered their uploader outside the policy gate. Restore that exception so a failed or paused file config request does not remove every attachment entry. |
||
|
|
241c692b63 | 🛶 chore: Include Latest Canary Work in Sync | ||
|
|
df59d61f77
|
🔅 fix: Quiet Form-Control Outlines in the Stock Palettes (#16400)
* fix: Quiet Form-Control Outlines in the Stock Palettes The stock light and dark palettes gave border-control a 3:1 value, which made every field, textarea and dropdown outline far louder than the cards and separators around them. Both now use their border-light value, while the high contrast and ClickHouse palettes keep their 3:1 outlines. A legacy theme without border-control now keeps its own light border on controls instead of being pushed to a contrast-ranked candidate, which often landed on a text color. The contrast helper that ranking needed is removed. The empty tools and skills cards step up from border-light to border-medium so their dashed edge reads against the panel. * fix: Keep a Legacy Medium Border on Controls A theme that predates border-control and painted only its medium border drew that edge on selects and OTP slots, so it now falls back to the medium border after the light one instead of the bundled role. Adds scenarios for the stock outlines matching the card border, the legacy medium-border theme, and the empty tools card edge. * test: Spell Out the Stock Control Outline Scenario Tags |
||
|
|
6d54d07ac1
|
🎛️ feat: Close the Data-Level Click UI Gaps in the ClickHouse Theme (#16379)
* feat: close the data-level Click UI gaps in the ClickHouse theme Set the theme values Click UI defines that the ClickHouse theme still left at LibreChat defaults: - controlHeight 2rem (genericMenu.panel.size.height), spaceCompact 0.5rem (button.basic.space.gap), spaceNormal 1rem (button.basic.space.x) and motionFast 100ms (transition.default). - Light ring-primary to outline.default #437eef, matching the dark mode ring, which already used outline.default. - Light surface-overlay to dialog.color.opaqueBackground #151515. - Dark surface-inverted to Click UI's primary fill #faff69 with its hover and #1f1f1c label, which is also its checked checkbox and switch colour. * fix: keep the shared spacing roles at LibreChat's values in the ClickHouse theme spaceNormal and spaceCompact are not control-only: spaceNormal pads the user message and queued-steer bubbles, and spaceCompact is the composer send button's inner padding. Raising them to Click UI's button padding and gap widened the bubbles and shrank the send icon's box. Keep both at the defaults; 0.75rem is already Click UI's field padding. |
||
|
|
57da77c60f
|
🔤 feat: Bundle Inconsolata for the ClickHouse Theme (#16376)
* feat: bundle Inconsolata for the ClickHouse theme The ClickHouse theme names Inconsolata as its mono family, but the app did not ship the face, so code fell back to the system monospace. Self-host the latin 400 and 700 woff2 faces from Fontsource 5.3.0 with their OFL licence, declared with font-display: swap in a stylesheet of theme-opt-in faces. The browser fetches a declared face only when text renders in it, so the default theme never downloads them. * fix: ship the Inconsolata licence with the production build Production builds disable publicDir, so the woff2 faces reached dist through the $fonts alias while the OFL text next to them in public/fonts did not. The build now copies the licence texts from public/fonts into assets/fonts, beside the faces they cover. |
||
|
|
85910e97b4
|
🔲 a11y: Form-Control Outlines Clear 3:1 in Every Palette (#16377)
* fix(client): Give form-control outlines their own 3:1 border role border-medium and border-light were the only visible edge on the shared form controls, and neither clears the WCAG 1.4.11 3:1 non-text floor in any palette. Raising them would also darken every separator and card edge, which the quieter dark borders deliberately keep one step off the page. border-control is a new theme role for the outline of a field, select trigger, dropdown, combobox trigger and OTP slot. Every bundled palette gives it a value that clears 3:1 on each canvas a form can sit on, the package ships the stock light and dark defaults so the outline holds before and without a theme definition, and a custom theme that paints its own medium border but not the new role keeps the outline it drew. semanticTokens.spec.ts holds the 3:1 floor for the role in all six modes. * fix(client): Keep a legacy control outline only when it clears 3:1 A theme that paints its own borders but predates border-control took its medium border as the control outline, and a quiet one left every field without a visible edge. The fallback now keeps that border only where it clears 3:1 on the theme's own canvases and otherwise uses the theme's secondary text, in both resolveTheme and the legacy applyTheme adapter. The palette scenarios spell out their tags so the runner can find them. * fix(client): Map legacy light and medium borders onto the control outline Controls drew border-light (fields, dropdowns, comboboxes) or border-medium (select, OTP) before border-control existed, so a stored theme that painted either, or the canvases they sit on, takes the first of its light border, its medium border, the bundled role or its secondary text that clears 3:1 on its own canvases. A theme that names none of them keeps the bundled role. * fix(client): Never settle for a control outline that fails when a better one exists Secondary and primary text join the candidates for a legacy theme's control outline, and when none clears 3:1 on the theme's canvases the one that comes closest is used rather than the secondary text by default. |
||
|
|
0ea3e27c8e
|
🧩 feat: Let Theme Readers Ignore Unknown Appearance Tokens (#16373)
A definition naming an appearance token this build does not know now resolves with that token dropped and reported, instead of being rejected whole. Unknown colours, invalid values for known tokens, and CSS or markup carried by an unknown token still reject the definition. |
||
|
|
b9b82d75cf | 🛶 style: Match CI Tailwind Formatting in Canary Sync | ||
|
|
09c12b98a4 | 🛶 fix: Reconcile Canary Sync Checks | ||
|
|
6d7ba72b89 | 🛶 chore: Bring Canary Up to Date With Dev | ||
|
|
631fa64b39
|
🟨 feat: ClickHouse Theme Shape Parity (#16342)
* feat: ClickHouse Theme Shape Parity The ClickHouse reference theme now sets the radius scale from Click UI's `border.radii`, the mono family to Inconsolata over a real fallback stack, and its shadow scale and surface elevation from Click UI's `shadow.1` (0.15 alpha in light, 0.6 in dark), so selecting it changes shape and not only colour. The divergence spec asserts the new tokens differ from LibreChat's, and the theme README documents the appearance scales. * test: Compare the ClickHouse Small Radius by Rendering, Not by String * test: Scenarios for the ClickHouse Theme Shape |
||
|
|
89f4a62dcf
|
🌫️ feat: Shadow Scale Follows the Theme (#16341)
* feat: Shadow Scale Follows the Theme Map Tailwind's shadow scale (xs through 2xl, plus bare `shadow`) to theme-owned appearance properties in the app's `@theme inline` block, with Tailwind's own values as defaults. `--theme-elevation-surface` stays the separate role behind `shadow-theme-surface`. * fix: Validate Theme Shadows and Keep Disabled Ones Composable A theme shadow must now parse as a box-shadow list or none, so a malformed value is rejected instead of voiding every shadow-* call site. none resolves to a transparent layer, since Tailwind lists --tw-shadow after the ring layers where a bare none invalidates the declaration. * feat: Theme the Smallest Shadow Step Too * test: Cover the Theme Shadow Scale in the Browser * fix: Let the Browser Reject Unknown Shadow Colors * fix: Keep var() and Other Length Units Valid in Theme Shadows * fix: Keep Defaults for Appearance Keys Present but Undefined * fix: Classify Shadow Tokens Instead of Deferring var() Values to the Browser * fix: Reject Empty Layers in a Theme Shadow List * fix: Require Concrete Theme Shadows So the Browser Can Validate Them * fix: Reject env() and attr() in Theme Shadows Like var() Both are substitution functions, so the browser only checks a value that holds one at computed-value time. A missing environment variable without a fallback then invalidated the composed box-shadow, ring layers included, instead of rejecting the theme and keeping the default. * fix: Keep Loading Released Themes With a Variable-Backed Surface Elevation The released validator accepted var() in elevationSurface, and a theme that fails validation is dropped as a whole. Only the new shadow scale steps need to be concrete, so elevationSurface keeps its original check. |
||
|
|
7d4a3f00fe
|
🪶 style: Quieter Primitives, Shared Panel Headers, and Flat Management Lists (#16244)
* style: Quieten the shared primitives and the dark borders The primitives carried the weight the screens then inherited: boxed empty states, outlined table shells, raised composer pills. Softening them here means a screen gets the quieter treatment by composing what it already composes rather than by overriding it. Dark moves its border roles one step off the page instead of two, so an edge separates a surface from the one behind it without reading as a seam. The values live in style.css for the pre-hydration paint and in dark.ts for the runtime theme, so both change together. Checkbox gains CheckboxGlyph, the presentational half of the control, for rows that are already a button and must not nest a second one inside it. * feat(client): Panel header and scroll fade for the side panels Every management panel was building its own title row, so the title, the search field and the create button sat at a different size and spacing in each one. PanelHeader is that row, and the panels adopt it next. PanelContent gains a fade at its foot, fed by useScrollFade, which watches the viewport and its content and reports whether anything sits below the fold. A list that is exactly as tall as its box shows no fade, and the gradient is dropped under prefers-reduced-motion. The sidebar keeps a right edge in every theme now that it shares a surface with the content beside it, rather than only in high contrast. * style: Apply the quieter layout to the panels and management pages The main content now sits on the same surface as the sidebar, so the app reads as one plane instead of a page floating on a backdrop. With the fill gone the containers had nothing left to justify them: cards, outlines and double borders come off the MCP, Skills, Bookmarks, Memory, Prompts and Scheduled Chats lists, and spacing and weight carry the hierarchy instead. The management screens adopt PanelHeader, so title, search and create sit at one size and one rhythm across all of them, and Schedules gains the search its siblings already had. Secondary row actions appear on hover and focus rather than resting in the row. Two rows also stop nesting interactive controls: the skills row splits into sibling buttons under a focus-within ring, and the memory and prompt toggles render CheckboxGlyph inside their button rather than a second control. * fix(client): Keep the schedules quota and skeleton honest under filtering The footer counted the filtered list while the create limit is enforced against all schedules, so filtering made a full account look under quota. The skeleton reserved a switch, a menu and three text rows the flattened row no longer has, so the panel visibly collapsed on load; it now mirrors the healthy row. The skill file expander announced "Show files" even while expanded, so its label is now a neutral toggle. * fix(client): Restore schedule row actions and settle the panels' design debt A schedule row's actions sat in the hover-revealing slot other lists use, but this panel's rows end at the sidebar's resize handle and a slot collapsed to zero width put the switch's clickable point outside the panel, under the handle, where no hover could ever reveal it; the slot now keeps its width and the menu trigger fades in on row hover alone. The design-rule violations this branch had suppressed are paid instead: the tables drop restatements the Table primitives own and take a compact header size, FilterInput gains the dialog surface instead of a caller-side color, the projects entries move to the section-action variant, the MCP cancel cross fades via a wrapper the caller owns, and the panel group's backdrop moves to its host. The counts this branch had raised come back down with the entries pruned. * fix(client): Preserve Shared Row Actions and Verify Panel States * fix(client): Match Schedule Skeleton Action Height * fix(client): Preserve Panel Overflow and Schedule History Actions * refactor(client): Derive Row Action Classes From the Reveal Variant The reveal recipe was spelled out both in the row-action-reveal Button variant and in rowActionClasses. The helper now starts from the variant and only adds the open and always-visible states, and the MCP card spec asserts classes the real recipe renders instead of a mocked string. * fix(client): Announce Panel Filter Results and Usage Changes The schedule filter now reports its match count through a polite live region, as the prompt filter does. The memory usage badge keeps a status region beside its toggle so a changed usage is announced while focus is elsewhere, and the search count reads as a floor while more pages remain. * fix(client): Keep Row Focus Visible and Warn on Balance-Skipped Runs The row action slot clipped its overflow even while focus was inside it, cutting off the focused action's ring. It now clips only while collapsed. Skill rows drew one focus ring around the whole row, so moving between the open and disclosure buttons changed nothing on screen. Each button now draws its own ring. A run skipped for balance keeps its schedule enabled only until the skip count disables it, so the row now shows it as a warning instead of reading as healthy. * test(e2e): Match the always-applied skill row's full button name * refactor(client): Render MCP Row Actions Through the Button Primitive The MCP row actions passed a computed class string to TooltipAnchor, which the design rules cannot check, and the file carried a new static-classes suppression for it. They now render the shared Button with the row-action variants, like the bookmark and memory rows, and the suppression is gone. * fix(client): Paint Field Notches With the Page Surface and Respect IME Escape The marketplace, skills and prompts pages moved to the primary-alt surface, but the floating labels on their fields still painted the presentation surface, leaving a patch across each field's border in both themes. The labels now paint the surface they sit on. The create-skill name label is a plain label like the edit form's, since the Label primitive owns its color and a notch has to paint its own backdrop. Escape in the sidebar search cleared the query even while an IME was composing, where Escape only cancels the composition. * fix(client): Keep the Chat Column Within the Viewport Beside the Sidebar Moving the surface off ResizablePanelGroup put a new flex item around it with the default auto minimum width, so a reply with a wide table grew the chat column past the viewport and cut its right edge off. The host now allows itself to shrink, as the group did. Also covers the sidebar search's IME Escape guard with a unit test, since the search field is not mounted without a search backend. |
||
|
|
50ff19829a
|
📐 feat: Radius and Font Scales Follow the Theme (#16340)
* feat: Radius and Font Scales Follow the Theme Map Tailwind's radius scale (sm through 3xl, plus bare `rounded`) and the sans and mono families to theme-owned appearance properties in the app's `@theme inline` block, so a theme definition reshapes the existing plain utilities instead of only the `theme-*` roles. Defaults reproduce the values those utilities resolved to before, and the JS config entries and the bare `--radius` they replace are removed. * fix: Keep the Pixel Offsets in the Small Radius Defaults The old `rounded-sm` and `rounded-md` were `calc(var(--radius) - 4px)` and `calc(var(--radius) - 2px)`. Rem-only defaults matched them only at a 16px root, so keep the calc form and match at every root font size. * test: Resolve Custom Properties Before Comparing the Code Font `code` and `.font-mono` now both reach the mono stack through custom properties, so compare the resolved stacks rather than the raw declarations. * fix: Leave Bare rounded on Its Fixed Radius Bare `rounded` was a fixed 0.25rem, which the `sm` default only equals at a 16px root now that it keeps its px offset, so it no longer follows the `sm` step. * fix: Accept the calc() Radius Defaults the Registry Exports * test: Cover the Theme Radius and Font Scales in the Browser * fix: Require Units on Both Operands of a calc() Radius |
||
|
|
ecce519b68
|
🎨 feat: Theme the Shared Code Block With surface-code and a New surface-code-body Role (#16334) | ||
|
|
e79ed0ab37
|
🖌️ refactor: Read Theme Roles in Prose, Settings Dialog and Composer Surfaces (#16332) | ||
|
|
2443095fcc
|
♿ fix: Keep Identity Badge Labels at Text Contrast (#16337)
* fix: keep identity badge labels on a text role and move the series hue to a dot Action method and principal type badges painted 11-12px labels in a categorical series slot over its own tint. The series scale is contracted at the 3:1 mark floor, so that text fell below 4.5:1 in every palette. The label now uses text-secondary and the hue rides on a decorative leading dot, and semanticTokens.spec.ts floors both halves of the pairing on the surfaces these badges sit on. * test: cover identity badge label contrast across palettes and modes * refactor: share the identity label treatment as a SeriesLabel primitive Both badges composed the same neutral label and series dot by hand. The treatment now lives in @librechat/client so a later contrast or appearance change lands once. It renders the caller's text, so it joins the text primitives whose typography belongs to the caller. The principal scenario also waits for each query's own option before reading paint, since the picker keeps the previous result on screen while the debounced search is in flight. |
||
|
|
ea2b5f756d
|
🔇 fix: Mute the Create Assistant Empty State in the Assistant Picker (#16338)
* fix: mute the Create Assistant empty state in the assistant picker AssistantSelect passed its "Create Assistant" label as the dropdown value, so it rendered in the primary value tone. Pass it as the placeholder with an empty value instead, which SelectDropDown already renders in text-text-secondary. SelectDropDown no longer checkmarks an option whose value is empty when nothing is selected, so the loading row stays unmarked. * test: reach the assistant builder through the mobile control panel |
||
|
|
5960f84a21
|
🎨 style: Semantic Colour Roles for Builder, Tools and Sharing Surfaces (#16294)
* style: move builder, tools and sharing surfaces onto semantic colour roles Replace raw palette utilities and dark: colour overrides in the Assistants builder, agent tool rows, principal avatars, SharePoint picker, code-analysis block, in-flight steers, prompt variables and the skill file editor with theme roles, so custom themes repaint them. Where a shared primitive owns its colour, the local override is dropped so the primitive's tokens apply. * test: cover semantic colour roles on builder, tools and sharing surfaces under a reference theme * fix: keep the theme focus ring, let steer text beat prose, clean up seeded messages Restore the ring-ring-primary focus role on the actions panel buttons so a theme's own focus colour applies, give the in-flight steer body an important text role so the unlayered .prose colour no longer wins, delete the messages the code-analysis scenarios seed, and read the v4 placeholder reference from the root --gray-400 triplet now that no source generates text-gray-400. |
||
|
|
c737753066
|
🟨 feat: Add a ClickHouse Reference Theme (#16262) | ||
|
|
f13b0eaef4
|
🚚 chore: Point Repository and Image References at LibreChat-AI (#16005)
Some checks failed
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
Docker Dev Images Build / publish (push) Waiting to run
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / pack (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
Update package repository and bugs URLs, GitHub links in docs, templates and comments, and image references (compose files, deployed-update, Helm values and renovate hints) from danny-avila to LibreChat-AI / librechat-ai. Covers the rag-api repository and its images, which moved to the organization. Sponsor links and the sealed star-history chart are unchanged. |
||
|
|
764a4393f4
|
📏 fix: Constrain the Agent Selector to 480px and 10 Own Agents (#16256)
* fix: constrain agent selector to 480px and 10 unsearched agents The Agents panel selector dropdown now caps at 480px tall with the option list scrolling inside, and lists at most 10 agents while the search field is empty; typing lifts the cap so search still reaches every agent. ControlCombobox gains optional popoverMaxHeight and unsearchedLimit props, so every other selector keeps its current fixed 300px list. * fix: make the agent selector cap configurable, viewport-safe, and selection-preserving The unsearched list cap now reads interface.agentSelectorLimit from librechat.yaml (default 10), the popover cap yields to Ariakit's available height so a short viewport never pushes options offscreen, and a selected agent ranking past the cut keeps the last slot instead of disappearing until searched for. * fix: forward agentSelectorLimit through the interface loader and guard it at the client loadDefaultInterface whitelists interface fields, so the new knob never reached /api/config without explicit forwarding; and values that bypass interfaceSchema (raw yaml reads, principal-scoped admin overrides) are normalized back into 1..100 at the client so a bad override cannot empty the selector. |
||
|
|
78694f8c1e
|
🎨 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> |
||
|
|
471abaa64d |
🔑 feat: Passkey Authentication with WebAuthn Sign-In and Management (#14715)
* feat: passkey authentication with WebAuthn sign-in and management * refactor: tighten passkey account protections Require password confirmation before adding or removing a passkey, and rate limit those confirmations per user in their own namespace. Restrict passkey enrollment and sign-in to local accounts, and re-evaluate account status once the credential owner is resolved. Require user verification on the sign-in ceremony. Invalidate outstanding access tokens on password reset. Tighten redirect target validation and sanitize ceremony failure logs. Adds coverage across the passkey controller, the WebAuthn helpers, the step-up limiter, both JWT strategies, the redirect utility and the passkey settings UI. * fix: localize passkey default name and respect router basename Send a localized default credential label at enrollment so non-English locales no longer persist the server's English fallback, and route the passkey post-login and 2FA navigations through the deployment base path so subdirectory installs stay inside the router. Also mock syncStaticTools in the server boot specs; without it the post-listen MCP initialization calls undefined and exits the worker. * fix: harden passkey counter checks and reach stranded credentials Make the signature counter write a compare-and-swap so two assertions that verified against the same stored counter cannot both commit, and reject the losing one; a cloned authenticator is otherwise accepted inside that window. Counterless authenticators keep restamping at 0. Keep the passkey panel reachable for identity-provider accounts, which already get passwordless removal server-side but had no way in, while hiding the add control they cannot use. Cascade passkey deletion from the admin user-deletion path so credential IDs are not stranded. * fix: reject stale 2FA temp tokens and surface passkey load failures A temporary 2FA token proves only the first factor, so honouring one minted before a password reset let anyone holding the second factor survive account recovery. Apply the same credentials-changed cutoff the JWT strategy uses. Also distinguish a failed passkey query from an empty list; the error state previously rendered as "no passkeys yet", which misreports what is protecting the account. * fix: fail closed when the passkey counter write cannot commit Returning success on a storage error bypassed the compare-and-swap it exists to enforce, so a cloned authenticator could be accepted while the stored counter stayed stale. A database that cannot take this write cannot mint the session either, so little is gained by failing open. Counterless credentials carry no clone signal and keep their old path. * fix: keep the passkey 2FA handoff inside the router A full-page navigation to the 2FA screen remounted AuthContextProvider, which silent-refreshes on mount; no refresh session exists yet at that point, so it bounced back to login before the code could be entered. Route through the router like the password flow does. Also reveal the removal step-up field when the server refuses a passwordless attempt, so an account migrated to an identity provider without its old hash cleared can still clear its credentials; drop the staged password when the dialog closes; and revoke passkeys in the CLI password reset, which bypassed the HTTP controller's cleanup. * fix: apply one email-verification policy across login methods Accounts predating mandatory verification are marked verified as they sign in when no email is configured, but only the password strategy did it, so the same legacy account was admitted by password and refused by passkey. Extract the rule into a shared helper and call it from both. * fix: refuse a passkey sign-in when the ban check cannot complete checkBan defaults next to a no-op, so calling it bare discarded any internal failure and left req.banned unset, letting the request fall through and be issued tokens. Capture the error the middleware chain would have propagated and reject instead. * fix: refine passkey management dialogs * test: stabilize passkey tooltip assertions * test: reconcile passkey specs with the canary reset and deletion flows The credentialsChangedAt stamp now lives in commitPasswordReset, so its assertion moves to the passwordReset unit spec. Restores the describe blocks the rebase merged together. * test: mock passkey routes in the cross-site login suite * refactor: move passkey handlers and credential checks into packages/api The passkey controller, the credentialsChangedAt predicate and the legacy email-verification grandfathering now live in TypeScript with injected dependencies; /api keeps only the wiring that builds the handlers. * style: align passkey UI with Tailwind v4 order and design-rule lint * fix: revoke earlier access tokens on a CLI password reset passwordVersion is not a user schema field, so the write was dropped and tokens issued before the reset kept verifying. * test: cover passkey sign-in and credential revocation end to end * fix: hide passkey sign-in when email login is disabled The passkey endpoints already refuse under ALLOW_EMAIL_LOGIN=false, so advertising the button only led to a 403. * fix: let only one concurrent verification consume a passkey challenge Without a native getDel the challenge was read then deleted, so two concurrent verifications could both use it. The delete now arbitrates: only the caller whose delete removed the key gets the challenge. * test: run passkey ceremonies on the localhost relying party WebAuthn refuses an IP address as the RP ID, and the harness serves the app on 127.0.0.1. The reset scenario runs once per project, so the mock harness lifts the per-IP reset request limit as it does for forks. * fix: keep passkey management when email login is disabled Gate only the sign-in button on emailLoginEnabled, since only the sign-in routes sit behind that gate; list, rename and remove stay reachable. * fix: build the passkey credential index before the first registration With MONGO_AUTO_INDEX=false the unique credentialId index was never created, so concurrent registrations could store the same credential. * test: enable password reset in the mock harness and cover email-login-off passkeys * fix: stop re-exporting the passkey cap from data-schemas The bundler left every import of methods/passkey.ts unlinked while that module re-exported MAX_PASSKEYS_PER_USER from librechat-data-provider, so the index build and the counter-failure log threw ReferenceError at runtime. Consumers now import the cap from librechat-data-provider. * test: close nested settings dialogs before logging out in passkey scenarios * fix: reject cross-site passkey assertions The verify route accepted a form posted from another site, which let an attacker sign a victim into the attacker's account. It now runs the same requireSameOrigin guard as password login and the 2FA step. * fix: end refresh sessions on a CLI password reset A surviving refresh session could mint an access token issued after the credentialsChangedAt stamp, so the CLI now deletes sessions like the web reset does. * fix: keep the passkey button locked when it supersedes autofill Starting the modal ceremony aborts the pending autofill one, and the autofill error path cleared the shared lock and busy state while the modal ceremony was still running. |
||
|
|
641f895be5 |
🌊 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> |
||
|
|
86d5ad5c6b |
🧵 fix: Restore Classes tailwind-merge Was Silently Dropping (#15995)
* 🧵 fix: Restore Classes tailwind-merge Was Silently Dropping tailwind-merge 1.9.1 predates Tailwind 3.3, so its conflict map has no group for text-wrap, touch-action, gradient color stops, or arbitrary bg-* properties. cn() therefore deleted classes the caller wrote, with no error: touch-pan-y on the mobile sidebar, from-* gradient colors behind three overlays, text-balance and text-pretty across the Projects and Prompts cards, and the checkerboard background on the skill file preview. Bumps client and the @librechat/client peer range to ^2.6.1, the line that supports Tailwind 3.x. Tailwind v4 requires tailwind-merge 3.x and moves in the v4 pull request, so this change is the class map alone. * ✅ test: Cover the Classes tailwind-merge Was Dropping From a Browser Three `@scenario`-tagged specs ask the browser what the DOM actually got, one per class `cn()` was deleting: the mobile drawer's `touch-pan-y` beside `touch-pinch-zoom`, the shared-conversation fade's `from-surface-secondary` beside `from-40%`, and `text-balance`/`text-pretty` beside `truncate` and `line-clamp-2`. Each resolves both sides of its comparison in the browser — computed value against the theme custom property, normalised through a probe — so the same spec holds in light mode, dark mode, under a custom theme and after the Tailwind v4 upgrade that follows this change in the stack. The wrapping scenario asserts the Projects header and description rather than `Prompts/lists/ListCard.tsx`: that component is exported but has no JSX call site anywhere in the repository, so its `text-balance` renders nowhere and the pull request's table overstates it. The `Projects` views carry the same pair and do render. * 🔬 test: Ask the Browser for Styles by Their CSS Names computedStyles took camelCase names straight to getPropertyValue, which only answers to the CSS spelling and returns '' for anything else, so every probe but width and height fell through to an indexed read on the declaration that TypeScript only allowed behind an 'as never' cast. touchAction reached the assertions that way. The helper now hyphenates the name it was given and asks once: a property the browser does not know comes back empty and fails its assertion instead of silently taking another path. --------- Co-authored-by: berry-13 <berry-13@users.noreply.github.com> |
||
|
|
8d5e1a75ee |
🎨 chore: Enforce Design-System Rules With @shadcn/lint (#15981)
* 🎨 chore: Enforce Design-System Rules With @shadcn/lint Registers @shadcn/lint for client/src and packages/client/src, resolving\n@librechat/client as the design system so a className that overrides what a\nprimitive owns is reported with the variants and sizes to use instead.\n\nFive rules run at error. no-unknown-classes stays off: it needs Tailwind v4.\nContracts record what callers legitimately own (text typography, skeleton\nsilhouette); eslint-suppressions.json records the 3,141 violations the tree\nalready carried, so the rules gate new code without a tree-wide migration.\n * 🩹 fix: Close the Gaps Review Found in the Design-Rule Gate Five findings against this pull request, and one that killed its CI: - The lockfile entries this change added resolved to a private mirror, so every job died in `npm ci`. They now resolve from registry.npmjs.org, with each integrity hash checked against the tarball npmjs.org serves. - The pre-commit hook ran ESLint twice and the first run had no `--pass-on-unpruned-suppressions`, so it exited 2 on the suppression the fix had just made unused and lint-staged never reached the command that tolerates it. One invocation now does both; ESLint applies suppressions after fixes, so it reports the post-fix state. - `scripts/static-checks.mts` omitted that same flag, so `npm run static-checks` failed locally on a diff the Static Checks lane passes. - `lint:design:suppress` recorded a moved file's new path and left the old one behind, because only `--prune-suppressions` removes it and ESLint refuses both flags in one run. The script now chains the prune, and CLAUDE.md documents the scoped recipe that does not re-baseline the whole surface. - The design rules matched only `.ts`/`.tsx`, so the client's `.jsx` entry points bypassed all five. Both globs now cover `.js`/`.jsx`; the one violation that exposed — an inline `display: none` on App.jsx's silent-audio iframe — is fixed at the source rather than recorded. - A suppressions-only diff started no workflow and nothing read the baseline. It is now a trigger path and its own filter group, and a new `suppressions` check rejects a shape ESLint cannot load, a count no run can reach, a rule the plugin does not define, and a path that no longer exists. The count-neutral swap two reviewers raised is not closed: ESLint's baseline format records a count, not violation identities, so replacing one suppressed violation with another of the same rule in the same file is invisible here. CLAUDE.md now says that instead of implying detection. Four `@scenario`-tagged specs cover the developer-facing behaviour: the report a caller gets on a primitive override, a `.jsx` file being checked, the fixing commit staying green (with the counter-proof that it exits 2 without the flag), the move recipe dropping the old path, and every locked tarball being fetchable from the public registry. * 🧪 fix: Close the Dormant-Entry and Gate-Trigger Gaps The suppressions gate did not run when the file that implements it changed, a count recorded against a path no design-rule lint reaches passed validation, the documented re-record chain could not run under cmd.exe, and the lockfile scenario failed a legitimate SheetJS upgrade. The trigger scenarios also ran four full-tree sweeps inside one test that declared a 180s deadline for work measured at 100-280s per sweep. - scripts/static-checks.mts: `scripts/static-checks.mts` joins the suppressions filter and the whole-record trigger, and a recorded path ESLint never reports on is rejected as dormant. - package.json/CLAUDE.md: `|| node -e ""` in place of `|| true`, which cmd.exe does not define. - e2e: the whole-record triggers are a matrix over a miniature repository (2-6s each instead of 100-280s), the oversized scenario is split into five behaviour-shaped ones, scratch baselines live in os.tmpdir(), and the lint gate runs in one project because it has no viewport. * 📏 chore: Re-Record the Counts Dev Moved Under the Backlog Rebasing onto dev brought #16067, which restyled three files the recorded backlog speaks for: MarketplaceSidebar.tsx gained one arbitrary value and two `no-restyle` violations, ToolsMarketplaceDialog.tsx gained one, and SkillsDialog lost one. Counts above the file fail the lint for whoever edits it next; the one below leaves capacity a later violation would spend. Scoped re-record and prune of those three paths, per the recipe in CLAUDE.md. * 🧭 test: Run the Copied Runner From the Tree It Is Testing The trigger matrix pointed the copied static-checks runner at a miniature repository but invoked it from the real one. The runner derives its repository from its own location and relativizes file arguments against the working directory, so `eslint.config.mjs` resolved to a path outside the miniature tree, the suppressions group read as "not affected by this diff", and the scenario passed a check that never ran (verify recorded it as a failure: exit 0 where a rejection was expected). `run` now takes a `cwd`, and both synthetic-root probes use it. * 🔇 fix: Reject a Disable Comment With Nothing Behind It Yet Comparing the two ESLint runs finds a directive only while it is silencing something. A `/* eslint-disable shadcn/no-raw-colors */` over a file with no raw colour left both runs agreeing, so it landed unseen and then silenced the first violation anyone added to that file. The configured run now also asks for unused directives, which is how ESLint names a disable with nothing behind it: a dormant design-rule disable and a dormant blanket disable are rejected, a dormant directive for another rule is not. Neither root carries one today (0 reports across 2,241 files), so what this rejects is new ones. The same pass also has to see the primitives' variants, so `validateSuppressions` builds `packages/client/dist` before the directive check rather than inside the capacity scan that follows it; without the metadata both runs report strictly fewer design diagnostics and a comment silencing a `no-restyle` violation is invisible to the comparison. * 🧱 fix: Count the Library's Build Inputs as Sources `designMetadataIsFresh` compared `packages/client/dist` with `packages/client/src` alone, so a commit that changed only the library's manifest or its tsdown config left every source older than the build and the runner skipped the rebuild. The design rules then classified against output emitted under the old contract — locally only, since CI always builds before validating, which is the shape of divergence nobody sees until the lane disagrees with the commit that passed. Both files already count as design metadata everywhere else (the suppressions filter, the whole-record trigger); they now count in the freshness comparison too. The scenario runs the miniature repository with an observable `build:client-package`: a current build is not rebuilt, and touching either input asks for one. * ⏱️ test: Set the Times the Freshness Rule Compares The rebuild scenario wrote the build output and then the manifest, and node wrote both inside the same millisecond, so the manifest was not newer than the build and the runner correctly declined to rebuild — the assertion failed on the filesystem clock rather than on the rule. The scenario now sets each mtime it depends on with `utimesSync`, which is what it meant to say. * 🩹 fix: Restore the Write the Import Edit Dropped Adding \ to the import list replaced \ instead of joining it, and nothing local caught it: no tsconfig covers e2e/, and the flat config leaves \ to TypeScript there. The mock harness did — every scenario in the file failed with ReferenceError — which is the point of running it. Typechecked the four scenario files directly this time. * 🚫 fix: Reject Every Inline Escape, Not Only the Ones in Use Codex found three more ways past the gate, one shape each. A blanket \ busy silencing an unrelated rule is used, so ESLint's unused-directive report never names it, and the configured-versus-ignored comparison sees no design delta — it waits for the file's first design violation and takes it. Inline \ over a clean file is invisible the same way. And a nested baseline that drops an entry for an unchanged source was checked against its remaining keys only, so the violation it used to speak for went unread. The directive check now has two halves: ESLint still answers what a comment is silencing today, and the comments themselves are read out of the parser — not the text, so a string that reads like a directive is not one — for a disable naming a design rule, a blanket disable, or inline configuration naming a design rule, whether or not anything is behind it yet. That supersedes \, which could only see the unused ones. Neither design root carries any of the three today. \ unions the entries a diff removes into a nested baseline's file list, and \ joins the design metadata: it carries the \ mapping, the entry emit and the include/exclude that decide what reaches the bundle the rules read, which is why the repository's own build caches key on \. * 🔐 fix: Make the Hook Select What the Lane Selects, and Distrust a Half-Built Bundle Two more shapes of the same mistake — trusting a proxy for the thing itself. The pre-commit group listed individual files while the Static Checks lane's filter also names both design roots, so staging a primitive ran ESLint locally and the whole-record sweep only in CI: the commit passed and the lane failed on callers nobody staged. The hook's group is now the lane's filter pattern for pattern, and the count-edit scenario reads both files and fails when the two lists differ, so the next path added to one has to reach the other. Freshness took the newest timestamp under \ as proof of a finished build. The build empties that directory before it writes, so a build that failed halfway leaves a recent directory over a bundle with no entry point, and every later run skipped rebuilding it. The check now also requires what \ promises inside \ — its entry fields and every string leaf of \ — to exist. * 🧾 fix: Give the CDN Exception to xlsx, Not to the Host The lockfile rule allowed \ for anything and then compared versions against the base branch, so regenerating the lockfile against that CDN could move any package off the public registry at the same version and pass. The exception now belongs to the package — \, at any version, nested or not — and every other entry has to come from the registry, which drops the version comparison and the shallow-clone caveat with it. The rule is a function the scenario applies to the repository's lockfile and to lockfiles written for the purpose: an xlsx upgrade on its CDN passes, lodash rewritten onto the same CDN at the same version fails, a new package from a private mirror fails, and a nested xlsx is still xlsx. * ↩️ fix: One Local Entry Point, Asked of the Runner The pre-commit group I added for the backlog and the design metadata was redundant and slower: \ already ends by running the runner over the staged diff with \, and that run selects its groups from the same filters — including both design roots, and including deletions, which lint-staged never hands to a task. The group made the whole-record sweep run twice for one commit. It is gone. The scenario now asserts the property instead of a copy of the list: the hook still runs the runner over the staged diff, and for every path the lane's suppressions paths-filter names, the runner reports that check as selected (\), while a path outside both roots is not affected. * 🗺️ fix: Assert Where the Rules Are Asked, Not Only What They Found A report cannot say where the rules were asked. Narrowing the design block over a subtree that happens to be clean today — \, say — produces no new diagnostic, no changed count, and no baseline entry to inspect, so every gate stays green while the styling written there next goes unread. The new scenario asks the resolved flat configuration instead: for one representative path of each source extension in every directory under both roots, all five design rules must be at error in the app and at the library's own profile inside \ (overriding a primitive is off there; colour and inline geometry still hold), and server code must carry none of them. 1,184 paths, answered through ESLint's API in one process in under a second — \ would have been eleven minutes of subprocesses. * 🎯 fix: Spend the Budget Once — Reject a Swap Inside the Allowance The recorded count is a budget per file and rule, and until now it could be respent: removing one raw colour while adding a different one keeps the total equal, so ESLint suppresses the new violation inside the old allowance and the count checks see nothing move. The backlog was documented as unable to tell that apart, and it was the one hole Codex kept finding its way back to. What the totals cannot distinguish the diagnostics can. For every design source a diff touches, the runner now lints that file's version at the base — through ESLint's API, one process for the whole diff — and reports a design-rule message the head has that the base did not, naming it. A violation that only moved keeps its message and is not reported; a file with no version at the base has no allowance to hide in and the count checks already answer for it. Measured on the checkout: swapping one `fill="#AFC1FF"` for `fill="#BEEF11"` in a file recording five raw colours is rejected in 4.9s naming the new one, and the unchanged file passes. The scenario proves all three states — recorded, moved, swapped — in a miniature repository with a history of its own, and CLAUDE.md no longer claims the swap is undetectable. * 🧰 fix: The Root Manifests Are Build Inputs Too \ is defined in the root manifest and runs with the toolchain the root lockfile pins, and both already select the suppressions check — but neither counted as an input to bundle freshness, so a commit that changed the build definition could validate locally against output made by the previous one while CI rebuilt. They count now, beside the library's own manifest, build config and compiler options, and the rebuild scenario drives the lockfile case through the miniature repository's observable build. * 🧭 fix: Read the Base From the Merge Base, and Give a New File No Allowance Two holes in the swap check, both about what "the base" means. It read each changed file's prior version from the base branch's tip, while the changed-file set comes from \. With \ moving under a branch, that calls a violation dev added since the branch diverged this change's doing, and forgives one this change added that dev happens to carry. It resolves the merge base once and reads from there. And a file with no version at the base was skipped, so adding a source with a violation and recording it in the same commit passed as "already recorded". A file the change adds has no allowance to inherit: every design violation in it is new. Renames are followed (\), so the documented re-record of a moved path stays green — its violations came with the file. The scenario now walks recorded, moved, swapped, added-with-its-own-entry and renamed through one miniature repository with a history of its own. * 🔗 fix: One Base Commit, Asked Once \ resolved the merge base; \ still read the baseline from the base branch's tip, so the two checks in the same run disagreed about what "before" meant — and an entry the base branch edited after the branch diverged entered \ as though this change had edited it. \ resolves it once and both ask it. * 🔤 fix: A Suppressed Message Carries Its Text \ omitted \, and the swap check reads it — the union of messages and suppressed messages is what a file's diagnostics are, and what the baseline silences is exactly what that check has to see. Nothing local caught it: node strips types without checking them and no tsconfig covers scripts/, so the runner is now typechecked directly ([41m [0m [41m[37m This is not the tsc command you are looking for [0m [41m [0m To get access to the TypeScript compiler, [34mtsc[0m, from the command line either: - Use [1mnpm install typescript[0m to first add TypeScript to your project [1mbefore[0m using npx - Use [1myarn[0m to avoid accidentally running code from un-installed packages, clean). * ⚖️ fix: Let the Record Grow, Out Loud The swap check reported every violation a change added, which also forbade the one path CLAUDE.md sanctions: add the violation and raise the count, so the debt arrives as a line in the diff a reviewer reads. What separates that from a swap is not the violation, it is whether the record said so — a swap keeps the count still. The check now charges each new diagnostic against how much that entry's count grew between the merge base and here, and reports only what the growth does not cover. Measured: a swap at an unchanged count fails, the same violation with the count raised passes, and raising nothing fails naming the class. CLAUDE.md says which of the three is which. * 🚧 fix: A File the Change Adds Brings No Allowance Letting the record grow to cover a new violation is right for a file that already existed — the raised count is the line a reviewer reads — but it also let a brand-new source arrive with its own entry, which is the backlog recording what the tree never owed. Growth applies only where there is something to grow: a file present at the merge base, renamed or not. A file the change adds owes everything in it, and the message says so. * ✏️ test: Assert the Wording the Added-File Rule Uses The scenario still expected "is new here" for a file the change adds, which now gets its own message — the backlog records what the tree owed, not what a new file brings. The harness caught it; the assertion follows the rule. * 🧮 fix: Ask Git What Existed, and Where Its Entry Lived Three faults in the new swap check, one cause: it inferred from content what only git can answer. A tracked empty file at the base reads as absent, so an existing file was treated as newly added and its recorded growth refused. A renamed file's growth was measured at the new key, where the base has no entry at all, so the move itself looked like room to spend. And a base commit missing from the clone made every changed file look new, silently. Existence is now \ succeeding, the allowance is read under the name the entry had (the rename map already resolved the source; it resolves the entry too), and a base commit that is not in the clone is reported rather than guessed at. Measured: a rename carrying a new violation with its count raised at the new key fails, a plain rename passes, a swap at an equal count fails. * 🗃️ fix: A Deleted Baseline Is a Deleted Baseline, Nested or Not The root baseline's deletion failed the check; a nested one was quietly dropped from the target list by the same \ filter that was meant to skip paths never present. What a nested baseline silences goes back to being reported — or stops being — and nothing else reads it, so its deletion is the same failure and now says which file is missing. * 📚 fix: A Baseline in the Diff Is Read in Full The comment said a baseline named in the diff is checked in full; the code checked only the entries the diff moved, because \ made \ non-empty and the full-record branch required it to be empty. So a count edit never revalidated the rest of the record — dormant paths and stale counts in unedited entries went unread. Editing the baseline now reads every path it records. And the rename map keyed on git's raw line, so a CRLF checkout left a \ on the new path and the rename never matched — the file read as added and its inherited allowance was refused. The lines are trimmed. * 🧷 fix: Lint the Base Under the Name It Had, and Compare a Commit With Its Parent Two last seams in the swap check. A renamed file's base contents were linted under the new path, so moving a component out of \ — where overriding a primitive is the library's own business — into \ made the destination's stricter rules apply to both sides: the diagnostics the move itself introduces looked inherited, and a matching entry would have hidden them. The base is linted as the path it had. And \, the documented single-commit mode, resolved its comparison to \ — the commit against itself, which forgives everything. It resolves to the commit's parent. * 🔖 fix: Quotes Do Not Hide an Inline Rule Configuration ESLint reads \ exactly as it reads the unquoted key, but the comment scan required the colon to follow the rule id directly, so the quoted form passed over a file that does not violate the rule yet — and then silences the first violation a primitive or config fan-out creates there. Over a violating file the two-run comparison always caught it; the dormant case is the one that slipped. The scan accepts either quoting, and the scenario carries the quoted spelling beside the rest. * 🧪 perf: A Spec Is Not Component Metadata Both roots the design rules police are full of specs — every primitive in `packages/client/src/components` has one — and editing any of them ran the two-root suppression sweep, because the metadata predicate asked only whether the path was a lintable source under a metadata root. A spec is neither: the flat config turns all five design rules off inside it and the library's tsconfig keeps it out of the bundle the caller rules resolve primitives through, so it carries no `cva` variant and can report no design diagnostic of its own. `packages/client/src/components/Button.spec.tsx` through the runner: 59.7s before, 0.0s after. The same `DESIGN_TEST_SOURCE` test is applied everywhere the invariant holds: the freshness input no longer treats a spec as something `dist` is built from (directory mtimes stay, so an added or deleted source still forces a rebuild), the directive gate no longer fails a commit over a comment in a file where the design rules are already off, and the base-vs-head lint no longer fetches a spec's base version to ask a question with one possible answer. * 🔎 fix: A Build That Reports Success Is Not a Build Two gates trusted a signal instead of the condition it stands for. `buildClientPackage` returned on the build's exit code. A build that exits 0 while leaving `packages/client/dist` incomplete or older than its sources left `designMetadataIsFresh()`'s answer exactly as it found it, and the suppression lint that follows then classified callers against a bundle describing something else — reporting fewer violations than CI, which is the failure the rebuild exists to prevent, reached through the branch meant to fix it. The freshness question is now asked again after a successful build, and a bundle still stale is an error naming `packages/client/dist`. The workflow's `on.pull_request.paths` named only the root `eslint-suppressions.json` while the inner `suppressions` filter names `**/eslint-suppressions.json`. A diff touching only a nested baseline outside `api|client|config|packages|scripts` — `e2e/fixtures`, say — started no workflow at all, so `validateSuppressions()` never ran over exactly the nested baselines it advertises. The trigger carries both spellings now. The miniature repository's `build:client-package` writes the bundle its manifest promises instead of only a marker, so the rebuild rows assert a finished build rather than a claim of one, and a build that writes nothing is its own row. * 🧭 fix: Ask the Tool, Don't Reconstruct Its Answer Four findings on the last head, and three of them were the next variant of a family this branch had already patched once. The shared cause is one habit: the gate re-derived a fact from a cheaper proxy instead of asking whatever owns it, and every round found another case the proxy got wrong. An inline `eslint` configuration comment was matched by the spelling of its rule key, so `shadcn/x`, `"shadcn/x"`, `"shadcn\/x"` and `"shadcn\u002fx"` — one key, four spellings, all of which ESLint honours — needed four regexes. The key is now decoded before it is compared, which ends the family rather than adding the fourth. Bundle freshness reduced a set of outputs to the newest file anywhere under `dist`. A resolver loads one entry, not a directory, so a build that rewrote the ESM bundle and left the CJS one or the type declarations behind passed while `@shadcn/lint` read the stale one. Every declared output is compared now, which is the same reason their existence was already checked one by one. Target discovery read `git diff --name-only` with rename detection, which names one side. `git mv eslint-suppressions.json backlog.json` therefore selected no group that owns the source, and the baseline's disappearance was reported by nothing. `--no-renames` at the single funnel makes a rename two paths; the one caller that wants the pairing asks for it separately. The fourth was the parity assertion added last round, sitting in the mock Playwright lane — whose own trigger excludes `.github/workflows` apart from its own file, so a workflow-only diff never ran the assertion guarding it. The claim moved into the runner, where the file that can break it already activates the group, and the scenario now exercises the runner both ways over a copy of the real workflow instead of reimplementing its parser. * 📝 docs: Say Which Swaps the Ratchet Misses The ratchet paragraph claimed a swap arrives as a failure, full stop. Two do not, and a reader deciding whether to trust the gate needs both. A swap whose diagnostic message equals the one it replaced is invisible, because the comparison keys on the message and some rules name the property without the value — `Inline style sets display.` is one message for `none` and for `flex`. And a swap the diff itself causes, by changing a primitive or the config, is invisible because both versions are linted under the head's design inputs. Tracked at berry-13/LibreChat#70 and berry-13/LibreChat#69. * 📏 chore: Re-Record the Count Dev Moved Under the Backlog `dev` fixed one `shadcn/no-restyle` violation in `client/src/components/SharePoint/SharePointPickerDialog.tsx`, so the rebased branch records 8 where the file now has 7. An entry with slack is exactly what this change added a check for: the unused 1 would silence the next violation anyone writes there, and the gate says so rather than letting it through. `npm run lint:design:prune` drops the one count; the trailing newline it strips is restored by prettier, the way the pre-commit hook's `*.json` group does. * 📝 docs: Drop a Recorded Count That Dev Keeps Moving The backlog total moves with every rebase that picks up new violations from `dev`, so a number written into CLAUDE.md is stale by the next re-record — it read 3,230 against a baseline holding 3,232. The recipe does not need the figure; `eslint-suppressions.json` is the record. * 📏 chore: Re-Record the Counts Canary Moved Under the Backlog Retargeting onto canary changes the tree the design rules read, so five files carry different violation counts than the recorded backlog claims: Wakeup and SubagentConversation shed no-restyle violations and picked up a require-static-classes one, and Ledger, UnifiedSidebar and ChatRoute each gained one. Re-recorded those entries and pruned; nothing else in the baseline moved. * 🧱 fix: Build the Primitives Before Recording What They Own `lint:design:record` was the one exposed design script that linted without building `packages/client/dist` first. The rules read each primitive's `cva` variants out of that bundle, so a fresh checkout or a primitive change left the recording run classifying against a library that does not exist yet and writing counts lower than the ones CI reports. Moved the build onto the record script, where the other three already have it, and dropped it from the `lint:design:suppress` wrapper so the wrapper still pays for exactly two builds. A build failure inside the wrapper is still loud: the record step cannot rewrite the baseline when the build it is chained to fails, and the prune that follows does not swallow its own. * 📏 chore: Re-Record the Counts Canary Moved Under the Backlog Rebasing onto canary picks up PR #15798, which rewrote the agent marketplace components, so eighteen recorded entries no longer describe the files they name: AgentDetail is gone, AgentCard traded its restyle and arbitrary-value violations for inline styles, AgentDetailContent grew to eighteen restyles, and CopyLink, GridSkeleton, Marketplace, MineFilterToggle, SortDropdown and LoadingDots arrived with violations nothing had recorded. Re-recorded and pruned; every entry that moved belongs to a file that commit touched, and nothing else in the baseline changed. * 🧪 test: Assert the Record Asks for a Build Before It Writes The build-freshness scenario covers the runner. Nothing covered the other entry point: `npm run lint:design:record`, which writes the budget every later change is measured against and, until now, linted whatever bundle happened to be on disk. The miniature repository's `build:client-package` appends to a log, so the scenario can ask whether the record built before it wrote, and whether a build that fails still stops the wrapper now that the wrapper no longer carries a build of its own. --------- Co-authored-by: berry-13 <berry-13@users.noreply.github.com> |