diff --git a/eslint.config.mjs b/eslint.config.mjs index 47745b0f1..efbc13b0d 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -145,7 +145,7 @@ export default defineConfig([ paths: [ { name: 'antd', - importNames: ['Flex', 'Switch', 'message',], + importNames: ['Flex', 'Switch', 'message', 'Button'], message: '❌ Do not import this component from antd. Use our custom components instead: import { ... } from "@cherrystudio/ui"' }, diff --git a/packages/ui/src/components/base/Button/index.tsx b/packages/ui/src/components/base/Button/index.tsx new file mode 100644 index 000000000..88815307a --- /dev/null +++ b/packages/ui/src/components/base/Button/index.tsx @@ -0,0 +1,12 @@ +import type { ButtonProps as HeroUIButtonProps } from '@heroui/react' +import { Button as HeroUIButton } from '@heroui/react' + +export interface ButtonProps extends HeroUIButtonProps {} + +const Button = ({ ...props }: ButtonProps) => { + return +} + +Button.displayName = 'Button' + +export default Button diff --git a/packages/ui/src/components/index.ts b/packages/ui/src/components/index.ts index 4c6f97649..8add0fbfd 100644 --- a/packages/ui/src/components/index.ts +++ b/packages/ui/src/components/index.ts @@ -1,4 +1,5 @@ // Base Components +export { default as Button, type ButtonProps } from './base/Button' export { default as CopyButton } from './base/CopyButton' export { default as CustomCollapse } from './base/CustomCollapse' export { default as CustomTag } from './base/CustomTag' diff --git a/packages/ui/src/components/interactive/ImageToolButton/index.tsx b/packages/ui/src/components/interactive/ImageToolButton/index.tsx index b8defb32b..97a5eeaeb 100644 --- a/packages/ui/src/components/interactive/ImageToolButton/index.tsx +++ b/packages/ui/src/components/interactive/ImageToolButton/index.tsx @@ -1,17 +1,20 @@ // Original path: src/renderer/src/components/Preview/ImageToolButton.tsx -import { Button, Tooltip } from 'antd' +import { Button } from '@cherrystudio/ui' +import { Tooltip } from 'antd' import { memo } from 'react' interface ImageToolButtonProps { tooltip: string icon: React.ReactNode - onClick: () => void + onPress: () => void } -const ImageToolButton = ({ tooltip, icon, onClick }: ImageToolButtonProps) => { +const ImageToolButton = ({ tooltip, icon, onPress }: ImageToolButtonProps) => { return ( - ) } diff --git a/packages/ui/stories/components/base/Button.stories.tsx b/packages/ui/stories/components/base/Button.stories.tsx new file mode 100644 index 000000000..b69aca5d3 --- /dev/null +++ b/packages/ui/stories/components/base/Button.stories.tsx @@ -0,0 +1,150 @@ +import type { Meta, StoryObj } from '@storybook/react' + +import { Button } from '../../../src/components' + +const meta: Meta = { + title: 'Components/Base/Button', + component: Button, + parameters: { + layout: 'centered' + }, + tags: ['autodocs'], + argTypes: { + variant: { + control: { type: 'select' }, + options: ['solid', 'bordered', 'light', 'flat', 'faded', 'shadow', 'ghost'] + }, + color: { + control: { type: 'select' }, + options: ['default', 'primary', 'secondary', 'success', 'warning', 'danger'] + }, + size: { + control: { type: 'select' }, + options: ['sm', 'md', 'lg'] + }, + radius: { + control: { type: 'select' }, + options: ['none', 'sm', 'md', 'lg', 'full'] + }, + isDisabled: { + control: { type: 'boolean' } + }, + isLoading: { + control: { type: 'boolean' } + }, + fullWidth: { + control: { type: 'boolean' } + }, + isIconOnly: { + control: { type: 'boolean' } + } + } +} + +export default meta +type Story = StoryObj + +// 基础按钮 +export const Default: Story = { + args: { + children: 'Button' + } +} + +// 不同变体 +export const Variants: Story = { + render: () => ( +
+ + + + + + + +
+ ) +} + +// 不同颜色 +export const Colors: Story = { + render: () => ( +
+ + + + + + +
+ ) +} + +// 不同尺寸 +export const Sizes: Story = { + render: () => ( +
+ + + +
+ ) +} + +// 不同圆角 +export const Radius: Story = { + render: () => ( +
+ + + + + +
+ ) +} + +// 状态 +export const States: Story = { + render: () => ( +
+ + + +
+ ) +} + +// 带图标 +export const WithIcons: Story = { + render: () => ( +
+ + + +
+ ) +} + +// 全宽按钮 +export const FullWidth: Story = { + render: () => ( +
+ +
+ ) +} + +// 交互示例 +export const Interactive: Story = { + render: () => ( +
+ + +
+ ) +} diff --git a/src/renderer/src/assets/styles/index.css b/src/renderer/src/assets/styles/index.css index d48eb615d..828342a06 100644 --- a/src/renderer/src/assets/styles/index.css +++ b/src/renderer/src/assets/styles/index.css @@ -170,10 +170,6 @@ ul { display: flow-root; } -.lucide:not(.lucide-custom) { - color: var(--color-icon); -} - ::highlight(search-matches) { background-color: var(--color-background-highlight); color: var(--color-highlight); diff --git a/src/renderer/src/components/Buttons/ActionIconButton.tsx b/src/renderer/src/components/Buttons/ActionIconButton.tsx index d571f7ff1..a492a4857 100644 --- a/src/renderer/src/components/Buttons/ActionIconButton.tsx +++ b/src/renderer/src/components/Buttons/ActionIconButton.tsx @@ -1,31 +1,34 @@ import { cn } from '@cherrystudio/ui' -import type { ButtonProps } from 'antd' -import { Button } from 'antd' +import { Button, type ButtonProps } from '@cherrystudio/ui' import React, { memo } from 'react' -interface ActionIconButtonProps extends ButtonProps { - children: React.ReactNode +interface ActionIconButtonProps extends Omit { + icon: React.ReactNode active?: boolean } /** * A simple action button rendered as an icon */ -const ActionIconButton: React.FC = ({ children, active = false, className, ...props }) => { +const ActionIconButton: React.FC = ({ icon, active = false, className, ...props }) => { return ( + {...props} + /> ) } +ActionIconButton.displayName = 'ActionIconButton' + export default memo(ActionIconButton) diff --git a/src/renderer/src/components/CodeBlockView/HtmlArtifactsCard.tsx b/src/renderer/src/components/CodeBlockView/HtmlArtifactsCard.tsx index c6feb2b48..77e46137e 100644 --- a/src/renderer/src/components/CodeBlockView/HtmlArtifactsCard.tsx +++ b/src/renderer/src/components/CodeBlockView/HtmlArtifactsCard.tsx @@ -1,9 +1,9 @@ import { CodeOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import { useTheme } from '@renderer/context/ThemeProvider' import { extractHtmlTitle, getFileNameFromHtmlTitle } from '@renderer/utils/formats' import type { ThemeMode } from '@shared/data/preference/preferenceTypes' -import { Button } from 'antd' import { Code, DownloadIcon, Globe, LinkIcon, Sparkles } from 'lucide-react' import type { FC } from 'react' import { useState } from 'react' @@ -89,20 +89,32 @@ const HtmlArtifactsCard: FC = ({ html, onSave, isStreaming = false }) => - ) : ( - - - diff --git a/src/renderer/src/components/CodeBlockView/HtmlArtifactsPopup.tsx b/src/renderer/src/components/CodeBlockView/HtmlArtifactsPopup.tsx index e176d227e..82e3a5849 100644 --- a/src/renderer/src/components/CodeBlockView/HtmlArtifactsPopup.tsx +++ b/src/renderer/src/components/CodeBlockView/HtmlArtifactsPopup.tsx @@ -1,4 +1,5 @@ import { CodeEditor, type CodeEditorHandles } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { CopyIcon, FilePngIcon } from '@renderer/components/Icons' import { isMac } from '@renderer/config/constant' @@ -7,7 +8,7 @@ import { useTemporaryValue } from '@renderer/hooks/useTemporaryValue' import { classNames } from '@renderer/utils' import { extractHtmlTitle, getFileNameFromHtmlTitle } from '@renderer/utils/formats' import { captureScrollableIframeAsBlob, captureScrollableIframeAsDataURL } from '@renderer/utils/image' -import { Button, Dropdown, Modal, Splitter, Tooltip, Typography } from 'antd' +import { Dropdown, Modal, Splitter, Tooltip, Typography } from 'antd' import { Camera, Check, Code, Eye, Maximize2, Minimize2, SaveIcon, SquareSplitHorizontal, X } from 'lucide-react' import { useCallback, useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -83,24 +84,24 @@ const HtmlArtifactsPopup: React.FC = ({ open, title, ht e.stopPropagation()}> } - onClick={() => setViewMode('split')}> + size="sm" + color={viewMode === 'split' ? 'primary' : 'default'} + startContent={} + onPress={() => setViewMode('split')}> {t('html_artifacts.split')} } - onClick={() => setViewMode('code')}> + size="sm" + color={viewMode === 'code' ? 'primary' : 'default'} + startContent={} + onPress={() => setViewMode('code')}> {t('html_artifacts.code')} } - onClick={() => setViewMode('preview')}> + size="sm" + color={viewMode === 'preview' ? 'primary' : 'default'} + startContent={} + onPress={() => setViewMode('preview')}> {t('html_artifacts.preview')} @@ -126,16 +127,17 @@ const HtmlArtifactsPopup: React.FC = ({ open, title, ht ] }}> - ) diff --git a/src/renderer/src/components/InputEmbeddingDimension.tsx b/src/renderer/src/components/InputEmbeddingDimension.tsx index 8e6357a91..db2c79d87 100644 --- a/src/renderer/src/components/InputEmbeddingDimension.tsx +++ b/src/renderer/src/components/InputEmbeddingDimension.tsx @@ -1,10 +1,11 @@ +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import AiProvider from '@renderer/aiCore' import { RefreshIcon } from '@renderer/components/Icons' import { useProvider } from '@renderer/hooks/useProvider' import type { Model } from '@renderer/types' import { getErrorMessage } from '@renderer/utils' -import { Button, InputNumber, Space, Tooltip } from 'antd' +import { InputNumber, Space, Tooltip } from 'antd' import { memo, useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -77,9 +78,11 @@ const InputEmbeddingDimension = ({ - + ) } ] @@ -222,20 +230,21 @@ export function LocalBackupManager({ visible, onClose, localBackupDir, restoreMe width={800} centered transitionName="animation-move-down" + classNames={{ footer: 'flex justify-end gap-1' }} footer={[ - , , - ]}> diff --git a/src/renderer/src/components/LocalBackupModals.tsx b/src/renderer/src/components/LocalBackupModals.tsx index d5c7972a1..ab0160ff2 100644 --- a/src/renderer/src/components/LocalBackupModals.tsx +++ b/src/renderer/src/components/LocalBackupModals.tsx @@ -1,6 +1,7 @@ +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import { backupToLocal } from '@renderer/services/BackupService' -import { Button, Input, Modal } from 'antd' +import { Input, Modal } from 'antd' import dayjs from 'dayjs' import { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -32,11 +33,12 @@ export function LocalBackupModal({ open={isModalVisible} onOk={handleBackup} onCancel={handleCancel} + classNames={{ footer: 'flex justify-end gap-1' }} footer={[ - , - ]}> diff --git a/src/renderer/src/components/MinApp/MinappPopupContainer.tsx b/src/renderer/src/components/MinApp/MinappPopupContainer.tsx index 01c0517e8..10df610f8 100644 --- a/src/renderer/src/components/MinApp/MinappPopupContainer.tsx +++ b/src/renderer/src/components/MinApp/MinappPopupContainer.tsx @@ -10,6 +10,7 @@ import { PushpinOutlined, ReloadOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { loggerService } from '@logger' import WindowControls from '@renderer/components/WindowControls' @@ -24,7 +25,7 @@ import { useTimer } from '@renderer/hooks/useTimer' import type { MinAppType } from '@renderer/types' import { delay } from '@renderer/utils' import { clearWebviewState, getWebviewLoaded, setWebviewLoaded } from '@renderer/utils/webviewStateManager' -import { Alert, Avatar, Button, Drawer, Tooltip } from 'antd' +import { Alert, Avatar, Drawer, Tooltip } from 'antd' import type { WebviewTag } from 'electron' import { useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -129,7 +130,7 @@ const GoogleLoginTip = ({ banner onClose={handleClose} action={ - } diff --git a/src/renderer/src/components/ModelSelectButton.tsx b/src/renderer/src/components/ModelSelectButton.tsx index 959461389..1f69fba9f 100644 --- a/src/renderer/src/components/ModelSelectButton.tsx +++ b/src/renderer/src/components/ModelSelectButton.tsx @@ -1,6 +1,7 @@ +import { Button } from '@cherrystudio/ui' import type { Model } from '@renderer/types' import type { TooltipProps } from 'antd' -import { Button, Tooltip } from 'antd' +import { Tooltip } from 'antd' import { useCallback, useMemo } from 'react' import ModelAvatar from './Avatar/ModelAvatar' @@ -23,7 +24,15 @@ const ModelSelectButton = ({ model, onSelectModel, modelFilter, noTooltip, toolt }, [model, modelFilter, onSelectModel]) const button = useMemo(() => { - return - @@ -234,16 +235,14 @@ export function NustorePathSelectorFooter(props: FooterProps) { return ( - - + - - + diff --git a/src/renderer/src/components/OAuth/OAuthButton.tsx b/src/renderer/src/components/OAuth/OAuthButton.tsx index b8e485a8e..5584adc32 100644 --- a/src/renderer/src/components/OAuth/OAuthButton.tsx +++ b/src/renderer/src/components/OAuth/OAuthButton.tsx @@ -1,3 +1,4 @@ +import { Button, type ButtonProps } from '@cherrystudio/ui' import { getProviderLabel } from '@renderer/i18n/label' import type { Provider } from '@renderer/types' import { @@ -8,8 +9,6 @@ import { oauthWithSiliconFlow, oauthWithTokenFlux } from '@renderer/utils/oauth' -import type { ButtonProps } from 'antd' -import { Button } from 'antd' import type { FC } from 'react' import { useTranslation } from 'react-i18next' @@ -55,7 +54,7 @@ const OAuthButton: FC = ({ provider, onSuccess, ...buttonProps }) => { } return ( - ) diff --git a/src/renderer/src/components/Popups/ApiKeyListPopup/item.tsx b/src/renderer/src/components/Popups/ApiKeyListPopup/item.tsx index e85d8093e..9d5dfbd39 100644 --- a/src/renderer/src/components/Popups/ApiKeyListPopup/item.tsx +++ b/src/renderer/src/components/Popups/ApiKeyListPopup/item.tsx @@ -1,11 +1,12 @@ import { Flex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { type HealthResult, HealthStatusIndicator } from '@renderer/components/HealthStatusIndicator' import { EditIcon } from '@renderer/components/Icons' import { StreamlineGoodHealthAndWellBeing } from '@renderer/components/Icons/SVGIcon' import type { ApiKeyWithStatus } from '@renderer/types/healthCheck' import { maskApiKey } from '@renderer/utils/api' import type { InputRef } from 'antd' -import { Button, Input, List, Popconfirm, Tooltip, Typography } from 'antd' +import { Input, List, Popconfirm, Tooltip, Typography } from 'antd' import { Check, Minus, X } from 'lucide-react' import type { FC } from 'react' import { memo, useEffect, useRef, useState } from 'react' @@ -93,79 +94,96 @@ const ApiKeyItem: FC = ({ return ( - {isEditing ? ( - - setEditValue(e.target.value)} - onPressEnter={handleSave} - placeholder={t('settings.provider.api.key.new_key.placeholder')} - style={{ flex: 1, fontSize: '14px', marginLeft: '-10px' }} - spellCheck={false} - disabled={disabled} - /> - - - diff --git a/src/renderer/src/components/Popups/MultiSelectionPopup.tsx b/src/renderer/src/components/Popups/MultiSelectionPopup.tsx index 7594d6a20..930c57311 100644 --- a/src/renderer/src/components/Popups/MultiSelectionPopup.tsx +++ b/src/renderer/src/components/Popups/MultiSelectionPopup.tsx @@ -1,7 +1,8 @@ +import { Button } from '@cherrystudio/ui' import { CopyIcon, DeleteIcon } from '@renderer/components/Icons' import { useChatContext } from '@renderer/hooks/useChatContext' import type { Topic } from '@renderer/types' -import { Button, Tooltip } from 'antd' +import { Tooltip } from 'antd' import { Save, X } from 'lucide-react' import type { FC } from 'react' import { useTranslation } from 'react-i18next' @@ -37,37 +38,37 @@ const MultiSelectActionPopup: FC = ({ topic }) => { ), - ].filter(Boolean)}> diff --git a/src/renderer/src/components/Preview/ImageToolButton.tsx b/src/renderer/src/components/Preview/ImageToolButton.tsx index e14ae8fee..8577b0a67 100644 --- a/src/renderer/src/components/Preview/ImageToolButton.tsx +++ b/src/renderer/src/components/Preview/ImageToolButton.tsx @@ -1,16 +1,17 @@ -import { Button, Tooltip } from 'antd' +import { Button } from '@cherrystudio/ui' +import { Tooltip } from 'antd' import { memo } from 'react' interface ImageToolButtonProps { tooltip: string icon: React.ReactNode - onClick: () => void + onPress: () => void } -const ImageToolButton = ({ tooltip, icon, onClick }: ImageToolButtonProps) => { +const ImageToolButton = ({ tooltip, icon, onPress }: ImageToolButtonProps) => { return ( - )) diff --git a/src/renderer/src/components/Preview/__tests__/__snapshots__/ImageToolButton.test.tsx.snap b/src/renderer/src/components/Preview/__tests__/__snapshots__/ImageToolButton.test.tsx.snap index 0f155f1ff..fe1074ed7 100644 --- a/src/renderer/src/components/Preview/__tests__/__snapshots__/ImageToolButton.test.tsx.snap +++ b/src/renderer/src/components/Preview/__tests__/__snapshots__/ImageToolButton.test.tsx.snap @@ -7,12 +7,19 @@ exports[`ImageToolButton > should match snapshot 1`] = ` > `; diff --git a/src/renderer/src/components/RichEditor/components/ImageUploader.tsx b/src/renderer/src/components/RichEditor/components/ImageUploader.tsx index 631fc6bd1..4ff13843d 100644 --- a/src/renderer/src/components/RichEditor/components/ImageUploader.tsx +++ b/src/renderer/src/components/RichEditor/components/ImageUploader.tsx @@ -1,6 +1,7 @@ import { InboxOutlined, LinkOutlined, LoadingOutlined, UploadOutlined } from '@ant-design/icons' import { Flex } from '@cherrystudio/ui' -import { Button, Input, Modal, Spin, Tabs, Upload } from 'antd' +import { Button } from '@cherrystudio/ui' +import { Input, Modal, Spin, Tabs, Upload } from 'antd' const { Dragger } = Upload import type { RcFile } from 'antd/es/upload' @@ -174,17 +175,10 @@ export const ImageUploader: React.FC = ({ onImageSelect, vis prefix={} style={{ flex: 1 }} /> - - diff --git a/src/renderer/src/components/RichEditor/components/LinkEditor.tsx b/src/renderer/src/components/RichEditor/components/LinkEditor.tsx index 31ef91a43..12cd8aad6 100644 --- a/src/renderer/src/components/RichEditor/components/LinkEditor.tsx +++ b/src/renderer/src/components/RichEditor/components/LinkEditor.tsx @@ -1,6 +1,7 @@ import { Flex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { useTheme } from '@renderer/context/ThemeProvider' -import { Button, Input } from 'antd' +import { Input } from 'antd' import React, { useCallback, useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -146,16 +147,16 @@ const LinkEditor: React.FC = ({
{showRemove && ( - )}
- - diff --git a/src/renderer/src/components/RichEditor/components/MathInputDialog.tsx b/src/renderer/src/components/RichEditor/components/MathInputDialog.tsx index 9f6c402cf..241e1a523 100644 --- a/src/renderer/src/components/RichEditor/components/MathInputDialog.tsx +++ b/src/renderer/src/components/RichEditor/components/MathInputDialog.tsx @@ -1,6 +1,7 @@ import { Flex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { useTheme } from '@renderer/context/ThemeProvider' -import { Button, Input } from 'antd' +import { Input } from 'antd' import React, { useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -148,10 +149,10 @@ const MathInputDialog: React.FC = ({ style={{ marginBottom: 12, fontFamily: 'monospace' }} /> - - diff --git a/src/renderer/src/components/RichEditor/extensions/code-block-shiki/CodeBlockNodeView.tsx b/src/renderer/src/components/RichEditor/extensions/code-block-shiki/CodeBlockNodeView.tsx index fafd1e447..7b6853a7b 100644 --- a/src/renderer/src/components/RichEditor/extensions/code-block-shiki/CodeBlockNodeView.tsx +++ b/src/renderer/src/components/RichEditor/extensions/code-block-shiki/CodeBlockNodeView.tsx @@ -1,7 +1,8 @@ import { CopyOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { DEFAULT_LANGUAGES, getHighlighter, getShiki } from '@renderer/utils/shiki' import { NodeViewContent, NodeViewWrapper, type ReactNodeViewProps, ReactNodeViewRenderer } from '@tiptap/react' -import { Button, Select, Tooltip } from 'antd' +import { Select, Tooltip } from 'antd' import type { FC } from 'react' import { useCallback, useEffect, useState } from 'react' @@ -67,11 +68,12 @@ const CodeBlockNodeView: FC = (props) => { /> @@ -262,19 +263,19 @@ export function S3BackupManager({ visible, onClose, s3Config, restoreMethod }: S centered transitionName="animation-move-down" footer={[ - , , - ]}> diff --git a/src/renderer/src/components/TranslateButton.tsx b/src/renderer/src/components/TranslateButton.tsx index 996b07526..ba811a0ab 100644 --- a/src/renderer/src/components/TranslateButton.tsx +++ b/src/renderer/src/components/TranslateButton.tsx @@ -1,14 +1,14 @@ import { LoadingOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { loggerService } from '@logger' import useTranslate from '@renderer/hooks/useTranslate' import { translateText } from '@renderer/services/TranslateService' -import { Button, Tooltip } from 'antd' +import { Tooltip } from 'antd' import { Languages } from 'lucide-react' import type { FC } from 'react' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' -import styled from 'styled-components' interface Props { text?: string @@ -70,47 +70,18 @@ const TranslateButton: FC = ({ text, onTranslated, disabled, style, isLoa title={t('chat.input.translate', { target_language: getLanguageByLangcode(targetLanguage).label() })} mouseLeaveDelay={0} arrow> - + ) } -const ToolbarButton = styled(Button)` - min-width: 30px; - height: 30px; - font-size: 16px; - border-radius: 50%; - transition: all 0.3s ease; - color: var(--color-icon); - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - padding: 0; - &.anticon, - &.iconfont { - transition: all 0.3s ease; - color: var(--color-icon); - } - &:hover { - background-color: var(--color-background-soft); - .anticon, - .iconfont { - color: var(--color-text-1); - } - } - &.active { - background-color: var(--color-primary) !important; - .anticon, - .iconfont { - color: var(--color-white-soft); - } - &:hover { - background-color: var(--color-primary); - } - } -` - export default TranslateButton diff --git a/src/renderer/src/components/WebdavBackupManager.tsx b/src/renderer/src/components/WebdavBackupManager.tsx index a77987141..b72da3ea8 100644 --- a/src/renderer/src/components/WebdavBackupManager.tsx +++ b/src/renderer/src/components/WebdavBackupManager.tsx @@ -1,7 +1,8 @@ import { DeleteOutlined, ExclamationCircleOutlined, ReloadOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { restoreFromWebdav } from '@renderer/services/BackupService' import { formatFileSize } from '@renderer/utils' -import { Button, Modal, Table, Tooltip } from 'antd' +import { Modal, Table, Tooltip } from 'antd' import dayjs from 'dayjs' import { useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -238,14 +239,14 @@ export function WebdavBackupManager({ width: 160, render: (_: any, record: BackupFile) => ( <> - @@ -269,19 +270,19 @@ export function WebdavBackupManager({ centered transitionName="animation-move-down" footer={[ - , , - ]}> diff --git a/src/renderer/src/components/__tests__/__snapshots__/InputEmbeddingDimension.test.tsx.snap b/src/renderer/src/components/__tests__/__snapshots__/InputEmbeddingDimension.test.tsx.snap index f05613003..609d3df38 100644 --- a/src/renderer/src/components/__tests__/__snapshots__/InputEmbeddingDimension.test.tsx.snap +++ b/src/renderer/src/components/__tests__/__snapshots__/InputEmbeddingDimension.test.tsx.snap @@ -18,13 +18,18 @@ exports[`InputEmbeddingDimension > basic rendering > should match snapshot with > diff --git a/src/renderer/src/hooks/useUserTheme.ts b/src/renderer/src/hooks/useUserTheme.ts index d2897eae5..99244db0d 100644 --- a/src/renderer/src/hooks/useUserTheme.ts +++ b/src/renderer/src/hooks/useUserTheme.ts @@ -2,6 +2,7 @@ // import { setUserTheme, UserTheme } from '@renderer/store/settings' import { usePreference } from '@data/hooks/usePreference' +import { getForegroundColor } from '@renderer/utils' import Color from 'color' export default function useUserTheme() { @@ -15,6 +16,7 @@ export default function useUserTheme() { document.body.style.setProperty('--color-primary', colorPrimary.toString()) // overwrite hero UI primary color. document.body.style.setProperty('--primary', colorPrimary.toString()) + document.body.style.setProperty('--primary-foreground', getForegroundColor(colorPrimary.hex())) document.body.style.setProperty('--color-primary-soft', colorPrimary.alpha(0.6).toString()) document.body.style.setProperty('--color-primary-mute', colorPrimary.alpha(0.3).toString()) diff --git a/src/renderer/src/pages/agents/AgentsPage.tsx b/src/renderer/src/pages/agents/AgentsPage.tsx index ca73650b2..9ae98a19e 100644 --- a/src/renderer/src/pages/agents/AgentsPage.tsx +++ b/src/renderer/src/pages/agents/AgentsPage.tsx @@ -1,5 +1,6 @@ import { ImportOutlined, PlusOutlined } from '@ant-design/icons' import { ColFlex, Flex, RowFlex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { Navbar, NavbarCenter } from '@renderer/components/app/Navbar' import ListItem from '@renderer/components/ListItem' import Scrollbar from '@renderer/components/Scrollbar' @@ -9,7 +10,7 @@ import { useNavbarPosition } from '@renderer/hooks/useNavbar' import { createAssistantFromAgent } from '@renderer/services/AssistantService' import type { Agent } from '@renderer/types' import { uuid } from '@renderer/utils' -import { Button, Empty, Input } from 'antd' +import { Empty, Input } from 'antd' import { omit } from 'lodash' import { Search } from 'lucide-react' import type { FC } from 'react' @@ -267,17 +268,17 @@ const AgentsPage: FC = () => { ) : ( isTopNavbar && ( ) )} - -
diff --git a/src/renderer/src/pages/agents/components/AddAgentPopup.tsx b/src/renderer/src/pages/agents/components/AddAgentPopup.tsx index 973b88aaa..2526559d3 100644 --- a/src/renderer/src/pages/agents/components/AddAgentPopup.tsx +++ b/src/renderer/src/pages/agents/components/AddAgentPopup.tsx @@ -1,6 +1,7 @@ import 'emoji-picker-element' import { CheckOutlined, LoadingOutlined, RollbackOutlined, ThunderboltOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import EmojiPicker from '@renderer/components/EmojiPicker' import { TopView } from '@renderer/components/TopView' @@ -14,7 +15,7 @@ import type { Agent, KnowledgeBase } from '@renderer/types' import { getLeadingEmoji, uuid } from '@renderer/utils' import { AGENT_PROMPT } from '@shared/config/prompts' import type { FormInstance, SelectProps } from 'antd' -import { Button, Form, Input, Modal, Popover, Select } from 'antd' +import { Form, Input, Modal, Popover, Select } from 'antd' import TextArea from 'antd/es/input/TextArea' import { useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -202,7 +203,7 @@ const PopupContainer: React.FC = ({ resolve }) => { } arrow trigger="click"> - + @@ -218,15 +219,19 @@ const PopupContainer: React.FC = ({ resolve }) => { Tokens: {tokenCount} - + @@ -124,7 +125,7 @@ const PopupContainer: React.FC = ({ resolve }) => { {importType === 'file' && ( - + )} diff --git a/src/renderer/src/pages/code/CodeToolsPage.tsx b/src/renderer/src/pages/code/CodeToolsPage.tsx index b902870ed..8243884b8 100644 --- a/src/renderer/src/pages/code/CodeToolsPage.tsx +++ b/src/renderer/src/pages/code/CodeToolsPage.tsx @@ -1,3 +1,4 @@ +import { Button } from '@cherrystudio/ui' import AiProvider from '@renderer/aiCore' import { Navbar, NavbarCenter } from '@renderer/components/app/Navbar' import ModelSelector from '@renderer/components/ModelSelector' @@ -16,7 +17,7 @@ import { setIsBunInstalled } from '@renderer/store/mcp' import type { EndpointType, Model } from '@renderer/types' import type { TerminalConfig } from '@shared/config/constant' import { codeTools, terminalApps } from '@shared/config/constant' -import { Alert, Avatar, Button, Checkbox, Input, Popover, Select, Space, Tooltip } from 'antd' +import { Alert, Avatar, Checkbox, Input, Popover, Select, Space, Tooltip } from 'antd' import { ArrowUpRight, Download, FolderOpen, HelpCircle, Terminal, X } from 'lucide-react' import type { FC } from 'react' import { useCallback, useEffect, useMemo, useState } from 'react' @@ -321,12 +322,12 @@ const CodeToolsPage: FC = () => {
{t('code.bun_required_message')}
@@ -457,7 +458,11 @@ const CodeToolsPage: FC = () => { selectedTerminal !== terminalApps.powershell && selectedTerminal !== terminalApps.windowsTerminal && ( - diff --git a/src/renderer/src/pages/files/FilesPage.tsx b/src/renderer/src/pages/files/FilesPage.tsx index 4754a6b8b..3265b2047 100644 --- a/src/renderer/src/pages/files/FilesPage.tsx +++ b/src/renderer/src/pages/files/FilesPage.tsx @@ -1,5 +1,6 @@ import { ExclamationCircleOutlined } from '@ant-design/icons' import { Flex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import { Navbar, NavbarCenter } from '@renderer/components/app/Navbar' import { DeleteIcon, EditIcon } from '@renderer/components/Icons' @@ -12,7 +13,7 @@ import store from '@renderer/store' import type { FileMetadata } from '@renderer/types' import { FileTypes } from '@renderer/types' import { formatFileSize } from '@renderer/utils' -import { Button, Checkbox, Dropdown, Empty, Popconfirm } from 'antd' +import { Checkbox, Dropdown, Empty, Popconfirm } from 'antd' import dayjs from 'dayjs' import { useLiveQuery } from 'dexie-react-hooks' import { @@ -114,7 +115,7 @@ const FilesPage: FC = () => { created_at_unix: dayjs(file.created_at).unix(), actions: ( - diff --git a/src/renderer/src/pages/history/components/TopicMessages.tsx b/src/renderer/src/pages/history/components/TopicMessages.tsx index 69cb365f9..139015998 100644 --- a/src/renderer/src/pages/history/components/TopicMessages.tsx +++ b/src/renderer/src/pages/history/components/TopicMessages.tsx @@ -1,5 +1,6 @@ import { MessageOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import SearchPopup from '@renderer/components/Popups/SearchPopup' import { MessageEditingProvider } from '@renderer/context/MessageEditingContext' @@ -13,7 +14,7 @@ import { locateToMessage } from '@renderer/services/MessagesService' import NavigationService from '@renderer/services/NavigationService' import type { Topic } from '@renderer/types' import { classNames, runAsyncFunction } from '@renderer/utils' -import { Button, Divider, Empty } from 'antd' +import { Divider, Empty } from 'antd' import { t } from 'i18next' import { Forward } from 'lucide-react' import type { FC } from 'react' @@ -64,11 +65,11 @@ const TopicMessages: FC = ({ topic: _topic, ...props }) => { diff --git a/src/renderer/src/pages/history/components/TopicsHistory.tsx b/src/renderer/src/pages/history/components/TopicsHistory.tsx index d13cd7094..cbf6092a6 100644 --- a/src/renderer/src/pages/history/components/TopicsHistory.tsx +++ b/src/renderer/src/pages/history/components/TopicsHistory.tsx @@ -1,9 +1,10 @@ import { SearchOutlined } from '@ant-design/icons' import { ColFlex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import useScrollPosition from '@renderer/hooks/useScrollPosition' import { selectAllTopics } from '@renderer/store/assistants' import type { Topic } from '@renderer/types' -import { Button, Divider, Empty, Segmented } from 'antd' +import { Divider, Empty, Segmented } from 'antd' import dayjs from 'dayjs' import { groupBy, isEmpty, orderBy } from 'lodash' import { useState } from 'react' @@ -40,7 +41,7 @@ const TopicsHistory: React.FC = ({ keywords, onClick, onSearch, ...props - @@ -75,7 +76,7 @@ const TopicsHistory: React.FC = ({ keywords, onClick, onSearch, ...props ))} {keywords && (
-
diff --git a/src/renderer/src/pages/home/Inputbar/AttachmentButton.tsx b/src/renderer/src/pages/home/Inputbar/AttachmentButton.tsx index a2ccd40e4..7f81f8f9f 100644 --- a/src/renderer/src/pages/home/Inputbar/AttachmentButton.tsx +++ b/src/renderer/src/pages/home/Inputbar/AttachmentButton.tsx @@ -148,9 +148,12 @@ const AttachmentButton: FC = ({ ref, couldAddImageFile, extensions, files title={couldAddImageFile ? t('chat.input.upload.image_or_document') : t('chat.input.upload.document')} mouseLeaveDelay={0} arrow> - 0} disabled={disabled}> - - + 0} + isDisabled={disabled} + icon={} + />
) } diff --git a/src/renderer/src/pages/home/Inputbar/GenerateImageButton.tsx b/src/renderer/src/pages/home/Inputbar/GenerateImageButton.tsx index 683c1fef6..f94114805 100644 --- a/src/renderer/src/pages/home/Inputbar/GenerateImageButton.tsx +++ b/src/renderer/src/pages/home/Inputbar/GenerateImageButton.tsx @@ -24,11 +24,11 @@ const GenerateImageButton: FC = ({ model, assistant, onEnableGenerateImag mouseLeaveDelay={0} arrow> - - + isDisabled={!isGenerateImageModel(model)} + icon={} + />
) } diff --git a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx index 6d3fc4732..977dde9a1 100644 --- a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx +++ b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx @@ -912,9 +912,11 @@ const Inputbar: FC = ({ assistant: _assistant, setActiveTopic, topic }) = {loading && ( - - - + } + /> )} diff --git a/src/renderer/src/pages/home/Inputbar/InputbarTools.tsx b/src/renderer/src/pages/home/Inputbar/InputbarTools.tsx index 9e4f56b1a..7dec21977 100644 --- a/src/renderer/src/pages/home/Inputbar/InputbarTools.tsx +++ b/src/renderer/src/pages/home/Inputbar/InputbarTools.tsx @@ -359,9 +359,7 @@ const InputbarTools = ({ title={t('chat.input.new_topic', { Command: newTopicShortcut })} mouseLeaveDelay={0} arrow> - - - + } /> ) }, @@ -466,9 +464,7 @@ const InputbarTools = ({ title={t('chat.input.clear.label', { Command: clearTopicShortcut })} mouseLeaveDelay={0} arrow> - - - + } /> ) }, @@ -481,9 +477,10 @@ const InputbarTools = ({ title={isExpended ? t('chat.input.collapse') : t('chat.input.expand')} mouseLeaveDelay={0} arrow> - - {isExpended ? : } - + : } + /> ) }, @@ -662,14 +659,17 @@ const InputbarTools = ({ placement="top" title={isCollapse ? t('chat.input.tools.expand') : t('chat.input.tools.collapse')} arrow> - dispatch(setIsCollapsed(!isCollapse))}> - - + dispatch(setIsCollapsed(!isCollapse))} + icon={ + + } + /> )} diff --git a/src/renderer/src/pages/home/Inputbar/KnowledgeBaseButton.tsx b/src/renderer/src/pages/home/Inputbar/KnowledgeBaseButton.tsx index daa2df9c7..69dd57e44 100644 --- a/src/renderer/src/pages/home/Inputbar/KnowledgeBaseButton.tsx +++ b/src/renderer/src/pages/home/Inputbar/KnowledgeBaseButton.tsx @@ -110,11 +110,11 @@ const KnowledgeBaseButton: FC = ({ ref, selectedBases, onSelect, disabled return ( 0} - disabled={disabled}> - - + isDisabled={disabled} + icon={} + /> ) } diff --git a/src/renderer/src/pages/home/Inputbar/MCPToolsButton.tsx b/src/renderer/src/pages/home/Inputbar/MCPToolsButton.tsx index 4d28b4824..6264094bf 100644 --- a/src/renderer/src/pages/home/Inputbar/MCPToolsButton.tsx +++ b/src/renderer/src/pages/home/Inputbar/MCPToolsButton.tsx @@ -488,9 +488,11 @@ const MCPToolsButton: FC = ({ ref, setInputValue, resizeTextArea, assista return ( - 0}> - - + 0} + icon={} + /> ) } diff --git a/src/renderer/src/pages/home/Inputbar/MentionModelsButton.tsx b/src/renderer/src/pages/home/Inputbar/MentionModelsButton.tsx index 646ac8df8..a383d72c8 100644 --- a/src/renderer/src/pages/home/Inputbar/MentionModelsButton.tsx +++ b/src/renderer/src/pages/home/Inputbar/MentionModelsButton.tsx @@ -304,9 +304,11 @@ const MentionModelsButton: FC = ({ return ( - 0}> - - + 0} + icon={} + /> ) } diff --git a/src/renderer/src/pages/home/Inputbar/NewContextButton.tsx b/src/renderer/src/pages/home/Inputbar/NewContextButton.tsx index f4dd1886a..990de921c 100644 --- a/src/renderer/src/pages/home/Inputbar/NewContextButton.tsx +++ b/src/renderer/src/pages/home/Inputbar/NewContextButton.tsx @@ -20,9 +20,7 @@ const NewContextButton: FC = ({ onNewContext }) => { title={t('chat.input.new.context', { Command: newContextShortcut })} mouseLeaveDelay={0} arrow> - - - + } /> ) } diff --git a/src/renderer/src/pages/home/Inputbar/QuickPhrasesButton.tsx b/src/renderer/src/pages/home/Inputbar/QuickPhrasesButton.tsx index 17d54ce24..78cd1e3f1 100644 --- a/src/renderer/src/pages/home/Inputbar/QuickPhrasesButton.tsx +++ b/src/renderer/src/pages/home/Inputbar/QuickPhrasesButton.tsx @@ -157,9 +157,7 @@ const QuickPhrasesButton = ({ ref, setInputValue, resizeTextArea, assistantId }: return ( <> - - - + } /> = ({ ref, model, assistantId }): ReactElement => } mouseLeaveDelay={0} arrow> - - {ThinkingIcon(currentReasoningEffort)} - + ) } diff --git a/src/renderer/src/pages/home/Inputbar/UrlContextbutton.tsx b/src/renderer/src/pages/home/Inputbar/UrlContextbutton.tsx index 8cdc568fc..2b6e54601 100644 --- a/src/renderer/src/pages/home/Inputbar/UrlContextbutton.tsx +++ b/src/renderer/src/pages/home/Inputbar/UrlContextbutton.tsx @@ -48,9 +48,7 @@ const UrlContextButton: FC = ({ assistantId }) => { return ( - - - + } /> ) } diff --git a/src/renderer/src/pages/home/Inputbar/WebSearchButton.tsx b/src/renderer/src/pages/home/Inputbar/WebSearchButton.tsx index b4107d7de..e465dee7b 100644 --- a/src/renderer/src/pages/home/Inputbar/WebSearchButton.tsx +++ b/src/renderer/src/pages/home/Inputbar/WebSearchButton.tsx @@ -212,9 +212,11 @@ const WebSearchButton: FC = ({ ref, assistantId }) => { title={enableWebSearch ? t('common.close') : t('chat.input.web_search.label')} mouseLeaveDelay={0} arrow> - - - + } + /> ) } diff --git a/src/renderer/src/pages/home/Messages/ChatNavigation.tsx b/src/renderer/src/pages/home/Messages/ChatNavigation.tsx index c14296c39..9801c392d 100644 --- a/src/renderer/src/pages/home/Messages/ChatNavigation.tsx +++ b/src/renderer/src/pages/home/Messages/ChatNavigation.tsx @@ -6,10 +6,11 @@ import { VerticalAlignBottomOutlined, VerticalAlignTopOutlined } from '@ant-design/icons' +// import { selectCurrentTopicId } from '@renderer/store/newMessage' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import type { RootState } from '@renderer/store' -// import { selectCurrentTopicId } from '@renderer/store/newMessage' -import { Button, Drawer, Tooltip } from 'antd' +import { Drawer, Tooltip } from 'antd' import type { FC } from 'react' import { useCallback, useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -338,54 +339,54 @@ const ChatNavigation: FC = ({ containerId }) => { } - onClick={handleCloseChatNavigation} + variant="light" + startContent={} + onPress={handleCloseChatNavigation} aria-label={t('chat.navigation.close')} /> } - onClick={handleScrollToTop} + variant="light" + startContent={} + onPress={handleScrollToTop} aria-label={t('chat.navigation.top')} /> } - onClick={handlePrevMessage} + variant="light" + startContent={} + onPress={handlePrevMessage} aria-label={t('chat.navigation.prev')} /> } - onClick={handleNextMessage} + variant="light" + startContent={} + onPress={handleNextMessage} aria-label={t('chat.navigation.next')} /> } - onClick={handleScrollToBottom} + variant="light" + startContent={} + onPress={handleScrollToBottom} aria-label={t('chat.navigation.bottom')} /> } - onClick={handleChatHistoryClick} + variant="light" + startContent={} + onPress={handleChatHistoryClick} aria-label={t('chat.navigation.history')} /> diff --git a/src/renderer/src/pages/home/Messages/CitationsList.tsx b/src/renderer/src/pages/home/Messages/CitationsList.tsx index 0e9ca2265..1a3777cf3 100644 --- a/src/renderer/src/pages/home/Messages/CitationsList.tsx +++ b/src/renderer/src/pages/home/Messages/CitationsList.tsx @@ -1,3 +1,4 @@ +import { Button } from '@cherrystudio/ui' import ContextMenu from '@renderer/components/ContextMenu' import Favicon from '@renderer/components/Icons/FallbackFavicon' import Scrollbar from '@renderer/components/Scrollbar' @@ -6,7 +7,7 @@ import type { Citation } from '@renderer/types' import { fetchWebContent } from '@renderer/utils/fetch' import { cleanMarkdownContent } from '@renderer/utils/formats' import { QueryClient, QueryClientProvider, useQuery } from '@tanstack/react-query' -import { Button, Popover, Skeleton } from 'antd' +import { Popover, Skeleton } from 'antd' import { Check, Copy, FileSearch } from 'lucide-react' import React from 'react' import { useTranslation } from 'react-i18next' @@ -91,7 +92,7 @@ const CitationsList: React.FC = ({ citations }) => { padding: '0 0 8px 0' } }}> - + {previewItems.map((c, i) => ( diff --git a/src/renderer/src/pages/home/Messages/MessageEditor.tsx b/src/renderer/src/pages/home/Messages/MessageEditor.tsx index fcd212520..cd28271ba 100644 --- a/src/renderer/src/pages/home/Messages/MessageEditor.tsx +++ b/src/renderer/src/pages/home/Messages/MessageEditor.tsx @@ -360,20 +360,14 @@ const MessageBlockEditor: FC = ({ message, topicId, onSave, onResend, onC - - - + } /> - - - + } /> {message.role === 'user' && ( - - - + } /> )} diff --git a/src/renderer/src/pages/home/Messages/MessageGroupMenuBar.tsx b/src/renderer/src/pages/home/Messages/MessageGroupMenuBar.tsx index e93418715..212c8a327 100644 --- a/src/renderer/src/pages/home/Messages/MessageGroupMenuBar.tsx +++ b/src/renderer/src/pages/home/Messages/MessageGroupMenuBar.tsx @@ -7,6 +7,7 @@ import { ReloadOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { useAssistant } from '@renderer/hooks/useAssistant' import { useMessageOperations } from '@renderer/hooks/useMessageOperations' import type { Topic } from '@renderer/types' @@ -14,7 +15,7 @@ import type { Message } from '@renderer/types/newMessage' import { AssistantMessageStatus } from '@renderer/types/newMessage' import { getMainTextContent } from '@renderer/utils/messageUtils/find' import type { MultiModelMessageStyle } from '@shared/data/preference/preferenceTypes' -import { Button, Tooltip } from 'antd' +import { Tooltip } from 'antd' import type { FC } from 'react' import { memo } from 'react' import { useTranslation } from 'react-i18next' @@ -137,19 +138,19 @@ const MessageGroupMenuBar: FC = ({ {hasFailedMessages && ( - + ) } -const Container = styled.div` - display: flex; - justify-content: center; - align-items: center; - margin-bottom: 10px; - margin-top: -10px; - padding: 0; - min-height: auto; -` - -const Button = styled(AntdButton)<{ $theme: ThemeMode }>` - border-radius: 20px; - padding: 0 12px; - height: 34px !important; - font-size: 12px; - opacity: 0.8; - transition: all 0.3s ease; - background-color: ${(props) => (props.$theme === ThemeMode.dark ? 'var(--color-background-soft)' : '')}; - color: var(--color-text-2); - &:hover { - opacity: 0.9; - background-color: ${(props) => (props.$theme === ThemeMode.dark ? 'var(--color-background-mute)' : '')} !important; - color: var(--color-text-1) !important; - border-color: var(--color-border-mute) !important; - } -` - export default NewTopicButton diff --git a/src/renderer/src/pages/home/Messages/Tools/MessageMcpTool.tsx b/src/renderer/src/pages/home/Messages/Tools/MessageMcpTool.tsx index 23ef52d5b..4e9fa5f69 100644 --- a/src/renderer/src/pages/home/Messages/Tools/MessageMcpTool.tsx +++ b/src/renderer/src/pages/home/Messages/Tools/MessageMcpTool.tsx @@ -1,4 +1,5 @@ import { Flex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { loggerService } from '@logger' import { CopyIcon, LoadingIcon } from '@renderer/components/Icons' @@ -11,7 +12,7 @@ import { isToolAutoApproved } from '@renderer/utils/mcp-tools' import { cancelToolAction, confirmToolAction } from '@renderer/utils/userConfirmation' import type { MCPProgressEvent } from '@shared/config/types' import { IpcChannel } from '@shared/IpcChannel' -import { Button, Collapse, ConfigProvider, Dropdown, Modal, Progress, Tabs, Tooltip } from 'antd' +import { Collapse, ConfigProvider, Dropdown, Modal, Progress, Tabs, Tooltip } from 'antd' import { Check, ChevronDown, @@ -400,26 +401,25 @@ const MessageMcpTool: FC = ({ block }) => { {isWaitingConfirmation && ( )} {isExecuting && toolResponse?.id ? ( ) : ( diff --git a/src/renderer/src/pages/home/Tabs/SettingsTab.tsx b/src/renderer/src/pages/home/Tabs/SettingsTab.tsx index 5a54a852b..c8d086279 100644 --- a/src/renderer/src/pages/home/Tabs/SettingsTab.tsx +++ b/src/renderer/src/pages/home/Tabs/SettingsTab.tsx @@ -1,4 +1,5 @@ import { RowFlex, Selector, Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { useMultiplePreferences, usePreference } from '@data/hooks/usePreference' import EditableNumber from '@renderer/components/EditableNumber' import Scrollbar from '@renderer/components/Scrollbar' @@ -20,7 +21,7 @@ import { modalConfirm } from '@renderer/utils' import { getSendMessageShortcutLabel } from '@renderer/utils/input' import type { SendMessageShortcut } from '@shared/data/preference/preferenceTypes' import { ThemeMode } from '@shared/data/preference/preferenceTypes' -import { Button, Col, InputNumber, Row, Slider } from 'antd' +import { Col, InputNumber, Row, Slider } from 'antd' import { Settings2 } from 'lucide-react' import type { FC } from 'react' import { useCallback, useEffect, useMemo, useState } from 'react' @@ -173,11 +174,12 @@ const SettingsTab: FC = (props) => { extra={ }> diff --git a/src/renderer/src/pages/home/Tabs/components/AssistantTagsPopup.tsx b/src/renderer/src/pages/home/Tabs/components/AssistantTagsPopup.tsx index 9aa0723a4..e5c95779e 100644 --- a/src/renderer/src/pages/home/Tabs/components/AssistantTagsPopup.tsx +++ b/src/renderer/src/pages/home/Tabs/components/AssistantTagsPopup.tsx @@ -1,10 +1,11 @@ import { Box } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { DragDropContext, Draggable, Droppable } from '@hello-pangea/dnd' import { DeleteIcon } from '@renderer/components/Icons' import { TopView } from '@renderer/components/TopView' import { useAssistants } from '@renderer/hooks/useAssistant' import { useTags } from '@renderer/hooks/useTags' -import { Button, Empty, Modal } from 'antd' +import { Empty, Modal } from 'antd' import { isEmpty } from 'lodash' import { useState } from 'react' import { useTranslation } from 'react-i18next' @@ -93,14 +94,14 @@ const PopupContainer: React.FC = ({ title, resolve }) => { {tag} )} diff --git a/src/renderer/src/pages/home/components/SelectModelButton.tsx b/src/renderer/src/pages/home/components/SelectModelButton.tsx index 466857a83..382ba8dcd 100644 --- a/src/renderer/src/pages/home/components/SelectModelButton.tsx +++ b/src/renderer/src/pages/home/components/SelectModelButton.tsx @@ -1,3 +1,4 @@ +import { Button } from '@cherrystudio/ui' import ModelAvatar from '@renderer/components/Avatar/ModelAvatar' import SelectModelPopup from '@renderer/components/Popups/SelectModelPopup' import { isLocalAi } from '@renderer/config/env' @@ -6,7 +7,7 @@ import { useAssistant } from '@renderer/hooks/useAssistant' import { useProvider } from '@renderer/hooks/useProvider' import { getProviderName } from '@renderer/services/ProviderService' import type { Assistant, Model } from '@renderer/types' -import { Button, Tag } from 'antd' +import { Tag } from 'antd' import { ChevronsUpDown } from 'lucide-react' import type { FC } from 'react' import { useEffect, useRef } from 'react' @@ -25,8 +26,7 @@ const SelectModelButton: FC = ({ assistant }) => { const modelFilter = (model: Model) => !isEmbeddingModel(model) && !isRerankModel(model) - const onSelectModel = async (event: React.MouseEvent) => { - event.currentTarget.blur() + const onSelectModel = async () => { const selectedModel = await SelectModelPopup.show({ model, filter: modelFilter }) if (selectedModel) { // 避免更新数据造成关闭弹框的卡顿 @@ -55,7 +55,11 @@ const SelectModelButton: FC = ({ assistant }) => { const providerName = getProviderName(model) return ( - + ) } -const DropdownButton = styled(Button)` - font-size: 11px; - border-radius: 15px; - padding: 13px 5px; - -webkit-app-region: none; - box-shadow: none; - background-color: transparent; - border: 1px solid transparent; - margin-top: 1px; -` - const ButtonContent = styled.div` display: flex; align-items: center; diff --git a/src/renderer/src/pages/home/components/UpdateAppButton.tsx b/src/renderer/src/pages/home/components/UpdateAppButton.tsx index 8eac14d3f..db82c3265 100644 --- a/src/renderer/src/pages/home/components/UpdateAppButton.tsx +++ b/src/renderer/src/pages/home/components/UpdateAppButton.tsx @@ -1,7 +1,7 @@ import { SyncOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { useAppUpdateState } from '@renderer/hooks/useAppUpdate' -import { Button } from 'antd' import type { FC } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' @@ -23,11 +23,11 @@ const UpdateAppButton: FC = () => { window.api.showUpdateDialog()} - icon={} - color="orange" - variant="outlined" - size="small"> + onPress={() => window.api.showUpdateDialog()} + startContent={} + color="warning" + variant="bordered" + size="sm"> {t('button.update_available')} diff --git a/src/renderer/src/pages/knowledge/KnowledgeContent.tsx b/src/renderer/src/pages/knowledge/KnowledgeContent.tsx index fe882bb3c..a3dd9d50a 100644 --- a/src/renderer/src/pages/knowledge/KnowledgeContent.tsx +++ b/src/renderer/src/pages/knowledge/KnowledgeContent.tsx @@ -1,12 +1,13 @@ import { RedoOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import CustomTag from '@renderer/components/Tags/CustomTag' import { useKnowledge } from '@renderer/hooks/useKnowledge' import { NavbarIcon } from '@renderer/pages/home/ChatNavbar' import { getProviderName } from '@renderer/services/ProviderService' import type { KnowledgeBase } from '@renderer/types' -import { Button, Empty, Tabs, Tag, Tooltip } from 'antd' +import { Empty, Tabs, Tag, Tooltip } from 'antd' import { Book, Folder, Globe, Link, Notebook, Search, Settings, Video } from 'lucide-react' import type { FC } from 'react' import { useEffect, useState } from 'react' @@ -145,10 +146,11 @@ const KnowledgeContent: FC = ({ selectedBase }) => { + )} = ({ selectedBase, progres type="directory" /> - ) }} diff --git a/src/renderer/src/pages/knowledge/items/KnowledgeFiles.tsx b/src/renderer/src/pages/knowledge/items/KnowledgeFiles.tsx index 800a6f565..b995f77b3 100644 --- a/src/renderer/src/pages/knowledge/items/KnowledgeFiles.tsx +++ b/src/renderer/src/pages/knowledge/items/KnowledgeFiles.tsx @@ -1,3 +1,4 @@ +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import Ellipsis from '@renderer/components/Ellipsis' import { useFiles } from '@renderer/hooks/useFiles' @@ -10,7 +11,7 @@ import type { FileMetadata, FileTypes, KnowledgeBase, KnowledgeItem } from '@ren import { isKnowledgeFileItem } from '@renderer/types' import { formatFileSize, uuid } from '@renderer/utils' import { bookExts, documentExts, textExts, thirdPartyApplicationExts } from '@shared/config/constant' -import { Button, Tooltip, Upload } from 'antd' +import { Tooltip, Upload } from 'antd' import dayjs from 'dayjs' import type { FC } from 'react' import { useCallback, useEffect, useState } from 'react' @@ -142,13 +143,12 @@ const KnowledgeFiles: FC = ({ selectedBase, progressMap, } - onClick={(e) => { - e.stopPropagation() - handleAddFile() - }} - disabled={disabled}> + size="sm" + variant="solid" + color="primary" + startContent={} + onPress={handleAddFile} + isDisabled={disabled}> {t('knowledge.add_file')} @@ -202,7 +202,9 @@ const KnowledgeFiles: FC = ({ selectedBase, progressMap, actions: ( {item.uniqueId && ( - )} {showPreprocessIcon(item) && ( @@ -224,12 +226,9 @@ const KnowledgeFiles: FC = ({ selectedBase, progressMap, type="file" /> - ) }} diff --git a/src/renderer/src/pages/knowledge/items/KnowledgeNotes.tsx b/src/renderer/src/pages/knowledge/items/KnowledgeNotes.tsx index 322467111..f02a697b3 100644 --- a/src/renderer/src/pages/knowledge/items/KnowledgeNotes.tsx +++ b/src/renderer/src/pages/knowledge/items/KnowledgeNotes.tsx @@ -1,3 +1,4 @@ +import { Button } from '@cherrystudio/ui' import { DeleteIcon, EditIcon } from '@renderer/components/Icons' import RichEditPopup from '@renderer/components/Popups/RichEditPopup' import { DynamicVirtualList } from '@renderer/components/VirtualList' @@ -6,7 +7,6 @@ import FileItem from '@renderer/pages/files/FileItem' import { getProviderName } from '@renderer/services/ProviderService' import type { KnowledgeBase, KnowledgeItem } from '@renderer/types' import { isMarkdownContent, markdownToPreviewText } from '@renderer/utils/markdownConverter' -import { Button } from 'antd' import dayjs from 'dayjs' import { PlusIcon } from 'lucide-react' import type { FC } from 'react' @@ -82,13 +82,11 @@ const KnowledgeNotes: FC = ({ selectedBase }) => { } - onClick={(e) => { - e.stopPropagation() - handleAddNote() - }} - disabled={disabled}> + variant="solid" + color="primary" + startContent={} + onPress={handleAddNote} + isDisabled={disabled}> {t('knowledge.add_note')} @@ -114,7 +112,9 @@ const KnowledgeNotes: FC = ({ selectedBase }) => { extra: getDisplayTime(note), actions: ( - = ({ selectedBase }) => { type="note" /> - ) }} diff --git a/src/renderer/src/pages/knowledge/items/KnowledgeSitemaps.tsx b/src/renderer/src/pages/knowledge/items/KnowledgeSitemaps.tsx index e81a1beb9..a6fcb96ff 100644 --- a/src/renderer/src/pages/knowledge/items/KnowledgeSitemaps.tsx +++ b/src/renderer/src/pages/knowledge/items/KnowledgeSitemaps.tsx @@ -1,3 +1,4 @@ +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import Ellipsis from '@renderer/components/Ellipsis' import { DeleteIcon } from '@renderer/components/Icons' @@ -7,7 +8,7 @@ import { useKnowledge } from '@renderer/hooks/useKnowledge' import FileItem from '@renderer/pages/files/FileItem' import { getProviderName } from '@renderer/services/ProviderService' import type { KnowledgeBase, KnowledgeItem } from '@renderer/types' -import { Button, Tooltip } from 'antd' +import { Tooltip } from 'antd' import dayjs from 'dayjs' import { PlusIcon } from 'lucide-react' import type { FC } from 'react' @@ -88,13 +89,11 @@ const KnowledgeSitemaps: FC = ({ selectedBase }) => { } - onClick={(e) => { - e.stopPropagation() - handleAddSitemap() - }} - disabled={disabled}> + variant="solid" + color="primary" + startContent={} + onPress={handleAddSitemap} + isDisabled={disabled}> {t('knowledge.add_sitemap')} @@ -126,7 +125,11 @@ const KnowledgeSitemaps: FC = ({ selectedBase }) => { extra: getDisplayTime(item), actions: ( - {item.uniqueId && + )} = ({ selectedBase }) => { type="sitemap" /> - ) }} diff --git a/src/renderer/src/pages/knowledge/items/KnowledgeUrls.tsx b/src/renderer/src/pages/knowledge/items/KnowledgeUrls.tsx index 68bd13544..a4210b22b 100644 --- a/src/renderer/src/pages/knowledge/items/KnowledgeUrls.tsx +++ b/src/renderer/src/pages/knowledge/items/KnowledgeUrls.tsx @@ -1,3 +1,4 @@ +import { Button } from '@cherrystudio/ui' import Ellipsis from '@renderer/components/Ellipsis' import { CopyIcon, DeleteIcon, EditIcon } from '@renderer/components/Icons' import PromptPopup from '@renderer/components/Popups/PromptPopup' @@ -6,7 +7,7 @@ import { useKnowledge } from '@renderer/hooks/useKnowledge' import FileItem from '@renderer/pages/files/FileItem' import { getProviderName } from '@renderer/services/ProviderService' import type { KnowledgeBase, KnowledgeItem } from '@renderer/types' -import { Button, Dropdown, Tooltip } from 'antd' +import { Dropdown, Tooltip } from 'antd' import dayjs from 'dayjs' import { PlusIcon } from 'lucide-react' import type { FC } from 'react' @@ -116,13 +117,11 @@ const KnowledgeUrls: FC = ({ selectedBase }) => { } - onClick={(e) => { - e.stopPropagation() - handleAddUrl() - }} - disabled={disabled}> + variant="solid" + color="primary" + startContent={} + onPress={handleAddUrl} + isDisabled={disabled}> {t('knowledge.add_url')} @@ -176,16 +175,17 @@ const KnowledgeUrls: FC = ({ selectedBase }) => { extra: getDisplayTime(item), actions: ( - {item.uniqueId && + )} - ) }} diff --git a/src/renderer/src/pages/knowledge/items/KnowledgeVideos.tsx b/src/renderer/src/pages/knowledge/items/KnowledgeVideos.tsx index fe8f0c17a..2e7fd3fa9 100644 --- a/src/renderer/src/pages/knowledge/items/KnowledgeVideos.tsx +++ b/src/renderer/src/pages/knowledge/items/KnowledgeVideos.tsx @@ -1,4 +1,5 @@ import { DeleteOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import Ellipsis from '@renderer/components/Ellipsis' import VideoPopup from '@renderer/components/Popups/VideoPopup' @@ -7,7 +8,7 @@ import { useKnowledge } from '@renderer/hooks/useKnowledge' import { getProviderName } from '@renderer/services/ProviderService' import type { KnowledgeBase, KnowledgeItem } from '@renderer/types' import { FileTypes, isKnowledgeVideoItem } from '@renderer/types' -import { Button, Tooltip } from 'antd' +import { Tooltip } from 'antd' import dayjs from 'dayjs' import { Plus } from 'lucide-react' import VirtualList from 'rc-virtual-list' @@ -87,13 +88,11 @@ const KnowledgeVideos: FC = ({ selectedBase }) => { } - onClick={(e) => { - e.stopPropagation() - handleAddVideo() - }} - disabled={disabled}> + variant="solid" + color="primary" + startContent={} + onPress={handleAddVideo} + isDisabled={disabled}> {t('knowledge.add_video')} @@ -139,7 +138,12 @@ const KnowledgeVideos: FC = ({ selectedBase }) => { actions: ( {item.uniqueId && ( - - + + diff --git a/src/renderer/src/pages/minapps/NewAppButton.tsx b/src/renderer/src/pages/minapps/NewAppButton.tsx index 22d9f9345..7d4507cf4 100644 --- a/src/renderer/src/pages/minapps/NewAppButton.tsx +++ b/src/renderer/src/pages/minapps/NewAppButton.tsx @@ -1,9 +1,10 @@ import { PlusOutlined, UploadOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import { loadCustomMiniApp, ORIGIN_DEFAULT_MIN_APPS, updateDefaultMinApps } from '@renderer/config/minapps' import { useMinapps } from '@renderer/hooks/useMinapps' import type { MinAppType } from '@renderer/types' -import { Button, Form, Input, Modal, Radio, Upload } from 'antd' +import { Form, Input, Modal, Radio, Upload } from 'antd' import type { UploadFile } from 'antd/es/upload/interface' import type { FC } from 'react' import { useState } from 'react' @@ -146,12 +147,12 @@ const NewAppButton: FC = ({ size = 60 }) => { fileList={fileList} onChange={handleFileChange} beforeUpload={() => false}> - + )} - diff --git a/src/renderer/src/pages/paintings/AihubmixPage.tsx b/src/renderer/src/pages/paintings/AihubmixPage.tsx index 38d9045ee..13961c30f 100644 --- a/src/renderer/src/pages/paintings/AihubmixPage.tsx +++ b/src/renderer/src/pages/paintings/AihubmixPage.tsx @@ -1,5 +1,5 @@ import { PlusOutlined, RedoOutlined } from '@ant-design/icons' -import { RowFlex } from '@cherrystudio/ui' +import { Button, RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' import { useCache } from '@data/hooks/useCache' import { usePreference } from '@data/hooks/usePreference' @@ -21,7 +21,7 @@ import { translateText } from '@renderer/services/TranslateService' import type { FileMetadata } from '@renderer/types' import type { PaintingAction, PaintingsState } from '@renderer/types' import { getErrorMessage, uuid } from '@renderer/utils' -import { Avatar, Button, Input, InputNumber, Radio, Segmented, Select, Slider, Tooltip, Upload } from 'antd' +import { Avatar, Input, InputNumber, Radio, Segmented, Select, Slider, Tooltip, Upload } from 'antd' import TextArea from 'antd/es/input/TextArea' import { Info } from 'lucide-react' import type { FC } from 'react' @@ -827,7 +827,7 @@ const AihubmixPage: FC<{ Options: string[] }> = ({ Options }) => { {t('paintings.title')} {isMac && ( - diff --git a/src/renderer/src/pages/paintings/DmxapiPage.tsx b/src/renderer/src/pages/paintings/DmxapiPage.tsx index 0d47a9263..e9d244c85 100644 --- a/src/renderer/src/pages/paintings/DmxapiPage.tsx +++ b/src/renderer/src/pages/paintings/DmxapiPage.tsx @@ -1,5 +1,5 @@ import { PlusOutlined, RedoOutlined } from '@ant-design/icons' -import { RowFlex } from '@cherrystudio/ui' +import { Button, RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' import { useCache } from '@data/hooks/useCache' import DMXAPIToImg from '@renderer/assets/images/providers/DMXAPI-to-img.webp' @@ -14,7 +14,7 @@ import FileManager from '@renderer/services/FileManager' import type { FileMetadata } from '@renderer/types' import { convertToBase64, uuid } from '@renderer/utils' import type { DmxapiPainting } from '@types' -import { Avatar, Button, Input, InputNumber, Segmented, Select, Tooltip } from 'antd' +import { Avatar, Input, InputNumber, Segmented, Select, Tooltip } from 'antd' import TextArea from 'antd/es/input/TextArea' import { Info } from 'lucide-react' import type { FC } from 'react' @@ -787,7 +787,7 @@ const DmxapiPage: FC<{ Options: string[] }> = ({ Options }) => { {t('paintings.title')} {isMac && ( - diff --git a/src/renderer/src/pages/paintings/NewApiPage.tsx b/src/renderer/src/pages/paintings/NewApiPage.tsx index 1f6e21f56..a5bd667e6 100644 --- a/src/renderer/src/pages/paintings/NewApiPage.tsx +++ b/src/renderer/src/pages/paintings/NewApiPage.tsx @@ -1,4 +1,5 @@ import { PlusOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { useCache } from '@data/hooks/useCache' import { usePreference } from '@data/hooks/usePreference' import { loggerService } from '@logger' @@ -27,7 +28,7 @@ import { translateText } from '@renderer/services/TranslateService' import type { PaintingAction, PaintingsState } from '@renderer/types' import type { FileMetadata } from '@renderer/types' import { getErrorMessage, uuid } from '@renderer/utils' -import { Avatar, Button, Empty, InputNumber, Segmented, Select, Upload } from 'antd' +import { Avatar, Empty, InputNumber, Segmented, Select, Upload } from 'antd' import TextArea from 'antd/es/input/TextArea' import type { FC } from 'react' import React from 'react' @@ -489,7 +490,7 @@ const NewApiPage: FC<{ Options: string[] }> = ({ Options }) => { {t('paintings.title')} {isMac && ( - @@ -531,7 +532,7 @@ const NewApiPage: FC<{ Options: string[] }> = ({ Options }) => { description={t('paintings.no_image_generation_model', { endpoint_type: t('endpoint_type.image-generation') })}> - diff --git a/src/renderer/src/pages/paintings/SiliconPage.tsx b/src/renderer/src/pages/paintings/SiliconPage.tsx index 84241f659..442f7b310 100644 --- a/src/renderer/src/pages/paintings/SiliconPage.tsx +++ b/src/renderer/src/pages/paintings/SiliconPage.tsx @@ -1,6 +1,7 @@ import { PlusOutlined, RedoOutlined } from '@ant-design/icons' import { ColFlex, RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { useCache } from '@data/hooks/useCache' import { usePreference } from '@data/hooks/usePreference' import { loggerService } from '@logger' @@ -25,7 +26,7 @@ import FileManager from '@renderer/services/FileManager' import { translateText } from '@renderer/services/TranslateService' import type { FileMetadata, Painting } from '@renderer/types' import { getErrorMessage, uuid } from '@renderer/utils' -import { Button, Input, InputNumber, Radio, Select, Slider, Tooltip } from 'antd' +import { Input, InputNumber, Radio, Select, Slider, Tooltip } from 'antd' import TextArea from 'antd/es/input/TextArea' import { Info } from 'lucide-react' import type { FC } from 'react' @@ -374,10 +375,10 @@ const SiliconPage: FC<{ Options: string[] }> = ({ Options }) => { {isMac && ( diff --git a/src/renderer/src/pages/paintings/TokenFluxPage.tsx b/src/renderer/src/pages/paintings/TokenFluxPage.tsx index 72ef5c683..1d0cd6835 100644 --- a/src/renderer/src/pages/paintings/TokenFluxPage.tsx +++ b/src/renderer/src/pages/paintings/TokenFluxPage.tsx @@ -1,4 +1,5 @@ import { PlusOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { useCache } from '@data/hooks/useCache' import { usePreference } from '@data/hooks/usePreference' import { loggerService } from '@logger' @@ -15,7 +16,7 @@ import FileManager from '@renderer/services/FileManager' import { translateText } from '@renderer/services/TranslateService' import type { TokenFluxPainting } from '@renderer/types' import { getErrorMessage, uuid } from '@renderer/utils' -import { Avatar, Button, Select, Tooltip } from 'antd' +import { Avatar, Select, Tooltip } from 'antd' import TextArea from 'antd/es/input/TextArea' import { Info } from 'lucide-react' import type { FC } from 'react' @@ -367,7 +368,7 @@ const TokenFluxPage: FC<{ Options: string[] }> = ({ Options }) => { {t('paintings.title')} {isMac && ( - diff --git a/src/renderer/src/pages/paintings/ZhipuPage.tsx b/src/renderer/src/pages/paintings/ZhipuPage.tsx index 7ac16a6eb..0fcd00861 100644 --- a/src/renderer/src/pages/paintings/ZhipuPage.tsx +++ b/src/renderer/src/pages/paintings/ZhipuPage.tsx @@ -1,5 +1,6 @@ import { PlusOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { useCache } from '@data/hooks/useCache' import AiProvider from '@renderer/aiCore' import { Navbar, NavbarCenter, NavbarRight } from '@renderer/components/app/Navbar' @@ -11,7 +12,7 @@ import { useAllProviders } from '@renderer/hooks/useProvider' import { getProviderLabel } from '@renderer/i18n/label' import FileManager from '@renderer/services/FileManager' import { getErrorMessage, uuid } from '@renderer/utils' -import { Avatar, Button, InputNumber, Radio, Select } from 'antd' +import { Avatar, InputNumber, Radio, Select } from 'antd' import TextArea from 'antd/es/input/TextArea' import type { FC } from 'react' import { useEffect, useState } from 'react' @@ -342,8 +343,13 @@ const ZhipuPage: FC<{ Options: string[] }> = ({ Options }) => { {t('paintings.title')} {isMac && ( - - diff --git a/src/renderer/src/pages/paintings/components/Artboard.tsx b/src/renderer/src/pages/paintings/components/Artboard.tsx index 7e915450b..2a988fba5 100644 --- a/src/renderer/src/pages/paintings/components/Artboard.tsx +++ b/src/renderer/src/pages/paintings/components/Artboard.tsx @@ -1,7 +1,8 @@ +import { Button } from '@cherrystudio/ui' import ImageViewer from '@renderer/components/ImageViewer' import FileManager from '@renderer/services/FileManager' import type { Painting } from '@renderer/types' -import { Button, Spin } from 'antd' +import { Spin } from 'antd' import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' @@ -43,7 +44,7 @@ const Artboard: FC = ({ {painting.files.length > 0 ? ( {painting.files.length > 1 && ( - + )} @@ -59,7 +60,7 @@ const Artboard: FC = ({ }} /> {painting.files.length > 1 && ( - + )} @@ -78,7 +79,7 @@ const Artboard: FC = ({
{t('paintings.proxy_required')} -
@@ -96,7 +97,7 @@ const Artboard: FC = ({ {loadText ? loadText : ''} - {t('common.cancel')} + {t('common.cancel')} )} diff --git a/src/renderer/src/pages/paintings/components/DynamicFormRender.tsx b/src/renderer/src/pages/paintings/components/DynamicFormRender.tsx index dab3e27b6..08db7a9db 100644 --- a/src/renderer/src/pages/paintings/components/DynamicFormRender.tsx +++ b/src/renderer/src/pages/paintings/components/DynamicFormRender.tsx @@ -1,8 +1,9 @@ import { CloseOutlined, LinkOutlined, RedoOutlined, UploadOutlined } from '@ant-design/icons' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import { convertToBase64 } from '@renderer/utils' -import { Button, Input, InputNumber, Select, Upload } from 'antd' +import { Input, InputNumber, Select, Upload } from 'antd' import TextArea from 'antd/es/input/TextArea' import { useCallback } from 'react' @@ -75,15 +76,7 @@ export const DynamicFormRender: React.FC = ({ handleImageUpload(propertyName, file, onChange) return false }}> - )} diff --git a/src/renderer/src/pages/settings/AboutSettings.tsx b/src/renderer/src/pages/settings/AboutSettings.tsx index 4cf0ad0d6..3dbf8211e 100644 --- a/src/renderer/src/pages/settings/AboutSettings.tsx +++ b/src/renderer/src/pages/settings/AboutSettings.tsx @@ -1,6 +1,7 @@ import { GithubOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import IndicatorLight from '@renderer/components/IndicatorLight' import { APP_NAME, AppLogo } from '@renderer/config/env' @@ -14,7 +15,7 @@ import { handleSaveData } from '@renderer/store' import { runAsyncFunction } from '@renderer/utils' import { UpgradeChannel } from '@shared/data/preference/preferenceTypes' import { ThemeMode } from '@shared/data/preference/preferenceTypes' -import { Avatar, Button, Progress, Radio, Row, Tag, Tooltip } from 'antd' +import { Avatar, Progress, Radio, Row, Tag, Tooltip } from 'antd' import { debounce } from 'lodash' import { Bug, FileCheck, Globe, Mail, Rss } from 'lucide-react' import { BadgeQuestionMark } from 'lucide-react' @@ -222,9 +223,9 @@ const AboutSettings: FC = () => { {!isPortable && ( + onPress={onCheckUpdate} + isLoading={appUpdateState.checking} + isDisabled={appUpdateState.downloading || appUpdateState.checking}> {appUpdateState.downloading ? t('settings.about.downloading') : appUpdateState.available @@ -292,7 +293,7 @@ const AboutSettings: FC = () => { {t('docs.title')} - + @@ -300,7 +301,7 @@ const AboutSettings: FC = () => { {t('settings.about.releases.title')} - + @@ -308,7 +309,7 @@ const AboutSettings: FC = () => { {t('settings.about.website.title')} - + @@ -316,7 +317,7 @@ const AboutSettings: FC = () => { {t('settings.about.feedback.title')} - @@ -326,7 +327,7 @@ const AboutSettings: FC = () => { {t('settings.about.license.title')} - + @@ -334,7 +335,7 @@ const AboutSettings: FC = () => { {t('settings.about.contact.title')} - + @@ -342,7 +343,7 @@ const AboutSettings: FC = () => { {t('settings.about.debug.title')} - +
diff --git a/src/renderer/src/pages/settings/AssistantSettings/AssistantMemorySettings.tsx b/src/renderer/src/pages/settings/AssistantSettings/AssistantMemorySettings.tsx index 8c5ec1538..b8a9f7e6b 100644 --- a/src/renderer/src/pages/settings/AssistantSettings/AssistantMemorySettings.tsx +++ b/src/renderer/src/pages/settings/AssistantSettings/AssistantMemorySettings.tsx @@ -1,12 +1,13 @@ import { InfoCircleOutlined } from '@ant-design/icons' import { Box } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import MemoriesSettingsModal from '@renderer/pages/memory/settings-modal' import MemoryService from '@renderer/services/MemoryService' import { selectGlobalMemoryEnabled, selectMemoryConfig } from '@renderer/store/memory' import type { Assistant, AssistantSettings } from '@renderer/types' -import { Alert, Button, Card, Space, Tooltip, Typography } from 'antd' +import { Alert, Card, Space, Tooltip, Typography } from 'antd' import { useForm } from 'antd/es/form/Form' import { Settings2 } from 'lucide-react' import { useCallback, useEffect, useState } from 'react' @@ -82,7 +83,7 @@ const AssistantMemorySettings: React.FC = ({ assistant, updateAssistant,
- } diff --git a/src/renderer/src/pages/settings/AssistantSettings/AssistantModelSettings.tsx b/src/renderer/src/pages/settings/AssistantSettings/AssistantModelSettings.tsx index af6e89c31..524bfd96e 100644 --- a/src/renderer/src/pages/settings/AssistantSettings/AssistantModelSettings.tsx +++ b/src/renderer/src/pages/settings/AssistantSettings/AssistantModelSettings.tsx @@ -1,6 +1,7 @@ import { QuestionCircleOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import ModelAvatar from '@renderer/components/Avatar/ModelAvatar' import EditableNumber from '@renderer/components/EditableNumber' import { DeleteIcon, ResetIcon } from '@renderer/components/Icons' @@ -12,7 +13,7 @@ import { useTimer } from '@renderer/hooks/useTimer' import { SettingRow } from '@renderer/pages/settings' import type { Assistant, AssistantSettingCustomParameters, AssistantSettings, Model } from '@renderer/types' import { modalConfirm } from '@renderer/utils' -import { Button, Col, Divider, Input, InputNumber, Row, Select, Slider, Tooltip } from 'antd' +import { Col, Divider, Input, InputNumber, Row, Select, Slider, Tooltip } from 'antd' import { isNull } from 'lodash' import { PlusIcon } from 'lucide-react' import type { FC } from 'react' @@ -221,20 +222,20 @@ const AssistantModelSettings: FC = ({ assistant, updateAssistant, updateA : } - onClick={onSelectModel}> + startContent={defaultModel ? : } + onPress={onSelectModel}> {defaultModel ? defaultModel.name : t('agents.edit.model.select.title')} {defaultModel && ( @@ -484,17 +485,19 @@ const AssistantModelSettings: FC = ({ assistant, updateAssistant, updateA {renderParameterValueInput(param, index)} diff --git a/src/renderer/src/pages/settings/AssistantSettings/AssistantPromptSettings.tsx b/src/renderer/src/pages/settings/AssistantSettings/AssistantPromptSettings.tsx index fbbefae78..dec4869b8 100644 --- a/src/renderer/src/pages/settings/AssistantSettings/AssistantPromptSettings.tsx +++ b/src/renderer/src/pages/settings/AssistantSettings/AssistantPromptSettings.tsx @@ -1,9 +1,11 @@ import 'emoji-picker-element' -import { CloseCircleFilled } from '@ant-design/icons' +import CloseCircleFilled from '@ant-design/icons/lib/icons/CloseCircleFilled' import { Box, RowFlex, SpaceBetweenRowFlex } from '@cherrystudio/ui' import { CodeEditor } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' +import { Popover, PopoverContent, PopoverTrigger, Tooltip } from '@heroui/react' import EmojiPicker from '@renderer/components/EmojiPicker' import type { RichEditorRef } from '@renderer/components/RichEditor/types' import { useCodeStyle } from '@renderer/context/CodeStyleProvider' @@ -11,7 +13,7 @@ import { usePromptProcessor } from '@renderer/hooks/usePromptProcessor' import { estimateTextTokens } from '@renderer/services/TokenService' import type { Assistant, AssistantSettings } from '@renderer/types' import { getLeadingEmoji } from '@renderer/utils' -import { Button, Input, Popover } from 'antd' +import { Input } from 'antd' import { Edit, HelpCircle, Save } from 'lucide-react' import { useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -75,37 +77,34 @@ const AssistantPromptSettings: React.FC = ({ assistant, updateAssistant } {t('common.name')} - } arrow trigger="click"> - - + + + + + + {emoji && ( + { + e.stopPropagation() + handleEmojiDelete() + }} style={{ - fontSize: 18, - padding: '4px', - minWidth: '28px', - height: '28px' - }}> - {emoji} - - {emoji && ( - { - e.stopPropagation() - handleEmojiDelete() - }} - style={{ - display: 'none', - position: 'absolute', - top: '-8px', - right: '-8px', - fontSize: '16px', - color: '#ff4d4f', - cursor: 'pointer' - }} - /> - )} - - + display: 'none', + position: 'absolute', + top: '-8px', + right: '-8px', + fontSize: '16px', + color: '#ff4d4f', + cursor: 'pointer' + }} + /> + )} + = ({ assistant, updateAssistant } {t('common.prompt')} - + +

{t('agents.add.prompt.variables.tip.title')}

+ {promptVarsContent} + + } + showArrow> -
+
@@ -151,9 +157,10 @@ const AssistantPromptSettings: React.FC = ({ assistant, updateAssistant } Tokens: {tokenCount} -
@@ -632,7 +633,7 @@ const DataSettings: FC = () => { handleOpenPath(appInfo?.appDataPath)} style={{ flexShrink: 0 }} /> - + @@ -645,7 +646,7 @@ const DataSettings: FC = () => { handleOpenPath(appInfo?.logsPath)} style={{ flexShrink: 0 }} /> - @@ -655,7 +656,7 @@ const DataSettings: FC = () => { {t('settings.data.app_knowledge.label')} - + @@ -665,14 +666,14 @@ const DataSettings: FC = () => { {cacheSize && ({cacheSize}MB)} - + {t('settings.general.reset.title')} - diff --git a/src/renderer/src/pages/settings/DataSettings/JoplinSettings.tsx b/src/renderer/src/pages/settings/DataSettings/JoplinSettings.tsx index 794749bd0..5aa89ba63 100644 --- a/src/renderer/src/pages/settings/DataSettings/JoplinSettings.tsx +++ b/src/renderer/src/pages/settings/DataSettings/JoplinSettings.tsx @@ -1,11 +1,12 @@ import { InfoCircleOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { AppLogo } from '@renderer/config/env' import { useTheme } from '@renderer/context/ThemeProvider' import { useMinappPopup } from '@renderer/hooks/useMinappPopup' -import { Button, Space, Tooltip } from 'antd' +import { Space, Tooltip } from 'antd' import { Input } from 'antd' import type { FC } from 'react' import { useTranslation } from 'react-i18next' @@ -114,7 +115,7 @@ const JoplinSettings: FC = () => { placeholder={t('settings.data.joplin.token_placeholder')} style={{ width: '100%' }} /> - + diff --git a/src/renderer/src/pages/settings/DataSettings/LocalBackupSettings.tsx b/src/renderer/src/pages/settings/DataSettings/LocalBackupSettings.tsx index c67a453b5..d1006cffd 100644 --- a/src/renderer/src/pages/settings/DataSettings/LocalBackupSettings.tsx +++ b/src/renderer/src/pages/settings/DataSettings/LocalBackupSettings.tsx @@ -1,6 +1,7 @@ import { DeleteOutlined, FolderOpenOutlined, SaveOutlined, SyncOutlined, WarningOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { loggerService } from '@logger' import { LocalBackupManager } from '@renderer/components/LocalBackupManager' @@ -10,7 +11,7 @@ import { useTheme } from '@renderer/context/ThemeProvider' import { startAutoSync, stopAutoSync } from '@renderer/services/BackupService' import { useAppSelector } from '@renderer/store' import type { AppInfo } from '@renderer/types' -import { Button, Input, Tooltip } from 'antd' +import { Input, Tooltip } from 'antd' import dayjs from 'dayjs' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -193,10 +194,14 @@ const LocalBackupSettings: React.FC = () => { placeholder={t('settings.data.local.directory.placeholder')} style={{ minWidth: 200, maxWidth: 400, flex: 1 }} /> - - @@ -205,10 +210,14 @@ const LocalBackupSettings: React.FC = () => { {t('settings.general.backup.title')} - - diff --git a/src/renderer/src/pages/settings/DataSettings/MarkdownExportSettings.tsx b/src/renderer/src/pages/settings/DataSettings/MarkdownExportSettings.tsx index f7a23b886..9d8802145 100644 --- a/src/renderer/src/pages/settings/DataSettings/MarkdownExportSettings.tsx +++ b/src/renderer/src/pages/settings/DataSettings/MarkdownExportSettings.tsx @@ -1,9 +1,9 @@ import { DeleteOutlined, FolderOpenOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { useTheme } from '@renderer/context/ThemeProvider' -import { Button } from 'antd' import Input from 'antd/es/input/Input' import type { FC } from 'react' import { useTranslation } from 'react-i18next' @@ -86,7 +86,7 @@ const MarkdownExportSettings: FC = () => { ) : null } /> - diff --git a/src/renderer/src/pages/settings/DataSettings/NotionSettings.tsx b/src/renderer/src/pages/settings/DataSettings/NotionSettings.tsx index dad25c7a2..3ad06f35b 100644 --- a/src/renderer/src/pages/settings/DataSettings/NotionSettings.tsx +++ b/src/renderer/src/pages/settings/DataSettings/NotionSettings.tsx @@ -1,12 +1,13 @@ import { InfoCircleOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { Client } from '@notionhq/client' import { AppLogo } from '@renderer/config/env' import { useTheme } from '@renderer/context/ThemeProvider' import { useMinappPopup } from '@renderer/hooks/useMinappPopup' -import { Button, Space, Tooltip } from 'antd' +import { Space, Tooltip } from 'antd' import { Input } from 'antd' import type { FC } from 'react' import { useTranslation } from 'react-i18next' @@ -122,7 +123,7 @@ const NotionSettings: FC = () => { placeholder={t('settings.data.notion.api_key_placeholder')} style={{ width: '100%' }} /> - + diff --git a/src/renderer/src/pages/settings/DataSettings/NutstoreSettings.tsx b/src/renderer/src/pages/settings/DataSettings/NutstoreSettings.tsx index 3b169a759..3d55b509b 100644 --- a/src/renderer/src/pages/settings/DataSettings/NutstoreSettings.tsx +++ b/src/renderer/src/pages/settings/DataSettings/NutstoreSettings.tsx @@ -1,6 +1,7 @@ import { CheckOutlined, FolderOutlined, LoadingOutlined, SyncOutlined, WarningOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import NutstorePathPopup from '@renderer/components/Popups/NutsorePathPopup' import Selector from '@renderer/components/Selector' @@ -20,7 +21,7 @@ import { import { useAppSelector } from '@renderer/store' import { modalConfirm } from '@renderer/utils' import { NUTSTORE_HOST } from '@shared/config/nutstore' -import { Button, Input, Tooltip, Typography } from 'antd' +import { Input, Tooltip, Typography } from 'antd' import dayjs from 'dayjs' import type { FC } from 'react' import { useCallback, useEffect, useState } from 'react' @@ -211,10 +212,10 @@ const NutstoreSettings: FC = () => { {isLogin ? ( - ) : ( - + )} @@ -251,19 +252,17 @@ const NutstoreSettings: FC = () => { setNutstorePath(e.target.value) }} /> - + - diff --git a/src/renderer/src/pages/settings/DataSettings/S3Settings.tsx b/src/renderer/src/pages/settings/DataSettings/S3Settings.tsx index 3e2516584..ab285d15e 100644 --- a/src/renderer/src/pages/settings/DataSettings/S3Settings.tsx +++ b/src/renderer/src/pages/settings/DataSettings/S3Settings.tsx @@ -1,6 +1,7 @@ import { FolderOpenOutlined, InfoCircleOutlined, SaveOutlined, SyncOutlined, WarningOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { S3BackupManager } from '@renderer/components/S3BackupManager' import { S3BackupModal, useS3BackupModal } from '@renderer/components/S3Modals' @@ -10,7 +11,7 @@ import { useTheme } from '@renderer/context/ThemeProvider' import { useMinappPopup } from '@renderer/hooks/useMinappPopup' import { startAutoSync, stopAutoSync } from '@renderer/services/BackupService' import { useAppSelector } from '@renderer/store' -import { Button, Input, Tooltip } from 'antd' +import { Input, Tooltip } from 'antd' import dayjs from 'dayjs' import type { FC } from 'react' import { useState } from 'react' @@ -182,16 +183,16 @@ const S3Settings: FC = () => { {t('settings.data.s3.backup.operation')} diff --git a/src/renderer/src/pages/settings/DataSettings/SiyuanSettings.tsx b/src/renderer/src/pages/settings/DataSettings/SiyuanSettings.tsx index 995352861..f16e8cc83 100644 --- a/src/renderer/src/pages/settings/DataSettings/SiyuanSettings.tsx +++ b/src/renderer/src/pages/settings/DataSettings/SiyuanSettings.tsx @@ -1,11 +1,12 @@ import { InfoCircleOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { loggerService } from '@logger' import { AppLogo } from '@renderer/config/env' import { useTheme } from '@renderer/context/ThemeProvider' import { useMinappPopup } from '@renderer/hooks/useMinappPopup' -import { Button, Space, Tooltip } from 'antd' +import { Space, Tooltip } from 'antd' import { Input } from 'antd' import type { FC } from 'react' import { useTranslation } from 'react-i18next' @@ -117,7 +118,7 @@ const SiyuanSettings: FC = () => { placeholder={t('settings.data.siyuan.token_placeholder')} style={{ width: '100%' }} /> - + diff --git a/src/renderer/src/pages/settings/DataSettings/WebDavSettings.tsx b/src/renderer/src/pages/settings/DataSettings/WebDavSettings.tsx index d3cf5963f..3b39e5fca 100644 --- a/src/renderer/src/pages/settings/DataSettings/WebDavSettings.tsx +++ b/src/renderer/src/pages/settings/DataSettings/WebDavSettings.tsx @@ -1,6 +1,7 @@ import { FolderOpenOutlined, SaveOutlined, SyncOutlined, WarningOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import Selector from '@renderer/components/Selector' import { WebdavBackupManager } from '@renderer/components/WebdavBackupManager' @@ -8,7 +9,7 @@ import { useWebdavBackupModal, WebdavBackupModal } from '@renderer/components/We import { useTheme } from '@renderer/context/ThemeProvider' import { startAutoSync, stopAutoSync } from '@renderer/services/BackupService' import { useAppSelector } from '@renderer/store' -import { Button, Input, Tooltip } from 'antd' +import { Input, Tooltip } from 'antd' import dayjs from 'dayjs' import type { FC } from 'react' import { useState } from 'react' @@ -147,10 +148,10 @@ const WebDavSettings: FC = () => { {t('settings.general.backup.title')} - - diff --git a/src/renderer/src/pages/settings/DataSettings/YuqueSettings.tsx b/src/renderer/src/pages/settings/DataSettings/YuqueSettings.tsx index 583a9a2ac..7617a346b 100644 --- a/src/renderer/src/pages/settings/DataSettings/YuqueSettings.tsx +++ b/src/renderer/src/pages/settings/DataSettings/YuqueSettings.tsx @@ -1,10 +1,11 @@ import { InfoCircleOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { AppLogo } from '@renderer/config/env' import { useTheme } from '@renderer/context/ThemeProvider' import { useMinappPopup } from '@renderer/hooks/useMinappPopup' -import { Button, Space, Tooltip } from 'antd' +import { Space, Tooltip } from 'antd' import { Input } from 'antd' import type { FC } from 'react' import { useTranslation } from 'react-i18next' @@ -107,7 +108,7 @@ const YuqueSettings: FC = () => { placeholder={t('settings.data.yuque.token_placeholder')} style={{ width: '100%' }} /> - + diff --git a/src/renderer/src/pages/settings/DisplaySettings/DisplaySettings.tsx b/src/renderer/src/pages/settings/DisplaySettings/DisplaySettings.tsx index 98e0f6e92..8985a4385 100644 --- a/src/renderer/src/pages/settings/DisplaySettings/DisplaySettings.tsx +++ b/src/renderer/src/pages/settings/DisplaySettings/DisplaySettings.tsx @@ -1,6 +1,7 @@ import { RowFlex } from '@cherrystudio/ui' import { CodeEditor } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { usePreference } from '@data/hooks/usePreference' import { ResetIcon } from '@renderer/components/Icons' import TextBadge from '@renderer/components/TextBadge' @@ -12,7 +13,7 @@ import useUserTheme from '@renderer/hooks/useUserTheme' import { DefaultPreferences } from '@shared/data/preference/preferenceSchemas' import type { AssistantIconType } from '@shared/data/preference/preferenceTypes' import { ThemeMode } from '@shared/data/preference/preferenceTypes' -import { Button, ColorPicker, Segmented, Select } from 'antd' +import { ColorPicker, Segmented, Select } from 'antd' import { Minus, Monitor, Moon, Plus, Sun } from 'lucide-react' import type { FC } from 'react' import { useCallback, useEffect, useMemo, useState } from 'react' @@ -259,15 +260,28 @@ const DisplaySettings: FC = () => { {t('settings.zoom.title')} - + diff --git a/src/renderer/src/pages/settings/DocProcessSettings/PreprocessProviderSettings.tsx b/src/renderer/src/pages/settings/DocProcessSettings/PreprocessProviderSettings.tsx index 75cab3f20..002e4e3ce 100644 --- a/src/renderer/src/pages/settings/DocProcessSettings/PreprocessProviderSettings.tsx +++ b/src/renderer/src/pages/settings/DocProcessSettings/PreprocessProviderSettings.tsx @@ -1,11 +1,12 @@ import { ExportOutlined } from '@ant-design/icons' import { Flex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { ApiKeyListPopup } from '@renderer/components/Popups/ApiKeyListPopup' import { getPreprocessProviderLogo, PREPROCESS_PROVIDER_CONFIG } from '@renderer/config/preprocessProviders' import { usePreprocessProvider } from '@renderer/hooks/usePreprocess' import type { PreprocessProvider } from '@renderer/types' import { formatApiKeys, hasObjectKey } from '@renderer/utils' -import { Avatar, Button, Divider, Input, Tooltip } from 'antd' +import { Avatar, Divider, Input, Tooltip } from 'antd' import Link from 'antd/es/typography/Link' import { List } from 'lucide-react' import type { FC } from 'react' @@ -95,7 +96,7 @@ const PreprocessProviderSettings: FC = ({ provider: _provider }) => { }}> {t('settings.provider.api_key.label')} - + )} diff --git a/src/renderer/src/pages/settings/MCPSettings/BuiltinMCPServerList.tsx b/src/renderer/src/pages/settings/MCPSettings/BuiltinMCPServerList.tsx index 617688fb2..d7d5e9b5c 100644 --- a/src/renderer/src/pages/settings/MCPSettings/BuiltinMCPServerList.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/BuiltinMCPServerList.tsx @@ -1,8 +1,9 @@ import { CheckOutlined, PlusOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { useMCPServers } from '@renderer/hooks/useMCPServers' import { getBuiltInMcpServerDescriptionLabel, getMcpTypeLabel } from '@renderer/i18n/label' import { builtinMCPServers } from '@renderer/store/mcp' -import { Button, Popover, Tag } from 'antd' +import { Popover, Tag } from 'antd' import type { FC } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' @@ -28,10 +29,12 @@ const BuiltinMCPServerList: FC = () => { )} @@ -150,11 +152,12 @@ const InstallNpxUv: FC = ({ mini = false }) => { {!isBunInstalled && ( )} @@ -170,7 +173,7 @@ const InstallNpxUv: FC = ({ mini = false }) => { } />
-
diff --git a/src/renderer/src/pages/settings/MCPSettings/McpServerCard.tsx b/src/renderer/src/pages/settings/MCPSettings/McpServerCard.tsx index f32f72ea3..56134445b 100644 --- a/src/renderer/src/pages/settings/MCPSettings/McpServerCard.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/McpServerCard.tsx @@ -1,4 +1,5 @@ import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { ErrorBoundary } from '@renderer/components/ErrorBoundary' import { DeleteIcon } from '@renderer/components/Icons' import GeneralPopup from '@renderer/components/Popups/GeneralPopup' @@ -6,7 +7,7 @@ import Scrollbar from '@renderer/components/Scrollbar' import { getMcpTypeLabel } from '@renderer/i18n/label' import type { MCPServer } from '@renderer/types' import { formatErrorMessage } from '@renderer/utils/error' -import { Alert, Button, Space, Tag, Tooltip, Typography } from 'antd' +import { Alert, Space, Tag, Tooltip, Typography } from 'antd' import { CircleXIcon, Settings2, SquareArrowOutUpRight } from 'lucide-react' import type { FC } from 'react' import { useCallback } from 'react' @@ -34,8 +35,7 @@ const McpServerCard: FC = ({ onOpenUrl }) => { const { t } = useTranslation() - const handleOpenUrl = (e: React.MouseEvent) => { - e.stopPropagation() + const handleOpenUrl = () => { if (server.providerUrl) { onOpenUrl(server.providerUrl) } @@ -62,8 +62,7 @@ const McpServerCard: FC = ({ ) } - const onClickDetails = (e: React.MouseEvent) => { - e.stopPropagation() + const onClickDetails = () => { GeneralPopup.show({ content: }) } return ( @@ -81,29 +80,30 @@ const McpServerCard: FC = ({ action={ { items: menuItems }} trigger={['click']}> - -
diff --git a/src/renderer/src/pages/settings/MCPSettings/McpSettings.tsx b/src/renderer/src/pages/settings/MCPSettings/McpSettings.tsx index 6ed72546c..0b2886fb1 100644 --- a/src/renderer/src/pages/settings/MCPSettings/McpSettings.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/McpSettings.tsx @@ -1,4 +1,5 @@ import { Flex, Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import type { McpError } from '@modelcontextprotocol/sdk/types.js' import { DeleteIcon } from '@renderer/components/Icons' @@ -8,7 +9,7 @@ import MCPDescription from '@renderer/pages/settings/MCPSettings/McpDescription' import type { MCPPrompt, MCPResource, MCPServer, MCPTool } from '@renderer/types' import { formatMcpError } from '@renderer/utils/error' import type { TabsProps } from 'antd' -import { Badge, Button, Form, Input, Radio, Select, Tabs } from 'antd' +import { Badge, Form, Input, Radio, Select, Tabs } from 'antd' import TextArea from 'antd/es/input/TextArea' import { ChevronDown, SaveIcon } from 'lucide-react' import React, { useCallback, useEffect, useState } from 'react' @@ -738,10 +739,12 @@ const McpSettings: React.FC = () => { {serverVersion && } diff --git a/src/renderer/src/pages/settings/MCPSettings/McpSettingsNavbar.tsx b/src/renderer/src/pages/settings/MCPSettings/McpSettingsNavbar.tsx index 0c9679f59..23e39c30a 100644 --- a/src/renderer/src/pages/settings/MCPSettings/McpSettingsNavbar.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/McpSettingsNavbar.tsx @@ -1,8 +1,8 @@ import { RowFlex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { NavbarRight } from '@renderer/components/app/Navbar' import { isLinux, isWin } from '@renderer/config/constant' import { useFullscreen } from '@renderer/hooks/useFullscreen' -import { Button } from 'antd' import { Search } from 'lucide-react' import { useTranslation } from 'react-i18next' import { useNavigate } from 'react-router' @@ -17,12 +17,11 @@ export const McpSettingsNavbar = () => { diff --git a/src/renderer/src/pages/settings/MCPSettings/NpxSearch.tsx b/src/renderer/src/pages/settings/MCPSettings/NpxSearch.tsx index 70187c807..1a7adf68d 100644 --- a/src/renderer/src/pages/settings/MCPSettings/NpxSearch.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/NpxSearch.tsx @@ -1,12 +1,13 @@ import { CheckOutlined, PlusOutlined } from '@ant-design/icons' import { Center, RowFlex } from '@cherrystudio/ui' import { Flex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { nanoid } from '@reduxjs/toolkit' import logo from '@renderer/assets/images/cherry-text-logo.svg' import { useMCPServers } from '@renderer/hooks/useMCPServers' import type { MCPServer } from '@renderer/types' import { getMcpConfigSampleFromReadme } from '@renderer/utils' -import { Button, Card, Input, Space, Spin, Tag, Typography } from 'antd' +import { Card, Input, Space, Spin, Tag, Typography } from 'antd' import { npxFinder } from 'npx-scope-finder' import { type FC, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -161,12 +162,12 @@ const NpxSearch: FC = () => { v{record.version} - diff --git a/src/renderer/src/pages/settings/MCPSettings/index.tsx b/src/renderer/src/pages/settings/MCPSettings/index.tsx index 9fe0a1cc6..886db1499 100644 --- a/src/renderer/src/pages/settings/MCPSettings/index.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/index.tsx @@ -1,7 +1,7 @@ import { ArrowLeftOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { ErrorBoundary } from '@renderer/components/ErrorBoundary' import { useTheme } from '@renderer/context/ThemeProvider' -import { Button } from 'antd' import type { FC } from 'react' import { Route, Routes, useLocation } from 'react-router' import { Link } from 'react-router-dom' @@ -26,7 +26,7 @@ const MCPSettings: FC = () => { {!isHome && ( - , - ]}> @@ -591,7 +598,12 @@ const MemorySettings = () => { - { }} trigger={['click']} placement="bottomRight"> - + @@ -699,10 +715,11 @@ const MemorySettings = () => { {t('memory.no_memories_description')} @@ -732,17 +749,18 @@ const MemorySettings = () => { } diff --git a/src/renderer/src/pages/settings/SelectionAssistantSettings/components/SelectionFilterListModal.tsx b/src/renderer/src/pages/settings/SelectionAssistantSettings/components/SelectionFilterListModal.tsx index ccab63b8d..429aef441 100644 --- a/src/renderer/src/pages/settings/SelectionAssistantSettings/components/SelectionFilterListModal.tsx +++ b/src/renderer/src/pages/settings/SelectionAssistantSettings/components/SelectionFilterListModal.tsx @@ -1,5 +1,6 @@ +import { Button } from '@cherrystudio/ui' import { isWin } from '@renderer/config/constant' -import { Button, Form, Input, Modal } from 'antd' +import { Form, Input, Modal } from 'antd' import type { FC } from 'react' import { useEffect } from 'react' import { useTranslation } from 'react-i18next' @@ -49,10 +50,10 @@ const SelectionFilterListModal: FC = ({ open, onC keyboard={true} destroyOnHidden footer={[ - , - ]}> diff --git a/src/renderer/src/pages/settings/SelectionAssistantSettings/components/SettingsActionsListHeader.tsx b/src/renderer/src/pages/settings/SelectionAssistantSettings/components/SettingsActionsListHeader.tsx index 01d721baf..a8461fb4b 100644 --- a/src/renderer/src/pages/settings/SelectionAssistantSettings/components/SettingsActionsListHeader.tsx +++ b/src/renderer/src/pages/settings/SelectionAssistantSettings/components/SettingsActionsListHeader.tsx @@ -1,4 +1,5 @@ -import { Button, Row, Tooltip } from 'antd' +import { Button } from '@cherrystudio/ui' +import { Row, Tooltip } from 'antd' import { Plus } from 'lucide-react' import { memo } from 'react' import { useTranslation } from 'react-i18next' @@ -22,7 +23,7 @@ const SettingsActionsListHeader = memo(({ customItemsCount, maxCustomItems, onRe {t('selection.settings.actions.title')} - + {t('selection.settings.actions.reset.button')} @@ -33,10 +34,10 @@ const SettingsActionsListHeader = memo(({ customItemsCount, maxCustomItems, onRe : t('selection.settings.actions.add_tooltip.enabled') }> diff --git a/src/renderer/src/pages/settings/ShortcutSettings.tsx b/src/renderer/src/pages/settings/ShortcutSettings.tsx index 20b95aa95..dcf707ffd 100644 --- a/src/renderer/src/pages/settings/ShortcutSettings.tsx +++ b/src/renderer/src/pages/settings/ShortcutSettings.tsx @@ -1,6 +1,7 @@ import { ClearOutlined, UndoOutlined } from '@ant-design/icons' import { RowFlex } from '@cherrystudio/ui' import { Switch } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { isMac, isWin } from '@renderer/config/constant' import { useTheme } from '@renderer/context/ThemeProvider' import { useShortcuts } from '@renderer/hooks/useShortcuts' @@ -10,7 +11,7 @@ import { useAppDispatch } from '@renderer/store' import { initialState, resetShortcuts, toggleShortcut, updateShortcut } from '@renderer/store/shortcuts' import type { Shortcut } from '@renderer/types' import type { InputRef } from 'antd' -import { Button, Input, Table as AntTable, Tooltip } from 'antd' +import { Input, Table as AntTable, Tooltip } from 'antd' import type { ColumnsType } from 'antd/es/table' import type { FC } from 'react' import React, { useRef, useState } from 'react' @@ -373,20 +374,20 @@ const ShortcutSettings: FC = () => { + diff --git a/src/renderer/src/pages/settings/ToolSettings/ApiServerSettings/ApiServerSettings.tsx b/src/renderer/src/pages/settings/ToolSettings/ApiServerSettings/ApiServerSettings.tsx index 8b7e46d9e..d4d402f26 100644 --- a/src/renderer/src/pages/settings/ToolSettings/ApiServerSettings/ApiServerSettings.tsx +++ b/src/renderer/src/pages/settings/ToolSettings/ApiServerSettings/ApiServerSettings.tsx @@ -1,4 +1,5 @@ // TODO: Refactor this component to use HeroUI +import { Button } from '@cherrystudio/ui' import { useTheme } from '@renderer/context/ThemeProvider' import { loggerService } from '@renderer/services/LoggerService' import type { RootState } from '@renderer/store' @@ -6,7 +7,7 @@ import { useAppDispatch } from '@renderer/store' import { setApiServerApiKey, setApiServerEnabled, setApiServerPort } from '@renderer/store/settings' import { formatErrorMessage } from '@renderer/utils/error' import { IpcChannel } from '@shared/IpcChannel' -import { Button, Input, InputNumber, Tooltip, Typography } from 'antd' +import { Input, InputNumber, Tooltip, Typography } from 'antd' import { Copy, ExternalLink, Play, RotateCcw, Square } from 'lucide-react' import type { FC } from 'react' import { useEffect, useState } from 'react' @@ -125,7 +126,7 @@ const ApiServerSettings: FC = () => { {t('apiServer.description')} {apiServerRunning && ( - )} @@ -201,12 +202,18 @@ const ApiServerSettings: FC = () => { suffix={ {!apiServerRunning && ( - + )} - } onClick={copyApiKey} disabled={!apiServerConfig.apiKey} /> + , - ] @@ -120,7 +121,7 @@ const CustomLanguageModal = ({ isOpen, editingCustomLanguage, onAdd, onEdit, onC } arrow trigger="click"> - onDelete(record.id)}> - @@ -122,9 +123,9 @@ const CustomLanguageSettings = () => { {t('translate.custom.label')} diff --git a/src/renderer/src/pages/settings/WebSearchSettings/AddSubscribePopup.tsx b/src/renderer/src/pages/settings/WebSearchSettings/AddSubscribePopup.tsx index b4e8b74f7..aa0347c67 100644 --- a/src/renderer/src/pages/settings/WebSearchSettings/AddSubscribePopup.tsx +++ b/src/renderer/src/pages/settings/WebSearchSettings/AddSubscribePopup.tsx @@ -1,7 +1,8 @@ import { Flex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { TopView } from '@renderer/components/TopView' import type { FormProps } from 'antd' -import { Button, Form, Input, Modal } from 'antd' +import { Form, Input, Modal } from 'antd' import { useState } from 'react' import { useTranslation } from 'react-i18next' @@ -92,7 +93,7 @@ const PopupContainer: React.FC = ({ title, resolve }) => { - diff --git a/src/renderer/src/pages/settings/WebSearchSettings/BlacklistSettings.tsx b/src/renderer/src/pages/settings/WebSearchSettings/BlacklistSettings.tsx index b3304b03d..40e0b61db 100644 --- a/src/renderer/src/pages/settings/WebSearchSettings/BlacklistSettings.tsx +++ b/src/renderer/src/pages/settings/WebSearchSettings/BlacklistSettings.tsx @@ -1,4 +1,5 @@ import { CheckOutlined, InfoCircleOutlined, LoadingOutlined } from '@ant-design/icons' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import { useTheme } from '@renderer/context/ThemeProvider' import { useTimer } from '@renderer/hooks/useTimer' @@ -7,7 +8,7 @@ import { useAppDispatch, useAppSelector } from '@renderer/store' import { setExcludeDomains } from '@renderer/store/websearch' import { parseMatchPattern, parseSubscribeContent } from '@renderer/utils/blacklistMatchPattern' import type { TableProps } from 'antd' -import { Alert, Button, Table } from 'antd' +import { Alert, Table } from 'antd' import TextArea from 'antd/es/input/TextArea' import { t } from 'i18next' import type { FC } from 'react' @@ -247,7 +248,7 @@ const BlacklistSettings: FC = () => { autoSize={{ minRows: 4, maxRows: 8 }} rows={4} /> - {errFormat && ( @@ -258,10 +259,10 @@ const BlacklistSettings: FC = () => { {t('settings.tool.websearch.subscribe')} @@ -276,11 +277,11 @@ const BlacklistSettings: FC = () => { /> - diff --git a/src/renderer/src/pages/settings/WebSearchSettings/WebSearchProviderSetting.tsx b/src/renderer/src/pages/settings/WebSearchSettings/WebSearchProviderSetting.tsx index 38c11481d..cdd80506e 100644 --- a/src/renderer/src/pages/settings/WebSearchSettings/WebSearchProviderSetting.tsx +++ b/src/renderer/src/pages/settings/WebSearchSettings/WebSearchProviderSetting.tsx @@ -1,5 +1,6 @@ import { CheckOutlined, ExportOutlined, LoadingOutlined } from '@ant-design/icons' import { Flex, RowFlex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { loggerService } from '@logger' import BochaLogo from '@renderer/assets/images/search/bocha.webp' import ExaLogo from '@renderer/assets/images/search/exa.png' @@ -13,7 +14,7 @@ import { useWebSearchProvider } from '@renderer/hooks/useWebSearchProviders' import WebSearchService from '@renderer/services/WebSearchService' import type { WebSearchProviderId } from '@renderer/types' import { formatApiKeys, hasObjectKey } from '@renderer/utils' -import { Button, Divider, Form, Input, Space, Tooltip } from 'antd' +import { Divider, Form, Input, Tooltip } from 'antd' import Link from 'antd/es/typography/Link' import { Info, List } from 'lucide-react' import type { FC } from 'react' @@ -179,10 +180,10 @@ const WebSearchProviderSetting: FC = ({ providerId }) => { }}> {t('settings.provider.api_key.label')} - - + {apiKeyWebsite && ( diff --git a/src/renderer/src/pages/translate/TranslateHistory.tsx b/src/renderer/src/pages/translate/TranslateHistory.tsx index 0190dacaf..690d17bfe 100644 --- a/src/renderer/src/pages/translate/TranslateHistory.tsx +++ b/src/renderer/src/pages/translate/TranslateHistory.tsx @@ -1,12 +1,13 @@ import { DeleteOutlined, StarFilled, StarOutlined } from '@ant-design/icons' import { ColFlex, RowFlex } from '@cherrystudio/ui' import { Flex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { DynamicVirtualList } from '@renderer/components/VirtualList' import db from '@renderer/databases' import useTranslate from '@renderer/hooks/useTranslate' import { clearHistory, deleteHistory, updateTranslateHistory } from '@renderer/services/TranslateService' import type { TranslateHistory, TranslateLanguage } from '@renderer/types' -import { Button, Drawer, Empty, Input, Popconfirm } from 'antd' +import { Drawer, Empty, Input, Popconfirm } from 'antd' import dayjs from 'dayjs' import { useLiveQuery } from 'dexie-react-hooks' import { isEmpty } from 'lodash' @@ -101,11 +102,11 @@ const TranslateHistoryList: FC = ({ isOpen, onHistoryItem {t('translate.history.title')} @@ -182,13 +183,13 @@ const TranslateHistoryList: FC = ({ isOpen, onHistoryItem {item._targetLanguage.label()} {/* tool bar */} - + )} {translating && ( - )} diff --git a/src/renderer/src/pages/translate/TranslateSettings.tsx b/src/renderer/src/pages/translate/TranslateSettings.tsx index 176c2edab..207e91af4 100644 --- a/src/renderer/src/pages/translate/TranslateSettings.tsx +++ b/src/renderer/src/pages/translate/TranslateSettings.tsx @@ -1,10 +1,11 @@ import { ColFlex, RowFlex, Switch } from '@cherrystudio/ui' import { Flex } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import LanguageSelect from '@renderer/components/LanguageSelect' import db from '@renderer/databases' import useTranslate from '@renderer/hooks/useTranslate' import type { AutoDetectionMethod, Model, TranslateLanguage } from '@renderer/types' -import { Button, Modal, Radio, Space, Tooltip } from 'antd' +import { Modal, Radio, Space, Tooltip } from 'antd' import { HelpCircle } from 'lucide-react' import type { FC } from 'react' import { memo, useEffect, useState } from 'react' @@ -199,7 +200,7 @@ const TranslateSettings: FC<{ )} - +
) diff --git a/src/renderer/src/windows/dataRefactorMigrate/MigrateApp.tsx b/src/renderer/src/windows/dataRefactorMigrate/MigrateApp.tsx index 0c91ef382..56ec5c679 100644 --- a/src/renderer/src/windows/dataRefactorMigrate/MigrateApp.tsx +++ b/src/renderer/src/windows/dataRefactorMigrate/MigrateApp.tsx @@ -1,8 +1,9 @@ import { getToastUtilities } from '@cherrystudio/ui' +import { Button } from '@cherrystudio/ui' import { AppLogo } from '@renderer/config/env' import { loggerService } from '@renderer/services/LoggerService' import { IpcChannel } from '@shared/IpcChannel' -import { Button, Progress, Space, Steps } from 'antd' +import { Progress, Space, Steps } from 'antd' import { AlertTriangle, CheckCircle, Database, Loader2, Rocket } from 'lucide-react' import React, { useEffect, useMemo, useState } from 'react' import styled from 'styled-components' @@ -218,9 +219,9 @@ const MigrateApp: React.FC = () => { case 'introduction': return ( <> - + - @@ -228,10 +229,10 @@ const MigrateApp: React.FC = () => { case 'backup_required': return ( <> - + - - + @@ -239,9 +240,9 @@ const MigrateApp: React.FC = () => { case 'backup_confirmed': return ( - + - @@ -251,14 +252,14 @@ const MigrateApp: React.FC = () => { return (
- +
) case 'completed': return (
-
@@ -266,9 +267,9 @@ const MigrateApp: React.FC = () => { case 'error': return ( - + - @@ -323,9 +324,9 @@ const MigrateApp: React.FC = () => { {/* Debug button to test Redux data extraction */}
@@ -135,10 +135,10 @@ const PreferenceBasicTests: React.FC = () => { {/* Theme Toggle with Visual Feedback */} {selectedKey === 'ui.theme_mode' && ( )} @@ -151,10 +151,10 @@ const PreferenceBasicTests: React.FC = () => { {/* Language Switch */} {selectedKey === 'app.language' && ( <> - - @@ -245,39 +245,39 @@ const PreferenceBasicTests: React.FC = () => { /> {selectedKey === 'app.zoom_factor' && ( - - - )} {selectedKey === 'chat.message.font_size' && ( - - - )} {selectedKey === 'feature.selection.action_window_opacity' && ( - - - @@ -291,9 +291,9 @@ const PreferenceBasicTests: React.FC = () => { {/* Sample Values */}