From fb6b326947b74000af2ff4f7857a82553c4bbff3 Mon Sep 17 00:00:00 2001 From: MyPrototypeWhat Date: Mon, 3 Nov 2025 13:41:00 +0800 Subject: [PATCH] chore: mark multiple components and icons as deprecated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added deprecation comments to several components and icons due to low usage (≤2 times), indicating plans for removal in future versions. - Components affected include EditableNumber, MaxContextCount, Sortable, ThinkingEffect, FileIcons, ToolIcon, and others. - Suggested alternatives or direct usage of other components where applicable. --- .../composites/EditableNumber/index.tsx | 8 ++++++++ .../composites/MaxContextCount/index.tsx | 8 ++++++++ .../components/composites/Sortable/Sortable.tsx | 8 ++++++++ .../composites/ThinkingEffect/index.tsx | 8 ++++++++ .../ui/src/components/icons/FileIcons/index.tsx | 15 +++++++++++++++ packages/ui/src/components/icons/Icon/index.tsx | 9 +++++++++ .../components/icons/SvgSpinners180Ring/index.tsx | 8 ++++++++ .../components/icons/ToolsCallingIcon/index.tsx | 8 ++++++++ .../ui/src/components/primitives/Avatar/index.tsx | 7 +++++++ .../primitives/Selector/SearchableSelector.tsx | 8 ++++++++ 10 files changed, 87 insertions(+) diff --git a/packages/ui/src/components/composites/EditableNumber/index.tsx b/packages/ui/src/components/composites/EditableNumber/index.tsx index a89a4bea7d..e6fed3cb55 100644 --- a/packages/ui/src/components/composites/EditableNumber/index.tsx +++ b/packages/ui/src/components/composites/EditableNumber/index.tsx @@ -1,3 +1,11 @@ +/** + * @deprecated 此组件使用频率仅为 2 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。且此组件依赖 antd 和 styled-components,与项目迁移方向不符。 + * + * This component has only 2 usages and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. Also depends on antd and styled-components, which conflicts with the migration direction. + */ + // Original path: src/renderer/src/components/EditableNumber/index.tsx import { InputNumber } from 'antd' import type { FC } from 'react' diff --git a/packages/ui/src/components/composites/MaxContextCount/index.tsx b/packages/ui/src/components/composites/MaxContextCount/index.tsx index af535660c1..0ded7db8dd 100644 --- a/packages/ui/src/components/composites/MaxContextCount/index.tsx +++ b/packages/ui/src/components/composites/MaxContextCount/index.tsx @@ -1,3 +1,11 @@ +/** + * @deprecated 此组件使用频率仅为 1 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。此组件与业务逻辑耦合,不适合通用 UI 库。 + * + * This component has only 1 usage and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. This component is coupled with business logic and not suitable for a general UI library. + */ + // Original path: src/renderer/src/components/MaxContextCount.tsx import { Infinity as InfinityIcon } from 'lucide-react' import type { CSSProperties } from 'react' diff --git a/packages/ui/src/components/composites/Sortable/Sortable.tsx b/packages/ui/src/components/composites/Sortable/Sortable.tsx index 0f6892e7d4..4ddc429eb4 100644 --- a/packages/ui/src/components/composites/Sortable/Sortable.tsx +++ b/packages/ui/src/components/composites/Sortable/Sortable.tsx @@ -1,3 +1,11 @@ +/** + * @deprecated 此组件使用频率仅为 2 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。且此组件依赖 styled-components,与项目迁移方向不符。 + * + * This component has only 2 usages and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. Also depends on styled-components, which conflicts with the migration direction. + */ + import type { Active, DragEndEvent, diff --git a/packages/ui/src/components/composites/ThinkingEffect/index.tsx b/packages/ui/src/components/composites/ThinkingEffect/index.tsx index 080496e922..6c542bf3d4 100644 --- a/packages/ui/src/components/composites/ThinkingEffect/index.tsx +++ b/packages/ui/src/components/composites/ThinkingEffect/index.tsx @@ -1,3 +1,11 @@ +/** + * @deprecated 此组件使用频率仅为 1 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。此组件是 AI 思考特效,可能需要保留在主项目中而不是 UI 库。 + * + * This component has only 1 usage and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. This is an AI thinking effect component that may need to stay in the main project. + */ + // Original path: src/renderer/src/components/ThinkingEffect.tsx import { isEqual } from 'lodash' import { ChevronRight, Lightbulb } from 'lucide-react' diff --git a/packages/ui/src/components/icons/FileIcons/index.tsx b/packages/ui/src/components/icons/FileIcons/index.tsx index 23f8ec8d9a..1c0a924254 100644 --- a/packages/ui/src/components/icons/FileIcons/index.tsx +++ b/packages/ui/src/components/icons/FileIcons/index.tsx @@ -67,5 +67,20 @@ const BaseFileIcon = ({ size = '1.1em', text = 'SVG', ...props }: BaseFileIconPr ) +/** + * @deprecated 此图标使用频率仅为 1 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。 + * + * This icon has only 1 usage and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. + */ export const FileSvgIcon = (props: Omit) => + +/** + * @deprecated 此图标使用频率仅为 2 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。 + * + * This icon has only 2 usages and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. + */ export const FilePngIcon = (props: Omit) => diff --git a/packages/ui/src/components/icons/Icon/index.tsx b/packages/ui/src/components/icons/Icon/index.tsx index c6bda5a2f4..bace2666a6 100644 --- a/packages/ui/src/components/icons/Icon/index.tsx +++ b/packages/ui/src/components/icons/Icon/index.tsx @@ -32,7 +32,16 @@ export const DeleteIcon = createIcon(Trash) export const EditIcon = createIcon(Pencil) export const RefreshIcon = createIcon(RefreshCw) export const ResetIcon = createIcon(RotateCcw) + +/** + * @deprecated 此组件使用频率为 0 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。虽然主项目中有本地副本,但完全未被导入使用。 + * + * This icon has 0 usages and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. + */ export const ToolIcon = createIcon(Wrench) + export const VisionIcon = createIcon(Eye) export const WebSearchIcon = createIcon(Search) export const WrapIcon = createIcon(WrapText) diff --git a/packages/ui/src/components/icons/SvgSpinners180Ring/index.tsx b/packages/ui/src/components/icons/SvgSpinners180Ring/index.tsx index cd65a6b911..fcdcec348f 100644 --- a/packages/ui/src/components/icons/SvgSpinners180Ring/index.tsx +++ b/packages/ui/src/components/icons/SvgSpinners180Ring/index.tsx @@ -1,3 +1,11 @@ +/** + * @deprecated 此组件使用频率为 0 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。虽然主项目中有本地副本,但完全未被导入使用。 + * + * This component has 0 usages and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. + */ + // Original path: src/renderer/src/components/Icons/SvgSpinners180Ring.tsx import type { SVGProps } from 'react' diff --git a/packages/ui/src/components/icons/ToolsCallingIcon/index.tsx b/packages/ui/src/components/icons/ToolsCallingIcon/index.tsx index a6b31babea..c3180ea76d 100644 --- a/packages/ui/src/components/icons/ToolsCallingIcon/index.tsx +++ b/packages/ui/src/components/icons/ToolsCallingIcon/index.tsx @@ -1,3 +1,11 @@ +/** + * @deprecated 此组件使用频率仅为 1 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。建议直接使用 lucide-react 的 Wrench 图标。 + * + * This component has only 1 usage and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. Consider using Wrench icon from lucide-react directly. + */ + // Original: src/renderer/src/components/Icons/ToolsCallingIcon.tsx import { Tooltip, type TooltipProps } from '@heroui/react' import { Wrench } from 'lucide-react' diff --git a/packages/ui/src/components/primitives/Avatar/index.tsx b/packages/ui/src/components/primitives/Avatar/index.tsx index dab1748e72..a2ad31bd73 100644 --- a/packages/ui/src/components/primitives/Avatar/index.tsx +++ b/packages/ui/src/components/primitives/Avatar/index.tsx @@ -20,6 +20,13 @@ const Avatar = (props: AvatarProps) => { Avatar.displayName = 'Avatar' +/** + * @deprecated 此组件使用频率仅为 1 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。建议直接使用 HeroUI 的 AvatarGroup 组件。 + * + * This component has only 1 usage and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. Consider using HeroUI's AvatarGroup component directly. + */ const AvatarGroup = HeroUIAvatarGroup AvatarGroup.displayName = 'AvatarGroup' diff --git a/packages/ui/src/components/primitives/Selector/SearchableSelector.tsx b/packages/ui/src/components/primitives/Selector/SearchableSelector.tsx index 7bff937138..2d178f93c9 100644 --- a/packages/ui/src/components/primitives/Selector/SearchableSelector.tsx +++ b/packages/ui/src/components/primitives/Selector/SearchableSelector.tsx @@ -1,3 +1,11 @@ +/** + * @deprecated 此组件使用频率为 0 次,不符合 UI 库提取标准(需 ≥3 次) + * 计划在未来版本中移除。如需可搜索选择器,请直接使用 HeroUI 的 Autocomplete 组件。 + * + * This component has 0 usages and does not meet the UI library extraction criteria (requires ≥3 usages). + * Planned for removal in future versions. Consider using HeroUI's Autocomplete component directly. + */ + import { Autocomplete, AutocompleteItem } from '@heroui/react' import type { Key } from '@react-types/shared' import { useMemo } from 'react'