diff --git a/client/src/components/Audio/Voices.tsx b/client/src/components/Audio/Voices.tsx index 7d8b3f9655..985e5e32d8 100644 --- a/client/src/components/Audio/Voices.tsx +++ b/client/src/components/Audio/Voices.tsx @@ -29,7 +29,7 @@ export function BrowserVoiceDropdown() { onChange={handleVoiceChange} sizeClasses="min-w-[200px] !max-w-[400px] [--anchor-max-width:400px]" testId="BrowserVoiceDropdown" - className="rounded-xl" + className="z-50" /> ); @@ -58,7 +58,7 @@ export function ExternalVoiceDropdown() { onChange={handleVoiceChange} sizeClasses="min-w-[200px] !max-w-[400px] [--anchor-max-width:400px]" testId="ExternalVoiceDropdown" - className="rounded-xl" + className="z-50" /> ); diff --git a/client/src/components/Nav/ExportConversation/ExportModal.tsx b/client/src/components/Nav/ExportConversation/ExportModal.tsx index bae8327ebe..ad36a107f8 100644 --- a/client/src/components/Nav/ExportConversation/ExportModal.tsx +++ b/client/src/components/Nav/ExportConversation/ExportModal.tsx @@ -1,10 +1,18 @@ import filenamify from 'filenamify'; -import { useEffect, useState } from 'react'; +import { useEffect, useState, useMemo, useCallback } from 'react'; import type { TConversation } from 'librechat-data-provider'; import { OGDialog, Button, Input, Label, Checkbox, Dropdown } from '~/components/ui'; import OGDialogTemplate from '~/components/ui/OGDialogTemplate'; import { useLocalize, useExportConversation } from '~/hooks'; +const TYPE_OPTIONS = [ + { value: 'screenshot', label: 'screenshot (.png)' }, + { value: 'text', label: 'text (.txt)' }, + { value: 'markdown', label: 'markdown (.md)' }, + { value: 'json', label: 'json (.json)' }, + { value: 'csv', label: 'csv (.csv)' }, +]; + export default function ExportModal({ open, onOpenChange, @@ -21,20 +29,12 @@ export default function ExportModal({ const localize = useLocalize(); const [filename, setFileName] = useState(''); - const [type, setType] = useState('Select a file type'); + const [type, setType] = useState('screenshot'); const [includeOptions, setIncludeOptions] = useState(true); const [exportBranches, setExportBranches] = useState(false); const [recursive, setRecursive] = useState(true); - const typeOptions = [ - { value: 'screenshot', label: 'screenshot (.png)' }, - { value: 'text', label: 'text (.txt)' }, - { value: 'markdown', label: 'markdown (.md)' }, - { value: 'json', label: 'json (.json)' }, - { value: 'csv', label: 'csv (.csv)' }, - ]; - useEffect(() => { if (!open && triggerRef && triggerRef.current) { triggerRef.current.focus(); @@ -49,17 +49,19 @@ export default function ExportModal({ setRecursive(true); }, [conversation?.title, open]); - const _setType = (newType: string) => { - const exportBranchesSupport = newType === 'json' || newType === 'csv' || newType === 'webpage'; - const exportOptionsSupport = newType !== 'csv' && newType !== 'screenshot'; - - setExportBranches(exportBranchesSupport); - setIncludeOptions(exportOptionsSupport); + const handleTypeChange = useCallback((newType: string) => { + const branches = newType === 'json' || newType === 'csv' || newType === 'webpage'; + const options = newType !== 'csv' && newType !== 'screenshot'; + setExportBranches(branches); + setIncludeOptions(options); setType(newType); - }; + }, []); - const exportBranchesSupport = type === 'json' || type === 'csv' || type === 'webpage'; - const exportOptionsSupport = type !== 'csv' && type !== 'screenshot'; + const exportBranchesSupport = useMemo( + () => type === 'json' || type === 'csv' || type === 'webpage', + [type], + ); + const exportOptionsSupport = useMemo(() => type !== 'csv' && type !== 'screenshot', [type]); const { exportConversation } = useExportConversation({ conversation, @@ -94,7 +96,13 @@ export default function ExportModal({ - +
@@ -108,7 +116,6 @@ export default function ExportModal({ id="includeOptions" disabled={!exportOptionsSupport} checked={includeOptions} - className="focus:ring-opacity-20 dark:border-gray-500 dark:bg-gray-700 dark:text-gray-50 dark:focus:ring-gray-600 dark:focus:ring-opacity-50 dark:focus:ring-offset-0" onCheckedChange={setIncludeOptions} />
); @@ -113,7 +113,7 @@ export const LangSelector = ({ onChange={onChange} sizeClasses="[--anchor-max-height:256px]" options={languageOptions} - className="rounded-xl" + className="z-50" /> ); diff --git a/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx b/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx index c63145f0ca..2abf281948 100644 --- a/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx +++ b/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx @@ -32,7 +32,7 @@ const EngineSTTDropdown: React.FC = ({ external }) => { options={endpointOptions} sizeClasses="w-[180px]" testId="EngineSTTDropdown" - className="rounded-xl" + className="z-50" /> ); diff --git a/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx b/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx index eb85c942e6..74ef7aa83c 100644 --- a/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx +++ b/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx @@ -31,9 +31,8 @@ const EngineTTSDropdown: React.FC = ({ external }) => { onChange={handleSelect} options={endpointOptions} sizeClasses="w-[180px]" - anchor="bottom start" testId="EngineTTSDropdown" - className="rounded-xl" + className="z-50" /> ); diff --git a/client/src/components/ui/Dropdown.tsx b/client/src/components/ui/Dropdown.tsx index 559bb6555b..2cb94f2b02 100644 --- a/client/src/components/ui/Dropdown.tsx +++ b/client/src/components/ui/Dropdown.tsx @@ -70,7 +70,7 @@ const Dropdown: React.FC = ({