From 591f05d2e195a248b54e8f8fae74a729cdf9bd71 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Sun, 23 Aug 2026 21:18:05 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20chore:=20Sort=20Client=20Imports?= =?UTF-8?q?=20Left=20Behind=20by=20the=20Import=20Order=20Gate=20(#15139)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/Providers/AgentsContext.tsx | 2 +- client/src/Providers/AssistantsContext.tsx | 2 +- client/src/components/Agents/SmartLoader.tsx | 2 +- client/src/components/Agents/tests/Accessibility.spec.tsx | 4 ++-- client/src/components/Agents/tests/CategoryTabs.spec.tsx | 4 ++-- client/src/components/Agents/tests/SearchBar.spec.tsx | 2 +- client/src/components/Audio/TTS.tsx | 2 +- client/src/components/Auth/ApiErrorWatcher.tsx | 2 +- client/src/components/Chat/Input/Files/FileContainer.tsx | 2 +- client/src/components/Chat/Input/Files/Table/Columns.tsx | 2 +- .../Chat/Input/Files/__tests__/AttachFileChat.spec.tsx | 2 +- client/src/components/Chat/Input/StreamAudio.tsx | 2 +- client/src/components/Chat/Input/TextareaHeader.tsx | 2 +- .../Input/__tests__/PendingManualSkillsChips.spec.tsx | 2 +- .../Chat/Menus/Endpoints/components/CustomGroup.tsx | 2 +- .../components/Chat/Messages/Content/Parts/Attachment.tsx | 6 +++--- .../components/Chat/Messages/Content/Parts/LogContent.tsx | 2 +- .../Chat/Messages/Content/Parts/ToolArtifactCard.tsx | 2 +- .../Messages/Content/__tests__/Markdown.mcpui.test.tsx | 8 ++++---- client/src/components/Chat/Messages/MessageIcon.tsx | 4 ++-- client/src/components/Endpoints/Settings/Anthropic.tsx | 2 +- 21 files changed, 29 insertions(+), 29 deletions(-) diff --git a/client/src/Providers/AgentsContext.tsx b/client/src/Providers/AgentsContext.tsx index a90a53ecb5..0b16b3e2f4 100644 --- a/client/src/Providers/AgentsContext.tsx +++ b/client/src/Providers/AgentsContext.tsx @@ -1,5 +1,5 @@ -import { useForm, FormProvider } from 'react-hook-form'; import { createContext, useContext } from 'react'; +import { useForm, FormProvider } from 'react-hook-form'; import type { UseFormReturn } from 'react-hook-form'; import type { AgentForm } from '~/common'; import { getDefaultAgentFormValues } from '~/utils'; diff --git a/client/src/Providers/AssistantsContext.tsx b/client/src/Providers/AssistantsContext.tsx index 10079083a2..adc2ce3ca8 100644 --- a/client/src/Providers/AssistantsContext.tsx +++ b/client/src/Providers/AssistantsContext.tsx @@ -1,5 +1,5 @@ -import { useForm, FormProvider } from 'react-hook-form'; import { createContext, useContext } from 'react'; +import { useForm, FormProvider } from 'react-hook-form'; import { defaultAssistantFormValues } from 'librechat-data-provider'; import type { UseFormReturn } from 'react-hook-form'; import type { AssistantForm } from '~/common'; diff --git a/client/src/components/Agents/SmartLoader.tsx b/client/src/components/Agents/SmartLoader.tsx index 2dcc7dbebb..58e741b936 100644 --- a/client/src/components/Agents/SmartLoader.tsx +++ b/client/src/components/Agents/SmartLoader.tsx @@ -1,5 +1,5 @@ -import { AgentListResponse } from 'librechat-data-provider'; import React, { useState, useEffect } from 'react'; +import { AgentListResponse } from 'librechat-data-provider'; interface SmartLoaderProps { /** Whether the content is currently loading */ diff --git a/client/src/components/Agents/tests/Accessibility.spec.tsx b/client/src/components/Agents/tests/Accessibility.spec.tsx index 8d9a02a982..0c856ee654 100644 --- a/client/src/components/Agents/tests/Accessibility.spec.tsx +++ b/client/src/components/Agents/tests/Accessibility.spec.tsx @@ -1,12 +1,12 @@ import React from 'react'; +import * as t from 'librechat-data-provider'; import { render, screen, fireEvent } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import CategoryTabs from '../CategoryTabs'; +import ErrorDisplay from '../ErrorDisplay'; import AgentGrid from '../AgentGrid'; import AgentCard from '../AgentCard'; import SearchBar from '../SearchBar'; -import ErrorDisplay from '../ErrorDisplay'; -import * as t from 'librechat-data-provider'; // Mock matchMedia Object.defineProperty(window, 'matchMedia', { diff --git a/client/src/components/Agents/tests/CategoryTabs.spec.tsx b/client/src/components/Agents/tests/CategoryTabs.spec.tsx index a38c16dde0..89906e65d4 100644 --- a/client/src/components/Agents/tests/CategoryTabs.spec.tsx +++ b/client/src/components/Agents/tests/CategoryTabs.spec.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; -import CategoryTabs from '../CategoryTabs'; import type t from 'librechat-data-provider'; +import CategoryTabs from '../CategoryTabs'; // Mock useLocalize hook jest.mock('~/hooks/useLocalize', () => () => (key: string) => { diff --git a/client/src/components/Agents/tests/SearchBar.spec.tsx b/client/src/components/Agents/tests/SearchBar.spec.tsx index c7fa163e51..9f0aebb264 100644 --- a/client/src/components/Agents/tests/SearchBar.spec.tsx +++ b/client/src/components/Agents/tests/SearchBar.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; import SearchBar from '../SearchBar'; diff --git a/client/src/components/Audio/TTS.tsx b/client/src/components/Audio/TTS.tsx index 0d9351703e..28d35244bc 100644 --- a/client/src/components/Audio/TTS.tsx +++ b/client/src/components/Audio/TTS.tsx @@ -1,8 +1,8 @@ /* eslint-disable jsx-a11y/media-has-caption */ import { useEffect } from 'react'; import { useRecoilValue } from 'recoil'; -import type { TMessageAudio } from '~/common'; import { VolumeIcon, VolumeMuteIcon, Spinner } from '@librechat/client'; +import type { TMessageAudio } from '~/common'; import { useLocalize, useTTSBrowser, useTTSExternal } from '~/hooks'; import { logger } from '~/utils'; import store from '~/store'; diff --git a/client/src/components/Auth/ApiErrorWatcher.tsx b/client/src/components/Auth/ApiErrorWatcher.tsx index 09827065af..d9878a8ac0 100644 --- a/client/src/components/Auth/ApiErrorWatcher.tsx +++ b/client/src/components/Auth/ApiErrorWatcher.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { useApiErrorBoundary } from '~/hooks/ApiErrorBoundaryContext'; import { useNavigate } from 'react-router-dom'; +import { useApiErrorBoundary } from '~/hooks/ApiErrorBoundaryContext'; const ApiErrorWatcher = () => { const { error } = useApiErrorBoundary(); diff --git a/client/src/components/Chat/Input/Files/FileContainer.tsx b/client/src/components/Chat/Input/Files/FileContainer.tsx index 551f477a84..c0790c7c72 100644 --- a/client/src/components/Chat/Input/Files/FileContainer.tsx +++ b/client/src/components/Chat/Input/Files/FileContainer.tsx @@ -1,5 +1,5 @@ -import type { ReactNode } from 'react'; import type { TFile } from 'librechat-data-provider'; +import type { ReactNode } from 'react'; import type { ExtendedFile } from '~/common'; import { getFileType, cn } from '~/utils'; import FilePreview from './FilePreview'; diff --git a/client/src/components/Chat/Input/Files/Table/Columns.tsx b/client/src/components/Chat/Input/Files/Table/Columns.tsx index bcedb62d55..dcf043b764 100644 --- a/client/src/components/Chat/Input/Files/Table/Columns.tsx +++ b/client/src/components/Chat/Input/Files/Table/Columns.tsx @@ -1,6 +1,6 @@ /* eslint-disable react-hooks/rules-of-hooks */ -import { ArrowUpDown, ArrowUp, ArrowDown, Database } from 'lucide-react'; import { FileSources, FileContext } from 'librechat-data-provider'; +import { ArrowUpDown, ArrowUp, ArrowDown, Database } from 'lucide-react'; import { Button, Checkbox, diff --git a/client/src/components/Chat/Input/Files/__tests__/AttachFileChat.spec.tsx b/client/src/components/Chat/Input/Files/__tests__/AttachFileChat.spec.tsx index e2c5a27613..3ac3d33be9 100644 --- a/client/src/components/Chat/Input/Files/__tests__/AttachFileChat.spec.tsx +++ b/client/src/components/Chat/Input/Files/__tests__/AttachFileChat.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { render, screen } from '@testing-library/react'; import { RecoilRoot } from 'recoil'; +import { render, screen } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { EModelEndpoint, mergeFileConfig } from 'librechat-data-provider'; import type { TEndpointsConfig, Agent } from 'librechat-data-provider'; diff --git a/client/src/components/Chat/Input/StreamAudio.tsx b/client/src/components/Chat/Input/StreamAudio.tsx index d199962eff..09011b27ab 100644 --- a/client/src/components/Chat/Input/StreamAudio.tsx +++ b/client/src/components/Chat/Input/StreamAudio.tsx @@ -1,5 +1,5 @@ -import { useParams } from 'react-router-dom'; import { useEffect, useCallback } from 'react'; +import { useParams } from 'react-router-dom'; import { QueryKeys } from 'librechat-data-provider'; import { useQueryClient } from '@tanstack/react-query'; import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'; diff --git a/client/src/components/Chat/Input/TextareaHeader.tsx b/client/src/components/Chat/Input/TextareaHeader.tsx index 06c1802585..00ba6e4651 100644 --- a/client/src/components/Chat/Input/TextareaHeader.tsx +++ b/client/src/components/Chat/Input/TextareaHeader.tsx @@ -1,7 +1,7 @@ import { memo } from 'react'; -import AddedConvo from './AddedConvo'; import type { TConversation } from 'librechat-data-provider'; import type { SetterOrUpdater } from 'recoil'; +import AddedConvo from './AddedConvo'; export default memo(function TextareaHeader({ addedConvo, diff --git a/client/src/components/Chat/Input/__tests__/PendingManualSkillsChips.spec.tsx b/client/src/components/Chat/Input/__tests__/PendingManualSkillsChips.spec.tsx index a8eb7984f4..63d9e4f5d2 100644 --- a/client/src/components/Chat/Input/__tests__/PendingManualSkillsChips.spec.tsx +++ b/client/src/components/Chat/Input/__tests__/PendingManualSkillsChips.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; +import userEvent from '@testing-library/user-event'; import { RecoilRoot, MutableSnapshot } from 'recoil'; import { render, screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; jest.mock('~/hooks', () => ({ useLocalize: () => (key: string, params?: Record) => diff --git a/client/src/components/Chat/Menus/Endpoints/components/CustomGroup.tsx b/client/src/components/Chat/Menus/Endpoints/components/CustomGroup.tsx index a71c676f9c..2283174f9d 100644 --- a/client/src/components/Chat/Menus/Endpoints/components/CustomGroup.tsx +++ b/client/src/components/Chat/Menus/Endpoints/components/CustomGroup.tsx @@ -1,8 +1,8 @@ import React from 'react'; import type { TModelSpec } from 'librechat-data-provider'; +import { useModelSelectorContext } from '../ModelSelectorContext'; import { CustomMenu as Menu } from '../CustomMenu'; import { ModelSpecItem } from './ModelSpecItem'; -import { useModelSelectorContext } from '../ModelSelectorContext'; import GroupIcon from './GroupIcon'; interface CustomGroupProps { diff --git a/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx b/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx index e6525ff8c4..f02e8a4189 100644 --- a/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx +++ b/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx @@ -1,6 +1,6 @@ import { memo, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react'; -import { Loader2, AlertCircle, Download, ChevronDown, Files as FilesIcon } from 'lucide-react'; import { Tools } from 'librechat-data-provider'; +import { Loader2, AlertCircle, Download, ChevronDown, Files as FilesIcon } from 'lucide-react'; import type { TAttachment, TFile, TAttachmentMetadata } from 'librechat-data-provider'; import type { ToolArtifactType } from '~/utils/artifacts'; import { @@ -13,14 +13,14 @@ import { isTextAttachment, renderAttachmentKey, } from './attachmentTypes'; -import FilePreview from '~/components/Chat/Input/Files/FilePreview'; +import { useLocalize, useAttachmentPreviewSync, useExpandCollapse } from '~/hooks'; import FileContainer from '~/components/Chat/Input/Files/FileContainer'; import { fileToArtifact, TOOL_ARTIFACT_TYPES } from '~/utils/artifacts'; +import FilePreview from '~/components/Chat/Input/Files/FilePreview'; import Image from '~/components/Chat/Messages/Content/Image'; import ToolMermaidArtifact from './ToolMermaidArtifact'; import ToolArtifactCard from './ToolArtifactCard'; import { useAttachmentLink } from './LogLink'; -import { useLocalize, useAttachmentPreviewSync, useExpandCollapse } from '~/hooks'; import { cn, getFileType } from '~/utils'; const COLLAPSED_MAX_HEIGHT = 320; diff --git a/client/src/components/Chat/Messages/Content/Parts/LogContent.tsx b/client/src/components/Chat/Messages/Content/Parts/LogContent.tsx index 7b7efd0572..a37419cd54 100644 --- a/client/src/components/Chat/Messages/Content/Parts/LogContent.tsx +++ b/client/src/components/Chat/Messages/Content/Parts/LogContent.tsx @@ -1,5 +1,5 @@ -import { isAfter } from 'date-fns'; import React, { useMemo } from 'react'; +import { isAfter } from 'date-fns'; import { imageExtRegex } from 'librechat-data-provider'; import type { TFile, TAttachment, TAttachmentMetadata } from 'librechat-data-provider'; import type { Artifact } from '~/common'; diff --git a/client/src/components/Chat/Messages/Content/Parts/ToolArtifactCard.tsx b/client/src/components/Chat/Messages/Content/Parts/ToolArtifactCard.tsx index 28349a7534..75d234783d 100644 --- a/client/src/components/Chat/Messages/Content/Parts/ToolArtifactCard.tsx +++ b/client/src/components/Chat/Messages/Content/Parts/ToolArtifactCard.tsx @@ -13,8 +13,8 @@ import FilePreview from '~/components/Chat/Input/Files/FilePreview'; import { isCodeOnlyArtifact } from '~/utils/artifacts'; import { displayFilename } from './attachmentTypes'; import { useAttachmentLink } from './LogLink'; -import { useLocalize } from '~/hooks'; import { cn, getFileType } from '~/utils'; +import { useLocalize } from '~/hooks'; import store from '~/store'; interface ToolArtifactCardProps { diff --git a/client/src/components/Chat/Messages/Content/__tests__/Markdown.mcpui.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/Markdown.mcpui.test.tsx index bde9614904..62ed8118b9 100644 --- a/client/src/components/Chat/Messages/Content/__tests__/Markdown.mcpui.test.tsx +++ b/client/src/components/Chat/Messages/Content/__tests__/Markdown.mcpui.test.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import { render, screen } from '@testing-library/react'; -import Markdown from '../Markdown'; -import MarkdownLite from '../MarkdownLite'; import { RecoilRoot } from 'recoil'; -import { UI_RESOURCE_MARKER } from '~/components/MCPUIResource/plugin'; +import { render, screen } from '@testing-library/react'; import { useMessageContext, useOptionalMessagesConversation, useOptionalMessagesOperations, } from '~/Providers'; +import { UI_RESOURCE_MARKER } from '~/components/MCPUIResource/plugin'; import { useGetMessagesByConvoId } from '~/data-provider'; +import MarkdownLite from '../MarkdownLite'; import { useLocalize } from '~/hooks'; +import Markdown from '../Markdown'; // Mocks for hooks used by MCPUIResource when rendered inside Markdown. // Keep Provider components intact while mocking only the hooks we use. diff --git a/client/src/components/Chat/Messages/MessageIcon.tsx b/client/src/components/Chat/Messages/MessageIcon.tsx index 0e4d1f4ffc..7eabab3ebb 100644 --- a/client/src/components/Chat/Messages/MessageIcon.tsx +++ b/client/src/components/Chat/Messages/MessageIcon.tsx @@ -4,9 +4,9 @@ import type { Assistant, Agent } from 'librechat-data-provider'; import type { TMessageIcon } from '~/common'; import ConvoIconURL from '~/components/Endpoints/ConvoIconURL'; import { useGetEndpointsQuery } from '~/data-provider'; -import { getIconEndpoint } from '~/utils'; -import { isImageURL } from '~/utils/icons'; import Icon from '~/components/Endpoints/Icon'; +import { isImageURL } from '~/utils/icons'; +import { getIconEndpoint } from '~/utils'; type MessageIconProps = { iconData?: TMessageIcon; diff --git a/client/src/components/Endpoints/Settings/Anthropic.tsx b/client/src/components/Endpoints/Settings/Anthropic.tsx index ffed8aa53d..51deb4e39f 100644 --- a/client/src/components/Endpoints/Settings/Anthropic.tsx +++ b/client/src/components/Endpoints/Settings/Anthropic.tsx @@ -1,9 +1,9 @@ import { useMemo } from 'react'; +import { presetSettings } from 'librechat-data-provider'; import { getSettingsKeys } from 'librechat-data-provider'; import type { SettingDefinition } from 'librechat-data-provider'; import type { TModelSelectProps } from '~/common'; import { componentMapping } from '~/components/SidePanel/Parameters/components'; -import { presetSettings } from 'librechat-data-provider'; export default function AnthropicSettings({ conversation,