diff --git a/client/src/components/Chat/Footer.tsx b/client/src/components/Chat/Footer.tsx index 30bd1cc20c..f92aeed314 100644 --- a/client/src/components/Chat/Footer.tsx +++ b/client/src/components/Chat/Footer.tsx @@ -155,10 +155,7 @@ function Footer({ className, startupConfig, configuredOnly = false }: FooterProp {contentRender} {!isLastElement && ( -
+
)} ); diff --git a/client/src/components/Chat/Input/Files/FileRow.tsx b/client/src/components/Chat/Input/Files/FileRow.tsx index 95d43b2ac9..d21342662c 100644 --- a/client/src/components/Chat/Input/Files/FileRow.tsx +++ b/client/src/components/Chat/Input/Files/FileRow.tsx @@ -111,27 +111,16 @@ export default function FileRow({ } const renderFiles = () => { - const rowStyle = isRTL - ? { - display: 'flex', - flexDirection: 'row-reverse', - flexWrap: 'wrap', - gap: '6px', - width: '100%', - maxWidth: '100%', - } - : { - display: 'flex', - flexWrap: 'wrap', - gap: '6px', - width: '100%', - maxWidth: '100%', - }; - return ( /* `items-center` so a card and a thumbnail of different heights share one baseline instead of hanging from the top of the tallest row. */ -
+
{files .reduce( (acc, current) => { diff --git a/client/src/components/Chat/Input/HeaderOptions.tsx b/client/src/components/Chat/Input/HeaderOptions.tsx deleted file mode 100644 index 063ca27d23..0000000000 --- a/client/src/components/Chat/Input/HeaderOptions.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import { useState } from 'react'; -import { Settings2 } from 'lucide-react'; -import { TooltipAnchor } from '@librechat/client'; -import { Root, Anchor } from '@radix-ui/react-popover'; -import { isParamEndpoint, getEndpointField, tConvoUpdateSchema } from 'librechat-data-provider'; -import type { TPreset, TInterfaceConfig } from 'librechat-data-provider'; -import { EndpointSettings, SaveAsPresetDialog, AlternativeSettings } from '~/components/Endpoints'; -import { useSetIndexOptions, useLocalize } from '~/hooks'; -import { useGetEndpointsQuery } from '~/data-provider'; -import OptionsPopover from './OptionsPopover'; -import PopoverButtons from './PopoverButtons'; -import { useChatContext } from '~/Providers'; - -export default function HeaderOptions({ - interfaceConfig, -}: { - interfaceConfig?: Partial; -}) { - const { data: endpointsConfig } = useGetEndpointsQuery(); - - const [saveAsDialogShow, setSaveAsDialogShow] = useState(false); - const localize = useLocalize(); - - const { showPopover, conversation, setShowPopover } = useChatContext(); - const { setOption } = useSetIndexOptions(); - const { endpoint } = conversation ?? {}; - - const saveAsPreset = () => { - setSaveAsDialogShow(true); - }; - - if (!endpoint) { - return null; - } - - const triggerAdvancedMode = () => setShowPopover((prev) => !prev); - - const endpointType = getEndpointField(endpointsConfig, endpoint, 'type'); - const paramEndpoint = isParamEndpoint(endpoint, endpointType); - - return ( - - -
- -
- {interfaceConfig?.parameters === true && paramEndpoint === false && ( - - - )} -
- {interfaceConfig?.parameters === true && paramEndpoint === false && ( - } - closePopover={() => setShowPopover(false)} - > -
- - -
-
- )} - {interfaceConfig?.presets === true && ( - - )} -
-
-
-
- ); -} diff --git a/client/src/components/Chat/Input/Mention.tsx b/client/src/components/Chat/Input/Mention.tsx index 1685a47f35..3f1ccf8afe 100644 --- a/client/src/components/Chat/Input/Mention.tsx +++ b/client/src/components/Chat/Input/Mention.tsx @@ -186,7 +186,7 @@ function MentionContent({ { diff --git a/client/src/components/Chat/Input/OptionsPopover.tsx b/client/src/components/Chat/Input/OptionsPopover.tsx deleted file mode 100644 index 8aac76f3f2..0000000000 --- a/client/src/components/Chat/Input/OptionsPopover.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import { useRef } from 'react'; -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 { useLocalize } from '~/hooks'; -import { cn } from '~/utils'; - -type TOptionsPopoverProps = { - children: ReactNode; - visible: boolean; - saveAsPreset: () => void; - closePopover: () => void; - PopoverButtons: ReactNode; - presetsDisabled: boolean; -}; - -export default function OptionsPopover({ - children, - // endpoint, - visible, - saveAsPreset, - closePopover, - PopoverButtons, - presetsDisabled, -}: TOptionsPopoverProps) { - const popoverRef = useRef(null); - useOnClickOutside( - popoverRef, - () => closePopover(), - ['dialog-template-content', 'shadcn-button', 'advanced-settings'], - (_target) => { - const target = _target as Element; - if ( - target.id === 'presets-button' || - (target.parentNode instanceof Element && target.parentNode.id === 'presets-button') - ) { - return false; - } - const tagName = target.tagName; - return tagName === 'path' || tagName === 'svg' || tagName === 'circle'; - }, - ); - - const localize = useLocalize(); - const cardStyle = - 'shadow-xl rounded-md min-w-[4.6875rem] font-normal bg-surface-secondary border-border-light border text-text-primary'; - - if (!visible) { - return null; - } - - return ( - - -
-
-
- {presetsDisabled ? null : ( - - )} - {PopoverButtons} - -
-
{children}
-
-
-
-
- ); -} diff --git a/client/src/components/Chat/Input/PopoverButtons.tsx b/client/src/components/Chat/Input/PopoverButtons.tsx index 2059603982..e2e4677565 100644 --- a/client/src/components/Chat/Input/PopoverButtons.tsx +++ b/client/src/components/Chat/Input/PopoverButtons.tsx @@ -1,6 +1,6 @@ -import { useRecoilState } from 'recoil'; +import { useSetRecoilState } from 'recoil'; +import { Button, MessagesSquared } from '@librechat/client'; import { EModelEndpoint, SettingsViews } from 'librechat-data-provider'; -import { Button, MessagesSquared, AssistantIcon, DataIcon } from '@librechat/client'; import type { ReactNode } from 'react'; import { useChatContext } from '~/Providers'; import { useLocalize } from '~/hooks'; @@ -11,7 +11,6 @@ type TPopoverButton = { label: string; buttonClass: string; handler: () => void; - type?: 'alternative'; icon: ReactNode; }; @@ -30,7 +29,7 @@ export default function PopoverButtons({ }) { const localize = useLocalize(); const { conversation, optionSettings, setOptionSettings } = useChatContext(); - const [settingsView, setSettingsView] = useRecoilState(store.currentSettingsView); + const setSettingsView = useSetRecoilState(store.currentSettingsView); const { model: _model, endpoint: _endpoint, endpointType } = conversation ?? {}; const overrideEndpoint = overrideEndpointType ?? _overrideEndpoint; @@ -68,31 +67,8 @@ export default function PopoverButtons({ return null; } - const additionalButtons: { [key: string]: TPopoverButton[] } = { - [SettingsViews.default]: [ - { - label: 'Context Settings', - buttonClass: '', - type: 'alternative', - handler: () => setSettingsView(SettingsViews.advanced), - icon: , - }, - ], - [SettingsViews.advanced]: [ - { - label: 'Model Settings', - buttonClass: '', - type: 'alternative', - handler: () => setSettingsView(SettingsViews.default), - icon: , - }, - ], - }; - const endpointButtons = (endpointSpecificbuttons[endpoint] as TPopoverButton[] | null) ?? []; - const disabled = true; - return (
@@ -113,26 +89,6 @@ export default function PopoverButtons({ ))}
- {disabled ? null : ( -
- {additionalButtons[settingsView].map((button, index) => ( - - ))} -
- )}
); } diff --git a/client/src/components/Chat/Input/PromptsCommand.tsx b/client/src/components/Chat/Input/PromptsCommand.tsx index 576333a6cb..48db1c6a28 100644 --- a/client/src/components/Chat/Input/PromptsCommand.tsx +++ b/client/src/components/Chat/Input/PromptsCommand.tsx @@ -221,7 +221,7 @@ function PromptsCommand({ { diff --git a/client/src/components/Chat/Input/SkillsCommand.tsx b/client/src/components/Chat/Input/SkillsCommand.tsx index 54c77c74c1..0d8d60ac37 100644 --- a/client/src/components/Chat/Input/SkillsCommand.tsx +++ b/client/src/components/Chat/Input/SkillsCommand.tsx @@ -290,7 +290,7 @@ function SkillsCommandContent({ { diff --git a/client/src/components/Chat/Input/StreamAudio.tsx b/client/src/components/Chat/Input/StreamAudio.tsx index 5db4b9c767..a35a839183 100644 --- a/client/src/components/Chat/Input/StreamAudio.tsx +++ b/client/src/components/Chat/Input/StreamAudio.tsx @@ -208,13 +208,7 @@ export default function StreamAudio({ index = 0 }) { ref={audioRef} controls controlsList="nodownload nofullscreen noremoteplayback" - style={{ - position: 'absolute', - overflow: 'hidden', - display: 'none', - height: '0px', - width: '0px', - }} + className="absolute hidden size-0 overflow-hidden" src={globalAudioURL ?? undefined} id={globalAudioId} autoPlay diff --git a/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx b/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx index 70b5752398..e7281ff6d9 100644 --- a/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx +++ b/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx @@ -414,13 +414,13 @@ export default function Breakdown({