chore: mark multiple components and icons as deprecated

- 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.
This commit is contained in:
MyPrototypeWhat
2025-11-03 13:41:00 +08:00
parent f9b7ff7d0e
commit fb6b326947
10 changed files with 87 additions and 0 deletions
@@ -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'
@@ -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'
@@ -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,
@@ -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'
@@ -67,5 +67,20 @@ const BaseFileIcon = ({ size = '1.1em', text = 'SVG', ...props }: BaseFileIconPr
</svg>
)
/**
* @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<BaseFileIconProps, 'text'>) => <BaseFileIcon text="SVG" {...props} />
/**
* @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<BaseFileIconProps, 'text'>) => <BaseFileIcon text="PNG" {...props} />
@@ -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)
@@ -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'
@@ -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'
@@ -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'
@@ -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'