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

View File

@ -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'

View File

@ -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'

View File

@ -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,

View File

@ -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'

View File

@ -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} />

View File

@ -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)

View File

@ -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'

View File

@ -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'

View File

@ -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'

View File

@ -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'