Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
🎨 feat: Refine Client Colors and Sharing Dialogs (#14734)
Marco Berettaf7d9f369221a
diff --git a/client/src/App.jsx b/client/src/App.jsxindex 5d20a99200..247185fcc3 100644--- a/client/src/App.jsx+++ b/client/src/App.jsx@@ -68,7 +68,7 @@ const App = () => {<WakeLockManager /><QueryDevtoolsGate /><Toast />- <RadixToast.Viewport className="pointer-events-none fixed inset-0 z-[1000] mx-auto my-2 flex max-w-[560px] flex-col items-stretch justify-start md:pb-5" />+ <RadixToast.Viewport className="pointer-events-none fixed inset-x-0 top-0 z-[1000] mx-auto my-2 flex max-w-[560px] flex-col items-stretch justify-start" /></DndProvider></ToastProvider></RadixToast.Provider>diff --git a/client/src/components/Chat/Input/AudioRecorder.tsx b/client/src/components/Chat/Input/AudioRecorder.tsxindex 2a3a3e64b9..09c5b23b70 100644--- a/client/src/components/Chat/Input/AudioRecorder.tsx+++ b/client/src/components/Chat/Input/AudioRecorder.tsx@@ -115,7 +115,7 @@ export default memo(function AudioRecorder({aria-label={localize('com_ui_use_micrphone')}onClick={isListening === true ? handleStopRecording : handleStartRecording}disabled={disabled}- className={cn('size-9 rounded-full p-1')}+ className={cn('size-9 rounded-full p-1 hover:bg-surface-composer-hover')}aria-pressed={isListening}>{renderIcon()}diff --git a/client/src/components/Chat/Input/Files/AttachFile.tsx b/client/src/components/Chat/Input/Files/AttachFile.tsxindex d531a46051..dd0cb0eb75 100644--- a/client/src/components/Chat/Input/Files/AttachFile.tsx+++ b/client/src/components/Chat/Input/Files/AttachFile.tsx@@ -45,7 +45,7 @@ const AttachFile = ({aria-keyshortcuts={ariaKey}disabled={isUploadDisabled}className={cn(- 'flex size-9 items-center justify-center rounded-full p-1 transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-primary focus-visible:ring-opacity-50',+ 'flex size-9 items-center justify-center rounded-full p-1 transition-colors hover:bg-surface-composer-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-primary focus-visible:ring-opacity-50',)}onKeyDownCapture={(e) => {if (!inputRef.current) {diff --git a/client/src/components/Chat/Input/Files/AttachFileMenu.tsx b/client/src/components/Chat/Input/Files/AttachFileMenu.tsxindex 4b8fccb14d..7b2aff0ed4 100644--- a/client/src/components/Chat/Input/Files/AttachFileMenu.tsx+++ b/client/src/components/Chat/Input/Files/AttachFileMenu.tsx@@ -307,8 +307,8 @@ const AttachFileMenu = ({aria-label="Attach File Options"aria-keyshortcuts={uploadFileAriaKey}className={cn(- 'flex size-9 items-center justify-center rounded-full p-1 hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-primary focus-visible:ring-opacity-50',- isPopoverActive && 'bg-surface-hover',+ 'flex size-9 items-center justify-center rounded-full p-1 hover:bg-surface-composer-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-primary focus-visible:ring-opacity-50',+ isPopoverActive && 'bg-surface-composer-hover',)}><div className="flex w-full items-center justify-center gap-2">diff --git a/client/src/components/Chat/Input/Files/MyFilesModal.tsx b/client/src/components/Chat/Input/Files/MyFilesModal.tsxindex a5945530de..f33013338a 100644--- a/client/src/components/Chat/Input/Files/MyFilesModal.tsx+++ b/client/src/components/Chat/Input/Files/MyFilesModal.tsx@@ -29,7 +29,7 @@ export function MyFilesModal({<OGDialog open={open} onOpenChange={onOpenChange} triggerRef={triggerRef}><OGDialogContenttitle={localize('com_nav_my_files')}- className="w-11/12 bg-surface-primary text-text-primary shadow-2xl"+ className="w-11/12 bg-surface-dialog text-text-primary shadow-2xl"><OGDialogHeader><OGDialogTitle>{localize('com_nav_my_files')}</OGDialogTitle>diff --git a/client/src/components/Chat/Input/HeaderOptions.tsx b/client/src/components/Chat/Input/HeaderOptions.tsxindex 7b0e01a17e..9ad2adba67 100644--- a/client/src/components/Chat/Input/HeaderOptions.tsx+++ b/client/src/components/Chat/Input/HeaderOptions.tsx@@ -39,10 +39,7 @@ export default function HeaderOptions({const paramEndpoint = isParamEndpoint(endpoint, endpointType);return (- <Root- open={showPopover}- // onOpenChange={} // called when the open state of the popover changes.- >+ <Root open={showPopover} onOpenChange={setShowPopover}><Anchor><div className="my-auto lg:max-w-2xl xl:max-w-3xl"><span className="flex w-full flex-col items-center justify-center gap-0 md:order-none md:m-auto md:gap-2">diff --git a/client/src/components/Chat/Input/InterruptSteerButton.tsx b/client/src/components/Chat/Input/InterruptSteerButton.tsxindex e5c593a3a6..5b3e05bc02 100644--- a/client/src/components/Chat/Input/InterruptSteerButton.tsx+++ b/client/src/components/Chat/Input/InterruptSteerButton.tsx@@ -53,7 +53,7 @@ const InterruptSteerButton = React.memo((props: InterruptSteerButtonProps) => {className={cn('flex size-9 items-center justify-center rounded-full border border-border-light','text-text-secondary transition-colors duration-200',- 'hover:bg-surface-hover hover:text-text-primary',+ 'hover:bg-surface-composer-hover hover:text-text-primary','focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-xheavy','disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent',)}diff --git a/client/src/components/Chat/Input/OptionsPopover.tsx b/client/src/components/Chat/Input/OptionsPopover.tsxindex 0bfb641ae2..698a40b57d 100644--- a/client/src/components/Chat/Input/OptionsPopover.tsx+++ b/client/src/components/Chat/Input/OptionsPopover.tsx@@ -3,8 +3,8 @@ import { Save } from 'lucide-react';import { Portal, Content } from '@radix-ui/react-popover';import { Button, CrossIcon, useOnClickOutside } from '@librechat/client';import type { ReactNode } from 'react';-import { cn, removeFocusOutlines } from '~/utils';import { useLocalize } from '~/hooks';+import { cn } from '~/utils';type TOptionsPopoverProps = {children: ReactNode;@@ -63,24 +63,25 @@ export default function OptionsPopover({<div className="flex w-full items-center bg-surface-tertiary px-2 py-2">{presetsDisabled ? null : (<Button+ variant="default"type="button"- className="h-auto w-[150px] justify-start rounded-md border border-border-medium bg-transparent px-2 py-1 text-xs font-normal text-text-primary hover:bg-surface-hover focus-visible:ring-1 focus-visible:ring-ring-primary"+ className="h-8 w-[150px] justify-start rounded-md px-2 text-xs font-normal"onClick={saveAsPreset}>- <Save className="mr-1 w-[14px]" />+ <Save className="mr-1 w-[14px]" aria-hidden="true" />{localize('com_endpoint_save_as_preset')}</Button>)}{PopoverButtons}<Button+ variant="ghost"+ size="icon"type="button"- className={cn(- 'ml-auto h-auto bg-transparent px-3 py-2 text-xs font-normal text-text-primary hover:bg-surface-hover',- removeFocusOutlines,- )}+ className="ml-auto size-8 text-text-primary"onClick={closePopover}+ aria-label={localize('com_ui_close')}>- <CrossIcon />+ <CrossIcon aria-hidden="true" /></Button></div><div>{children}</div>diff --git a/client/src/components/Chat/Input/ToolsDropdown.tsx b/client/src/components/Chat/Input/ToolsDropdown.tsxindex 70df5312fc..c1c665e63b 100644--- a/client/src/components/Chat/Input/ToolsDropdown.tsx+++ b/client/src/components/Chat/Input/ToolsDropdown.tsx@@ -379,8 +379,8 @@ const ToolsDropdown = ({ disabled }: ToolsDropdownProps) => {id="tools-dropdown-button"aria-label="Tools Options"className={cn(- 'flex size-9 items-center justify-center rounded-full p-1 hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-primary focus-visible:ring-opacity-50',- isPopoverActive && 'bg-surface-hover',+ 'flex size-9 items-center justify-center rounded-full p-1 hover:bg-surface-composer-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-primary focus-visible:ring-opacity-50',+ isPopoverActive && 'bg-surface-composer-hover',)}><div className="flex w-full items-center justify-center gap-2">diff --git a/client/src/components/Chat/Menus/Endpoints/CustomMenu.tsx b/client/src/components/Chat/Menus/Endpoints/CustomMenu.tsxindex cc7f3b75bc..06db64662c 100644--- a/client/src/components/Chat/Menus/Endpoints/CustomMenu.tsx+++ b/client/src/components/Chat/Menus/Endpoints/CustomMenu.tsx@@ -38,6 +38,13 @@ export const CustomMenu = React.forwardRef<HTMLDivElement, CustomMenuProps>(funcplacement: parent ? 'right' : 'left',defaultOpen: defaultOpen,});+ const isOpen = menuStore.useState('open');+ const rootMenuStateClass = isOpen+ ? 'bg-surface-active-alt hover:bg-surface-active-alt'+ : 'bg-presentation hover:bg-surface-active-alt';+ const nestedMenuStateClass = isOpen+ ? 'bg-surface-secondary hover:bg-surface-hover data-[active-item]:bg-surface-secondary data-[active-item]:hover:bg-surface-hover'+ : 'hover:bg-surface-hover data-[active-item]:bg-surface-secondary data-[active-item]:hover:bg-surface-hover';const element = (<Ariakit.MenuProvider store={menuStore} values={values} setValues={onValuesChange}>@@ -47,9 +54,7 @@ export const CustomMenu = React.forwardRef<HTMLDivElement, CustomMenuProps>(funcclassName={cn(!parent &&'flex h-10 w-full items-center justify-center gap-2 rounded-xl border border-border-light px-3 py-2 text-sm text-text-primary',- menuStore.useState('open')- ? 'bg-surface-active-alt hover:bg-surface-active-alt'- : 'bg-presentation hover:bg-surface-active-alt',+ parent ? nestedMenuStateClass : rootMenuStateClass,props.className,)}render={parent ? <CustomMenuItem render={trigger} /> : trigger}@@ -58,7 +63,7 @@ export const CustomMenu = React.forwardRef<HTMLDivElement, CustomMenuProps>(func<Ariakit.MenuButtonArrow className="stroke-1 text-base opacity-75" /></Ariakit.MenuButton><Ariakit.Menu- open={menuStore.useState('open')}+ open={isOpen}portaloverlapunmountOnHide@@ -167,7 +172,7 @@ export const CustomMenuItem = React.forwardRef<HTMLDivElement, CustomMenuItemProblurOnHoverEnd: false,...props,className: cn(- 'relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1 outline-none! scroll-m-1 scroll-mt-[calc(var(--combobox-height,0px)+var(--label-height,4px))] aria-disabled:opacity-25 data-[active-item]:bg-surface-active data-[active-item]:text-text-primary sm:text-sm min-w-0 w-full before:absolute before:left-0 before:top-1 before:bottom-1 before:w-0.5 before:bg-transparent before:rounded-full data-[active-item]:before:bg-text-primary',+ 'relative flex w-full min-w-0 cursor-default scroll-m-1 scroll-mt-[calc(var(--combobox-height,0px)+var(--label-height,4px))] items-center gap-2 rounded-lg px-2 py-1 outline-none! hover:bg-surface-hover aria-disabled:opacity-25 aria-selected:bg-surface-secondary data-[active-item]:bg-surface-secondary data-[active-item]:text-text-primary data-[active-item]:hover:bg-surface-hover sm:text-sm before:absolute before:bottom-1 before:left-0 before:top-1 before:w-0.5 before:rounded-full before:bg-transparent data-[active-item]:before:bg-text-primary',props.className,),};diff --git a/client/src/components/Chat/Menus/Presets/PresetItems.tsx b/client/src/components/Chat/Menus/Presets/PresetItems.tsxindex 0604c41a64..98f14f90e2 100644--- a/client/src/components/Chat/Menus/Presets/PresetItems.tsx+++ b/client/src/components/Chat/Menus/Presets/PresetItems.tsx@@ -1,25 +1,31 @@import { useRecoilValue } from 'recoil';import { Close } from '@radix-ui/react-popover';+import { BookCopy, FileX2 } from 'lucide-react';import { Flipper, Flipped } from 'react-flip-toolkit';import { getEndpointField } from 'librechat-data-provider';import {- Dialog,- Label,Button,PinIcon,EditIcon,TrashIcon,- DialogTrigger,TooltipAnchor,- DialogTemplate,+ AlertDialog,+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogTitle,+ AlertDialogTrigger,} from '@librechat/client';import type { TPreset } from 'librechat-data-provider';import type { FC } from 'react';import FileUpload from '~/components/Chat/Input/Files/FileUpload';import { useGetEndpointsQuery } from '~/data-provider';import { getPresetTitle, getIconKey } from '~/utils';-import { MenuSeparator, MenuItem } from '../UI';import { icons } from '~/hooks/Endpoint/Icons';+import { MenuSeparator } from '../UI';import { useLocalize } from '~/hooks';import { cn } from '~/utils';import store from '~/store';@@ -32,6 +38,7 @@ const PresetItems: FC<{onDeletePreset: (preset: TPreset) => void;clearAllPresets: () => void;onFileSelected: (jsonData: Record<string, unknown>) => void;+ onSaveAsPreset?: () => void;}> = ({presets,onSetDefaultPreset,@@ -40,87 +47,87 @@ const PresetItems: FC<{onDeletePreset,clearAllPresets,onFileSelected,+ onSaveAsPreset,}) => {const { data: endpointsConfig } = useGetEndpointsQuery();const defaultPreset = useRecoilValue(store.defaultPreset);const localize = useLocalize();+ const hasPresets = (presets?.length ?? 0) > 0;+return (<>- <div- role="menuitem"- className="pointer-none group m-1.5 flex h-8 min-w-[170px] gap-2 rounded px-5 py-2.5 !pr-3 text-sm !opacity-100 focus:ring-0 radix-disabled:pointer-events-none radix-disabled:opacity-50 md:min-w-[240px]"- tabIndex={-1}- >- <div className="flex h-full grow items-center justify-end gap-2">- <Label- htmlFor="default-preset"- className="w-40 truncate rounded bg-transparent py-1 text-xs font-medium text-text-secondary transition-colors sm:w-72"- >- {defaultPreset- ? `${localize('com_endpoint_preset_default_item')} ${defaultPreset.title}`- : localize('com_endpoint_preset_default_none')}- </Label>- <Dialog>- <DialogTrigger asChild>- <Button- variant="ghost"- type="button"- className="mr-1 flex h-[32px] cursor-pointer items-center rounded bg-transparent px-2 py-1 text-xs font-medium text-text-secondary transition-colors hover:bg-surface-hover hover:text-text-destructive focus:ring-text-primary"- aria-label={localize('com_ui_clear_all')}- >- <svg- width="24"- height="24"- viewBox="0 0 16 16"- fill="currentColor"- xmlns="http://www.w3.org/2000/svg"- className="mr-1 flex w-[22px] items-center"- aria-hidden="true"+ <div className="flex min-w-[300px] items-center gap-3 border-b border-border-light bg-surface-secondary px-3 py-2 md:min-w-[400px]">+ <div className="min-w-0 flex-1">+ <p className="text-sm font-medium text-text-primary">+ {localize('com_endpoint_examples')}+ </p>+ {hasPresets && (+ <p className="truncate text-xs text-text-secondary">+ {defaultPreset+ ? `${localize('com_endpoint_preset_default_item')} ${defaultPreset.title}`+ : localize('com_endpoint_preset_default_none')}+ </p>+ )}+ </div>+ <div className="flex shrink-0 items-center gap-1">+ {hasPresets && (+ <AlertDialog>+ <AlertDialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ type="button"+ className="h-8 px-2 text-xs font-normal text-text-secondary hover:text-text-destructive"+ aria-label={localize('com_ui_clear_all')}>- <path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0M9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1M6.854 7.146 8 8.293l1.146-1.147a.5.5 0 1 1 .708.708L8.707 9l1.147 1.146a.5.5 0 0 1-.708.708L8 9.707l-1.146 1.147a.5.5 0 0 1-.708-.708L7.293 9 6.146 7.854a.5.5 0 1 1 .708-.708"></path>- </svg>- {localize('com_ui_clear_all')}- </Button>- </DialogTrigger>- <DialogTemplate- showCloseButton={false}- title={localize('com_ui_clear_presets')}- className="max-w-[450px]"- main={- <>- <div className="flex w-full flex-col items-center gap-2">- <div className="grid w-full items-center gap-2">- <Label- htmlFor="preset-item-clear-all"- className="text-left text-sm font-medium"- >- {localize('com_endpoint_presets_clear_warning')}- </Label>- </div>- </div>- </>- }- selection={{- selectHandler: clearAllPresets,- selectClasses:- 'bg-surface-destructive text-white hover:bg-surface-destructive-hover',- selectText: localize('com_ui_clear'),- }}- />- <FileUpload onFileSelected={onFileSelected} />- </Dialog>+ <FileX2 className="size-4" aria-hidden="true" />+ {localize('com_ui_clear_all')}+ </Button>+ </AlertDialogTrigger>+ <AlertDialogContent className="w-11/12 max-w-md rounded-lg">+ <AlertDialogHeader>+ <AlertDialogTitle>{localize('com_ui_clear_presets')}</AlertDialogTitle>+ <AlertDialogDescription>+ {localize('com_endpoint_presets_clear_warning')}+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogFooter>+ <AlertDialogCancel>{localize('com_ui_cancel')}</AlertDialogCancel>+ <AlertDialogAction+ onClick={clearAllPresets}+ className="bg-surface-destructive text-text-on-status hover:bg-surface-destructive-hover"+ >+ {localize('com_ui_clear')}+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog>+ )}+ <FileUpload+ id="preset-import"+ onFileSelected={onFileSelected}+ containerClassName="mr-0 h-8 hover:text-text-primary"+ /></div></div>{presets && presets.length === 0 && (- <div- role="menuitem"- className="pointer-none group m-1.5 flex h-8 min-w-[170px] gap-2 rounded px-5 py-2.5 !pr-3 text-sm !opacity-100 focus:ring-0 radix-disabled:pointer-events-none radix-disabled:opacity-50 md:min-w-[240px]"- tabIndex={-1}- >- <div className="flex h-full grow items-center justify-end gap-2 text-text-secondary">- {/* TODO: Create Preset from here */}- {localize('com_endpoint_no_presets')}+ <div className="flex min-h-40 flex-col items-center justify-center gap-3 px-6 py-8 text-center">+ <div className="rounded-full bg-surface-secondary p-2.5 text-text-secondary">+ <BookCopy className="size-5" aria-hidden="true" />+ </div>+ <div className="space-y-1">+ <p className="text-sm font-medium text-text-primary">+ {localize('com_endpoint_no_presets')}+ </p>+ <p className="max-w-sm text-xs leading-5 text-text-secondary">+ {localize('com_endpoint_no_presets_description')}+ </p></div>+ {onSaveAsPreset && (+ <Button variant="default" size="sm" type="button" onClick={onSaveAsPreset}>+ {localize('com_endpoint_save_as_preset')}+ </Button>+ )}</div>)}<Flipper@@ -139,30 +146,32 @@ const PresetItems: FC<{const iconKey = getIconKey({ endpoint: preset.endpoint, endpointsConfig });const Icon = icons[iconKey];+ const presetTitle = getPresetTitle(preset);return (<Close asChild key={`preset-${presetId}`}><div key={`preset-${presetId}`}><Flipped flipId={presetId}>- <MenuItem- key={`preset-item-${presetId}`}- textClassName="text-xs max-w-[150px] sm:max-w-[200px] truncate md:max-w-full "- title={getPresetTitle(preset)}- onClick={() => onSelectPreset(preset)}- icon={- Icon != null && (+ <div className="group m-1.5 flex items-center gap-2 rounded px-3 py-1.5 text-sm hover:bg-surface-hover">+ <Button+ variant="ghost"+ type="button"+ className="h-auto min-w-0 flex-1 justify-start gap-1 bg-transparent p-2 text-left text-xs font-normal hover:bg-transparent focus-visible:ring-offset-0"+ onClick={() => onSelectPreset(preset)}+ aria-label={presetTitle}+ data-testid={`preset-item-${presetId}`}+ >+ {Icon != null && (<Iconcontext="menu-item"iconURL={getEndpointField(endpointsConfig, preset.endpoint, 'iconURL')}- className="icon-md mr-1"+ className="icon-md shrink-0"endpoint={preset.endpoint}/>- )- }- selected={false}- data-testid={`preset-item-${preset}`}- >- <div className="flex h-full items-center justify-end gap-1">+ )}+ <span className="truncate">{presetTitle}</span>+ </Button>+ <div className="flex items-center justify-end gap-1"><TooltipAnchordescription={defaultPreset?.presetId === presetId@@ -190,13 +199,6 @@ const PresetItems: FC<{e.stopPropagation();onSetDefaultPreset(preset, defaultPreset?.presetId === presetId);}}- // Native <button> already activates once on Enter/Space; only- // stop propagation so the parent MenuItem does not also fire.- onKeyDown={(e) => {- if (e.key === 'Enter' || e.key === ' ') {- e.stopPropagation();- }- }}><PinIcon unpin={defaultPreset?.presetId === presetId} /></Button>@@ -214,11 +216,6 @@ const PresetItems: FC<{e.stopPropagation();onChangePreset(preset);}}- onKeyDown={(e) => {- if (e.key === 'Enter' || e.key === ' ') {- e.stopPropagation();- }- }}><EditIcon /></Button>@@ -236,18 +233,13 @@ const PresetItems: FC<{e.stopPropagation();onDeletePreset(preset);}}- onKeyDown={(e) => {- if (e.key === 'Enter' || e.key === ' ') {- e.stopPropagation();- }- }}><TrashIcon /></Button>}/></div>- </MenuItem>+ </div></Flipped>{i !== presets.length - 1 && <MenuSeparator />}</div>diff --git a/client/src/components/Chat/Menus/PresetsMenu.tsx b/client/src/components/Chat/Menus/PresetsMenu.tsxindex 8a9c7c02ca..f5137cc9ff 100644--- a/client/src/components/Chat/Menus/PresetsMenu.tsx+++ b/client/src/components/Chat/Menus/PresetsMenu.tsx@@ -1,7 +1,8 @@-import { useRef } from 'react';-import { useRecoilValue } from 'recoil';+import { useRef, useState } from 'react';import { Trans } from 'react-i18next';+import { useRecoilValue } from 'recoil';import { BookCopy } from 'lucide-react';+import { tConvoUpdateSchema } from 'librechat-data-provider';import { Content, Portal, Root, Trigger } from '@radix-ui/react-popover';import {Button,@@ -11,14 +12,20 @@ import {OGDialogHeader,OGDialogContent,} from '@librechat/client';+import type { TPreset } from 'librechat-data-provider';import type { FC } from 'react';+import { SaveAsPresetDialog } from '~/components/Endpoints';import { EditPresetDialog, PresetItems } from './Presets';import { useLocalize, usePresets } from '~/hooks';+import { useChatContext } from '~/Providers';import store from '~/store';const PresetsMenu: FC = () => {const localize = useLocalize();const presetsMenuTriggerRef = useRef<HTMLDivElement>(null);+ const [saveAsDialogOpen, setSaveAsDialogOpen] = useState(false);+ const [presetToSave, setPresetToSave] = useState<TPreset | null>(null);+ const { conversation } = useChatContext();const {presetsQuery,onSetDefaultPreset,@@ -34,7 +41,15 @@ const PresetsMenu: FC = () => {presetToDelete,confirmDeletePreset,} = usePresets();- const preset = useRecoilValue(store.presetByIndex(0));+ const presetToEdit = useRecoilValue(store.presetByIndex(0));++ const openSaveAsDialog = () => {+ if (!conversation) {+ return;+ }+ setPresetToSave(tConvoUpdateSchema.parse({ ...conversation }) as TPreset);+ setSaveAsDialogOpen(true);+ };const handleDeleteDialogChange = (open: boolean) => {setShowDeleteDialog(open);@@ -59,8 +74,7 @@ const PresetsMenu: FC = () => {id="presets-button"data-testid="presets-button"aria-label={localize('com_endpoint_examples')}- className="h-9 w-9 shrink-0 rounded-xl bg-presentation duration-0 hover:bg-surface-active-alt"- // className="inline-flex size-10 flex-shrink-0 items-center justify-center rounded-xl border border-border-light bg-transparent text-text-primary transition-all ease-in-out hover:bg-surface-tertiary disabled:pointer-events-none disabled:opacity-50 radix-state-open:bg-surface-tertiary"+ className="h-9 w-9 shrink-0 rounded-xl bg-presentation duration-0 hover:bg-surface-hover radix-state-open:bg-surface-active-alt"><BookCopy className="icon-md" aria-hidden="true" /></Button>@@ -68,34 +82,34 @@ const PresetsMenu: FC = () => {></TooltipAnchor></Trigger><Portal>- <div- style={{- position: 'fixed',- left: '0px',- top: '0px',- transform: 'translate3d(268px, 50px, 0px)',- minWidth: 'max-content',- zIndex: 'auto',- }}+ <Content+ side="bottom"+ align="center"+ sideOffset={8}+ collisionPadding={16}+ aria-label={localize('com_endpoint_examples')}+ className="z-50 max-h-[495px] overflow-x-hidden rounded-lg border border-border-light bg-presentation text-text-primary shadow-lg md:min-w-[400px]">- <Content- side="bottom"- align="center"- className="mt-2 max-h-[495px] overflow-x-hidden rounded-lg border border-border-light bg-presentation text-text-primary shadow-lg md:min-w-[400px]"- >- <PresetItems- presets={presetsQuery.data}- onSetDefaultPreset={onSetDefaultPreset}- onSelectPreset={onSelectPreset}- onChangePreset={onChangePreset}- onDeletePreset={onDeletePreset}- clearAllPresets={clearAllPresets}- onFileSelected={onFileSelected}- />- </Content>- </div>+ <PresetItems+ presets={presetsQuery.data}+ onSetDefaultPreset={onSetDefaultPreset}+ onSelectPreset={onSelectPreset}+ onChangePreset={onChangePreset}+ onDeletePreset={onDeletePreset}+ clearAllPresets={clearAllPresets}+ onFileSelected={onFileSelected}+ onSaveAsPreset={conversation ? openSaveAsDialog : undefined}+ />+ </Content></Portal>- {preset && (+ {presetToSave && (+ <SaveAsPresetDialog+ open={saveAsDialogOpen}+ onOpenChange={setSaveAsDialogOpen}+ preset={presetToSave}+ />+ )}+ {presetToEdit && (<EditPresetDialogsubmitPreset={submitPreset}exportPreset={exportPreset}diff --git a/client/src/components/Conversations/Conversations.tsx b/client/src/components/Conversations/Conversations.tsxindex 70eaf201b6..eb3a981334 100644--- a/client/src/components/Conversations/Conversations.tsx+++ b/client/src/components/Conversations/Conversations.tsx@@ -2,21 +2,18 @@ import { useMemo, memo, type FC, useCallback, useEffect, useRef } from 'react';import throttle from 'lodash/throttle';import { useRecoilValue } from 'recoil';import { ChevronDown } from 'lucide-react';-import { QueryKeys } from 'librechat-data-provider';-import { useQueryClient } from '@tanstack/react-query';+import { Spinner, useMediaQuery } from '@librechat/client';import { List, CellMeasurer, CellMeasurerCache } from 'react-virtualized';-import { Button, Spinner, TooltipAnchor, NewChatIcon, useMediaQuery } from '@librechat/client';import type { TConversation } from 'librechat-data-provider';import {useLocalize,TranslationKeys,useFavorites,useShowMarketplace,- useNewConvo,useElementSize,} from '~/hooks';-import { groupConversationsByDate, clearMessagesCache, cn } from '~/utils';import FavoritesList from '~/components/Nav/Favorites/FavoritesList';+import { groupConversationsByDate, cn } from '~/utils';import { useActiveJobs } from '~/data-provider';import Convo from './Convo';import store from '~/store';@@ -91,24 +88,12 @@ interface ChatsHeaderProps {onToggle: () => void;}-const headerIconButtonClassName =- 'flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-text-secondary outline-none transition-colors hover:bg-surface-active-alt hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-text-primary';-/** Collapsible header for the Chats section */const ChatsHeader: FC<ChatsHeaderProps> = memo(({ isExpanded, onToggle }) => {const localize = useLocalize();- const queryClient = useQueryClient();- const { newConversation } = useNewConvo();- const conversation = useRecoilValue(store.conversationByIndex(0));-- const handleNewChat = useCallback(() => {- clearMessagesCache(queryClient, conversation?.conversationId);- queryClient.invalidateQueries([QueryKeys.messages]);- newConversation();- }, [conversation?.conversationId, newConversation, queryClient]);return (- <div className="flex h-8 w-full items-center gap-0.5 pr-2">+ <div className="flex h-8 w-full items-center pr-2"><buttononClick={onToggle}className="group flex min-w-0 flex-1 items-center gap-1 rounded-lg px-1 py-2 text-xs font-bold text-text-secondary outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-text-primary"@@ -124,20 +109,6 @@ const ChatsHeader: FC<ChatsHeaderProps> = memo(({ isExpanded, onToggle }) => {aria-hidden="true"/></button>- <TooltipAnchor- description={localize('com_ui_new_chat')}- render={- <Button- variant="ghost"- size="icon"- aria-label={localize('com_ui_new_chat')}- className={headerIconButtonClassName}- onClick={handleNewChat}- >- <NewChatIcon className="h-4 w-4" />- </Button>- }- /></div>);});diff --git a/client/src/components/Conversations/__tests__/Conversations.test.tsx b/client/src/components/Conversations/__tests__/Conversations.test.tsxindex 4d4c79a5eb..0bfd556d88 100644--- a/client/src/components/Conversations/__tests__/Conversations.test.tsx+++ b/client/src/components/Conversations/__tests__/Conversations.test.tsx@@ -46,15 +46,11 @@ jest.mock('react-virtualized', () => {});jest.mock('~/store', () => {- const { atom, atomFamily } = jest.requireActual('recoil');+ const { atom } = jest.requireActual('recoil');return {__esModule: true,default: {search: atom({ key: 'test-conversations-search', default: { query: '' } }),- conversationByIndex: atomFamily({- key: 'test-conversations-convo-by-index',- default: null,- }),},};});@@ -72,28 +68,13 @@ jest.mock('~/hooks', () => ({useFavorites: () => mockFavoritesState,useLocalize: () => (key: string) => key,useShowMarketplace: () => mockShowMarketplace,- useNewConvo: () => ({ newConversation: jest.fn() }),useElementSize: () => ({ ref: jest.fn(), width: 300, height: 600 }),TranslationKeys: {},}));-jest.mock('@tanstack/react-query', () => ({- useQueryClient: () => ({ invalidateQueries: jest.fn() }),-}));-jest.mock('@librechat/client', () => ({Spinner: () => <div data-testid="spinner" />,useMediaQuery: () => false,- TooltipAnchor: ({ render }: { render: React.ReactNode }) => render,- NewChatIcon: () => <svg data-testid="new-chat-icon" />,- Button: ({- children,- variant: _variant,- size: _size,- ...props- }: React.ComponentProps<'button'> & { variant?: string; size?: string }) => (- <button {...props}>{children}</button>- ),}));jest.mock('~/data-provider', () => ({@@ -102,7 +83,6 @@ jest.mock('~/data-provider', () => ({jest.mock('~/utils', () => ({groupConversationsByDate: () => [],- clearMessagesCache: jest.fn(),cn: (...args: unknown[]) => args.filter(Boolean).join(' '),}));@@ -261,4 +241,9 @@ describe('Conversations – pinned header', () => {const { queryByText } = renderConversations([pinnedConvo], 'some query');expect(queryByText('com_ui_pinned')).not.toBeInTheDocument();});++ it('does not render a duplicate new chat button in the chats header', () => {+ const { queryByRole } = renderConversations([]);+ expect(queryByRole('button', { name: 'com_ui_new_chat' })).not.toBeInTheDocument();+ });});diff --git a/client/src/components/Endpoints/SaveAsPresetDialog.tsx b/client/src/components/Endpoints/SaveAsPresetDialog.tsxindex 9c699f48cd..61d246a4fa 100644--- a/client/src/components/Endpoints/SaveAsPresetDialog.tsx+++ b/client/src/components/Endpoints/SaveAsPresetDialog.tsx@@ -1,4 +1,4 @@-import React, { useEffect, useState } from 'react';+import React, { useEffect, useId, useState } from 'react';import { useCreatePresetMutation } from 'librechat-data-provider/react-query';import {OGDialogTemplate,@@ -9,17 +9,20 @@ import {useToastContext,} from '@librechat/client';import type { TEditPresetProps } from '~/common';-import { cn, removeFocusOutlines, cleanupPreset, defaultTextProps } from '~/utils';import { NotificationSeverity } from '~/common';+import { cleanupPreset } from '~/utils';import { useLocalize } from '~/hooks';const SaveAsPresetDialog = ({ open, onOpenChange, preset }: TEditPresetProps) => {- const [title, setTitle] = useState<string>(preset.title ?? 'My Preset');+ const localize = useLocalize();+ const formId = useId();+ const inputId = `${formId}-name`;+ const [title, setTitle] = useState<string>(preset.title ?? localize('com_endpoint_my_preset'));const createPresetMutation = useCreatePresetMutation();const { showToast } = useToastContext();- const localize = useLocalize();- const submitPreset = () => {+ const submitPreset = (event: React.FormEvent<HTMLFormElement>) => {+ event.preventDefault();const _preset = cleanupPreset({preset: {...preset,@@ -47,49 +50,45 @@ const SaveAsPresetDialog = ({ open, onOpenChange, preset }: TEditPresetProps) =>};useEffect(() => {- setTitle(preset.title ?? localize('com_endpoint_my_preset'));- // eslint-disable-next-line react-hooks/exhaustive-deps- }, [open]);-- // Handle Enter key press- const handleKeyDown = (event: React.KeyboardEvent) => {- if (event.key === 'Enter') {- event.preventDefault();- submitPreset();+ if (open) {+ setTitle(preset.title ?? localize('com_endpoint_my_preset'));}- };+ }, [localize, open, preset.title]);return (<OGDialog open={open} onOpenChange={onOpenChange}><OGDialogTemplatetitle={localize('com_endpoint_save_as_preset')}- className="z-[90] w-11/12 sm:w-1/4"+ className="z-[90] w-11/12 max-w-md"overlayClassName="z-[80]"showCloseButton={false}main={- <div className="flex w-full flex-col items-center gap-2">+ <form+ id={formId}+ onSubmit={submitPreset}+ className="flex w-full flex-col items-center gap-2"+ ><div className="grid w-full items-center gap-2">- <Label htmlFor="preset-custom-name" className="text-left text-sm font-medium">+ <Label htmlFor={inputId} className="text-left text-sm font-medium">{localize('com_endpoint_preset_name')}</Label><Input- id="preset-custom-name"+ id={inputId}value={title || ''}onChange={(e) => setTitle(e.target.value || '')}- onKeyDown={handleKeyDown}placeholder={localize('com_endpoint_preset_custom_name_placeholder')}- aria-label={localize('com_endpoint_preset_name')}- className={cn(- defaultTextProps,- 'flex h-10 max-h-10 w-full resize-none border-border-medium px-3 py-2',- removeFocusOutlines,- )}+ className="flex h-10 max-h-10 w-full resize-none border-border-medium px-3 py-2"/></div>- </div>+ </form>}buttons={- <Button variant="submit" onClick={submitPreset}>+ <Button+ type="submit"+ form={formId}+ variant="submit"+ disabled={createPresetMutation.isLoading}+ >{localize('com_ui_save')}</Button>}diff --git a/client/src/components/Input/SetKeyDialog/SetKeyDialog.tsx b/client/src/components/Input/SetKeyDialog/SetKeyDialog.tsxindex 5e726164e4..a6e96f95c0 100644--- a/client/src/components/Input/SetKeyDialog/SetKeyDialog.tsx+++ b/client/src/components/Input/SetKeyDialog/SetKeyDialog.tsx@@ -21,6 +21,7 @@ import {import type { TDialogProps } from '~/common';import { useUserKey, useLocalize } from '~/hooks';import { NotificationSeverity } from '~/common';+import { formatKeyExpiryLabel } from './utils';import CustomConfig from './CustomEndpoint';import BedrockConfig from './BedrockConfig';import GoogleConfig from './GoogleConfig';@@ -363,6 +364,12 @@ const SetKeyDialog = ({const EndpointComponent = endpointComponents[configuredEndpoint] ?? endpointComponents['default'];const expiryTime = getExpiry();+ let currentExpiryLabel: string | null = null;+ if (expiryTime === 'never') {+ currentExpiryLabel = localize('com_endpoint_config_key_never_expires');+ } else if (expiryTime !== undefined) {+ currentExpiryLabel = formatKeyExpiryLabel(localize, expiryTime);+ }return (<OGDialog open={open} onOpenChange={onOpenChange}>@@ -372,23 +379,18 @@ const SetKeyDialog = ({{`${localize('com_endpoint_config_key_for')} ${alternateName[endpoint] ?? endpoint}`}</OGDialogTitle></OGDialogHeader>- <div className="grid w-full items-center gap-2 py-4">- <small className="text-text-destructive">- {expiryTime === 'never'- ? localize('com_endpoint_config_key_never_expires')- : `${localize('com_endpoint_config_key_encryption')} ${new Date(- expiryTime ?? 0,- ).toLocaleString()}`}- </small>+ <div className="grid w-full items-center gap-2 py-2">+ {currentExpiryLabel && (+ <small className="text-text-destructive">{currentExpiryLabel}</small>+ )}<Dropdown- label="Expires "+ label={`${localize('com_endpoint_config_new_key_expiration')}: `}value={expiresAtLabel}onChange={handleExpirationChange}options={expirationOptions.map((option) => option.label)}sizeClasses="w-[185px]"portal={false}/>- <div className="mt-2" /><FormProvider {...methods}><EndpointComponentuserKey={userKey}diff --git a/client/src/components/Input/SetKeyDialog/utils.ts b/client/src/components/Input/SetKeyDialog/utils.tsnew file mode 100644index 0000000000..0e29dadeaa--- /dev/null+++ b/client/src/components/Input/SetKeyDialog/utils.ts@@ -0,0 +1,15 @@+import type { TOptions } from 'i18next';+import type { TranslationKeys } from '~/hooks';++type Localize = (phraseKey: TranslationKeys, options?: TOptions) => string;++export function formatKeyExpiryLabel(localize: Localize, expiry: string): string {+ const formattedExpiry = new Date(expiry).toLocaleString();+ const localizedLabel = localize('com_endpoint_config_key_encryption', {+ 0: formattedExpiry,+ });++ return localizedLabel.includes(formattedExpiry)+ ? localizedLabel+ : `${localizedLabel} ${formattedExpiry}`;+}diff --git a/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx b/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsxindex bd29d7bb26..ac7df0da06 100644--- a/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx+++ b/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx@@ -84,7 +84,7 @@ const MermaidDialog: React.FC<MermaidDialogProps> = memo(<OGDialog open={open} onOpenChange={onOpenChange} triggerRef={triggerRef}><OGDialogContentshowCloseButton={false}- className="h-[85vh] max-h-[85vh] w-[90vw] max-w-[90vw] gap-0 overflow-hidden border-border-light bg-surface-primary-alt p-0"+ className="h-[85vh] max-h-[85vh] w-[90vw] max-w-[90vw] gap-0 overflow-hidden border-border-light bg-surface-dialog p-0"><OGDialogTitle className="flex h-10 items-center justify-between border-b border-border-light bg-surface-secondary px-4 font-sans text-xs text-text-secondary"><span>{localize('com_ui_mermaid')}</span>diff --git a/client/src/components/Nav/Settings/Dialog.tsx b/client/src/components/Nav/Settings/Dialog.tsxindex 358314f3e9..c2d29132ae 100644--- a/client/src/components/Nav/Settings/Dialog.tsx+++ b/client/src/components/Nav/Settings/Dialog.tsx@@ -63,7 +63,7 @@ export default function SettingsDialog({ open, onOpenChange }: TDialogProps) {<div className="fixed inset-0 flex w-screen items-center justify-center p-4"><DialogPanelclassName={cn(- 'flex max-h-[85vh] w-full flex-col overflow-hidden rounded-2xl bg-surface-primary shadow-2xl',+ 'flex max-h-[85vh] w-full flex-col overflow-hidden rounded-2xl bg-surface-dialog shadow-2xl','md:h-[85vh] md:w-[900px]',)}>diff --git a/client/src/components/Nav/Settings/Sidebar.tsx b/client/src/components/Nav/Settings/Sidebar.tsxindex ffbc0a5e39..ce86d6921c 100644--- a/client/src/components/Nav/Settings/Sidebar.tsx+++ b/client/src/components/Nav/Settings/Sidebar.tsx@@ -45,14 +45,14 @@ export default function Sidebar({}}placeholder={localize('com_ui_settings_search_placeholder')}aria-label={localize('com_ui_settings_search_placeholder')}- className="w-full rounded-lg bg-surface-secondary py-2 pl-8 pr-8 text-sm text-text-primary focus:outline-none"+ className="w-full rounded-lg bg-surface-secondary py-2 pl-8 pr-8 text-sm text-text-primary focus-visible:outline-none"/>{query.length > 0 && (<buttontype="button"onClick={() => onQueryChange('')}aria-label={localize('com_ui_clear_search')}- className="absolute right-1.5 top-1/2 -translate-y-1/2 rounded-md p-1 text-text-secondary transition-colors hover:bg-surface-hover hover:text-text-primary focus:outline-none focus:ring-2 focus:ring-border-xheavy"+ className="absolute right-1.5 top-1/2 -translate-y-1/2 rounded-md p-1 text-text-secondary transition-colors hover:bg-surface-hover hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-primary"><X className="h-4 w-4" aria-hidden="true" /></button>@@ -69,7 +69,7 @@ export default function Sidebar({value={tab.id}onClick={() => onSelectTab(tab.id)}className={cn(- 'flex items-center justify-between gap-2 rounded-xl px-3 py-2.5 text-sm text-text-secondary transition-colors hover:bg-surface-hover md:py-2',+ 'flex items-center justify-between gap-2 rounded-xl px-3 py-2.5 text-sm text-text-secondary transition-colors hover:bg-surface-hover hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-text-primary md:py-2','radix-state-active:bg-surface-tertiary radix-state-active:text-text-primary',)}>diff --git a/client/src/components/Nav/SettingsTabs/About/About.spec.tsx b/client/src/components/Nav/SettingsTabs/About/About.spec.tsxindex 46d9158668..f7808abbc9 100644--- a/client/src/components/Nav/SettingsTabs/About/About.spec.tsx+++ b/client/src/components/Nav/SettingsTabs/About/About.spec.tsx@@ -1,7 +1,7 @@import React from 'react';-import { act, render, screen } from '@testing-library/react';import userEvent from '@testing-library/user-event';import { Constants } from 'librechat-data-provider';+import { act, render, screen } from '@testing-library/react';import type { TStartupConfig } from 'librechat-data-provider';import About from './About';@@ -110,9 +110,7 @@ describe('About', () => {expect(screen.getByRole('button', { name: /com_nav_about_diagnostics_copy/i }),).toBeInTheDocument();- expect(- screen.queryByRole('button', { name: /com_nav_about_diagnostics_copied/i }),- ).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: /com_ui_copied/i })).not.toBeInTheDocument();expect(screen.getByRole('status').textContent).toBe('');});@@ -123,9 +121,7 @@ describe('About', () => {render(<About />);await user.click(screen.getByRole('button', { name: /com_nav_about_diagnostics_copy/i }));- expect(- screen.getByRole('button', { name: /com_nav_about_diagnostics_copied/i }),- ).toBeInTheDocument();+ expect(screen.getByRole('button', { name: /com_ui_copied/i })).toBeInTheDocument();act(() => {jest.advanceTimersByTime(2000);@@ -164,7 +160,7 @@ describe('About', () => {expect(status.textContent).toBe('');await user.click(screen.getByRole('button', { name: /com_nav_about_diagnostics_copy/i }));- expect(status.textContent).toMatch(/com_nav_about_diagnostics_copied/);+ expect(status.textContent).toMatch(/com_ui_copied/);});});});diff --git a/client/src/components/Nav/SettingsTabs/About/About.tsx b/client/src/components/Nav/SettingsTabs/About/About.tsxindex 820f7dc2bb..cae1413921 100644--- a/client/src/components/Nav/SettingsTabs/About/About.tsx+++ b/client/src/components/Nav/SettingsTabs/About/About.tsx@@ -98,19 +98,18 @@ function About() {/></dl>- <div className="mt-4 flex flex-col items-start gap-3 border-t border-border-light pt-4">- <p className="text-xs text-text-secondary">+ <div className="mt-4 flex flex-col items-start gap-3 border-t border-border-light pt-4 sm:flex-row sm:items-center sm:justify-between sm:gap-4">+ <p className="min-w-0 flex-1 text-xs text-text-secondary">{localize('com_nav_about_diagnostics_description')}</p><CopyButtonisCopied={isCopied}onClick={handleCopy}label={localize('com_nav_about_diagnostics_copy')}- copiedLabel={localize('com_nav_about_diagnostics_copied')}- className="ml-0 gap-2 self-start rounded-lg border border-border-light bg-surface-secondary px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-surface-tertiary"+ className="ml-0 shrink-0 gap-2 self-start rounded-lg border border-border-light bg-surface-secondary px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-surface-tertiary sm:self-auto"/><span className="sr-only" role="status" aria-live="polite" aria-atomic="true">- {isCopied ? localize('com_nav_about_diagnostics_copied') : ''}+ {isCopied ? localize('com_ui_copied') : ''}</span></div></div>diff --git a/client/src/components/Nav/SettingsTabs/Account/Avatar.tsx b/client/src/components/Nav/SettingsTabs/Account/Avatar.tsxindex 93a92fe6ca..a65e65cea0 100644--- a/client/src/components/Nav/SettingsTabs/Account/Avatar.tsx+++ b/client/src/components/Nav/SettingsTabs/Account/Avatar.tsx@@ -18,10 +18,32 @@ import {} from '@librechat/client';import type { TUser } from 'librechat-data-provider';import { useUploadAvatarMutation, useGetFileConfig } from '~/data-provider';-import { cn, formatBytes } from '~/utils';+import { cn } from '~/utils';import { useLocalize } from '~/hooks';import store from '~/store';+const AVATAR_FILE_EXTENSIONS = ['.jpeg', '.jpg', '.png'];+const AVATAR_MIME_TYPES = new Set(['image/jpeg', 'image/png']);+const DEFAULT_AVATAR_SIZE_LIMIT_MB = 2;++const getAvatarSizeLimitMB = (sizeLimit?: number | null) => {+ if (sizeLimit == null) {+ return DEFAULT_AVATAR_SIZE_LIMIT_MB;+ }++ return Number((sizeLimit / (1024 * 1024)).toFixed(2));+};++const isSupportedAvatarFile = (file: File) => {+ const fileName = file.name.toLowerCase();+ const hasSupportedExtension = AVATAR_FILE_EXTENSIONS.some((extension) =>+ fileName.endsWith(extension),+ );+ const hasSupportedMimeType = file.type === '' || AVATAR_MIME_TYPES.has(file.type.toLowerCase());++ return hasSupportedExtension && hasSupportedMimeType;+};+interface AvatarEditorRef {getImageScaledToCanvas: () => HTMLCanvasElement;getImage: () => HTMLImageElement;@@ -51,6 +73,7 @@ function Avatar() {const localize = useLocalize();const { showToast } = useToastContext();+ const avatarSizeLimitMB = getAvatarSizeLimitMB(fileConfig.avatarSizeLimit);const { mutate: uploadAvatar, isLoading: isUploading } = useUploadAvatarMutation({onSuccess: (data) => {@@ -70,21 +93,23 @@ function Avatar() {const handleFile = useCallback((file: File | undefined) => {- if (fileConfig.avatarSizeLimit != null && file && file.size <= fileConfig.avatarSizeLimit) {+ const isWithinSizeLimit =+ file != null &&+ (fileConfig.avatarSizeLimit == null || file.size <= fileConfig.avatarSizeLimit);++ if (file && isSupportedAvatarFile(file) && isWithinSizeLimit) {setImage(file);setScale(1);setRotation(0);setPosition({ x: 0.5, y: 0.5 });} else {- const megabytes =- fileConfig.avatarSizeLimit != null ? formatBytes(fileConfig.avatarSizeLimit) : 2;showToast({- message: localize('com_ui_upload_invalid_var', { 0: megabytes + '' }),+ message: localize('com_ui_avatar_invalid_file', { 0: avatarSizeLimitMB }),status: 'error',});}},- [fileConfig.avatarSizeLimit, localize, showToast],+ [avatarSizeLimitMB, fileConfig.avatarSizeLimit, localize, showToast],);const handleScaleChange = (value: number[]) => {@@ -134,13 +159,9 @@ function Avatar() {e.preventDefault();}, []);- const openFileDialog = useCallback(() => {- fileInputRef.current?.click();- }, []);-const handleSelectFileClick = (event: React.MouseEvent) => {- event.stopPropagation();- openFileDialog();+ event.preventDefault();+ fileInputRef.current?.click();};const resetImage = useCallback(() => {@@ -176,7 +197,7 @@ function Avatar() {</OGDialogTrigger></div>- <OGDialogContent showCloseButton={false} className="w-11/12 max-w-md">+ <OGDialogContent className="w-11/12 max-w-md"><OGDialogHeader><OGDialogTitle className="text-lg font-medium leading-6 text-text-primary">{image != null ? localize('com_ui_preview') : localize('com_ui_upload_image')}@@ -323,27 +344,14 @@ function Avatar() {className="flex h-72 w-full flex-col items-center justify-center rounded-lg border-2 border-dashed border-border-medium bg-transparent transition-colors hover:border-border-heavy"onDrop={handleDrop}onDragOver={handleDragOver}- role="button"- tabIndex={0}- onClick={openFileDialog}- onKeyDown={(e) => {- if (e.key === 'Enter' || e.key === ' ') {- e.preventDefault();- openFileDialog();- }- }}- aria-label={localize('com_ui_upload_avatar_label')}>- <FileImage className="mb-4 size-16 text-text-tertiary" />+ <FileImage className="mb-4 size-16 text-text-tertiary" aria-hidden="true" /><p className="mb-2 text-center text-sm font-medium text-text-primary">- {localize('com_ui_drag_drop')}+ {localize('com_ui_avatar_drop_image')}</p><p className="mb-4 text-center text-xs text-text-secondary">- {localize('com_ui_max_file_size', {- 0:- fileConfig.avatarSizeLimit != null- ? formatBytes(fileConfig.avatarSizeLimit)- : '2MB',+ {localize('com_ui_avatar_file_requirements', {+ 0: avatarSizeLimitMB,})}</p><Button type="button" variant="secondary" onClick={handleSelectFileClick}>diff --git a/client/src/components/Nav/SettingsTabs/Account/__tests__/Avatar.spec.tsx b/client/src/components/Nav/SettingsTabs/Account/__tests__/Avatar.spec.tsxnew file mode 100644index 0000000000..6a81fe88fb--- /dev/null+++ b/client/src/components/Nav/SettingsTabs/Account/__tests__/Avatar.spec.tsx@@ -0,0 +1,65 @@+import userEvent from '@testing-library/user-event';+import { fireEvent, render, screen, waitFor } from 'test/layout-test-utils';+import Avatar from '../Avatar';++const mockShowToast = jest.fn();++jest.mock('@librechat/client', () => ({+ ...jest.requireActual('@librechat/client'),+ useToastContext: () => ({ showToast: mockShowToast }),+}));++jest.mock('~/data-provider', () => ({+ ...jest.requireActual('~/data-provider'),+ useGetFileConfig: () => ({ data: { avatarSizeLimit: 2 * 1024 * 1024 } }),+ useUploadAvatarMutation: () => ({ mutate: jest.fn(), isLoading: false }),+}));++describe('Avatar upload dialog', () => {+ beforeEach(() => {+ mockShowToast.mockClear();+ });++ const openDialog = async () => {+ render(<Avatar />);+ await userEvent.click(screen.getByRole('button', { name: 'Change picture' }));+ };++ it('shows avatar-specific guidance and the configured size unit', async () => {+ await openDialog();++ expect(screen.getByText('Drop an image here to use as your profile picture')).toBeVisible();+ expect(screen.getByText('PNG, JPG, or JPEG, up to 2 MB')).toBeVisible();+ expect(screen.getByLabelText('File input for avatar')).toHaveAttribute(+ 'accept',+ '.png, .jpg, .jpeg',+ );+ });++ it('closes from the top-right dialog close button', async () => {+ await openDialog();++ await userEvent.click(screen.getByRole('button', { name: 'Close' }));++ await waitFor(() => {+ expect(screen.queryByRole('heading', { name: 'Upload an image' })).not.toBeInTheDocument();+ });+ });++ it('rejects a dropped file outside the advertised image formats', async () => {+ await openDialog();+ const dropTarget = screen.getByText(+ 'Drop an image here to use as your profile picture',+ ).parentElement;+ const unsupportedFile = new File(['gif'], 'avatar.gif', { type: 'image/gif' });++ fireEvent.drop(dropTarget as HTMLElement, {+ dataTransfer: { files: [unsupportedFile] },+ });++ expect(mockShowToast).toHaveBeenCalledWith({+ message: 'Choose a PNG, JPG, or JPEG image up to 2 MB',+ status: 'error',+ });+ });+});diff --git a/client/src/components/Nav/SettingsTabs/ApiKeys/ApiKeys.tsx b/client/src/components/Nav/SettingsTabs/ApiKeys/ApiKeys.tsxindex 769daf0476..4c0d6cbecd 100644--- a/client/src/components/Nav/SettingsTabs/ApiKeys/ApiKeys.tsx+++ b/client/src/components/Nav/SettingsTabs/ApiKeys/ApiKeys.tsx@@ -30,7 +30,7 @@ export default function ApiKeys() {</Button></OGDialogTrigger><OGDialogContent- className="w-11/12 max-w-2xl bg-surface-primary text-text-primary shadow-2xl"+ className="w-11/12 max-w-2xl bg-surface-dialog text-text-primary shadow-2xl"aria-describedby={undefined}><OGDialogHeader className="space-y-0 pr-8 text-left">diff --git a/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsx b/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsxindex fe8defc00e..5e66812729 100644--- a/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsx+++ b/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsx@@ -279,7 +279,7 @@ export default function SharedLinks() {<OGDialogContenttitle={localize('com_nav_shared_links')}- className="w-11/12 max-w-5xl bg-surface-primary text-text-primary shadow-2xl"+ className="w-11/12 max-w-5xl bg-surface-dialog text-text-primary shadow-2xl"><OGDialogHeader><OGDialogTitle>{localize('com_nav_shared_links')}</OGDialogTitle>diff --git a/client/src/components/Nav/SettingsTabs/General/ArchivedChatsModal.tsx b/client/src/components/Nav/SettingsTabs/General/ArchivedChatsModal.tsxindex a0faa5c5c1..6740b642d1 100644--- a/client/src/components/Nav/SettingsTabs/General/ArchivedChatsModal.tsx+++ b/client/src/components/Nav/SettingsTabs/General/ArchivedChatsModal.tsx@@ -31,7 +31,7 @@ export function ArchivedChatsModal({tabIndex={-1}onOpenAutoFocus={handleOpenAutoFocus}title={localize('com_nav_archived_chats')}- className="w-11/12 max-w-[1000px] bg-surface-primary text-text-primary shadow-2xl focus:outline-none"+ className="w-11/12 max-w-[1000px] bg-surface-dialog text-text-primary shadow-2xl focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-text-primary"><OGDialogHeader><OGDialogTitle>{localize('com_nav_archived_chats')}</OGDialogTitle>diff --git a/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx b/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsxindex 63b5cebf70..eca0a29619 100644--- a/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx+++ b/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx@@ -3,16 +3,18 @@ import {Button,CircleHelpIcon,Dropdown,- HoverCard,- HoverCardContent,- HoverCardPortal,- HoverCardTrigger,Input,Label,SecretInput,Spinner,useToastContext,} from '@librechat/client';+import {+ Root as Popover,+ Portal as PopoverPortal,+ Trigger as PopoverTrigger,+ Content as PopoverContent,+} from '@radix-ui/react-popover';import type {TLangfuseConnectionStatus,TLangfuseConnectionTestErrorCode,@@ -24,7 +26,6 @@ import {useTestLangfuseConnectionMutation,} from '~/data-provider';import { useLocalize } from '~/hooks';-import { ESide } from '~/common';type ConnectionTestState = 'idle' | 'unverified' | 'checking' | 'connected' | 'failed';@@ -81,11 +82,11 @@ function getConnectionTestErrorLabelKey(function getConnectionStatusDotClass(state: ConnectionTestState): string {switch (state) {case 'connected':- return 'bg-green-500';+ return 'bg-status-success';case 'failed':- return 'bg-red-500';+ return 'bg-status-error';case 'checking':- return 'bg-yellow-500';+ return 'bg-status-warning';case 'idle':default:return 'border border-border-medium';@@ -249,13 +250,13 @@ export default function LangfuseConnection() {: localize(getConnectionStatusLabelKey(connectionTestState));const connectionStatusDotClass = getConnectionStatusDotClass(connectionTestState);const connectionStatusTextClass =- connectionTestState === 'failed' ? 'text-red-600 dark:text-red-400' : 'text-text-secondary';+ connectionTestState === 'failed' ? 'text-text-destructive' : 'text-text-secondary';const connectionStatusTitle =connectionTestState === 'failed' ? localize('com_ui_langfuse_status_failed_hover') : undefined;const handleSave = () => {const payload = {- enabled: true,+ enabled: !secretConfigured || connectionStatus?.enabled === true,destination,publicKey: trimmedPublicKey,...(trimmedSecretKey ? { secretKey: trimmedSecretKey } : {}),@@ -281,49 +282,6 @@ export default function LangfuseConnection() {});};- const handleCancel = () => {- const storedDestination = connectionStatus?.destination;- setDestination(storedDestination ?? '');- setPublicKey(connectionStatus?.publicKey ?? '');- setSecretKey('');- setIsEditingPublicKey(false);- setIsEditingSecretKey(false);-- if (!storedDestination || !connectionStatus?.publicKey) {- setConnectionTestState('idle');- setConnectionTestMessage('');- return;- }-- if (!connectionStatus.destinations?.some(({ key }) => key === storedDestination)) {- connectionTestRequestRef.current += 1;- setConnectionTestState('failed');- setConnectionTestMessage(localize('com_ui_langfuse_destination_removed'));- return;- }-- const requestId = ++connectionTestRequestRef.current;- setConnectionTestState('checking');- setConnectionTestMessage('');- testMutation.mutate(- { destination: storedDestination, publicKey: connectionStatus.publicKey },- {- onSuccess: (result) => {- if (requestId !== connectionTestRequestRef.current) return;- setConnectionTestState(result.success ? 'connected' : 'failed');- setConnectionTestMessage(- result.success ? '' : localize(getConnectionTestErrorLabelKey(result.errorCode)),- );- },- onError: () => {- if (requestId !== connectionTestRequestRef.current) return;- setConnectionTestState('failed');- setConnectionTestMessage(localize('com_ui_langfuse_test_error'));- },- },- );- };-const handleDestinationChange = (nextDestination: string) => {setDestination(nextDestination);const requestId = ++connectionTestRequestRef.current;@@ -440,44 +398,48 @@ export default function LangfuseConnection() {return (<div className="flex flex-col gap-4">- <HoverCard openDelay={50}>- <div className="flex flex-col gap-2">- <div className="flex items-start gap-4">- <div className="min-w-0">- <div className="flex flex-wrap items-center gap-2">- <div className="font-medium">{localize('com_ui_langfuse_title')}</div>- <div className="rounded-full border border-purple-600/40 bg-purple-500/10 px-2 py-0.5 text-xs font-medium text-purple-700 hover:bg-purple-700/10 dark:text-purple-400">- {localize('com_ui_beta')}- </div>- <HoverCardTrigger>- <CircleHelpIcon className="h-4 w-4 text-text-tertiary" />- </HoverCardTrigger>- </div>- <div className="mt-1 max-w-md text-xs text-text-secondary">- {localize('com_ui_langfuse_description')}- </div>+ <Popover>+ <div className="flex flex-wrap items-start justify-between gap-x-4 gap-y-2">+ <div className="flex min-w-0 flex-1 flex-wrap items-center gap-2">+ <div className="font-medium">{localize('com_ui_langfuse_title')}</div>+ <div className="rounded-full border border-brand-purple/40 bg-brand-purple/10 px-2 py-0.5 text-xs font-medium text-brand-purple">+ {localize('com_ui_beta')}</div>+ <PopoverTrigger asChild>+ <button+ type="button"+ aria-label={localize('com_ui_more_info')}+ className="inline-flex size-6 items-center justify-center rounded-md text-text-tertiary transition-colors hover:bg-surface-hover hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-primary"+ >+ <CircleHelpIcon className="h-4 w-4" aria-hidden="true" />+ </button>+ </PopoverTrigger></div><div- className={`flex items-center gap-1.5 text-xs ${connectionStatusTextClass}`}+ data-testid="langfuse-connection-status"+ className={`ml-auto flex max-w-full shrink-0 items-start justify-end gap-1.5 text-right text-xs sm:max-w-[50%] ${connectionStatusTextClass}`}aria-live="polite"title={connectionStatusTitle}>{connectionTestState === 'checking' ? (<Spinner className="h-3 w-3" />) : (- <span className={`h-2 w-2 rounded-full ${connectionStatusDotClass}`} />+ <span className={`mt-1 h-2 w-2 shrink-0 rounded-full ${connectionStatusDotClass}`} />)}<span>{connectionStatusLabel}</span></div></div>- <HoverCardPortal>- <HoverCardContent side={ESide.Top} className="w-80">+ <PopoverPortal>+ <PopoverContent+ side="top"+ sideOffset={6}+ className="z-[999] w-80 rounded-xl border border-border-light bg-surface-secondary p-4 text-text-primary shadow-md outline-none"+ ><p className="text-sm text-text-secondary">{localize('com_ui_langfuse_beta_info')}</p>- </HoverCardContent>- </HoverCardPortal>- </HoverCard>+ </PopoverContent>+ </PopoverPortal>+ </Popover><div className="flex flex-col gap-1.5"><Label id="langfuse-destination-label">{localize('com_ui_langfuse_destination')}</Label>@@ -577,21 +539,16 @@ export default function LangfuseConnection() {<div className="flex min-h-9 items-center justify-end gap-2">{isEditing ? (- <>- <Button variant="outline" disabled={busy} onClick={handleCancel}>- {localize('com_ui_cancel')}- </Button>- <Button disabled={!canSubmit || busy} onClick={handleSave}>- {testMutation.isLoading ? (- <span className="flex items-center gap-2">- <Spinner className="h-4 w-4" />- {localize('com_ui_langfuse_testing')}- </span>- ) : (- localize('com_ui_langfuse_save_and_enable')- )}- </Button>- </>+ <Button variant="submit" disabled={!canSubmit || busy} onClick={handleSave}>+ {testMutation.isLoading ? (+ <span className="flex items-center gap-2">+ <Spinner className="h-4 w-4" />+ {localize('com_ui_langfuse_testing')}+ </span>+ ) : (+ localize('com_ui_save')+ )}+ </Button>) : (<Buttonvariant={connectionStatus?.enabled === true ? 'outline' : 'submit'}diff --git a/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsx b/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsxindex 506915da4e..26e18a8f3b 100644--- a/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsx+++ b/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsx@@ -104,8 +104,13 @@ describe('LangfuseConnection', () => {expect(screen.getByRole('button', { name: 'Show secret' })).toBeInTheDocument();expect(screen.queryByText('com_ui_langfuse_test')).not.toBeInTheDocument();expect(screen.getByText('com_ui_langfuse_status_not_configured')).toBeInTheDocument();- expect(screen.getByRole('button', { name: 'com_ui_cancel' })).toBeVisible();- expect(screen.getByRole('button', { name: 'com_ui_langfuse_save_and_enable' })).toBeVisible();+ expect(screen.queryByRole('button', { name: 'com_ui_cancel' })).not.toBeInTheDocument();+ expect(screen.getByRole('button', { name: 'com_ui_save' })).toHaveClass('bg-surface-submit');+ expect(screen.getByTestId('langfuse-connection-status')).toHaveTextContent(+ 'com_ui_langfuse_status_not_configured',+ );+ expect(screen.queryByText('com_ui_langfuse_description')).not.toBeInTheDocument();+ expect(screen.getByRole('button', { name: 'com_ui_more_info' })).toBeVisible();expect(screen.queryByRole('button', { name: 'com_ui_langfuse_enable' }),).not.toBeInTheDocument();@@ -131,6 +136,15 @@ describe('LangfuseConnection', () => {expect(screen.queryByText('com_ui_langfuse_status_not_configured')).not.toBeInTheDocument();});+ it('opens the connection explanation when the help button is clicked', async () => {+ render(<LangfuseConnection />);++ expect(screen.queryByText('com_ui_langfuse_description')).not.toBeInTheDocument();+ await userEvent.click(screen.getByRole('button', { name: 'com_ui_more_info' }));++ expect(await screen.findByText('com_ui_langfuse_beta_info')).toBeVisible();+ });+it('renders a retryable error when the stored connection cannot be loaded', async () => {mockGet.mockReturnValue({data: undefined,@@ -212,7 +226,7 @@ describe('LangfuseConnection', () => {expect(screen.getByText('pk-lf-...515f')).toBeInTheDocument();expect(screen.queryByLabelText('com_ui_langfuse_secret_key')).not.toBeInTheDocument();expect(screen.getByText('sk-lf-...515f')).toBeInTheDocument();- expect(screen.queryByText('com_ui_langfuse_save_and_enable')).not.toBeInTheDocument();+ expect(screen.queryByText('com_ui_save')).not.toBeInTheDocument();expect(screen.getByTestId('langfuse-destination')).toBeEnabled();expect(screen.getByRole('button', { name: 'com_ui_langfuse_disable' })).toBeEnabled();await waitFor(() => expect(mockTest).toHaveBeenCalledTimes(1));@@ -258,7 +272,7 @@ describe('LangfuseConnection', () => {target: { value: 'sk-lf-secret' },});- await userEvent.click(screen.getByText('com_ui_langfuse_save_and_enable'));+ await userEvent.click(screen.getByText('com_ui_save'));expect(mockTest).not.toHaveBeenCalled();expect(mockUpdate).toHaveBeenCalledTimes(1);@@ -294,7 +308,7 @@ describe('LangfuseConnection', () => {target: { value: 'sk-lf-secret' },});- await userEvent.click(screen.getByText('com_ui_langfuse_save_and_enable'));+ await userEvent.click(screen.getByText('com_ui_save'));expect(mockTest).not.toHaveBeenCalled();expect(screen.queryByLabelText('com_ui_langfuse_secret_key')).not.toBeInTheDocument();@@ -324,12 +338,12 @@ describe('LangfuseConnection', () => {expect(mockTest).not.toHaveBeenCalled();expect(screen.getByLabelText(/com_ui_langfuse_secret_key/)).toBeVisible();expect(screen.getByText('com_ui_langfuse_status_not_verified')).toBeInTheDocument();- expect(screen.getByText('com_ui_langfuse_save_and_enable')).toBeDisabled();+ expect(screen.getByText('com_ui_save')).toBeDisabled();fireEvent.change(screen.getByLabelText(/com_ui_langfuse_secret_key/), {target: { value: 'sk-lf-replacement' },});- await userEvent.click(screen.getByText('com_ui_langfuse_save_and_enable'));+ await userEvent.click(screen.getByText('com_ui_save'));expect(mockTest).not.toHaveBeenCalled();expect(mockUpdate).toHaveBeenCalledTimes(1);@@ -363,8 +377,8 @@ describe('LangfuseConnection', () => {}),);- expect(screen.getByRole('button', { name: 'com_ui_cancel' })).toBeVisible();- expect(screen.getByRole('button', { name: 'com_ui_langfuse_save_and_enable' })).toBeVisible();+ expect(screen.queryByRole('button', { name: 'com_ui_cancel' })).not.toBeInTheDocument();+ expect(screen.getByRole('button', { name: 'com_ui_save' })).toBeVisible();expect(screen.queryByRole('button', { name: 'com_ui_langfuse_disable' }),).not.toBeInTheDocument();@@ -387,7 +401,7 @@ describe('LangfuseConnection', () => {fireEvent.change(secretKeyInput, {target: { value: 'sk-lf-replacement' },});- await userEvent.click(screen.getByText('com_ui_langfuse_save_and_enable'));+ await userEvent.click(screen.getByText('com_ui_save'));expect(mockTest).not.toHaveBeenCalled();expect(mockUpdate).toHaveBeenCalledTimes(1);@@ -398,52 +412,35 @@ describe('LangfuseConnection', () => {});});- it('restores the stored connection when editing is cancelled', async () => {+ it('preserves a disabled connection when saving edited credentials', async () => {mockGet.mockReturnValue({data: {configured: true,- enabled: true,- destinations: [- { key: 'eu', baseUrl: 'https://cloud.langfuse.com' },- { key: 'us', baseUrl: 'https://us.cloud.langfuse.com' },- ],+ enabled: false,+ destinations: [{ key: 'eu', baseUrl: 'https://cloud.langfuse.com' }],destination: 'eu',- publicKey: 'pk-lf-original',+ publicKey: 'pk-lf-1',secretKeyPreview: 'sk-lf-...515f',},});render(<LangfuseConnection />);await waitFor(() => expect(mockTest).toHaveBeenCalledTimes(1));- await selectDestination('us');- expect(screen.getByText('com_ui_langfuse_status_not_verified')).toBeVisible();await userEvent.click(screen.getByRole('button', {name: 'com_ui_edit com_ui_langfuse_public_key',}),);- fireEvent.change(screen.getByLabelText('com_ui_langfuse_public_key'), {- target: { value: 'pk-lf-edited' },- });- fireEvent.change(screen.getByLabelText(/com_ui_langfuse_secret_key/), {- target: { value: 'sk-lf-edited' },- });- mockTest.mockImplementationOnce((_payload, options) => {- options?.onSuccess?.({ success: true });- });- await userEvent.click(screen.getByRole('button', { name: 'com_ui_cancel' }));+ await userEvent.click(screen.getByRole('button', { name: 'com_ui_save' }));- expect(await screen.findByText('com_ui_langfuse_status_connected')).toBeVisible();- expect(mockTest.mock.calls.at(-1)?.[0]).toEqual({- destination: 'eu',- publicKey: 'pk-lf-original',- });- expect(screen.getByRole('button', { name: 'com_ui_langfuse_disable' })).toBeEnabled();- expect(screen.getByTestId('langfuse-destination')).toHaveTextContent(destinationLabels.eu);- expect(screen.getByText('pk-lf-...inal')).toBeInTheDocument();- expect(screen.getByText('sk-lf-...515f')).toBeInTheDocument();- expect(screen.queryByText('com_ui_langfuse_save_and_enable')).not.toBeInTheDocument();- expect(mockUpdate).not.toHaveBeenCalled();+ expect(mockUpdate).toHaveBeenCalledWith(+ {+ enabled: false,+ destination: 'eu',+ publicKey: 'pk-lf-1',+ },+ expect.any(Object),+ );});it('shows a save failure when mandatory server verification rejects the connection', async () => {@@ -459,7 +456,7 @@ describe('LangfuseConnection', () => {target: { value: 'sk-lf-secret' },});- await userEvent.click(screen.getByText('com_ui_langfuse_save_and_enable'));+ await userEvent.click(screen.getByText('com_ui_save'));expect(mockTest).not.toHaveBeenCalled();expect(mockUpdate).toHaveBeenCalledTimes(1);@@ -496,7 +493,7 @@ describe('LangfuseConnection', () => {fireEvent.change(screen.getByLabelText(/com_ui_langfuse_secret_key/), {target: { value: 'sk-lf-replacement' },});- await userEvent.click(screen.getByText('com_ui_langfuse_save_and_enable'));+ await userEvent.click(screen.getByText('com_ui_save'));expect(mockTest).not.toHaveBeenCalled();expect(mockUpdate).toHaveBeenCalledWith(@@ -544,7 +541,7 @@ describe('LangfuseConnection', () => {destination: 'eu',publicKey: 'pk-lf-1',});- expect(screen.queryByText('com_ui_langfuse_save_and_enable')).not.toBeInTheDocument();+ expect(screen.queryByText('com_ui_save')).not.toBeInTheDocument();expect(screen.getByRole('button', { name: 'com_ui_langfuse_enable' })).toBeEnabled();});@@ -613,7 +610,7 @@ describe('LangfuseConnection', () => {{ enabled: true, destination: 'eu', publicKey: 'pk-lf-1' },expect.any(Object),);- expect(screen.queryByText('com_ui_langfuse_save_and_enable')).not.toBeInTheDocument();+ expect(screen.queryByText('com_ui_save')).not.toBeInTheDocument();expect(screen.getByRole('button', { name: 'com_ui_langfuse_disable' })).toBeEnabled();});});diff --git a/client/src/components/Nav/SettingsTabs/ProviderKeys/ProviderKeyRow.tsx b/client/src/components/Nav/SettingsTabs/ProviderKeys/ProviderKeyRow.tsxindex 1d6a2b2e37..10b2f665f3 100644--- a/client/src/components/Nav/SettingsTabs/ProviderKeys/ProviderKeyRow.tsx+++ b/client/src/components/Nav/SettingsTabs/ProviderKeys/ProviderKeyRow.tsx@@ -2,6 +2,7 @@ import React, { useMemo, useState } from 'react';import { Button } from '@librechat/client';import { alternateName, getEndpointField } from 'librechat-data-provider';import type { TEndpointsConfig } from 'librechat-data-provider';+import { formatKeyExpiryLabel } from '~/components/Input/SetKeyDialog/utils';import { SetKeyDialog } from '~/components/Input/SetKeyDialog';import { useUserKey, useLocalize } from '~/hooks';import { icons } from '~/hooks/Endpoint/Icons';@@ -32,7 +33,7 @@ export default function ProviderKeyRow({ endpoint, endpointsConfig }: ProviderKeif (expiry === 'never') {return localize('com_endpoint_config_key_never_expires');}- return `${localize('com_endpoint_config_key_encryption')} ${new Date(expiry).toLocaleString()}`;+ return formatKeyExpiryLabel(localize, expiry);}, [expiry, localize]);return (diff --git a/client/src/components/Nav/SettingsTabs/ProviderKeys/ProviderKeys.tsx b/client/src/components/Nav/SettingsTabs/ProviderKeys/ProviderKeys.tsxindex ea591daa33..4e23a782e0 100644--- a/client/src/components/Nav/SettingsTabs/ProviderKeys/ProviderKeys.tsx+++ b/client/src/components/Nav/SettingsTabs/ProviderKeys/ProviderKeys.tsx@@ -1,4 +1,4 @@-import { useState } from 'react';+import { useRef, useState } from 'react';import {Label,Button,@@ -17,9 +17,15 @@ import { useLocalize } from '~/hooks';export default function ProviderKeys() {const localize = useLocalize();const [open, setOpen] = useState(false);+ const contentRef = useRef<HTMLDivElement>(null);const { data: endpointsConfig } = useGetEndpointsQuery();const endpoints = useProviderKeys();+ const handleOpenAutoFocus = (event: Event) => {+ event.preventDefault();+ contentRef.current?.focus();+ };+return (<div className="flex items-center justify-between"><Label id="provider-api-keys-label">@@ -32,7 +38,10 @@ export default function ProviderKeys() {</Button></OGDialogTrigger><OGDialogContent- className="w-11/12 max-w-2xl bg-surface-primary text-text-primary shadow-2xl"+ ref={contentRef}+ tabIndex={-1}+ onOpenAutoFocus={handleOpenAutoFocus}+ className="w-11/12 max-w-2xl bg-surface-dialog text-text-primary shadow-2xl focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-text-primary"aria-describedby={undefined}><OGDialogHeader className="space-y-0 pr-8 text-left">diff --git a/client/src/components/Nav/SettingsTabs/ProviderKeys/__tests__/ProviderKeyRow.spec.tsx b/client/src/components/Nav/SettingsTabs/ProviderKeys/__tests__/ProviderKeyRow.spec.tsxnew file mode 100644index 0000000000..87ada52e46--- /dev/null+++ b/client/src/components/Nav/SettingsTabs/ProviderKeys/__tests__/ProviderKeyRow.spec.tsx@@ -0,0 +1,45 @@+import type { TEndpointsConfig } from 'librechat-data-provider';+import { changeLanguageSafely, initializeI18n } from '~/locales/i18n';+import { render, screen } from 'test/layout-test-utils';+import ProviderKeyRow from '../ProviderKeyRow';++const mockExpiry = '2026-08-11T12:00:00.000Z';++jest.mock('~/hooks', () => ({+ useLocalize: jest.requireActual('~/hooks/useLocalize').default,+ useUserKey: () => ({+ getExpiry: () => mockExpiry,+ checkExpiry: () => true,+ }),+}));++jest.mock('~/hooks/Endpoint/Icons', () => ({ icons: {} }));+jest.mock('~/utils', () => ({ getIconKey: () => '' }));+jest.mock('~/components/Input/SetKeyDialog', () => ({ SetKeyDialog: () => null }));++describe('ProviderKeyRow', () => {+ beforeAll(async () => {+ await initializeI18n();+ });++ afterEach(async () => {+ await changeLanguageSafely('en');+ });++ it('interpolates a finite key expiry without leaving a placeholder', () => {+ render(<ProviderKeyRow endpoint="openAI" endpointsConfig={{} as TEndpointsConfig} />);++ const formattedExpiry = new Date(mockExpiry).toLocaleString();+ expect(+ screen.getByText(`Current key is encrypted and will be deleted at ${formattedExpiry}`),+ ).toBeInTheDocument();+ expect(screen.queryByText(/\{\{0\}\}/)).not.toBeInTheDocument();+ });++ it('preserves the expiry for translations that predate interpolation', async () => {+ await changeLanguageSafely('fr');+ render(<ProviderKeyRow endpoint="openAI" endpointsConfig={{} as TEndpointsConfig} />);++ expect(screen.getByText(new RegExp(new Date(mockExpiry).toLocaleString()))).toBeInTheDocument();+ });+});diff --git a/client/src/components/Nav/SettingsTabs/ProviderKeys/__tests__/ProviderKeys.spec.tsx b/client/src/components/Nav/SettingsTabs/ProviderKeys/__tests__/ProviderKeys.spec.tsxnew file mode 100644index 0000000000..3717f2ece1--- /dev/null+++ b/client/src/components/Nav/SettingsTabs/ProviderKeys/__tests__/ProviderKeys.spec.tsx@@ -0,0 +1,28 @@+import userEvent from '@testing-library/user-event';+import { fireEvent, render, screen, waitFor } from 'test/layout-test-utils';+import ProviderKeys from '../ProviderKeys';++jest.mock('~/data-provider', () => ({+ ...jest.requireActual('~/data-provider'),+ useGetEndpointsQuery: () => ({ data: {} }),+}));++jest.mock('../useProviderKeys', () => () => []);++describe('ProviderKeys', () => {+ it('keeps help hidden until its trigger receives focus', async () => {+ render(<ProviderKeys />);++ await userEvent.click(screen.getByRole('button', { name: 'Provider API keys' }));++ const dialog = screen.getByRole('dialog');+ const helpText = 'Manage API keys for endpoints configured to use a user-provided key.';+ const helpTrigger = screen.getByLabelText(helpText);++ await waitFor(() => expect(dialog).toHaveFocus());+ expect(screen.queryByText(helpText)).not.toBeInTheDocument();++ fireEvent.focus(helpTrigger);+ expect(await screen.findByText(helpText)).toBeVisible();+ });+});diff --git a/client/src/components/Projects/ProjectCreateDialog.tsx b/client/src/components/Projects/ProjectCreateDialog.tsxindex 427e024660..faf0fc572c 100644--- a/client/src/components/Projects/ProjectCreateDialog.tsx+++ b/client/src/components/Projects/ProjectCreateDialog.tsx@@ -7,7 +7,6 @@ import {type MutableRefObject,type ReactNode,} from 'react';-import type { TChatProject } from 'librechat-data-provider';import {Button,Input,@@ -17,6 +16,7 @@ import {Spinner,useToastContext,} from '@librechat/client';+import type { TChatProject } from 'librechat-data-provider';import { useCreateProjectMutation } from '~/data-provider';import { useLocalize } from '~/hooks';@@ -83,7 +83,7 @@ export default function ProjectCreateDialog({<OGDialogTemplatetitle={localize('com_ui_create_project')}showCloseButton={true}- className="w-11/12 max-w-lg bg-surface-primary text-text-primary"+ className="w-11/12 max-w-lg bg-surface-dialog text-text-primary"main={<form id={formId} onSubmit={handleCreate} className="space-y-2"><Label htmlFor={`${formId}-name`} className="text-sm font-medium text-text-primary">diff --git a/client/src/components/Prompts/dialogs/VariableDialog.tsx b/client/src/components/Prompts/dialogs/VariableDialog.tsxindex 8f59c3ee66..9151d6dc15 100644--- a/client/src/components/Prompts/dialogs/VariableDialog.tsx+++ b/client/src/components/Prompts/dialogs/VariableDialog.tsx@@ -31,7 +31,7 @@ const VariableDialog: React.FC<VariableDialogProps> = ({ open, onClose, group })return (<OGDialog open={open} onOpenChange={handleOpenChange}>- <OGDialogContent className="max-h-[90vh] max-w-full overflow-y-auto bg-surface-primary text-text-primary md:max-w-[60vw]">+ <OGDialogContent className="max-h-[90vh] max-w-full overflow-y-auto bg-surface-dialog text-text-primary md:max-w-[60vw]"><OGDialogTitle>{group.name}</OGDialogTitle><VariableForm group={group} onClose={onClose} /></OGDialogContent>diff --git a/client/src/components/SharePoint/SharePointPickerDialog.tsx b/client/src/components/SharePoint/SharePointPickerDialog.tsxindex 9d4ea583aa..fd10ffac62 100644--- a/client/src/components/SharePoint/SharePointPickerDialog.tsx+++ b/client/src/components/SharePoint/SharePointPickerDialog.tsx@@ -66,7 +66,7 @@ export default function SharePointPickerDialog({<OGDialogPortal><OGDialogOverlay className="bg-black/50" /><OGDialogContent- className="sharepoint-picker-bg fixed left-1/2 top-1/2 z-50 h-[680px] max-h-[90vh] max-w-[90vw] -translate-x-1/2 -translate-y-1/2 rounded-lg border bg-surface-primary p-2 shadow-lg focus:outline-none"+ className="sharepoint-picker-bg fixed left-1/2 top-1/2 z-50 h-[680px] max-h-[90vh] max-w-[90vw] -translate-x-1/2 -translate-y-1/2 rounded-lg border bg-surface-dialog p-2 shadow-lg focus:outline-none"showCloseButton={true}><OGDialogTitle className="sr-only">diff --git a/client/src/components/Sharing/AccessRolesPicker.tsx b/client/src/components/Sharing/AccessRolesPicker.tsxindex c94f419d63..ee30d842bf 100644--- a/client/src/components/Sharing/AccessRolesPicker.tsx+++ b/client/src/components/Sharing/AccessRolesPicker.tsx@@ -11,6 +11,7 @@ import { useLocalize } from '~/hooks';interface AccessRolesPickerProps {id?: string;+ ariaLabel?: string;resourceType?: ResourceType;selectedRoleId?: AccessRoleIds;onRoleChange: (roleId: AccessRoleIds) => void;@@ -19,12 +20,14 @@ interface AccessRolesPickerProps {export default function AccessRolesPicker({id,+ ariaLabel,resourceType = ResourceType.AGENT,selectedRoleId = AccessRoleIds.AGENT_VIEWER,onRoleChange,className = '',}: AccessRolesPickerProps) {const localize = useLocalize();+ const menuId = React.useId();const [isOpen, setIsOpen] = React.useState(false);const { data: accessRoles, isLoading: rolesLoading } = useGetAccessRolesQuery(resourceType);@@ -71,14 +74,17 @@ export default function AccessRolesPicker({});return (- <div className={className} id={id}>+ <div className={className}><DropdownPopup- menuId="access-roles-menu"+ menuId={`access-roles-menu-${menuId}`}isOpen={isOpen}setIsOpen={setIsOpen}trigger={<Ariakit.MenuButton- aria-label={selectedRoleInfo?.description || 'Select role'}+ id={id}+ aria-label={+ ariaLabel || selectedRoleInfo?.description || localize('com_ui_role_select')+ }className={cn('flex items-center justify-between gap-2 rounded-xl border border-border-light bg-transparent px-3 py-2 text-sm transition-colors hover:bg-surface-tertiary',)}diff --git a/client/src/components/Sharing/GenericGrantAccessDialog.tsx b/client/src/components/Sharing/GenericGrantAccessDialog.tsxindex 81806ed6e9..7e210ba1a0 100644--- a/client/src/components/Sharing/GenericGrantAccessDialog.tsx+++ b/client/src/components/Sharing/GenericGrantAccessDialog.tsx@@ -1,14 +1,17 @@import React, { useState, useEffect } from 'react';import { AccessRoleIds, ResourceType } from 'librechat-data-provider';-import { Share2Icon, Users, Link, CopyCheck, UserX, UserCheck, AlertCircle } from 'lucide-react';+import { Share2Icon, Users, Link, CopyCheck, UserCheck, AlertCircle } from 'lucide-react';import {+ Alert,Label,Button,Spinner,Skeleton,OGDialog,+ OGDialogHeader,+ OGDialogFooter,OGDialogTitle,- OGDialogClose,+ OGDialogDescription,OGDialogContent,OGDialogTrigger,TooltipAnchor,@@ -52,6 +55,8 @@ export default function GenericGrantAccessDialog({const { showToast } = useToastContext();const [isCopying, setIsCopying] = useState(false);const [isModalOpen, setIsModalOpen] = useState(false);+ const peopleSectionId = React.useId();+ const ownerErrorId = React.useId();const canSharePublic = useCanSharePublic(resourceType);const { hasPeoplePickerAccess, peoplePickerTypeFilter } = usePeoplePickerPermissions();@@ -202,15 +207,20 @@ export default function GenericGrantAccessDialog({}};- const handleCancel = () => {- // Reset to original state+ const resetDraft = () => {const shares = permissionsData?.principals || [];setAllShares(shares.map((share) => ({ ...share, isExisting: true })));setDefaultPermissionId(config?.defaultViewerRoleId);setIsPublic(currentIsPublic);setPublicRole(currentPublicRole || config?.defaultViewerRoleId || '');setHasChanges(false);- setIsModalOpen(false);+ };++ const handleModalOpenChange = (open: boolean) => {+ if (!open) {+ resetDraft();+ }+ setIsModalOpen(open);};// Validation and calculated values@@ -283,89 +293,110 @@ export default function GenericGrantAccessDialog({);return (- <OGDialog open={isModalOpen} onOpenChange={setIsModalOpen} modal>+ <OGDialog open={isModalOpen} onOpenChange={handleModalOpenChange} modal><OGDialogTrigger asChild>{TriggerComponent}</OGDialogTrigger>- <OGDialogContent className="max-h-[90vh] w-11/12 overflow-y-auto md:max-w-3xl">- <OGDialogTitle>- <div className="flex items-center gap-2">- <Users className="h-5 w-5" aria-hidden="true" />- {localize('com_ui_share_var', {- 0: config?.getShareMessage(resourceName),- })}+ <OGDialogContent className="flex max-h-[90dvh] w-11/12 max-w-5xl flex-col gap-0 overflow-hidden p-0">+ <OGDialogHeader className="shrink-0 px-5 py-5 pr-14 text-left sm:px-6">+ <div className="flex items-start gap-3">+ <div className="flex size-10 shrink-0 items-center justify-center rounded-xl border border-border-light bg-surface-secondary text-text-secondary">+ <Users className="size-5" aria-hidden="true" />+ </div>+ <div className="min-w-0 space-y-1">+ <OGDialogTitle className="truncate text-xl leading-7">+ {localize('com_ui_share_var', {+ 0: config?.getShareMessage(resourceName),+ })}+ </OGDialogTitle>+ <OGDialogDescription className="sr-only">+ {localize('com_ui_share_access_description')}+ </OGDialogDescription>+ </div></div>- </OGDialogTitle>-- <div className="space-y-6 p-2">- {/* Unified Search and Management Section */}- <div className="space-y-4">- {/* Search Bar with Default Permission Setting */}- {hasPeoplePickerAccess && (- <div className="space-y-2">- <h4 className="mb-2 flex items-center gap-2 text-sm font-medium text-text-primary">- <UserCheck className="h-4 w-4" aria-hidden="true" />- {localize('com_ui_user_group_permissions')} ( {allShares.length} )- </h4>-- <UnifiedPeopleSearch- onAddPeople={handleAddFromSearch}- placeholder={localize('com_ui_search_people_placeholder')}- typeFilter={peoplePickerTypeFilter}- excludeIds={allShares.map((s) => s.idOnTheSource)}- />-- {/* Unified User/Group List */}- {(() => {- if (isLoadingPermissions) {- return (- <div className="flex flex-col items-center gap-2">- <Skeleton className="h-[62px] w-full rounded-lg" />- <Skeleton className="h-[62px] w-full rounded-lg" />- </div>- );- }-- if (allShares.length === 0 && !hasChanges) {- return (- <div className="rounded-lg border-2 border-dashed border-border-light p-8 text-center">- <Users className="mx-auto h-8 w-8 text-text-primary" aria-hidden="true" />- <p className="mt-2 text-sm text-text-primary">- {localize('com_ui_no_individual_access')}+ </OGDialogHeader>++ <div+ className="min-h-0 flex-1 overflow-y-auto px-5 py-3 sm:px-6 sm:py-4"+ aria-busy={isLoadingPermissions}+ >+ {hasPeoplePickerAccess && (+ <section aria-labelledby={peopleSectionId} className="w-full min-w-0">+ <div className="flex items-center justify-between gap-3 px-1 pb-3">+ <h3+ id={peopleSectionId}+ className="flex min-w-0 items-center gap-2 text-sm font-semibold text-text-primary"+ >+ <UserCheck className="size-4 shrink-0 text-text-secondary" aria-hidden="true" />+ <span className="truncate">{localize('com_ui_user_group_permissions')}</span>+ </h3>+ <span className="flex size-6 shrink-0 items-center justify-center rounded-full bg-surface-tertiary text-xs font-medium text-text-secondary">+ {allShares.length}+ </span>+ </div>++ <div className="w-full space-y-3">+ {isLoadingPermissions ? (+ <div className="space-y-2" aria-live="polite">+ <span className="sr-only">{localize('com_ui_loading')}</span>+ <Skeleton className="h-10 w-full rounded-lg" />+ <Skeleton className="h-[62px] w-full rounded-xl" />+ <Skeleton className="h-[62px] w-full rounded-xl" />+ </div>+ ) : (+ <>+ <UnifiedPeopleSearch+ onAddPeople={handleAddFromSearch}+ label={localize('com_ui_search_people_placeholder')}+ placeholder={localize('com_ui_search_people_placeholder')}+ typeFilter={peoplePickerTypeFilter}+ excludeIds={allShares.map((s) => s.idOnTheSource)}+ />++ {!hasAtLeastOneOwner && hasChanges && (+ <Alert id={ownerErrorId} variant="error">+ {localize('com_ui_at_least_one_owner_required')}+ </Alert>+ )}++ {allShares.length === 0 ? (+ <div className="rounded-xl border border-dashed border-border-medium px-5 py-8 text-center">+ <div className="mx-auto flex size-10 items-center justify-center rounded-full bg-surface-tertiary text-text-secondary">+ <Users className="size-5" aria-hidden="true" />+ </div>+ <p className="mt-3 text-sm font-medium text-text-primary">+ {localize('com_ui_no_individual_resource_access')}</p>- <p className="mt-1 text-xs text-text-primary">+ <p className="mt-1 text-xs text-text-secondary">{localize('com_ui_search_above_to_add_people')}</p></div>- );- }-- return (- <div className="space-y-2">- {!hasAtLeastOneOwner && hasChanges && (- <div className="rounded-lg border border-status-error-border bg-status-error-subtle p-3 text-center">- <div className="flex items-center justify-center gap-2 text-sm text-text-destructive">- <UserX className="h-4 w-4" aria-hidden="true" />- {localize('com_ui_at_least_one_owner_required')}- </div>- </div>- )}+ ) : (<SelectedPrincipalsListprinciples={allShares}onRemoveHandler={handleRemoveShare}resourceType={resourceType}onRoleChange={(id, newRole) => handleRoleChange(id, newRole)}/>- </div>- );- })()}+ )}+ </>+ )}</div>- )}- </div>- {canSharePublic && (- <>- <div className="flex border-t border-border-light" />+ {canSharePublic && (+ <div className="mt-4 border-t border-border-light pt-4">+ <PublicSharingToggle+ isPublic={isPublic}+ publicRole={publicRole}+ onPublicToggle={handlePublicToggle}+ onPublicRoleChange={handlePublicRoleChange}+ resourceType={resourceType}+ />+ </div>+ )}+ </section>+ )}- {/* Public Access Section */}+ {canSharePublic && !hasPeoplePickerAccess && (+ <section className="w-full"><PublicSharingToggleisPublic={isPublic}publicRole={publicRole}@@ -373,78 +404,68 @@ export default function GenericGrantAccessDialog({onPublicRoleChange={handlePublicRoleChange}resourceType={resourceType}/>- </>+ </section>)}+ </div>- {/* Footer Actions */}- <div className="flex justify-between pt-4">- <div className="flex gap-2">- {resourceId && resourceUrl && (- <TooltipAnchor- description={- isCopying+ <OGDialogFooter className="shrink-0 gap-3 bg-transparent px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:space-x-0 sm:px-6">+ <div className="flex flex-col-reverse gap-2 sm:flex-row">+ <PeoplePickerAdminSettings />+ {resourceId && resourceUrl && (+ <TooltipAnchor+ description={+ isCopying ? config?.getCopyUrlMessage() : localize('com_ui_copy_url_to_clipboard')+ }+ render={+ <Button+ variant="outline"+ onClick={() => {+ if (isCopying) return;+ copyResourceUrl(setIsCopying);+ showToast({+ message: localize('com_ui_agent_url_copied'),+ status: 'success',+ });+ }}+ disabled={isCopying}+ className={cn('shrink-0 gap-2', isCopying ? 'cursor-default' : '')}+ aria-label={localize('com_ui_copy_url_to_clipboard')}+ >+ {isCopying ? (+ <CopyCheck className="size-4" aria-hidden="true" />+ ) : (+ <Link className="size-4" aria-hidden="true" />+ )}+ {isCopying? config?.getCopyUrlMessage()- : localize('com_ui_copy_url_to_clipboard')- }- render={- <Button- variant="outline"- onClick={() => {- if (isCopying) return;- copyResourceUrl(setIsCopying);- showToast({- message: localize('com_ui_agent_url_copied'),- status: 'success',- });- }}- disabled={isCopying}- className={cn('shrink-0', isCopying ? 'cursor-default' : '')}- aria-label={localize('com_ui_copy_url_to_clipboard')}- >- {isCopying ? (- <CopyCheck className="h-4 w-4" aria-hidden="true" />- ) : (- <Link className="h-4 w-4" aria-hidden="true" />- )}- </Button>- }- />- )}- </div>- <div className="flex gap-2">- <PeoplePickerAdminSettings />- <OGDialogClose asChild>- <Button- variant="outline"- onClick={handleCancel}- aria-label={localize('com_ui_cancel')}- >- {localize('com_ui_cancel')}- </Button>- </OGDialogClose>- <Button- variant="submit"- onClick={handleSave}- disabled={- updatePermissionsMutation.isLoading ||- !submitButtonActive ||- (hasChanges && !hasAtLeastOneOwner)+ : localize('com_ui_copy_url_to_clipboard')}+ </Button>}- className="min-w-[120px]"- aria-label={localize('com_ui_save_changes')}- >- {updatePermissionsMutation.isLoading ? (- <div className="flex items-center gap-2">- <Spinner className="h-4 w-4" />- {localize('com_ui_saving')}- </div>- ) : (- localize('com_ui_save_changes')- )}- </Button>- </div>+ />+ )}</div>- </div>+ <Button+ variant="submit"+ onClick={handleSave}+ disabled={+ updatePermissionsMutation.isLoading ||+ !submitButtonActive ||+ (hasChanges && !hasAtLeastOneOwner)+ }+ className="w-full sm:w-auto"+ aria-label={localize('com_ui_save')}+ aria-describedby={hasChanges && !hasAtLeastOneOwner ? ownerErrorId : undefined}+ >+ {updatePermissionsMutation.isLoading ? (+ <div className="flex items-center gap-2">+ <Spinner className="size-4" />+ {localize('com_ui_saving')}+ </div>+ ) : (+ localize('com_ui_save')+ )}+ </Button>+ </OGDialogFooter></OGDialogContent></OGDialog>);diff --git a/client/src/components/Sharing/PeoplePicker/SearchPicker.tsx b/client/src/components/Sharing/PeoplePicker/SearchPicker.tsxindex 9c5f08b433..ff1148871c 100644--- a/client/src/components/Sharing/PeoplePicker/SearchPicker.tsx+++ b/client/src/components/Sharing/PeoplePicker/SearchPicker.tsx@@ -2,7 +2,7 @@ import * as React from 'react';import { Search } from 'lucide-react';import debounce from 'lodash/debounce';import * as Ariakit from '@ariakit/react';-import { Spinner, Skeleton } from '@librechat/client';+import { Input, Spinner, Skeleton } from '@librechat/client';import { useLocalize } from '~/hooks';import { cn } from '~/utils';@@ -15,6 +15,7 @@ type SearchPickerProps<TOption extends { key: string }> = {placeholder?: string;inputClassName?: string;label?: string;+ labelClassName?: string;resetValueOnHide?: boolean;isSmallScreen?: boolean;isLoading?: boolean;@@ -28,8 +29,10 @@ export function SearchPicker<TOption extends { key: string; value: string }>({onQueryChange,query,label,+ labelClassName,isSmallScreen = false,placeholder,+ inputClassName,resetValueOnHide = false,isLoading = false,minQueryLengthForNoResults = 2,@@ -72,25 +75,25 @@ export function SearchPicker<TOption extends { key: string; value: string }>({return (<Ariakit.ComboboxProvider store={combobox}>- <Ariakit.ComboboxLabel className="mb-2 block font-medium text-text-primary">+ <Ariakit.ComboboxLabel+ className={cn('mb-2 block font-medium text-text-primary', labelClassName)}+ >{label}</Ariakit.ComboboxLabel><><divclassName={cn(- 'group relative flex h-10 cursor-pointer items-center gap-2 rounded-lg border-border-medium text-text-primary transition-colors duration-200 focus-within:bg-surface-hover hover:bg-surface-hover',+ 'relative flex h-10 items-center gap-2 text-text-primary',isSmallScreen === true ? 'mb-2 h-14 rounded-2xl' : '',)}>{isLoading ? (<Spinner className="absolute left-3 h-4 w-4" />) : (- <Search- className="absolute left-3 h-4 w-4 text-text-secondary group-focus-within:text-text-primary group-hover:text-text-primary"- aria-hidden="true"- />+ <Search className="absolute left-3 h-4 w-4 text-text-secondary" aria-hidden="true" />)}<Ariakit.Combobox+ render={<Input />}ref={inputRef}onKeyDown={(e) => {if (e.key === 'Escape' && combobox.getState().open) {@@ -113,7 +116,7 @@ export function SearchPicker<TOption extends { key: string; value: string }>({value={localQuery}// autoSelectplaceholder={placeholder || localize('com_ui_select_options')}- className="h-10 w-full rounded-lg bg-transparent pl-10 text-sm leading-tight text-text-primary placeholder-text-secondary placeholder-opacity-100 focus:outline-none focus-visible:outline-none group-focus-within:placeholder-text-primary group-hover:placeholder-text-primary"+ className={cn('h-10 w-full pl-10 text-sm leading-tight', inputClassName)}/></div></>diff --git a/client/src/components/Sharing/PeoplePicker/SelectedPrincipalsList.tsx b/client/src/components/Sharing/PeoplePicker/SelectedPrincipalsList.tsxindex 31e6bb6516..774105c552 100644--- a/client/src/components/Sharing/PeoplePicker/SelectedPrincipalsList.tsx+++ b/client/src/components/Sharing/PeoplePicker/SelectedPrincipalsList.tsx@@ -58,7 +58,7 @@ export default function SelectedPrincipalsList({return (<divkey={share.idOnTheSource + '-principalList'}- className="flex items-center justify-between rounded-2xl border border-border-light bg-surface-primary p-3"+ className="flex flex-col gap-3 rounded-xl border border-border-light bg-transparent p-3 sm:flex-row sm:items-center sm:justify-between"><div className="flex min-w-0 flex-1 items-center gap-3"><PrincipalAvatar principal={share} size="md" />@@ -77,7 +77,7 @@ export default function SelectedPrincipalsList({</div></div>- <div className="flex flex-shrink-0 items-center gap-2">+ <div className="flex w-full flex-shrink-0 items-center justify-end gap-2 sm:w-auto">{lockOwner ? (<span className="px-3 py-2 text-sm font-medium text-text-secondary">{localize('com_ui_role_owner')}diff --git a/client/src/components/Sharing/PeoplePicker/UnifiedPeopleSearch.tsx b/client/src/components/Sharing/PeoplePicker/UnifiedPeopleSearch.tsxindex 05092bed20..3b2b578ac1 100644--- a/client/src/components/Sharing/PeoplePicker/UnifiedPeopleSearch.tsx+++ b/client/src/components/Sharing/PeoplePicker/UnifiedPeopleSearch.tsx@@ -1,12 +1,13 @@import React, { useState, useMemo } from 'react';-import type { TPrincipal, PrincipalType, PrincipalSearchParams } from 'librechat-data-provider';import { useSearchPrincipalsQuery } from 'librechat-data-provider/react-query';+import type { TPrincipal, PrincipalType, PrincipalSearchParams } from 'librechat-data-provider';import PeoplePickerSearchItem from './PeoplePickerSearchItem';import { SearchPicker } from './SearchPicker';import { useLocalize } from '~/hooks';interface UnifiedPeopleSearchProps {onAddPeople: (principals: TPrincipal[]) => void;+ label?: string;placeholder?: string;className?: string;typeFilter?: Array<PrincipalType.USER | PrincipalType.GROUP | PrincipalType.ROLE> | null;@@ -15,6 +16,7 @@ interface UnifiedPeopleSearchProps {export default function UnifiedPeopleSearch({onAddPeople,+ label,placeholder,className = '',typeFilter = null,@@ -76,7 +78,8 @@ export default function UnifiedPeopleSearch({}}onPick={handlePick}isLoading={isLoading}- label=""+ label={label || placeholder || localize('com_ui_search_default_placeholder')}+ labelClassName="sr-only"/></div>);diff --git a/client/src/components/Sharing/PeoplePickerAdminSettings.tsx b/client/src/components/Sharing/PeoplePickerAdminSettings.tsxindex 2021ce6d4c..b5a499bf61 100644--- a/client/src/components/Sharing/PeoplePickerAdminSettings.tsx+++ b/client/src/components/Sharing/PeoplePickerAdminSettings.tsx@@ -1,7 +1,7 @@-import { useEffect, useState } from 'react';+import { useEffect, useId, useState } from 'react';import * as Ariakit from '@ariakit/react';-import { ShieldEllipsis } from 'lucide-react';import { useForm, Controller } from 'react-hook-form';+import { ChevronDown, ShieldEllipsis } from 'lucide-react';import { Permissions, SystemRoles, PermissionTypes } from 'librechat-data-provider';import {Label,@@ -9,7 +9,10 @@ import {Switch,OGDialog,DropdownPopup,+ OGDialogHeader,+ OGDialogFooter,OGDialogTitle,+ OGDialogDescription,OGDialogContent,OGDialogTrigger,useToastContext,@@ -31,8 +34,11 @@ type LabelControllerProps = {};const LabelController: React.FC<LabelControllerProps> = ({ control, peoplePickerPerm, label }) => (- <div className="mb-4 flex items-center justify-between gap-2">- <Label htmlFor={peoplePickerPerm} className="w-auto cursor-pointer select-none break-normal">+ <div className="flex items-center justify-between gap-4 px-4 py-3.5">+ <Label+ htmlFor={peoplePickerPerm}+ className="w-auto cursor-pointer select-none break-normal text-sm font-medium text-text-primary"+ >{label}</Label><Controller@@ -56,16 +62,10 @@ const PeoplePickerAdminSettings = () => {const localize = useLocalize();const { showToast } = useToastContext();const { user } = useAuthContext();- const { mutate, isLoading } = useUpdatePeoplePickerPermissionsMutation({- onSuccess: () => {- showToast({ status: 'success', message: localize('com_ui_saved') });- },- onError: () => {- showToast({ status: 'error', message: localize('com_ui_error_save_admin_settings') });- },- });-+ const [isDialogOpen, setIsDialogOpen] = useState(false);const [isRoleMenuOpen, setIsRoleMenuOpen] = useState(false);+ const roleLabelId = useId();+ const roleValueId = useId();const {selectedRole,isSelectedCustomRole,@@ -92,6 +92,24 @@ const PeoplePickerAdminSettings = () => {reset(defaultValues as FormValues);}, [isSelectedCustomRole, isCustomRoleLoading, isCustomRoleError, defaultValues, reset]);+ const handleDialogOpenChange = (open: boolean) => {+ if (!open) {+ setIsRoleMenuOpen(false);+ reset(defaultValues as FormValues);+ }+ setIsDialogOpen(open);+ };++ const { mutate, isLoading } = useUpdatePeoplePickerPermissionsMutation({+ onSuccess: () => {+ showToast({ status: 'success', message: localize('com_ui_saved') });+ handleDialogOpenChange(false);+ },+ onError: () => {+ showToast({ status: 'error', message: localize('com_ui_error_save_admin_settings') });+ },+ });+if (user?.role !== SystemRoles.ADMIN) {return null;}@@ -119,70 +137,95 @@ const PeoplePickerAdminSettings = () => {};return (- <OGDialog>+ <OGDialog open={isDialogOpen} onOpenChange={handleDialogOpenChange}><OGDialogTrigger asChild><Button- variant={'outline'}- className="gap-1 rounded-lg font-medium"+ type="button"+ variant="outline"+ className="gap-2 rounded-lg font-medium"aria-label={localize('com_ui_admin_settings')}>- <ShieldEllipsis className="cursor-pointer" aria-hidden="true" />+ <ShieldEllipsis className="size-4" aria-hidden="true" />{localize('com_ui_admin_settings')}</Button></OGDialogTrigger>- <OGDialogContent className="w-full border-border-light bg-surface-primary text-text-primary lg:w-1/4">- <OGDialogTitle>- {localize('com_ui_admin_settings_section', { section: localize('com_ui_people_picker') })}- </OGDialogTitle>- <div className="p-2">- {/* Role selection dropdown */}- <div className="flex items-center gap-2">- <span className="font-medium">{localize('com_ui_role_select')}:</span>- <DropdownPopup- unmountOnHide={true}- menuId="role-dropdown"- isOpen={isRoleMenuOpen}- setIsOpen={setIsRoleMenuOpen}- trigger={- <Ariakit.MenuButton className="inline-flex min-w-[6rem] items-center justify-center rounded-lg border border-border-light bg-transparent px-2 py-1 text-text-primary transition-all ease-in-out hover:bg-surface-tertiary">- {selectedRole}- </Ariakit.MenuButton>- }- items={roleDropdownItems}- itemClassName="items-center justify-center"- sameWidth={true}- />+ <OGDialogContent className="w-11/12 max-w-2xl gap-0 overflow-hidden p-0">+ <OGDialogHeader className="px-5 py-5 pr-14 text-left sm:px-6">+ <div className="flex items-start gap-3">+ <div className="flex size-10 shrink-0 items-center justify-center rounded-xl border border-border-light bg-surface-secondary text-text-secondary">+ <ShieldEllipsis className="size-5" aria-hidden="true" />+ </div>+ <div className="min-w-0 space-y-1">+ <OGDialogTitle className="text-xl leading-7">+ {localize('com_ui_admin_settings_section', {+ section: localize('com_ui_people_picker'),+ })}+ </OGDialogTitle>+ <OGDialogDescription className="sr-only">+ {localize('com_ui_people_picker_admin_description')}+ </OGDialogDescription>+ </div></div>- {/* Permissions form */}- <form onSubmit={handleSubmit(onSubmit)}>- <div className="py-5">+ </OGDialogHeader>++ <form onSubmit={handleSubmit(onSubmit)}>+ <div className="space-y-4 p-4 sm:p-6">+ <div className="grid gap-3 rounded-xl border border-border-light bg-surface-secondary p-4 sm:grid-cols-[minmax(0,1fr)_9rem] sm:items-center">+ <span id={roleLabelId} className="text-sm font-semibold text-text-primary">+ {localize('com_ui_role_select')}+ </span>+ <DropdownPopup+ unmountOnHide={true}+ menuId="people-picker-role-dropdown"+ isOpen={isRoleMenuOpen}+ setIsOpen={setIsRoleMenuOpen}+ trigger={+ <Ariakit.MenuButton+ aria-labelledby={`${roleLabelId} ${roleValueId}`}+ className="inline-flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-border-medium bg-transparent px-3 text-sm text-text-primary transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-primary"+ >+ <span id={roleValueId} className="truncate font-medium">+ {selectedRole}+ </span>+ <ChevronDown+ className="size-4 shrink-0 text-text-secondary"+ aria-hidden="true"+ />+ </Ariakit.MenuButton>+ }+ items={roleDropdownItems}+ itemClassName="items-center justify-center"+ sameWidth={true}+ />+ </div>++ <div className="divide-y divide-border-light overflow-hidden rounded-xl border border-border-light bg-surface-secondary">{labelControllerData.map(({ peoplePickerPerm, label }) => (- <div key={peoplePickerPerm}>- <LabelController- control={control}- peoplePickerPerm={peoplePickerPerm}- label={label}- />- </div>+ <LabelController+ key={peoplePickerPerm}+ control={control}+ peoplePickerPerm={peoplePickerPerm}+ label={label}+ />))}</div>- <div className="flex justify-end">- <Button- variant="submit"- type="button"- onClick={handleSubmit(onSubmit)}- disabled={- isSubmitting ||- isLoading ||- (isSelectedCustomRole && (isCustomRoleLoading || isCustomRoleError))- }- className="font-bold"- >- {localize('com_ui_save')}- </Button>- </div>- </form>- </div>+ </div>++ <OGDialogFooter className="bg-transparent px-4 py-4 sm:px-6">+ <Button+ variant="submit"+ type="submit"+ disabled={+ isSubmitting ||+ isLoading ||+ (isSelectedCustomRole && (isCustomRoleLoading || isCustomRoleError))+ }+ className="font-bold"+ >+ {localize('com_ui_save')}+ </Button>+ </OGDialogFooter>+ </form></OGDialogContent></OGDialog>);diff --git a/client/src/components/Sharing/PublicSharingToggle.tsx b/client/src/components/Sharing/PublicSharingToggle.tsxindex 61ca48d0c8..6bcf329894 100644--- a/client/src/components/Sharing/PublicSharingToggle.tsx+++ b/client/src/components/Sharing/PublicSharingToggle.tsx@@ -4,6 +4,7 @@ import { ResourceType } from 'librechat-data-provider';import { Switch, InfoHoverCard, ESide, Label } from '@librechat/client';import type { AccessRoleIds } from 'librechat-data-provider';import AccessRolesPicker from './AccessRolesPicker';+import { Collapse } from '~/components/ui';import { useLocalize } from '~/hooks';import { cn } from '~/utils';@@ -46,7 +47,7 @@ export default function PublicSharingToggle({);return (- <div className={cn('space-y-4', className)}>+ <div className={className}>{/* Main toggle section */}<div className="group relative rounded-lg"><div className="flex items-center justify-between">@@ -84,63 +85,29 @@ export default function PublicSharingToggle({</div></div>- {/* Permission level section with smooth animation */}- <div- className={cn(- 'transition-all duration-300 ease-in-out',- isPublic ? 'max-h-32 opacity-100' : 'max-h-0 opacity-0',- )}- style={{ overflow: isPublic ? 'visible' : 'hidden' }}- aria-hidden={!isPublic}- ref={(el) => {- if (!el) {- return;- }- if (isPublic) {- el.removeAttribute('inert');- } else {- el.setAttribute('inert', '');- }- }}- >- <div- className={cn(- 'rounded-lg transition-all duration-300',- isPublic ? 'translate-y-0 bg-surface-secondary/50' : '-translate-y-2',- )}- >- <div className="flex items-center justify-between">- <div className="flex items-center gap-3">- <div- className={cn(- 'transition-all duration-300',- isPublic ? 'scale-100 text-status-info' : 'scale-95 text-text-secondary',- )}- >- <Shield className="size-5" />- </div>- <div className="flex flex-col gap-0.5">- <Label htmlFor="permission-level" className="text-sm font-medium text-text-primary">- {localize('com_ui_everyone_permission_level')}- </Label>- </div>+ <Collapse open={isPublic} className="pt-4">+ <div className="flex items-center justify-between bg-transparent">+ <div className="flex items-center gap-3">+ <div className="text-status-info">+ <Shield className="size-5" /></div>- <div- className={cn(- 'relative z-50 transition-all duration-300',- isPublic ? 'scale-100 opacity-100' : 'scale-95 opacity-0',- )}- >- <AccessRolesPicker- id="permission-level"- resourceType={resourceType}- selectedRoleId={publicRole}- onRoleChange={onPublicRoleChange}- />+ <div className="flex flex-col gap-0.5">+ <Label htmlFor="permission-level" className="text-sm font-medium text-text-primary">+ {localize('com_ui_everyone_permission_level')}+ </Label></div></div>+ <div className="relative z-50">+ <AccessRolesPicker+ id="permission-level"+ ariaLabel={localize('com_ui_everyone_permission_level')}+ resourceType={resourceType}+ selectedRoleId={publicRole}+ onRoleChange={onPublicRoleChange}+ />+ </div></div>- </div>+ </Collapse></div>);}diff --git a/client/src/components/Sharing/__tests__/AccessRolesPicker.spec.tsx b/client/src/components/Sharing/__tests__/AccessRolesPicker.spec.tsxnew file mode 100644index 0000000000..1a2414725b--- /dev/null+++ b/client/src/components/Sharing/__tests__/AccessRolesPicker.spec.tsx@@ -0,0 +1,49 @@+import React from 'react';+import userEvent from '@testing-library/user-event';+import { AccessRoleIds } from 'librechat-data-provider';+import { OGDialog, OGDialogContent } from '@librechat/client';+import { render, screen, within } from '@testing-library/react';+import AccessRolesPicker from '../AccessRolesPicker';++const onRoleChange = jest.fn();++jest.mock('librechat-data-provider/react-query', () => ({+ useGetAccessRolesQuery: () => {+ const { AccessRoleIds: roleIds } = jest.requireActual('librechat-data-provider');+ return {+ data: [{ accessRoleId: roleIds.AGENT_VIEWER }, { accessRoleId: roleIds.AGENT_EDITOR }],+ isLoading: false,+ };+ },+}));++jest.mock('~/hooks', () => ({+ useLocalize: () => (key: string) => key,+}));++describe('AccessRolesPicker', () => {+ beforeEach(() => {+ onRoleChange.mockClear();+ });++ it('keeps its menu within the modal focus and pointer scope', async () => {+ render(+ <OGDialog open onOpenChange={jest.fn()}>+ <OGDialogContent>+ <AccessRolesPicker+ selectedRoleId={AccessRoleIds.AGENT_VIEWER}+ onRoleChange={onRoleChange}+ />+ </OGDialogContent>+ </OGDialog>,+ );++ await userEvent.click(screen.getByRole('button', { name: 'com_ui_role_viewer_desc' }));++ const dialog = screen.getByRole('dialog');+ const menu = within(dialog).getByRole('menu');+ await userEvent.click(within(menu).getByText('com_ui_role_editor'));++ expect(onRoleChange).toHaveBeenCalledWith(AccessRoleIds.AGENT_EDITOR);+ });+});diff --git a/client/src/components/Sharing/__tests__/GenericGrantAccessDialog.spec.tsx b/client/src/components/Sharing/__tests__/GenericGrantAccessDialog.spec.tsxindex f91667860d..08f62be4c6 100644--- a/client/src/components/Sharing/__tests__/GenericGrantAccessDialog.spec.tsx+++ b/client/src/components/Sharing/__tests__/GenericGrantAccessDialog.spec.tsx@@ -131,6 +131,37 @@ describe('GenericGrantAccessDialog - permissions load failure', () => {).not.toBeInTheDocument();fireEvent.click(screen.getByRole('button', { name: 'com_ui_share_var' }));- expect(screen.getByTestId('unified-people-search')).toBeInTheDocument();+ const dialog = screen.getByRole('dialog');++ expect(dialog).toHaveClass('max-w-5xl', 'overflow-hidden', 'p-0');+ expect(+ screen.getByRole('heading', { level: 3, name: 'com_ui_user_group_permissions' }),+ ).toBeInTheDocument();+ expect(screen.getByText('com_ui_share_access_description')).toHaveClass('sr-only');+ expect(screen.getByTestId('unified-people-search').closest('section')).toHaveClass('w-full');+ expect(screen.getByTestId('public-toggle').parentElement).toHaveClass('border-t');+ expect(screen.getByTestId('admin-settings')).toBeInTheDocument();+ expect(dialog.firstElementChild).not.toHaveClass('border-b');+ const saveButton = screen.getByRole('button', { name: 'com_ui_save' });+ const footer = saveButton.parentElement;+ expect(footer).toHaveClass('bg-transparent');+ expect(footer).not.toHaveClass('border-t');+ expect(saveButton).toHaveClass('sm:w-auto');+ expect(saveButton).not.toHaveClass('min-w-[140px]');+ expect(screen.queryByRole('button', { name: 'com_ui_cancel' })).not.toBeInTheDocument();+ });++ it('discards the draft through the shared close path', () => {+ const setIsPublic = jest.fn();+ const setPublicRole = jest.fn();+ mockUseResourcePermissionState.mockReturnValue(baseState({ setIsPublic, setPublicRole }));++ renderDialog();++ fireEvent.click(screen.getByRole('button', { name: 'com_ui_share_var' }));+ fireEvent.click(screen.getByRole('button', { name: 'Close' }));++ expect(setIsPublic).toHaveBeenCalledWith(false);+ expect(setPublicRole).toHaveBeenCalledWith('viewer');});});diff --git a/client/src/components/Sharing/__tests__/PeoplePickerAdminSettings.spec.tsx b/client/src/components/Sharing/__tests__/PeoplePickerAdminSettings.spec.tsxnew file mode 100644index 0000000000..7ef4e66b31--- /dev/null+++ b/client/src/components/Sharing/__tests__/PeoplePickerAdminSettings.spec.tsx@@ -0,0 +1,74 @@+import React from 'react';+import { fireEvent, render, screen } from '@testing-library/react';+import '@testing-library/jest-dom/extend-expect';+import PeoplePickerAdminSettings from '../PeoplePickerAdminSettings';++const mockMutate = jest.fn();++jest.mock('@ariakit/react', () => ({+ MenuButton: ({ children, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement>) => (+ <button type="button" {...props}>+ {children}+ </button>+ ),+}));++jest.mock('~/hooks', () => {+ const defaultValues = {};++ return {+ useLocalize: () => (key: string) => key,+ useAuthContext: () => ({ user: { role: 'ADMIN' } }),+ useRoleSelector: () => ({+ selectedRole: 'USER',+ isSelectedCustomRole: false,+ isCustomRoleLoading: false,+ isCustomRoleError: false,+ defaultValues,+ roleDropdownItems: [],+ }),+ };+});++jest.mock('~/data-provider', () => ({+ useUpdatePeoplePickerPermissionsMutation: () => ({+ mutate: mockMutate,+ isLoading: false,+ }),+}));++jest.mock('@librechat/client', () => ({+ ...jest.requireActual('@librechat/client'),+ DropdownPopup: ({ trigger }: { trigger: React.ReactNode }) => trigger,+ useToastContext: () => ({ showToast: jest.fn() }),+}));++describe('PeoplePickerAdminSettings', () => {+ beforeEach(() => {+ mockMutate.mockReset();+ });++ it('uses the responsive dialog width and a native submit action', () => {+ render(<PeoplePickerAdminSettings />);++ fireEvent.click(screen.getByRole('button', { name: 'com_ui_admin_settings' }));++ const dialog = screen.getByRole('dialog');+ const saveButton = screen.getByRole('button', { name: 'com_ui_save' });++ expect(dialog).toHaveClass('w-11/12', 'max-w-2xl');+ expect(dialog).not.toHaveClass('w-full', 'lg:w-1/4');+ expect(screen.getByText('com_ui_people_picker_admin_description')).toHaveClass('sr-only');+ expect(+ screen.getByRole('switch', { name: 'com_ui_people_picker_allow_view_users' }),+ ).toBeInTheDocument();+ expect(saveButton).toHaveAttribute('type', 'submit');+ expect(saveButton).not.toHaveClass('min-w-[120px]');+ expect(dialog.firstElementChild).not.toHaveClass('border-b');+ expect(saveButton.parentElement).toHaveClass('bg-transparent');+ expect(saveButton.parentElement).not.toHaveClass('border-t');+ expect(+ screen.getByRole('button', { name: 'com_ui_role_select USER' }).parentElement,+ ).toHaveClass('sm:grid-cols-[minmax(0,1fr)_9rem]');+ });+});diff --git a/client/src/components/Sharing/__tests__/PublicSharingToggle.spec.tsx b/client/src/components/Sharing/__tests__/PublicSharingToggle.spec.tsxnew file mode 100644index 0000000000..440adb62b2--- /dev/null+++ b/client/src/components/Sharing/__tests__/PublicSharingToggle.spec.tsx@@ -0,0 +1,42 @@+import React from 'react';+import { render, screen } from '@testing-library/react';+import '@testing-library/jest-dom/extend-expect';+import PublicSharingToggle from '../PublicSharingToggle';++jest.mock('~/hooks', () => ({+ useLocalize: () => (key: string) => key,+}));++jest.mock('../AccessRolesPicker', () => ({+ __esModule: true,+ default: () => <div />,+}));++describe('PublicSharingToggle', () => {+ it('uses the shared auto-height collapse and a transparent permission row', () => {+ const { rerender } = render(+ <PublicSharingToggle+ isPublic={false}+ onPublicToggle={jest.fn()}+ onPublicRoleChange={jest.fn()}+ />,+ );++ const permissionLabel = screen.getByText('com_ui_everyone_permission_level');+ const collapse = permissionLabel.closest('[aria-hidden="true"]');++ expect(collapse).toHaveClass('grid-rows-[0fr]');++ rerender(+ <PublicSharingToggle+ isPublic={true}+ onPublicToggle={jest.fn()}+ onPublicRoleChange={jest.fn()}+ />,+ );++ expect(permissionLabel.closest('.bg-transparent')).toBeInTheDocument();+ expect(permissionLabel.closest('.bg-transparent')).not.toHaveClass('bg-surface-secondary/50');+ expect(permissionLabel.closest('.grid')).toHaveClass('grid-rows-[1fr]');+ });+});diff --git a/client/src/components/SidePanel/Agents/MCPToolItem.tsx b/client/src/components/SidePanel/Agents/MCPToolItem.tsxindex 46e89cce9e..d77caf4e7c 100644--- a/client/src/components/SidePanel/Agents/MCPToolItem.tsx+++ b/client/src/components/SidePanel/Agents/MCPToolItem.tsx@@ -86,7 +86,7 @@ export default function MCPToolItem({pressed={isDeferred}label={localize('com_ui_mcp_defer_loading')}tooltip={localize('com_ui_mcp_click_to_defer')}- activeClass="text-amber-500"+ activeClass="text-text-warning"onToggle={onToggleDefer}/>)}diff --git a/client/src/components/SidePanel/Agents/OptionToggle.tsx b/client/src/components/SidePanel/Agents/OptionToggle.tsxindex 7e51f04e9d..e45dc5a333 100644--- a/client/src/components/SidePanel/Agents/OptionToggle.tsx+++ b/client/src/components/SidePanel/Agents/OptionToggle.tsx@@ -8,7 +8,7 @@ interface OptionToggleProps {label: string;/** Defaults to `label` (bulk toggles use the same text for both). */tooltip?: string;- /** Text color applied when pressed (e.g. `text-amber-500`). */+ /** Text color applied directly to the icon when pressed. */activeClass: string;onToggle: () => void;size?: 'sm' | 'md';@@ -52,13 +52,10 @@ export default function OptionToggle({size === 'sm' ? 'size-6' : 'size-7',disabled? 'cursor-not-allowed text-text-tertiary opacity-60 hover:bg-transparent hover:text-text-tertiary'- : cn(- 'hover:bg-surface-hover',- pressed ? activeClass : 'text-text-secondary hover:text-text-primary',- ),+ : 'text-text-secondary hover:bg-surface-hover hover:text-text-secondary',)}>- <Icon className="size-4" aria-hidden="true" />+ <Icon className={cn('size-4', pressed && activeClass)} aria-hidden="true" /></Button>}/>diff --git a/client/src/components/SidePanel/Agents/Tools/ToolRow.tsx b/client/src/components/SidePanel/Agents/Tools/ToolRow.tsxindex 2e4e99832c..1095f1132a 100644--- a/client/src/components/SidePanel/Agents/Tools/ToolRow.tsx+++ b/client/src/components/SidePanel/Agents/Tools/ToolRow.tsx@@ -87,7 +87,7 @@ function ToolRowImpl({ item, onInfo, onRemove }: Props) {}className={cn('size-6 rounded-md p-0 text-text-secondary',- 'hover:text-text-primary focus-visible:opacity-100',+ 'hover:text-text-secondary focus-visible:opacity-100',)}><DetailIcon className="size-3.5" aria-hidden="true" />@@ -98,7 +98,7 @@ function ToolRowImpl({ item, onInfo, onRemove }: Props) {aria-label={localize('com_ui_tools_remove')}className={cn('size-6 rounded-md p-0 text-text-secondary',- 'hover:text-text-primary focus-visible:opacity-100',+ 'hover:text-text-secondary focus-visible:opacity-100',)}><X className="size-3.5" aria-hidden="true" />diff --git a/client/src/components/SidePanel/Agents/Tools/__tests__/ToolRow.spec.tsx b/client/src/components/SidePanel/Agents/Tools/__tests__/ToolRow.spec.tsxnew file mode 100644index 0000000000..9ff2b0912e--- /dev/null+++ b/client/src/components/SidePanel/Agents/Tools/__tests__/ToolRow.spec.tsx@@ -0,0 +1,48 @@+import React from 'react';+import '@testing-library/jest-dom/extend-expect';+import { render, screen } from '@testing-library/react';+import type { McpItem } from '../items/types';+import ToolRow from '../ToolRow';++jest.mock('~/hooks', () => ({+ useLocalize: () => (key: string) => key,+}));++jest.mock('@librechat/client', () => ({+ Button: ({+ children,+ variant: _variant,+ ...props+ }: React.ComponentProps<'button'> & { variant?: string }) => (+ <button {...props}>{children}</button>+ ),+}));++const item: McpItem = {+ kind: 'mcp',+ id: 'mcp-server',+ name: 'MCP server',+ description: '',+ iconKey: 'mcp',+ server: {+ serverName: 'mcp-server',+ tools: [],+ isConfigured: true,+ isConnected: true,+ metadata: {},+ } as never,+ toolCount: 0,+};++describe('ToolRow', () => {+ test('MCP action icons keep their color while hovered', () => {+ render(<ToolRow item={item} onInfo={jest.fn()} onRemove={jest.fn()} />);++ expect(screen.getByRole('button', { name: 'com_ui_tools_configure' })).toHaveClass(+ 'hover:text-text-secondary',+ );+ expect(screen.getByRole('button', { name: 'com_ui_tools_remove' })).toHaveClass(+ 'hover:text-text-secondary',+ );+ });+});diff --git a/client/src/components/SidePanel/Agents/__tests__/MCPToolItem.spec.tsx b/client/src/components/SidePanel/Agents/__tests__/MCPToolItem.spec.tsxindex 166cbc6644..1486374744 100644--- a/client/src/components/SidePanel/Agents/__tests__/MCPToolItem.spec.tsx+++ b/client/src/components/SidePanel/Agents/__tests__/MCPToolItem.spec.tsx@@ -93,6 +93,13 @@ describe('MCPToolItem', () => {expect(props.onToggleDefer).toHaveBeenCalledTimes(1);});+ test('deferred tool keeps its warning color while hovered', () => {+ setup({ deferredToolsEnabled: true, isDeferred: true });+ const deferButton = screen.getByRole('button', { name: 'com_ui_mcp_defer_loading' });+ expect(deferButton).toHaveClass('hover:text-text-secondary');+ expect(deferButton.querySelector('svg')).toHaveClass('text-text-warning');+ });+test('defer button is absent when deferred tools are disabled', () => {setup();expect(diff --git a/client/src/components/SidePanel/Builder/ActionsAuth.tsx b/client/src/components/SidePanel/Builder/ActionsAuth.tsxindex 34be0eb6cc..ebb6bc3e25 100644--- a/client/src/components/SidePanel/Builder/ActionsAuth.tsx+++ b/client/src/components/SidePanel/Builder/ActionsAuth.tsx@@ -80,7 +80,7 @@ export default function ActionsAuth({ disableOAuth }: { disableOAuth?: boolean }<OGDialogTrigger asChild><buttontype="button"- className="group flex w-full items-center gap-3 rounded-xl border border-border-light bg-transparent px-3 py-2.5 text-left transition-colors hover:bg-surface-secondary focus:outline-none focus-visible:ring-2 focus-visible:ring-ring-primary"+ className="group flex w-full items-center gap-3 rounded-xl border border-border-light bg-transparent px-3 py-2.5 text-left transition-colors hover:bg-surface-secondary focus:outline-none focus-visible:ring-2 focus-visible:ring-text-primary"><current.icon className="size-5 shrink-0 text-text-secondary" aria-hidden={true} /><span className="min-w-0 flex-1">@@ -95,7 +95,7 @@ export default function ActionsAuth({ disableOAuth }: { disableOAuth?: boolean }</button></OGDialogTrigger></div>- <OGDialogContent className="w-full max-w-lg bg-surface-primary text-text-primary">+ <OGDialogContent className="w-full max-w-lg bg-surface-dialog text-text-primary"><OGDialogHeader><OGDialogTitle className="text-lg font-semibold">{localize('com_ui_authentication')}diff --git a/client/src/components/SidePanel/MCPBuilder/MCPCardActions.spec.tsx b/client/src/components/SidePanel/MCPBuilder/MCPCardActions.spec.tsxnew file mode 100644index 0000000000..6067c16ff8--- /dev/null+++ b/client/src/components/SidePanel/MCPBuilder/MCPCardActions.spec.tsx@@ -0,0 +1,50 @@+import React from 'react';+import '@testing-library/jest-dom/extend-expect';+import { render, screen } from '@testing-library/react';+import type { MCPServerStatus } from 'librechat-data-provider';+import MCPCardActions from './MCPCardActions';++jest.mock('~/hooks', () => ({+ useLocalize: () => (key: string) => key,+}));++jest.mock('@librechat/client', () => ({+ Spinner: (props: React.ComponentProps<'span'>) => <span {...props} />,+ TooltipAnchor: ({+ children,+ description: _description,+ side: _side,+ ...props+ }: React.ComponentProps<'div'> & { description: string; side?: string }) => (+ <div {...props}>{children}</div>+ ),+}));++const connectedOAuthStatus = {+ connectionState: 'connected',+ requiresOAuth: true,+} as MCPServerStatus;++describe('MCPCardActions', () => {+ test('revoke icon keeps its destructive color while hovered', () => {+ render(+ <MCPCardActions+ serverName="server"+ serverStatus={connectedOAuthStatus}+ isInitializing={false}+ canCancel={false}+ hasCustomUserVars={false}+ canEdit={false}+ onEditClick={jest.fn()}+ onConfigClick={jest.fn()}+ onInitialize={jest.fn()}+ onCancel={jest.fn()}+ onRevoke={jest.fn()}+ />,+ );++ const revokeButton = screen.getByRole('button', { name: 'com_ui_revoke' });+ expect(revokeButton).toHaveClass('hover:text-text-secondary');+ expect(revokeButton.querySelector('svg')).toHaveClass('text-text-destructive');+ });+});diff --git a/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx b/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsxindex 996a0ecfcb..6becb23931 100644--- a/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx+++ b/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx@@ -56,9 +56,9 @@ export default function MCPCardActions({const buttonBaseClass = cn('flex size-7 items-center justify-center rounded-md','transition-colors duration-150',- 'text-text-secondary hover:text-text-primary',+ 'text-text-secondary hover:text-text-secondary','hover:bg-surface-tertiary',- 'focus:outline-none focus-visible:ring-2 focus-visible:ring-border-heavy',+ 'focus:outline-none focus-visible:ring-2 focus-visible:ring-text-primary',);// Loading state - show spinner (with cancel option)@@ -171,12 +171,12 @@ export default function MCPCardActions({<TooltipAnchordescription={localize('com_ui_revoke')}side="top"- className={cn(buttonBaseClass, 'text-text-destructive')}+ className={buttonBaseClass}aria-label={localize('com_ui_revoke')}role="button"onClick={onRevoke}>- <Trash2 className="size-3.5" aria-hidden="true" />+ <Trash2 className="size-3.5 text-text-destructive" aria-hidden="true" /></TooltipAnchor>)}</div>diff --git a/client/src/components/SidePanel/Parameters/Panel.tsx b/client/src/components/SidePanel/Parameters/Panel.tsxindex 14fef38a79..0939adecca 100644--- a/client/src/components/SidePanel/Parameters/Panel.tsx+++ b/client/src/components/SidePanel/Parameters/Panel.tsx@@ -208,7 +208,7 @@ export default function Parameters() {</div><div className="mt-2 flex justify-center"><Button- variant="submit"+ variant="default"onClick={openDialog}className="flex w-full items-center justify-center px-4 py-2 font-semibold"type="button"diff --git a/client/src/components/Tools/AssistantToolsDialog.tsx b/client/src/components/Tools/AssistantToolsDialog.tsxindex 90927956fa..c399c9c5ef 100644--- a/client/src/components/Tools/AssistantToolsDialog.tsx+++ b/client/src/components/Tools/AssistantToolsDialog.tsx@@ -157,7 +157,7 @@ function AssistantToolsDialog({}}><OGDialogContent- className="gap-0 overflow-hidden overflow-y-auto bg-surface-secondary p-0 text-left max-sm:h-full sm:mx-7 sm:my-8 sm:max-w-2xl lg:max-w-5xl xl:max-w-7xl"+ className="gap-0 overflow-hidden overflow-y-auto bg-surface-dialog p-0 text-left max-sm:h-full sm:mx-7 sm:my-8 sm:max-w-2xl lg:max-w-5xl xl:max-w-7xl"style={{ minHeight: '610px' }}><div>diff --git a/client/src/components/Web/Sources.tsx b/client/src/components/Web/Sources.tsxindex 57c2c90bae..2fa62dfb9f 100644--- a/client/src/components/Web/Sources.tsx+++ b/client/src/components/Web/Sources.tsx@@ -425,8 +425,8 @@ const SourcesGroup = React.memo(function SourcesGroup({</div></OGDialogTrigger>)}- <OGDialogContent className="flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg bg-surface-primary p-0 md:max-w-[600px]">- <div className="sticky top-0 z-10 flex items-center justify-between border-b border-border-light bg-surface-primary px-3 py-2">+ <OGDialogContent className="flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg bg-surface-dialog p-0 md:max-w-[600px]">+ <div className="sticky top-0 z-10 flex items-center justify-between border-b border-border-light bg-surface-dialog px-3 py-2"><OGDialogTitle className="text-base font-medium">{localize('com_sources_title')}</OGDialogTitle>@@ -521,8 +521,8 @@ function FilesGroup({ files, messageId, conversationId, limit = 3 }: FilesGroupP</div></OGDialogTrigger>)}- <OGDialogContent className="flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg bg-surface-primary p-0 md:max-w-[600px]">- <div className="sticky top-0 z-10 flex items-center justify-between border-b border-border-light bg-surface-primary px-3 py-2">+ <OGDialogContent className="flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg bg-surface-dialog p-0 md:max-w-[600px]">+ <div className="sticky top-0 z-10 flex items-center justify-between border-b border-border-light bg-surface-dialog px-3 py-2"><OGDialogTitle className="text-base font-medium">{localize('com_sources_agent_files')}</OGDialogTitle>diff --git a/client/src/components/ui/AdminSettingsDialog.tsx b/client/src/components/ui/AdminSettingsDialog.tsxindex 9ddc6dae73..86dc433720 100644--- a/client/src/components/ui/AdminSettingsDialog.tsx+++ b/client/src/components/ui/AdminSettingsDialog.tsx@@ -168,7 +168,7 @@ const AdminSettingsDialog: React.FC<AdminSettingsDialogProps> = ({<OGDialogContentclassName={dialogContentClassName ??- 'w-11/12 max-w-lg border-border-light bg-surface-primary text-text-primary'+ 'w-11/12 max-w-lg border-border-light bg-surface-dialog text-text-primary'}><OGDialogTitle>diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.jsonindex 5dd9e971f9..8cf9d8c468 100644--- a/client/src/locales/en/translation.json+++ b/client/src/locales/en/translation.json@@ -256,7 +256,7 @@"com_endpoint_config_google_gemini_api": "(Gemini API)","com_endpoint_config_google_service_key": "Google Service Account Key","com_endpoint_config_key": "Set API Key",- "com_endpoint_config_key_encryption": "Your key will be encrypted and deleted at",+ "com_endpoint_config_key_encryption": "Current key is encrypted and will be deleted at {{0}}","com_endpoint_config_key_for": "Set API Key for","com_endpoint_config_key_google_need_to": "You need to","com_endpoint_config_key_google_service_account": "Create a Service Account",@@ -267,7 +267,8 @@"com_endpoint_config_key_import_json_key_invalid": "Invalid Service Account JSON Key, Did you import the correct file?","com_endpoint_config_key_import_json_key_success": "Successfully Imported Service Account JSON Key","com_endpoint_config_key_name": "Key",- "com_endpoint_config_key_never_expires": "Your key will never expire",+ "com_endpoint_config_key_never_expires": "Current key: never expires",+ "com_endpoint_config_new_key_expiration": "New key expiration","com_endpoint_config_placeholder": "Set your Key in the Header menu to chat.","com_endpoint_config_required_fields": "The following fields are required:","com_endpoint_config_value": "Enter value for",@@ -281,7 +282,7 @@"com_endpoint_disable_streaming": "Disable streaming responses and receive the complete response at once. Useful for models like o3 that require organization verification for streaming","com_endpoint_disable_streaming_label": "Disable Streaming","com_endpoint_effort": "Effort",- "com_endpoint_examples": " Presets",+ "com_endpoint_examples": "Presets","com_endpoint_export": "Export","com_endpoint_export_share": "Export/Share","com_endpoint_frequency_penalty": "Frequency Penalty",@@ -302,7 +303,8 @@"com_endpoint_message_new": "Message {{0}}","com_endpoint_message_not_appendable": "Edit your message or Regenerate.","com_endpoint_my_preset": "My Preset",- "com_endpoint_no_presets": "No presets yet, use the settings button to create one",+ "com_endpoint_no_presets": "No presets yet",+ "com_endpoint_no_presets_description": "Save your current model settings or import a preset to get started.","com_endpoint_openai_custom_name_placeholder": "Set a custom name for the AI","com_endpoint_openai_detail": "The resolution for Vision requests. \"Low\" is cheaper and faster, \"High\" is more detailed and expensive, and \"Auto\" will automatically choose between the two based on the image resolution.","com_endpoint_openai_freq": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.",@@ -427,7 +429,6 @@"com_nav_about_branch": "Branch","com_nav_about_build_date": "Built","com_nav_about_commit": "Commit",- "com_nav_about_diagnostics_copied": "Copied to clipboard","com_nav_about_diagnostics_copy": "Copy diagnostics","com_nav_about_diagnostics_description": "Copy this block when opening a support issue so maintainers can identify the exact build you're running.","com_nav_about_version": "Version",@@ -913,6 +914,9 @@"com_ui_auto": "Auto","com_ui_available_options": "Available options","com_ui_avatar": "Avatar",+ "com_ui_avatar_drop_image": "Drop an image here to use as your profile picture",+ "com_ui_avatar_file_requirements": "PNG, JPG, or JPEG, up to {{0}} MB",+ "com_ui_avatar_invalid_file": "Choose a PNG, JPG, or JPEG image up to {{0}} MB","com_ui_azure": "Azure","com_ui_azure_ad": "Entra ID","com_ui_back": "Back",@@ -1041,7 +1045,7 @@"com_ui_convo_archived": "Conversation archived","com_ui_convo_delete_error": "Failed to delete conversation","com_ui_convo_delete_success": "Conversation successfully deleted",- "com_ui_copied": "Copied!",+ "com_ui_copied": "Copied","com_ui_copied_to_clipboard": "Copied to clipboard","com_ui_copy": "Copy","com_ui_copy_code": "Copy code",@@ -1374,8 +1378,7 @@"com_ui_key": "Key","com_ui_key_required": "API key is required","com_ui_labels": "Labels",- "com_ui_langfuse_beta_info": "This feature is in beta. Enabling this connection will send traces from all agents in your org to Langfuse.",- "com_ui_langfuse_description": "Send this organization's traces and feedback scores to your own Langfuse project.",+ "com_ui_langfuse_beta_info": "This feature is in beta. Enabling this connection sends traces from all agents in your organization, along with feedback scores, to your Langfuse project.","com_ui_langfuse_destination": "Destination","com_ui_langfuse_destination_removed": "The saved Langfuse destination is no longer available. Disable the connection or select another destination.","com_ui_langfuse_destination_unavailable": "Unavailable",@@ -1383,7 +1386,6 @@"com_ui_langfuse_enable": "Enable","com_ui_langfuse_load_error": "Failed to load the Langfuse connection","com_ui_langfuse_public_key": "Public key",- "com_ui_langfuse_save_and_enable": "Save & enable","com_ui_langfuse_save_error": "Failed to save the Langfuse connection","com_ui_langfuse_saved": "Langfuse connection saved","com_ui_langfuse_secret_key": "Secret key",@@ -1428,7 +1430,6 @@"com_ui_max": "Max","com_ui_max_favorites_reached": "Maximum pinned items reached ({{0}}). Unpin an item to add more.","com_ui_max_favorites_reached_items": "Maximum favorites reached ({{0}}). Remove a favorite to add more.",- "com_ui_max_file_size": "PNG, JPG or JPEG (max {{0}})","com_ui_max_tags": "Maximum number allowed is {{0}}, using latest values.","com_ui_mcp_authenticated_success": "MCP server '{{0}}' authenticated successfully","com_ui_mcp_background": "Background",@@ -1567,7 +1568,7 @@"com_ui_no_category": "No category","com_ui_no_changes": "No changes were made","com_ui_no_valid_items": "No valid items were selected",- "com_ui_no_individual_access": "No individual users or groups have access to this agent",+ "com_ui_no_individual_resource_access": "No individual users or groups have access","com_ui_no_labels": "No Labels","com_ui_no_mcp_servers": "No MCP servers yet","com_ui_no_mcp_servers_match": "No MCP servers match your filter",@@ -1620,6 +1621,7 @@"com_ui_path": "Path","com_ui_people": "people","com_ui_people_picker": "People Picker",+ "com_ui_people_picker_admin_description": "Control which directory entries each role can find when sharing resources.","com_ui_people_picker_allow_view_groups": "Allow viewing groups","com_ui_people_picker_allow_view_roles": "Allow viewing roles","com_ui_people_picker_allow_view_users": "Allow viewing users",@@ -1777,7 +1779,6 @@"com_ui_sandbox_starting": "Starting sandbox environment","com_ui_save": "Save","com_ui_save_badge_changes": "Save badge changes?",- "com_ui_save_changes": "Save Changes","com_ui_save_key_error": "Failed to save API key. Please try again.","com_ui_save_key_success": "API key saved successfully","com_ui_save_submit": "Save & Submit",@@ -1865,6 +1866,7 @@"com_ui_settings_tab_data": "Data & Privacy","com_ui_settings_tab_langfuse": "Langfuse","com_ui_share": "Share",+ "com_ui_share_access_description": "Choose who can access this resource and what they can do.","com_ui_share_create_message": "Your name and any messages you add after sharing stay private.","com_ui_share_delete_error": "There was an error deleting the shared link","com_ui_share_error": "There was an error sharing the chat link",diff --git a/client/src/style.css b/client/src/style.cssindex 58c217e67e..1128e6e90d 100644--- a/client/src/style.css+++ b/client/src/style.css@@ -18,9 +18,11 @@--gray-400: 153 150 150;--gray-500: 89 89 89;--gray-600: 66 66 66;+ --gray-650: 57 57 57;--gray-700: 47 47 47;--gray-800: 33 33 33;--gray-850: 23 23 23;+ --gray-875: 18 18 18;--gray-900: 13 13 13;--green-50: 236 253 245;--green-100: 209 250 229;@@ -66,7 +68,7 @@--blue-800: 30 64 175;--blue-900: 30 58 138;--blue-950: 23 37 84;- --brand-purple: 171 104 255;+ --brand-purple: 126 34 206;--gizmo-gray-500: 153 153 153;--gizmo-gray-600: 102 102 102;--gizmo-gray-950: 15 15 15;@@ -145,7 +147,7 @@}html {- --brand-purple: 171 104 255;+ --brand-purple: 126 34 206;--presentation: var(--white);--text-primary: var(--gray-800);--text-secondary: var(--gray-600);@@ -166,6 +168,7 @@ html {--surface-active-alt: var(--gray-200);--surface-hover: var(--gray-200);--surface-hover-alt: var(--gray-300);+ --surface-composer-hover: var(--gray-200);--surface-primary: var(--white);--surface-primary-alt: var(--gray-50);--surface-primary-contrast: var(--gray-100);@@ -240,7 +243,7 @@ html {--text-secondary-alt: var(--gray-400);--text-tertiary: var(--gray-400);--text-warning: var(--amber-500);- --text-destructive: var(--status-error);+ --text-destructive: var(--red-400);--link: var(--blue-400);--link-hover: var(--blue-300);--link-visited: 192 132 252;@@ -251,8 +254,9 @@ html {--header-button-hover: var(--gray-700);--surface-active: var(--gray-500);--surface-active-alt: var(--gray-700);- --surface-hover: var(--gray-600);+ --surface-hover: var(--gray-650);--surface-hover-alt: var(--gray-600);+ --surface-composer-hover: var(--gray-600);--surface-primary: var(--gray-900);--surface-primary-alt: var(--gray-850);--surface-primary-contrast: var(--gray-850);@@ -260,7 +264,7 @@ html {--surface-secondary-alt: var(--gray-800);--surface-tertiary: var(--gray-700);--surface-tertiary-alt: var(--gray-700);- --surface-dialog: var(--gray-850);+ --surface-dialog: var(--gray-875);--surface-overlay: 0 0 0;--surface-submit: var(--green-700);--surface-submit-hover: var(--green-800);@@ -2186,6 +2190,52 @@ html {outline: none;}+html[data-input-modality='pointer']+ :where(+ input:not([type]),+ input:is(+ [type='text'],+ [type='search'],+ [type='email'],+ [type='password'],+ [type='url'],+ [type='tel'],+ [type='number'],+ [type='date'],+ [type='datetime-local'],+ [type='month'],+ [type='week'],+ [type='time']+ ),+ textarea+ ):is(:focus, :focus-visible) {+ outline: none !important;+ box-shadow: none !important;+}++html[data-input-modality='keyboard']+ :where(+ input:not([type]),+ input:is(+ [type='text'],+ [type='search'],+ [type='email'],+ [type='password'],+ [type='url'],+ [type='tel'],+ [type='number'],+ [type='date'],+ [type='datetime-local'],+ [type='month'],+ [type='week'],+ [type='time']+ ),+ textarea+ ):not(.lc-field):focus-visible {+ outline: 2px solid rgb(var(--text-primary)) !important;+ outline-offset: 2px !important;+}+:focus-visible {outline: 2px solid #000;outline-offset: 2px;@@ -2438,5 +2488,5 @@ html {}.sharepoint-picker-bg {- background-color: #f5f5f5;+ background-color: rgb(var(--surface-dialog));}diff --git a/client/src/utils/getThemeFromEnv.spec.js b/client/src/utils/getThemeFromEnv.spec.jsindex 11713f01aa..7b5103e1bd 100644--- a/client/src/utils/getThemeFromEnv.spec.js+++ b/client/src/utils/getThemeFromEnv.spec.js@@ -37,6 +37,7 @@ describe('getThemeFromEnv', () => {REACT_APP_THEME_STATUS_WARNING_STRONG: '37 38 39',REACT_APP_THEME_STATUS_ERROR_STRONG: '40 41 42',REACT_APP_THEME_TEXT_ON_STATUS: '43 44 45',+ REACT_APP_THEME_SURFACE_COMPOSER_HOVER: '46 47 48',}),).toEqual({'rgb-status-error': '1 2 3',@@ -54,6 +55,7 @@ describe('getThemeFromEnv', () => {'rgb-status-warning-strong': '37 38 39','rgb-status-error-strong': '40 41 42','rgb-text-on-status': '43 44 45',+ 'rgb-surface-composer-hover': '46 47 48',});});diff --git a/eslint.config.mjs b/eslint.config.mjsindex 2c3f2b3fcb..43d141b1f5 100644--- a/eslint.config.mjs+++ b/eslint.config.mjs@@ -42,6 +42,7 @@ export default ['data-node/**/*','meili_data/**/*','**/node_modules/**/*',+ 'venv/**/*','.devcontainer/**/*',],},diff --git a/package-lock.json b/package-lock.jsonindex 40fb5aa5ae..4ea985826a 100644--- a/package-lock.json+++ b/package-lock.json@@ -21,6 +21,7 @@"@eslint/js": "^9.20.0","@playwright/test": "^1.56.1","@types/react-virtualized": "^9.22.0",+ "brace-expansion": "^2.1.2","caniuse-lite": "^1.0.30001741","cross-env": "^7.0.3","elliptic": "^6.6.1",@@ -20214,6 +20215,29 @@"typescript": ">=4.8.4 <6.1.0"}},+ "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "18 || 20 || >=22"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {+ "version": "5.0.9",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",+ "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^4.0.2"+ },+ "engines": {+ "node": "20 || >=22"+ }+ },"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {"version": "10.2.5","resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",@@ -21640,13 +21664,10 @@}},"node_modules/balanced-match": {- "version": "4.0.4",- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",- "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",- "license": "MIT",- "engines": {- "node": "18 || 20 || >=22"- }+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",+ "license": "MIT"},"node_modules/bare-events": {"version": "2.8.2",@@ -21973,15 +21994,12 @@"integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA=="},"node_modules/brace-expansion": {- "version": "5.0.9",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",- "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",+ "version": "2.1.4",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",+ "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==","license": "MIT","dependencies": {- "balanced-match": "^4.0.2"- },- "engines": {- "node": "20 || >=22"+ "balanced-match": "^1.0.0"}},"node_modules/braces": {@@ -22942,6 +22960,13 @@"node": ">= 0.6"}},+ "node_modules/concat-map": {+ "version": "0.0.1",+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",+ "dev": true,+ "license": "MIT"+ },"node_modules/concat-stream": {"version": "2.0.0","resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",@@ -26909,6 +26934,29 @@"node": ">=10.13.0"}},+ "node_modules/glob/node_modules/balanced-match": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "18 || 20 || >=22"+ }+ },+ "node_modules/glob/node_modules/brace-expansion": {+ "version": "5.0.9",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",+ "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^4.0.2"+ },+ "engines": {+ "node": "20 || >=22"+ }+ },"node_modules/glob/node_modules/lru-cache": {"version": "11.2.6","resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.6.tgz",@@ -33158,6 +33206,17 @@"node": "*"}},+ "node_modules/minimatch/node_modules/brace-expansion": {+ "version": "1.1.18",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",+ "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0",+ "concat-map": "0.0.1"+ }+ },"node_modules/minimist": {"version": "1.2.8","resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",@@ -33818,6 +33877,29 @@"url": "https://opencollective.com/nodemon"}},+ "node_modules/nodemon/node_modules/balanced-match": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "18 || 20 || >=22"+ }+ },+ "node_modules/nodemon/node_modules/brace-expansion": {+ "version": "5.0.9",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",+ "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^4.0.2"+ },+ "engines": {+ "node": "20 || >=22"+ }+ },"node_modules/nodemon/node_modules/has-flag": {"version": "3.0.0","resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",@@ -39986,6 +40068,29 @@"node": "20 || >=22"}},+ "node_modules/test-exclude/node_modules/balanced-match": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "18 || 20 || >=22"+ }+ },+ "node_modules/test-exclude/node_modules/brace-expansion": {+ "version": "5.0.9",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",+ "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^4.0.2"+ },+ "engines": {+ "node": "20 || >=22"+ }+ },"node_modules/test-exclude/node_modules/minimatch": {"version": "10.2.6","resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",@@ -41940,6 +42045,29 @@}}},+ "node_modules/workbox-build/node_modules/balanced-match": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "18 || 20 || >=22"+ }+ },+ "node_modules/workbox-build/node_modules/brace-expansion": {+ "version": "5.0.9",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",+ "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^4.0.2"+ },+ "engines": {+ "node": "20 || >=22"+ }+ },"node_modules/workbox-build/node_modules/fs-extra": {"version": "9.1.0","resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",diff --git a/package.json b/package.jsonindex 32cbb0a109..ff2d163cc0 100644--- a/package.json+++ b/package.json@@ -97,8 +97,8 @@"test:all": "npm run test:client && npm run test:api && npm run test:packages:api && npm run test:packages:data-provider && npm run test:packages:data-schemas","e2e:update": "npm run e2e:prepare && playwright test --config=e2e/playwright.config.local.ts --update-snapshots","e2e:report": "npx playwright show-report e2e/playwright-report",- "lint:fix": "eslint --fix \"{,!(node_modules|venv)/**/}*.{js,jsx,ts,tsx}\"",- "lint": "eslint \"{,!(node_modules|venv)/**/}*.{js,jsx,ts,tsx}\"",+ "lint:fix": "eslint . --fix",+ "lint": "eslint .","sort-imports": "node scripts/sort-imports.mts","sort-imports:check": "node scripts/sort-imports.mts --check","format": "npx prettier --write \"{,!(node_modules|venv)/**/}*.{js,jsx,ts,tsx}\"",@@ -153,6 +153,7 @@"@eslint/js": "^9.20.0","@playwright/test": "^1.56.1","@types/react-virtualized": "^9.22.0",+ "brace-expansion": "^2.1.2","caniuse-lite": "^1.0.30001741","cross-env": "^7.0.3","elliptic": "^6.6.1",@@ -177,7 +178,18 @@"typescript-eslint": "^8.60.1"},"overrides": {- "brace-expansion": "^5.0.8",+ "minimatch@3": {+ "brace-expansion": "^1.1.16"+ },+ "minimatch@5": {+ "brace-expansion": "^2.1.2"+ },+ "minimatch@9": {+ "brace-expansion": "^2.1.2"+ },+ "minimatch@10": {+ "brace-expansion": "^5.0.8"+ },"@xmldom/xmldom": "^0.8.13","elliptic": "^6.6.1","form-data": "^4.0.6",diff --git a/packages/client/src/components/Dropdown.tsx b/packages/client/src/components/Dropdown.tsxindex 79081b3569..522a713c34 100644--- a/packages/client/src/components/Dropdown.tsx+++ b/packages/client/src/components/Dropdown.tsx@@ -137,8 +137,8 @@ const Dropdown: React.FC<DropdownProps> = ({store={selectProps}disabled={disabled}className={cn(- 'relative inline-flex items-center justify-between rounded-xl border border-border-light bg-surface-primary py-2 text-sm text-text-primary transition-all duration-200 ease-in-out hover:bg-surface-hover hover:text-text-primary',- 'disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-surface-primary disabled:hover:text-text-primary',+ 'relative inline-flex items-center justify-between rounded-xl border border-border-light bg-transparent py-2 text-sm text-text-primary transition-all duration-200 ease-in-out hover:bg-surface-hover hover:text-text-primary',+ 'disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-text-primary',/** Horizontal padding would squeeze the icon, which flex-shrinks to fit */iconOnly ? 'size-10 justify-center px-0' : 'w-fit gap-2 px-3',className,diff --git a/packages/client/src/components/Field.css b/packages/client/src/components/Field.cssindex 4a1a79d632..91a129dbc7 100644--- a/packages/client/src/components/Field.css+++ b/packages/client/src/components/Field.css@@ -2,7 +2,7 @@only. Text inputs match :focus-visible on pointer focus too (a UA heuristicCSS cannot distinguish), so the ring is gated on the input modality trackedby useInputModality (mount it once near the app root). Without the hook the- attribute is absent and the ring always shows — the safe fallback. */+ attribute is absent and the ring always shows, which is the safe fallback. */html[data-input-modality='pointer'] .lc-field:focus,html[data-input-modality='pointer'] .lc-field:focus-visible {border-color: rgb(var(--border-light) / var(--border-light-alpha, 1));diff --git a/packages/client/src/components/OGDialogTemplate.tsx b/packages/client/src/components/OGDialogTemplate.tsxindex 999b3fcdc6..f78f689457 100644--- a/packages/client/src/components/OGDialogTemplate.tsx+++ b/packages/client/src/components/OGDialogTemplate.tsx@@ -121,7 +121,7 @@ const OGDialogTemplate: ForwardRefExoticComponent<overlayClassName={overlayClassName}showCloseButton={showCloseButton}ref={ref}- className={cn('w-11/12 border-none bg-surface-primary text-text-primary', className ?? '')}+ className={cn('w-11/12 border-none bg-surface-dialog text-text-primary', className ?? '')}onClick={(e) => e.stopPropagation()}><OGDialogHeader className={cn(headerClassName ?? '')}>diff --git a/packages/client/src/components/OriginalDialog.tsx b/packages/client/src/components/OriginalDialog.tsxindex 6dd0b05b27..53dc3a08cf 100644--- a/packages/client/src/components/OriginalDialog.tsx+++ b/packages/client/src/components/OriginalDialog.tsx@@ -170,14 +170,14 @@ const DialogContent: React.ForwardRefExoticComponent<style={{ ...style, zIndex: contentZIndex }}onEscapeKeyDown={handleEscapeKeyDown}className={cn(- 'max-w-11/12 fixed left-[50%] top-[50%] grid max-h-[90vh] w-full translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-2xl bg-surface-primary p-6 text-text-primary shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',+ 'max-w-11/12 fixed left-[50%] top-[50%] grid max-h-[90vh] w-full translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-2xl bg-surface-dialog p-6 text-text-primary shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',className,)}{...props}>{children}{showCloseButton && (- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-ring-primary ring-offset-surface-primary transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-text-primary focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-surface-hover data-[state=open]:text-text-secondary">+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-ring-primary ring-offset-surface-dialog transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-text-primary focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-surface-hover data-[state=open]:text-text-secondary"><X className="h-6 w-6" aria-hidden="true" /><span className="sr-only">Close</span></DialogPrimitive.Close>diff --git a/packages/client/src/components/SecretInput.tsx b/packages/client/src/components/SecretInput.tsxindex 630b7e95de..44dca947eb 100644--- a/packages/client/src/components/SecretInput.tsx+++ b/packages/client/src/components/SecretInput.tsx@@ -80,7 +80,7 @@ const SecretInput: React.ForwardRefExoticComponent<id={id}type={isVisible ? 'text' : 'password'}className={cn(- 'flex h-10 w-full rounded-lg border border-border-light bg-transparent py-2 pl-3 text-sm transition-colors placeholder:text-text-secondary hover:border-border-medium focus-visible:border-border-heavy focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50',+ 'flex h-10 w-full rounded-lg border border-border-light bg-transparent py-2 pl-3 text-sm placeholder:text-text-secondary focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50',className ?? '',copyButton != null || showCopy ? 'pr-20' : 'pr-11',)}diff --git a/packages/client/src/theme/registry.spec.ts b/packages/client/src/theme/registry.spec.tsindex 55d25eefa7..bfc43ce67e 100644--- a/packages/client/src/theme/registry.spec.ts+++ b/packages/client/src/theme/registry.spec.ts@@ -48,6 +48,23 @@ describe('theme registry', () => {expect(dark.appearance).toEqual(defaultAppearance);});+ it('preserves hover overrides from themes created before the composer hover token', () => {+ const storedTheme: ThemeDefinition = {+ version: 1,+ name: 'stored-theme',+ modes: {+ dark: {+ colors: { 'rgb-surface-hover': '44 45 46' },+ },+ },+ };++ const dark = resolveTheme(storedTheme, 'dark');++ expect(dark.colors['rgb-surface-hover']).toBe('44 45 46');+ expect(dark.colors['rgb-surface-composer-hover']).toBe('44 45 46');+ });+it('reports invalid and unknown values before a definition reaches the DOM', () => {const invalidTheme = {version: 1,diff --git a/packages/client/src/theme/registry.ts b/packages/client/src/theme/registry.tsindex 3c5245bf84..c2bd657a17 100644--- a/packages/client/src/theme/registry.ts+++ b/packages/client/src/theme/registry.ts@@ -187,12 +187,18 @@ export function resolveTheme(theme: ThemeDefinition, mode: ThemeMode): ResolvedTconst baseColors = mode === 'dark' ? darkTheme : defaultTheme;const definition = theme.modes[mode];+ const customColors = definition?.colors;+ const composerHoverFallback =+ customColors?.['rgb-surface-composer-hover'] === undefined &&+ customColors?.['rgb-surface-hover'] !== undefined+ ? { 'rgb-surface-composer-hover': customColors['rgb-surface-hover'] }+ : {};return {version: THEME_VERSION,name: theme.name,mode,- colors: { ...baseColors, ...definition?.colors } as Required<IThemeRGB>,+ colors: { ...baseColors, ...customColors, ...composerHoverFallback } as Required<IThemeRGB>,appearance: { ...defaultAppearance, ...definition?.appearance },};}diff --git a/packages/client/src/theme/semanticTokens.spec.ts b/packages/client/src/theme/semanticTokens.spec.tsindex 2745379689..fceddba789 100644--- a/packages/client/src/theme/semanticTokens.spec.ts+++ b/packages/client/src/theme/semanticTokens.spec.ts@@ -10,11 +10,22 @@ const sharedComponents = ['Button.tsx','Chip.tsx','Dialog.tsx',+ 'DialogTemplate.tsx','IconButton.tsx',+ 'OGDialogTemplate.tsx',+ 'OriginalDialog.tsx','Tag.tsx','Toast.tsx',];+const sharedDialogComponents = [+ 'AlertDialog.tsx',+ 'Dialog.tsx',+ 'DialogTemplate.tsx',+ 'OGDialogTemplate.tsx',+ 'OriginalDialog.tsx',+];+describe('shared component color guardrail', () => {it('keeps shared primitives free of direct palette utilities and hex colors', () => {const directPalette =@@ -28,6 +39,108 @@ describe('shared component color guardrail', () => {expect(source).not.toMatch(hexColor);});});++ it('keeps every shared dialog shell on the semantic dialog surface', () => {+ sharedDialogComponents.forEach((component) => {+ const source = readFileSync(join(__dirname, '..', 'components', component), 'utf8');++ expect(source).toMatch(/\bbg-surface-dialog\b/);+ });+ });+});++describe('dark dialog surface', () => {+ it('matches the legacy rendered background in CSS and the runtime theme', () => {+ const appStyles = readFileSync(+ join(__dirname, '..', '..', '..', '..', 'client', 'src', 'style.css'),+ 'utf8',+ );++ expect(appStyles).toMatch(/--gray-875:\s*18 18 18;/);+ expect(appStyles).toMatch(/--surface-dialog:\s*var\(--gray-875\);/);+ expect(darkTheme['rgb-surface-dialog']).toBe('18 18 18');+ });+});++describe('dark hover surface', () => {+ it('uses the gray-650 midpoint in both CSS and the runtime theme', () => {+ const appStyles = readFileSync(+ join(__dirname, '..', '..', '..', '..', 'client', 'src', 'style.css'),+ 'utf8',+ );++ expect(appStyles).toMatch(/--gray-650:\s*57 57 57;/);+ expect(appStyles).toMatch(/--surface-hover:\s*var\(--gray-650\);/);+ expect(darkTheme['rgb-surface-hover']).toBe('57 57 57');+ });+});++describe('composer hover surface', () => {+ it('keeps light hover unchanged and uses the lighter dark hover surface', () => {+ const appStyles = readFileSync(+ join(__dirname, '..', '..', '..', '..', 'client', 'src', 'style.css'),+ 'utf8',+ );++ expect(appStyles).toMatch(/--surface-composer-hover:\s*var\(--gray-200\);/);+ expect(appStyles).toMatch(/--surface-composer-hover:\s*var\(--gray-600\);/);+ expect(defaultTheme['rgb-surface-composer-hover']).toBe('227 227 227');+ expect(darkTheme['rgb-surface-composer-hover']).toBe('66 66 66');+ });+});++describe('dark destructive text', () => {+ it('uses red-400 without changing the status error token', () => {+ const appStyles = readFileSync(+ join(__dirname, '..', '..', '..', '..', 'client', 'src', 'style.css'),+ 'utf8',+ );++ expect(appStyles).toMatch(/--text-destructive:\s*var\(--red-400\);/);+ expect(darkTheme['rgb-text-destructive']).toBe('248 113 113');+ expect(darkTheme['rgb-status-error']).toBe('252 165 165');+ });+});++describe('light brand text', () => {+ it('uses the contrasting purple foreground in the default theme', () => {+ expect(defaultTheme['rgb-brand-purple']).toBe('126 34 206');+ });+});++describe('shared field and dropdown interaction styles', () => {+ it('keeps pointer focus stable and keyboard focus visible on text fields', () => {+ ['Input.tsx', 'Textarea.tsx'].forEach((component) => {+ const source = readFileSync(join(__dirname, '..', 'components', component), 'utf8');++ expect(source).toMatch(/focus-visible:border-border-medium/);+ expect(source).toMatch(/focus-visible:ring-2/);+ expect(source).toMatch(/focus-visible:ring-text-primary/);+ });++ const secretInput = readFileSync(+ join(__dirname, '..', 'components', 'SecretInput.tsx'),+ 'utf8',+ );+ expect(secretInput).not.toMatch(/(?:hover|focus-visible):border-/);++ const appStyles = readFileSync(+ join(__dirname, '..', '..', '..', '..', 'client', 'src', 'style.css'),+ 'utf8',+ );+ expect(appStyles).toMatch(/html\[data-input-modality='pointer'\]/);+ expect(appStyles).toMatch(/html\[data-input-modality='keyboard'\]/);+ expect(appStyles).toMatch(/outline:\s*2px solid rgb\(var\(--text-primary\)\) !important;/);+ expect(appStyles).not.toMatch(/textarea\s*\n\):hover,/);+ });++ it('keeps shared dropdown triggers transparent at rest and while disabled', () => {+ const source = readFileSync(join(__dirname, '..', 'components', 'Dropdown.tsx'), 'utf8');++ expect(source).toMatch(/\bbg-transparent\b/);+ expect(source).toMatch(/\bdisabled:hover:bg-transparent\b/);+ expect(source).not.toMatch(/\bbg-surface-primary\b/);+ });});type Rgb = [number, number, number];diff --git a/packages/client/src/theme/themes/dark.ts b/packages/client/src/theme/themes/dark.tsindex 81d31503dd..3d7a854dff 100644--- a/packages/client/src/theme/themes/dark.ts+++ b/packages/client/src/theme/themes/dark.ts@@ -11,7 +11,7 @@ export const darkTheme: IThemeRGB = {'rgb-text-secondary-alt': '153 150 150', // #999696 (gray-400)'rgb-text-tertiary': '153 150 150', // #999696 (gray-400)'rgb-text-warning': '245 158 11', // #f59e0b (amber-500)- 'rgb-text-destructive': '252 165 165', // #fca5a5 (red-300, matches status-error)+ 'rgb-text-destructive': '248 113 113', // #f87171 (red-400)// Link and accent colors'rgb-link': '96 165 250', // #60a5fa (blue-400)@@ -31,8 +31,9 @@ export const darkTheme: IThemeRGB = {// Surface colors'rgb-surface-active': '89 89 89', // #595959 (gray-500)'rgb-surface-active-alt': '47 47 47', // #2f2f2f (gray-700)- 'rgb-surface-hover': '66 66 66', // #424242 (gray-600)+ 'rgb-surface-hover': '57 57 57', // #393939 (gray-650)'rgb-surface-hover-alt': '66 66 66', // #424242 (gray-600)+ 'rgb-surface-composer-hover': '66 66 66', // #424242 (gray-600)'rgb-surface-primary': '13 13 13', // #0d0d0d (gray-900)'rgb-surface-primary-alt': '23 23 23', // #171717 (gray-850)'rgb-surface-primary-contrast': '23 23 23', // #171717 (gray-850)@@ -40,7 +41,7 @@ export const darkTheme: IThemeRGB = {'rgb-surface-secondary-alt': '33 33 33', // #212121 (gray-800)'rgb-surface-tertiary': '47 47 47', // #2f2f2f (gray-700)'rgb-surface-tertiary-alt': '47 47 47', // #2f2f2f (gray-700)- 'rgb-surface-dialog': '23 23 23', // #171717 (gray-850)+ 'rgb-surface-dialog': '18 18 18', // #121212 (legacy dark dialog)'rgb-surface-overlay': '0 0 0', // #000 (black)'rgb-surface-submit': '4 120 87', // #047857 (green-700)'rgb-surface-submit-hover': '6 95 70', // #065f46 (green-800)diff --git a/packages/client/src/theme/themes/default.ts b/packages/client/src/theme/themes/default.tsindex 021abd6d68..ebd693f7fe 100644--- a/packages/client/src/theme/themes/default.ts+++ b/packages/client/src/theme/themes/default.ts@@ -33,6 +33,7 @@ export const defaultTheme: IThemeRGB = {'rgb-surface-active-alt': '227 227 227', // #e3e3e3 (gray-200)'rgb-surface-hover': '227 227 227', // #e3e3e3 (gray-200)'rgb-surface-hover-alt': '205 205 205', // #cdcdcd (gray-300)+ 'rgb-surface-composer-hover': '227 227 227', // #e3e3e3 (gray-200)'rgb-surface-primary': '255 255 255', // #fff (white)'rgb-surface-primary-alt': '247 247 248', // #f7f7f8 (gray-50)'rgb-surface-primary-contrast': '236 236 236', // #ececec (gray-100)@@ -85,7 +86,7 @@ export const defaultTheme: IThemeRGB = {'rgb-text-on-status': '255 255 255', // #fff (white)// Brand colors- 'rgb-brand-purple': '171 104 255', // #ab68ff+ 'rgb-brand-purple': '126 34 206', // #7e22ce (purple-700)// Presentation'rgb-presentation': '255 255 255', // #fff (white)diff --git a/packages/client/src/theme/types/index.ts b/packages/client/src/theme/types/index.tsindex 02d9b82516..db1e686397 100644--- a/packages/client/src/theme/types/index.ts+++ b/packages/client/src/theme/types/index.ts@@ -31,6 +31,7 @@ export interface IThemeRGB {'rgb-surface-active-alt'?: string;'rgb-surface-hover'?: string;'rgb-surface-hover-alt'?: string;+ 'rgb-surface-composer-hover'?: string;'rgb-surface-primary'?: string;'rgb-surface-primary-alt'?: string;'rgb-surface-primary-contrast'?: string;@@ -112,6 +113,7 @@ export interface IThemeVariables {'--surface-active-alt': string;'--surface-hover': string;'--surface-hover-alt': string;+ '--surface-composer-hover': string;'--surface-primary': string;'--surface-primary-alt': string;'--surface-primary-contrast': string;@@ -189,6 +191,7 @@ export interface IThemeColors {'surface-active-alt'?: string;'surface-hover'?: string;'surface-hover-alt'?: string;+ 'surface-composer-hover'?: string;'surface-primary'?: string;'surface-primary-alt'?: string;'surface-primary-contrast'?: string;diff --git a/packages/client/src/theme/utils/applyTheme.spec.ts b/packages/client/src/theme/utils/applyTheme.spec.tsindex 7676edba7c..6c8eb3a8ed 100644--- a/packages/client/src/theme/utils/applyTheme.spec.ts+++ b/packages/client/src/theme/utils/applyTheme.spec.ts@@ -16,6 +16,8 @@ const semanticProperties = ['--status-success-border','--status-success-strong','--surface-overlay',+ '--surface-hover',+ '--surface-composer-hover','--text-on-status','--status-error','--status-neutral-border',@@ -45,6 +47,27 @@ describe('applyTheme', () => {);});+ it('applies the composer hover surface from runtime themes', () => {+ applyTheme({+ 'rgb-surface-composer-hover': '66 66 66',+ });++ expect(document.documentElement.style.getPropertyValue('--surface-composer-hover')).toBe(+ '66 66 66',+ );+ });++ it('keeps existing custom hover colors on composer controls', () => {+ applyTheme({+ 'rgb-surface-hover': '44 45 46',+ });++ expect(document.documentElement.style.getPropertyValue('--surface-hover')).toBe('44 45 46');+ expect(document.documentElement.style.getPropertyValue('--surface-composer-hover')).toBe(+ '44 45 46',+ );+ });+it('applies status and destructive colors from runtime themes', () => {applyTheme({'rgb-text-destructive': '20 21 22',diff --git a/packages/client/src/theme/utils/applyTheme.ts b/packages/client/src/theme/utils/applyTheme.tsindex 58422e43a2..6f600177dd 100644--- a/packages/client/src/theme/utils/applyTheme.ts+++ b/packages/client/src/theme/utils/applyTheme.ts@@ -16,13 +16,22 @@ function validateRGB(rgb: string): boolean {}function mapColors(colors: IThemeRGB): Array<[string, string]> {- return themeColorTokens.reduce<Array<[string, string]>>((variables, token) => {+ const variables = themeColorTokens.reduce<Array<[string, string]>>((result, token) => {const value = colors[token];if (value !== undefined) {- variables.push([colorProperty(token), value]);+ result.push([colorProperty(token), value]);}- return variables;+ return result;}, []);++ if (+ colors['rgb-surface-composer-hover'] === undefined &&+ colors['rgb-surface-hover'] !== undefined+ ) {+ variables.push(['--surface-composer-hover', colors['rgb-surface-hover']]);+ }++ return variables;}function mapAppearance(appearance: IThemeAppearance): Array<[string, string]> {diff --git a/packages/client/src/theme/utils/createTailwindColors.js b/packages/client/src/theme/utils/createTailwindColors.jsindex 5cb3d02498..1ffda1d0b0 100644--- a/packages/client/src/theme/utils/createTailwindColors.js+++ b/packages/client/src/theme/utils/createTailwindColors.js@@ -28,6 +28,7 @@ const palette = {400: '#999696',500: '#595959',600: '#424242',+ 650: '#393939',700: '#2f2f2f',800: '#212121',850: '#171717',@@ -88,6 +89,7 @@ function createTailwindColors() {'surface-active-alt': cssVar('--surface-active-alt'),'surface-hover': cssVar('--surface-hover'),'surface-hover-alt': cssVar('--surface-hover-alt'),+ 'surface-composer-hover': cssVar('--surface-composer-hover'),'surface-primary': cssVar('--surface-primary'),'surface-primary-alt': cssVar('--surface-primary-alt'),'surface-primary-contrast': cssVar('--surface-primary-contrast'),diff --git a/packages/client/src/theme/utils/createTailwindColors.spec.js b/packages/client/src/theme/utils/createTailwindColors.spec.jsindex a626edf59d..8325c4b82b 100644--- a/packages/client/src/theme/utils/createTailwindColors.spec.js+++ b/packages/client/src/theme/utils/createTailwindColors.spec.js@@ -1,6 +1,12 @@const { createTailwindColors } = require('./createTailwindColors');describe('createTailwindColors', () => {+ it('includes the gray midpoint used by the dark hover surface', () => {+ const colors = createTailwindColors();++ expect(colors.gray[650]).toBe('#393939');+ });+it('exposes semantic overlay and strong status colors', () => {const colors = createTailwindColors();@@ -9,6 +15,9 @@ describe('createTailwindColors', () => {'rgb(var(--status-success-strong) / <alpha-value>)',);expect(colors['text-on-status']).toBe('rgb(var(--text-on-status) / <alpha-value>)');+ expect(colors['surface-composer-hover']).toBe(+ 'rgb(var(--surface-composer-hover) / <alpha-value>)',+ );});it('combines intrinsic border alpha with Tailwind opacity modifiers', () => {