From e6e1fb040472b0324f30e0b0f0c07f13a5e684ba Mon Sep 17 00:00:00 2001 From: Phantom <59059173+EurFelux@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:04:03 +0800 Subject: [PATCH] refactor(button): migrate button from antd to heroui (#10292) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(eslint): add Button to restricted antd imports * feat(ui): add Button component with Storybook stories Implement a reusable Button component wrapping HeroUIButton with proper TypeScript props. Add comprehensive Storybook stories demonstrating all button variants, colors, sizes and states. * refactor(components): update ActionIconButton implementation and usage Replace onClick with onPress prop and move icon into icon prop Update component to use @cherrystudio/ui Button instead of antd Simplify props interface and add displayName * refactor(ui): migrate antd buttons to @cherrystudio/ui components update button components across multiple files to use @cherrystudio/ui's Button component replace antd button props with equivalent @cherrystudio/ui props * refactor(InputEmbeddingDimension): replace antd Button with custom Button component Update the Button component to use the custom @cherrystudio/ui Button with updated props for better consistency and maintainability * refactor(components): migrate buttons from antd to @cherrystudio/ui Update button components in LocalBackupModals and LocalBackupManager to use @cherrystudio/ui instead of antd Add flex styling to modal footers for better button alignment * refactor(ProviderSetting): migrate Button components from antd to @cherrystudio/ui Update Button components to use @cherrystudio/ui implementation with new props like variant, color, and startContent Replace onClick handlers with onPress and adjust disabled states * refactor(ui): migrate antd buttons to cherrystudio ui buttons Update button components across multiple files to use @cherrystudio/ui Button instead of antd Button Standardize button props and behavior while maintaining existing functionality * refactor(NutstorePathSelector): update button props to use cherrystudio ui Replace antd Button with cherrystudio ui Button component and update props * refactor(S3BackupManager): migrate antd buttons to @cherrystudio/ui Update button components from antd to @cherrystudio/ui library Change button props to match new library's API (variant, color, onPress, etc) Adjust table props for consistency with new component library * refactor(TranslateButton): replace styled Button with cherrystudio Button component The custom styled Button was replaced with the cherrystudio Button component to maintain consistency across the UI and reduce custom styling code. The functionality remains the same but uses the library's built-in props for styling. * refactor(WebdavBackupManager): replace antd buttons with cherrystudio ui buttons Update button components to use cherrystudio ui library for consistency * refactor(ui): migrate buttons from antd to @cherrystudio/ui Update button components across multiple editor components to use @cherrystudio/ui's Button component instead of antd's. This includes updating props like size, variant, and event handlers to match the new component's API. * refactor(components): migrate buttons from antd to @cherrystudio/ui Update button components in HtmlArtifactsCard and HtmlArtifactsPopup to use @cherrystudio/ui's Button component instead of antd's Button. This includes updating props like icon to startContent, onClick to onPress, and type to variant/color. * refactor(ui): migrate button components from antd to hero ui - replace antd Button with hero ui Button component - update button props interface to extend hero ui props - adjust button props in OAuthButton and MinappPopupContainer * refactor(MultiSelectionPopup): migrate button components to @cherrystudio/ui Update button props to match new component library requirements * refactor(ApiKeyItem): migrate antd buttons to cherrystudio ui components Update button components in ApiKeyItem to use cherrystudio ui library instead of antd * refactor(ApiKeyListPopup): update button props to use new UI library syntax Update button components to use the new syntax from @cherrystudio/ui library, replacing antd Button props with the new variant, color, and isDisabled props. Also adjust icon placement and button types to match the new library's API. * refactor(SelectModelButton): replace antd Button with custom Button component Simplify button implementation by using custom Button component from ui library instead of antd. Remove unused styled component and event handling. * refactor(Preview): migrate ImageToolButton to use @cherrystudio/ui Update ImageToolButton component to use Button from @cherrystudio/ui instead of antd Change onClick prop to onPress to match new Button component API Update related usage in ImageToolbar component * refactor(ui): migrate buttons from antd to cherrystudio ui components Update button components across multiple files to use cherrystudio's Button component instead of antd's. This includes updating props like onClick to onPress and adjusting button styling props to match the new component's API. * refactor(ui): migrate antd buttons to @cherrystudio/ui buttons Update button components from antd to @cherrystudio/ui library Adjust button props to match new component API * refactor(components): update prop names and component usage - Rename onClick to onPress in ImageToolButton test props - Update isLoading to loading in S3BackupManager table props - Change ghost to variant in ProviderSetting button props - Replace antd Button with cherrystudio Button in PreferenceBasicTests * refactor(ImageToolButton): migrate from antd to @cherrystudio/ui * refactor(FilesPage): migrate Button components from antd to @cherrystudio/ui * refactor(SearchMessage): migrate Button components from antd to @cherrystudio/ui * refactor(TopicMessages): migrate Button components from antd to @cherrystudio/ui * refactor(TopicsHistory): migrate Button components from antd to @cherrystudio/ui * refactor(ChatNavigation): migrate Button components from antd to @cherrystudio/ui * refactor(CitationsList): migrate Button components from antd to @cherrystudio/ui * refactor(MessageGroupMenuBar): migrate Button components from antd to @cherrystudio/ui * refactor: reorganize button imports and adjust class order Consolidate Button imports from @cherrystudio/ui to be grouped with other imports Standardize className order for consistency across components * refactor(SelectModelPopup): replace HStack with Flex component for layout * feat: migrate PrivacyPopup from antd Button to @cherrystudio/ui Button - Replace antd Button import with @cherrystudio/ui Button - Update onClick to onPress event handler - Update type="primary" to variant="solid" color="primary" - Maintain existing functionality while following Hero UI API 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate NewTopicButton from antd Button to @cherrystudio/ui Button - Replace antd Button import with @cherrystudio/ui Button - Update size="small" to size="sm" - Update icon prop to startContent for Hero UI API - Update onClick to onPress event handler - Maintain existing styled-components with StyledButton wrapper 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate MessageMcpTool Buttons from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update two Button components with Hero UI API: - size="small" to size="sm" - onClick to onPress - variant="filled" to variant="solid" - Move icons to startContent prop - Maintain Dropdown.Button as antd component (not migrated) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate SettingsTab Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update settings icon button with Hero UI API: - type="text" to variant="light" - size="small" to size="sm" - icon prop to isIconOnly with child content - onClick to onPress event handler 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate AssistantTagsPopup Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update delete tag button with Hero UI API: - type="text" to variant="light" - danger prop to color="danger" - icon prop to isIconOnly with child content - onClick to onPress event handler 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate UpdateAppButton from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update styled Button component with Hero UI API: - onClick to onPress event handler - icon prop to startContent - color="orange" to color="warning" (closest equivalent) - variant="outlined" to variant="bordered" - size="small" to size="sm" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(NewTopicButton): replace styled-components with cn utility Simplify component styling by removing styled-components in favor of the cn utility * refactor: organize imports and remove unused event handlers remove duplicate Button imports and clean up stopPropagation handlers * feat: migrate KnowledgeContent Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update settings icon Button with Hero UI API: - type="text" to variant="light" - size="small" to size="sm" - icon prop to isIconOnly with child content - onClick to onPress event handler - Update ResponsiveButton styled component selector: - .ant-btn-icon + span to [data-slot="icon"] + [data-slot="label"] 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate KnowledgeDirectories Buttons from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update three Button components with Hero UI API: - Refresh button: type="text" to variant="light", icon to isIconOnly, onClick to onPress - Delete button: type="text" danger to variant="light" color="danger", icon to isIconOnly, onClick to onPress - Add directory button: type="primary" to variant="solid" color="primary", icon to startContent, disabled to isDisabled - Remove stopPropagation from add directory button as not needed with onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate KnowledgeFiles Buttons from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update three Button components with Hero UI API: - Add file button: type="primary" to variant="solid" color="primary", icon to startContent, disabled to isDisabled - Refresh button: type="text" to variant="light", icon to isIconOnly, onClick to onPress - Delete button: type="text" danger to variant="light" color="danger", icon to isIconOnly, onClick to onPress - Remove stopPropagation from add file button as not needed with onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate KnowledgeNotes Buttons from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update three Button components with Hero UI API: - Add note button: type="primary" to variant="solid" color="primary", icon to startContent, disabled to isDisabled - Edit button: type="text" to variant="light", icon to isIconOnly, onClick to onPress - Delete button: type="text" danger to variant="light" color="danger", icon to isIconOnly, onClick to onPress - Remove stopPropagation from add note button as not needed with onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate KnowledgeSitemaps Buttons from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update three Button components with Hero UI API: - Add sitemap button: type="primary" to variant="solid" color="primary", icon to startContent, disabled to isDisabled - Refresh button: type="text" to variant="light", icon to isIconOnly, onClick to onPress - Delete button: type="text" danger to variant="light" color="danger", icon to isIconOnly, onClick to onPress - Remove stopPropagation from add sitemap button as not needed with onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate KnowledgeUrls Buttons from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update three Button components with Hero UI API: - Add URL button: type="primary" to variant="solid" color="primary", icon to startContent, disabled to isDisabled - Refresh button: type="text" to variant="light", icon to isIconOnly, onClick to onPress - Delete button: type="text" danger to variant="light" color="danger", icon to isIconOnly, onClick to onPress - Remove stopPropagation from add URL button as not needed with onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate KnowledgeVideos Buttons from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update three Button components with Hero UI API: - Add video button: type="primary" to variant="solid" color="primary", icon to startContent, disabled to isDisabled - Refresh button: type="text" to variant="light", icon to isIconOnly, onClick to onPress - Delete button: type="text" danger to variant="light" color="danger", icon to isIconOnly, onClick to onPress - Remove stopPropagation from add video button as not needed with onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate MinAppsPage Buttons from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update two settings Button components with Hero UI API: - type="text" to variant="light" - icon prop to isIconOnly with child content - onClick to onPress event handler - Maintain className="nodrag" for draggable interface 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate MiniAppSettings Buttons from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update two Button components with Hero UI API: - Swap button: onClick to onPress event handler - Reset button: onClick to onPress event handler - Buttons use default Hero UI styling without additional props 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate NewAppButton from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update two Button components with Hero UI API: - Upload button: icon to startContent - Save button: type="primary" htmlType="submit" to variant="solid" color="primary" type="submit" - Maintain form submission functionality with type="submit" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor: standardize button imports from @cherrystudio/ui * refactor(KnowledgeContent): replace icon prop with startContent in Button Improve consistency with component library by using startContent prop instead of children for icons * refactor(KnowledgeVideos): update button components to use startContent prop Use startContent prop for icons in buttons to improve consistency with the design system * refactor(MinAppsPage): improve button component structure by using startContent prop * feat: migrate AihubmixPage Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - size="small" to size="sm" - icon to startContent - onClick to onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate DmxapiPage Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - size="small" to size="sm" - icon to startContent - onClick to onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate NewApiPage Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - size="small" to size="sm" - icon to startContent - onClick to onPress - type="primary" to variant="solid" color="primary" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate SiliconPage Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - size="small" to size="sm" - icon to startContent - onClick to onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate TokenFluxPage Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - size="small" to size="sm" - icon to startContent - onClick to onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate ZhipuPage Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - type="text" to variant="light" - icon to startContent - onClick to onPress - disabled to isDisabled 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate Artboard Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - onClick to onPress for NavigationButton and CancelButton - type="link" to variant="light" - Maintain styled-components usage for NavigationButton and CancelButton 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate DynamicFormRender Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - icon to startContent - onClick to onPress - size="small" to size="sm" - danger to color="danger" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor: convert Button inline styles to Tailwind CSS - Replace style={{borderTopLeftRadius: 0, borderBottomLeftRadius: 0, height: '32px'}} with className="rounded-l-none h-8" - Replace style={{flexShrink: 0, minWidth: 'auto', padding: '0 8px'}} with className="shrink-0 min-w-0 px-2" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate ImageUploader Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - size="small" to size="sm" - onClick to onPress 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(Artboard): replace inline styles with tailwind classes Use tailwind classes for consistent styling of navigation buttons instead of inline styles * feat: migrate AboutSettings Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - onClick to onPress for all Button components - loading to isLoading for CheckUpdateButton - disabled to isDisabled for CheckUpdateButton - Maintain CheckUpdateButton styled component 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate AssistantMemorySettings Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - type="text" to variant="light" + isIconOnly - icon to startContent - onClick to onPress - size="small" to size="sm" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate AssistantModelSettings Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - icon to startContent - onClick to onPress - variant="filled" to variant="solid" - danger + type="primary" to color="danger" variant="solid" - Add isIconOnly for icon-only buttons - Maintain ModelSelectButton styled component 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate AssistantPromptSettings Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - type="primary" to variant="solid" color="primary" - icon to startContent - onClick to onPress - Convert inline styles to Tailwind CSS: - style={{fontSize: 18, padding: '4px', minWidth: '28px', height: '28px'}} to className="text-lg p-1 min-w-7 h-7" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor: consolidate Button imports from @cherrystudio/ui Move all Button imports from @cherrystudio/ui to be grouped with other imports from the same package for better consistency and maintainability * feat: migrate AssistantRegularPromptsSettings Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - type="text" to variant="light" - icon to startContent - onClick to onPress - Add isIconOnly for icon-only buttons - danger to color="danger" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * feat: migrate DataSettings Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Update Button props with Hero UI API: - onClick to onPress for all buttons - icon to startContent for backup/restore buttons - danger to color="danger" for reset button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(NutstoreSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers - Update type/danger props to variant/color system - Convert loading to isLoading prop - Convert disabled to isDisabled prop - Update ghost prop to variant="ghost" - Add isIconOnly for folder icon button - Migrate startContent pattern for icons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(S3Settings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers - Convert icon props to startContent pattern - Convert loading to isLoading prop - Convert disabled to isDisabled prop 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(SiyuanSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(WebDavSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers - Convert icon props to startContent pattern - Convert loading to isLoading prop - Convert disabled to isDisabled prop 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(YuqueSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(DisplaySettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers - Convert icon props to startContent pattern - Convert variant="text" to variant="light" - Add isIconOnly for icon-only buttons - Replace inline styles with Tailwind CSS classes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(PreprocessProviderSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Convert type="text" to variant="light" - Convert size="small" to size="sm" - Convert icon to startContent pattern - Add isIconOnly for icon-only button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(NotionSettings): replace antd Button with cherrystudio Button and update prop Update the Button import to use cherrystudio's component instead of antd's * refactor(settings): migrate Button props to use startContent and isDisabled Update Button components in LocalBackupSettings to use startContent instead of icon and isDisabled instead of disabled for consistency with the updated UI library * refactor(JoplinSettings): replace Button import and update onPress prop Use Button component from @cherrystudio/ui instead of antd Update onClick to onPress for consistency with component API * refactor(MarkdownExportSettings): replace antd Button with cherrystudio Button in markdown export Update the Button component import and props to use the cherrystudio UI library version instead of antd for consistency * refactor: organize imports in settings components Move Button import from cherrystudio/ui to be grouped with other imports from the same package for better consistency and readability * refactor(AddMcpServerModal): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert icon prop to startContent pattern 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(BuiltinMCPServerList): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Convert type="text" to variant="light" - Convert size="small" to size="sm" - Convert icon to startContent pattern - Convert disabled to isDisabled prop - Add isIconOnly for icon-only button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(InstallNpxUv): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers - Convert type="primary" to variant="solid" color="primary" - Convert type="link" to variant="light" - Convert shape="circle" to radius="full" - Convert size="small" to size="sm" - Convert loading/disabled to isLoading/isDisabled - Convert icon to startContent pattern - Add isIconOnly for icon-only button - Convert green color to success color 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(McpServerCard): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers (removing e.stopPropagation) - Convert type="text" to variant="light" - Convert size="small" to size="sm" - Convert shape="circle" to radius="full" - Convert danger to color="danger" - Convert icon to startContent pattern - Add isIconOnly for icon-only buttons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(MCPSettings): reorder Button imports for consistency Move Button imports to be grouped with other UI component imports for better readability and maintainability * refactor(McpServersList): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers - Convert type="default" to variant="solid" - Convert shape="round" to radius="full" - Convert icon to startContent pattern 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(McpServerCard): remove unused event parameter from click handlers The event parameter was not being used in handleOpenUrl and onClickDetails handlers, so it was removed to simplify the code. * refactor(McpServerCard): remove data-no-dnd attribute from Button * refactor(McpSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers - Convert danger to color="danger" - Convert type="text" to variant="light" - Convert type="primary" to variant="solid" color="primary" - Convert shape="round" to radius="full" - Convert loading/disabled to isLoading/isDisabled - Convert icon to startContent pattern - Add isIconOnly for icon-only button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(McpSettingsNavbar): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Convert type="text" to variant="light" - Convert size="small" to size="sm" - Convert icon to startContent pattern - Replace inline styles with Tailwind CSS classes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(NpxSearch): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Convert type="text" to variant="light" - Convert size="small" to size="sm" - Convert icon to startContent pattern - Add isIconOnly for icon-only button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(SyncServersPopup): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers - Convert type="default" to variant="solid" - Convert type="primary" to variant="solid" color="primary" - Convert loading/disabled to isLoading/isDisabled 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(MCPSettings/index): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert type="default" to variant="solid" - Convert shape="circle" to radius="full" - Convert icon to startContent pattern - Add isIconOnly for icon-only button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(MemorySettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers - Convert type="text" to variant="light" - Convert type="primary" to variant="solid" color="primary" - Convert size="large" to size="lg" - Convert size="small" to size="sm" - Convert loading/disabled to isLoading/isDisabled - Convert danger to color="danger" - Convert icon to startContent pattern - Add isIconOnly for icon-only buttons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(UserSelector): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Convert type="default" to variant="solid" - Convert icon to startContent pattern - Add isIconOnly for icon-only button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(DefaultAssistantSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Convert type="text" to variant="light" - Convert icon to startContent pattern - Add isIconOnly for icon-only button - Replace inline styles with Tailwind CSS classes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(QuickModelPopup): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Change icon prop to startContent - Update type="text" to variant="light" - Add isIconOnly prop for icon-only button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(NotesSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for all buttons - Change type="default" to variant="solid" - Change type="primary" to color="primary" - Update loading to isLoading prop - Update disabled to isDisabled prop - Change icon prop to startContent - Replace inline style with Tailwind CSS class (ml-2) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(AnthropicSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Change type="primary" to color="primary" - Update loading to isLoading prop 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(ModelEditContent): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for all buttons - Change size="small" to size="sm" - Update icon prop to startContent for save and reset buttons - Change iconPosition="end" to endContent for more settings toggle - Update type="text" to variant="light" and add isIconOnly for reset button - Change type="primary" to color="primary" - Replace htmlType="submit" with type="submit" - Update variant="filled" to variant="solid" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(ModelTypeSelector): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Change size="small" to size="sm" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(GithubCopilotSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for all buttons - Change type="primary" to color="primary" - Change type="primary" danger to color="danger" - Update size="small" to size="sm" - Update loading to isLoading prop - Update disabled to isDisabled prop - Change icon prop to startContent for copy button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(AddModelPopup): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Change type="primary" to color="primary" - Replace htmlType="submit" with type="submit" - Change size="middle" to size="md" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(ModelList): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for all buttons - Change type="text" to variant="light" and add isIconOnly for icon button - Change type="primary" to color="primary" - Change type="default" to variant="solid" - Update disabled to isDisabled prop - Change icon prop to startContent for all buttons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(ModelListGroup): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Change type="text" to variant="light" - Update disabled to isDisabled prop - Change icon prop to startContent - Remove e.stopPropagation() as no longer needed - Add isIconOnly prop for icon-only button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(ModelListItem): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for both buttons - Change type="text" to variant="light" - Update disabled to isDisabled prop - Change icon prop to startContent for both buttons - Add isIconOnly prop for icon-only buttons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(NewApiAddModelPopup): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Change type="primary" to color="primary" - Replace htmlType="submit" with type="submit" - Change size="middle" to size="md" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(NewApiBatchAddModelPopup): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Change type="primary" to color="primary" - Replace htmlType="submit" with type="submit" - Change size="middle" to size="md" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(ProviderList): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Update disabled to isDisabled prop - Change icon prop to startContent - Keep existing style attributes for custom styling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(ProviderOAuth): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for both buttons - Change shape="round" to radius="full" - Change icon prop to startContent for both buttons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(UrlSchemaInfoPopup): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Change type="link" to variant="light" - Change size="small" to size="sm" - Change icon prop to startContent - Add isIconOnly prop for icon-only button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(QuickAssistantSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for both styled buttons - Change type="primary" to color="primary" - Change type="default" to color="default" - Update styled component to use new Button from @cherrystudio/ui 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(QuickPhraseSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for all buttons - Change type="text" to variant="light" - Change icon prop to startContent for all buttons - Change danger prop to color="danger" - Add isIconOnly prop for all icon-only buttons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(SelectionAssistantSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for both buttons - Change type="link" to variant="light" - Change icon prop to startContent - Keep existing style attributes for custom styling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(ActionsListItem): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for all buttons - Change type="link" to variant="light" - Change size="small" to size="sm" - Change danger prop to color="danger" - Add isIconOnly prop for all icon-only buttons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(MacProcessTrustHintModal): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for both buttons - Change type="link" to variant="light" - Change type="primary" to color="primary" - Keep existing style attributes for custom styling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(SelectionActionSearchModal): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler - Change type="link" to variant="light" - Change size="small" to size="sm" - Keep existing style attributes for custom styling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(SelectionFilterListModal): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handler for both modal buttons - Change type="primary" to color="primary" - Keep existing key attributes for modal footer 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(SettingsActionsListHeader): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers - Update icon prop to startContent with Plus icon - Change disabled to isDisabled - Add color="primary" for primary button style - Update styled ResetButton to use variant="light" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(ShortcutSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers for all buttons - Update icon prop to startContent for icon buttons - Change disabled to isDisabled - Convert size="small" to size="sm" - Replace shape="circle" with isIconOnly for circular buttons - Migrate reset undo button, clear button, and reset all button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(ApiServerSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers for all buttons - Update icon prop to startContent for documentation and copy buttons - Change type="primary" to color="primary" - Convert type="link" to variant="light" for regenerate button - Change disabled to isDisabled for input button and regenerate button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(CustomLanguageModal): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers for modal footer buttons - Change type="primary" to color="primary" for save button - Convert icon prop to startContent with isIconOnly for emoji button - Migrate cancel, save, and emoji picker buttons to Hero UI API 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(CustomLanguageSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers for all buttons - Update icon prop to startContent for edit, delete, and add buttons - Change type="primary" to color="primary" for add button - Convert danger prop to color="danger" for delete button - Migrate table action buttons and primary add button to Hero UI API 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(AddSubscribePopup): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert type="primary" to color="primary" for submit button - Change htmlType="submit" to type="submit" following Hero UI API - Migrate form submit button from antd to Hero UI 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(BlacklistSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers for all buttons - Change type="primary" to color="primary" for subscribe buttons - Convert ghost prop to variant="ghost" - Change disabled to isDisabled for all button states - Migrate save, add subscribe, update subscribe, and delete buttons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(WebSearchProviderSetting): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers for API key list and check buttons - Change type="text" to variant="light" for API key list button - Convert icon prop to startContent with isIconOnly for list button - Update size="small" to size="sm" - Change ghost prop to variant="ghost" and type to color for check button - Convert disabled to isDisabled for API checking state 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(TranslateSettings): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress for more settings button - Simple migration for modal footer button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(MigrateApp): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers for all migration buttons - Change type="primary" to color="primary" for primary buttons - Convert disabled to isDisabled for migration in progress button - Change size="small" to size="sm" for debug button - Convert type="dashed" to variant="bordered" for styled buttons - Migrate all buttons in migration workflow stages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * refactor(SelectionActionApp): migrate Button from antd to @cherrystudio/ui - Replace antd Button import with @cherrystudio/ui Button - Convert onClick to onPress handlers for all window control buttons - Change type="text" to variant="light" for all title bar buttons - Update icon prop to startContent for pin, opacity, minimize, and close buttons - Add isIconOnly prop for all icon-only buttons in the title bar - Migrate styled WinButton component to use Hero UI Button as base 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * style(ActionIconButton): remove fixed dimensions and add size prop Simplify button styling by removing fixed height/width and using size="sm" prop instead * refactor(AssistantPromptSettings): migrate from antd Popover to hero-ui components Replace antd Popover with hero-ui Popover and Tooltip components for better consistency Rename EmojiButtonWrapper to EmojiDeleteButtonWrapper for clarity * style(AssistantModelSettings): add size prop to delete button in model settings * style(settings): standardize button sizes and replace Space.Compact with Flex Consistently apply 'sm' size to buttons across settings components and replace deprecated Space.Compact with Flex component for better layout consistency * refactor(ApiServerSettings): replace custom buttons with standard Button component remove custom styled InputButton and RegenerateButton components in favor of using the standard Button component with appropriate props * style(ProviderSetting): make settings button icon-only for consistency * style(ui): update icon styling and button props remove global lucide icon color override update button components to use consistent props * style(ProviderList): adjust button size to match design * feat(theme): add foreground color calculation for primary theme Calculate and set foreground color based on primary theme color to ensure proper contrast * style(KnowledgeFiles): make button size consistent with other buttons * test: update test snapshots for button components Update test snapshots to reflect changes in button styling and accessibility attributes. The changes include updated class names, ripple effects, and focus states. --------- Co-authored-by: Claude Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com> Co-authored-by: MyPrototypeWhat --- eslint.config.mjs | 2 +- .../ui/src/components/base/Button/index.tsx | 12 ++ packages/ui/src/components/index.ts | 1 + .../interactive/ImageToolButton/index.tsx | 11 +- .../components/base/Button.stories.tsx | 150 +++++++++++++++++ src/renderer/src/assets/styles/index.css | 4 - .../components/Buttons/ActionIconButton.tsx | 25 +-- .../CodeBlockView/HtmlArtifactsCard.tsx | 22 ++- .../CodeBlockView/HtmlArtifactsPopup.tsx | 57 +++---- src/renderer/src/components/ContentSearch.tsx | 54 +++--- .../src/components/ExpandableText.tsx | 4 +- .../components/InputEmbeddingDimension.tsx | 11 +- .../src/components/LocalBackupManager.tsx | 39 +++-- .../src/components/LocalBackupModals.tsx | 8 +- .../MinApp/MinappPopupContainer.tsx | 5 +- .../src/components/ModelSelectButton.tsx | 13 +- .../src/components/NutstorePathSelector.tsx | 17 +- .../src/components/OAuth/OAuthButton.tsx | 5 +- .../Popups/ApiKeyListPopup/item.tsx | 156 ++++++++++-------- .../Popups/ApiKeyListPopup/list.tsx | 31 ++-- .../components/Popups/MultiSelectionPopup.tsx | 39 ++--- .../src/components/Popups/PrivacyPopup.tsx | 7 +- .../components/Preview/ImageToolButton.tsx | 9 +- .../src/components/Preview/ImageToolbar.tsx | 16 +- .../__tests__/ImageToolButton.test.tsx | 2 +- .../Preview/__tests__/ImageToolbar.test.tsx | 4 +- .../ImageToolButton.test.tsx.snap | 17 +- .../RichEditor/components/ImageUploader.tsx | 14 +- .../RichEditor/components/LinkEditor.tsx | 9 +- .../RichEditor/components/MathInputDialog.tsx | 7 +- .../code-block-shiki/CodeBlockNodeView.tsx | 12 +- .../src/components/S3BackupManager.tsx | 27 +-- .../src/components/TranslateButton.tsx | 51 ++---- .../src/components/WebdavBackupManager.tsx | 27 +-- .../InputEmbeddingDimension.test.tsx.snap | 14 ++ src/renderer/src/hooks/useUserTheme.ts | 2 + src/renderer/src/pages/agents/AgentsPage.tsx | 13 +- .../pages/agents/components/AddAgentPopup.tsx | 19 ++- .../src/pages/agents/components/AgentCard.tsx | 16 +- .../agents/components/ImportAgentPopup.tsx | 9 +- src/renderer/src/pages/code/CodeToolsPage.tsx | 35 ++-- src/renderer/src/pages/files/FilesPage.tsx | 9 +- .../history/components/SearchMessage.tsx | 14 +- .../history/components/TopicMessages.tsx | 15 +- .../history/components/TopicsHistory.tsx | 7 +- .../pages/home/Inputbar/AttachmentButton.tsx | 9 +- .../home/Inputbar/GenerateImageButton.tsx | 8 +- .../src/pages/home/Inputbar/Inputbar.tsx | 8 +- .../src/pages/home/Inputbar/InputbarTools.tsx | 34 ++-- .../home/Inputbar/KnowledgeBaseButton.tsx | 8 +- .../pages/home/Inputbar/MCPToolsButton.tsx | 8 +- .../home/Inputbar/MentionModelsButton.tsx | 8 +- .../pages/home/Inputbar/NewContextButton.tsx | 4 +- .../home/Inputbar/QuickPhrasesButton.tsx | 4 +- .../pages/home/Inputbar/ThinkingButton.tsx | 8 +- .../pages/home/Inputbar/UrlContextbutton.tsx | 4 +- .../pages/home/Inputbar/WebSearchButton.tsx | 8 +- .../pages/home/Messages/ChatNavigation.tsx | 41 ++--- .../src/pages/home/Messages/CitationsList.tsx | 5 +- .../src/pages/home/Messages/MessageEditor.tsx | 12 +- .../home/Messages/MessageGroupMenuBar.tsx | 21 +-- .../pages/home/Messages/NewTopicButton.tsx | 53 +++--- .../home/Messages/Tools/MessageMcpTool.tsx | 22 +-- .../src/pages/home/Tabs/SettingsTab.tsx | 14 +- .../Tabs/components/AssistantTagsPopup.tsx | 17 +- .../home/components/SelectModelButton.tsx | 25 +-- .../pages/home/components/UpdateAppButton.tsx | 12 +- .../src/pages/knowledge/KnowledgeContent.tsx | 14 +- .../knowledge/items/KnowledgeDirectories.tsx | 30 ++-- .../pages/knowledge/items/KnowledgeFiles.tsx | 29 ++-- .../pages/knowledge/items/KnowledgeNotes.tsx | 27 ++- .../knowledge/items/KnowledgeSitemaps.tsx | 30 ++-- .../pages/knowledge/items/KnowledgeUrls.tsx | 30 ++-- .../pages/knowledge/items/KnowledgeVideos.tsx | 30 ++-- .../src/pages/minapps/MinAppsPage.tsx | 17 +- .../MiniappSettings/MiniAppSettings.tsx | 7 +- .../src/pages/minapps/NewAppButton.tsx | 7 +- .../src/pages/paintings/AihubmixPage.tsx | 6 +- .../src/pages/paintings/DmxapiPage.tsx | 6 +- .../src/pages/paintings/NewApiPage.tsx | 7 +- .../src/pages/paintings/SiliconPage.tsx | 9 +- .../src/pages/paintings/TokenFluxPage.tsx | 5 +- .../src/pages/paintings/ZhipuPage.tsx | 12 +- .../pages/paintings/components/Artboard.tsx | 11 +- .../components/DynamicFormRender.tsx | 29 ++-- .../paintings/components/ImageUploader.tsx | 4 +- .../src/pages/settings/AboutSettings.tsx | 23 +-- .../AssistantMemorySettings.tsx | 7 +- .../AssistantModelSettings.tsx | 27 +-- .../AssistantPromptSettings.tsx | 83 +++++----- .../AssistantRegularPromptsSettings.tsx | 20 ++- .../settings/DataSettings/DataSettings.tsx | 17 +- .../settings/DataSettings/JoplinSettings.tsx | 5 +- .../DataSettings/LocalBackupSettings.tsx | 19 ++- .../DataSettings/MarkdownExportSettings.tsx | 4 +- .../settings/DataSettings/NotionSettings.tsx | 5 +- .../DataSettings/NutstoreSettings.tsx | 23 ++- .../settings/DataSettings/S3Settings.tsx | 17 +- .../settings/DataSettings/SiyuanSettings.tsx | 5 +- .../settings/DataSettings/WebDavSettings.tsx | 7 +- .../settings/DataSettings/YuqueSettings.tsx | 5 +- .../DisplaySettings/DisplaySettings.tsx | 50 ++++-- .../PreprocessProviderSettings.tsx | 5 +- .../MCPSettings/AddMcpServerModal.tsx | 5 +- .../MCPSettings/BuiltinMCPServerList.tsx | 16 +- .../settings/MCPSettings/InstallNpxUv.tsx | 39 +++-- .../settings/MCPSettings/McpServerCard.tsx | 66 ++++---- .../settings/MCPSettings/McpServersList.tsx | 13 +- .../settings/MCPSettings/McpSettings.tsx | 27 +-- .../MCPSettings/McpSettingsNavbar.tsx | 13 +- .../pages/settings/MCPSettings/NpxSearch.tsx | 12 +- .../settings/MCPSettings/SyncServersPopup.tsx | 12 +- .../src/pages/settings/MCPSettings/index.tsx | 4 +- .../MemorySettings/MemorySettings.tsx | 57 ++++--- .../settings/MemorySettings/UserSelector.tsx | 11 +- .../DefaultAssistantSettings.tsx | 7 +- .../settings/ModelSettings/ModelSettings.tsx | 26 ++- .../ModelSettings/QuickModelPopup.tsx | 7 +- .../src/pages/settings/NotesSettings.tsx | 17 +- .../ProviderSettings/AnthropicSettings.tsx | 7 +- .../EditModelPopup/ModelEditContent.tsx | 20 ++- .../EditModelPopup/ModelTypeSelector.tsx | 5 +- .../GithubCopilotSettings.tsx | 19 ++- .../ModelList/AddModelPopup.tsx | 5 +- .../ModelList/ManageModelsList.tsx | 20 ++- .../ModelList/ManageModelsPopup.tsx | 26 +-- .../ProviderSettings/ModelList/ModelList.tsx | 18 +- .../ModelList/ModelListGroup.tsx | 15 +- .../ModelList/ModelListItem.tsx | 19 ++- .../ModelList/NewApiAddModelPopup.tsx | 5 +- .../ModelList/NewApiBatchAddModelPopup.tsx | 5 +- .../ProviderSettings/ProviderList.tsx | 10 +- .../ProviderSettings/ProviderOAuth.tsx | 9 +- .../ProviderSettings/ProviderSetting.tsx | 50 +++--- .../ProviderSettings/UrlSchemaInfoPopup.tsx | 12 +- .../pages/settings/QuickAssistantSettings.tsx | 11 +- .../pages/settings/QuickPhraseSettings.tsx | 19 ++- .../SelectionAssistantSettings.tsx | 9 +- .../components/ActionsListItem.tsx | 8 +- .../components/MacProcessTrustHintModal.tsx | 10 +- .../components/SelectionActionSearchModal.tsx | 5 +- .../components/SelectionFilterListModal.tsx | 7 +- .../components/SettingsActionsListHeader.tsx | 13 +- .../src/pages/settings/ShortcutSettings.tsx | 25 +-- .../ApiServerSettings/ApiServerSettings.tsx | 32 ++-- .../CustomLanguageModal.tsx | 9 +- .../CustomLanguageSettings.tsx | 13 +- .../WebSearchSettings/AddSubscribePopup.tsx | 5 +- .../WebSearchSettings/BlacklistSettings.tsx | 23 +-- .../WebSearchProviderSetting.tsx | 17 +- .../src/pages/translate/TranslateHistory.tsx | 36 ++-- .../src/pages/translate/TranslatePage.tsx | 42 +++-- .../src/pages/translate/TranslateSettings.tsx | 5 +- .../dataRefactorMigrate/MigrateApp.tsx | 31 ++-- .../components/PreferenceBasicTests.tsx | 42 ++--- .../selection/action/SelectionActionApp.tsx | 27 ++- 156 files changed, 1695 insertions(+), 1257 deletions(-) create mode 100644 packages/ui/src/components/base/Button/index.tsx create mode 100644 packages/ui/stories/components/base/Button.stories.tsx 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 */}