Commit Graph

5034 Commits

Author SHA1 Message Date
icarus
94ed39ab27 refactor(ocr): simplify provider fallback logic and remove unused methods
Remove unused provider management methods (add/remove) and simplify the fallback logic in useOcrProvider to always use Tesseract when provider is not found
2025-10-20 02:30:57 +08:00
icarus
ed8501961a refactor(ocr): extract image provider logic to separate hook
Move image provider related state and logic from useOcrProviders to new useOcrImageProvider hook
Update all components to use the new hook for better separation of concerns
2025-10-20 02:27:10 +08:00
icarus
78000816e5 refactor(useOcrProvider): rename useOcrProvider from tsx to ts 2025-10-20 02:21:29 +08:00
icarus
5900ff0c6e feat(ocr): add provider availability check and error message
Add validation to ensure OCR provider can process images before attempting OCR
2025-10-20 02:17:28 +08:00
icarus
b310ea1407 feat(ocr): add type guard for OcrProvider
Add isOcrProvider type guard function to validate unknown inputs against OcrProviderSchema
2025-10-20 02:11:29 +08:00
icarus
beb44eea61 refactor(ocr): move provider logo logic to component and consolidate hooks
Move OcrProviderLogo implementation from useOcrProviders hook to the component file
Extract common OCR provider logic into a separate useOcrProviders hook
Clean up and reorganize related imports and exports
2025-10-20 02:07:12 +08:00
icarus
7658b1e79f refactor(ocr): reorganize ocr hooks into dedicated directory
Move useOcr and useOcrProvider hooks to new ocr directory under hooks
Update all imports in settings components to reflect new paths
2025-10-20 02:01:56 +08:00
icarus
ea1aa6e5a8 refactor(ocr): remove unused langs config from ovocr provider
The langs configuration for ovocr provider is not currently configurable, so it's removed from both type definition and default config.
2025-10-20 01:58:03 +08:00
icarus
e823d97e31 feat(ocr): add provider config mappings and default preferences
Add OCR provider configuration mappings to PreferencesMappings.ts and define default preferences for OCR providers in preferenceSchemas.ts. This enables support for multiple OCR providers with their respective configurations.
2025-10-20 01:54:22 +08:00
icarus
515d3cd596 refactor(data): update PreferencesMappings type with PreferenceSchemas
Add type import for PreferenceSchemas and update REDUX_STORE_MAPPINGS type to use keyof PreferenceSchemas
Mark several mappings with TODO comments for future fixes
2025-10-20 01:53:49 +08:00
icarus
47366064ca refactor(ocr): move ocr config to shared and add utility function
Migrate ocr configuration from renderer to shared config and introduce getDefaultOcrProvider utility function to centralize default provider logic
2025-10-20 01:44:23 +08:00
icarus
61a71a0486 refactor(utils): reorganize utils files into module structure
Move defaultAppHeaders function from utils.ts to new net.ts module and create index.ts for exports
2025-10-20 01:40:01 +08:00
icarus
e640beb874 refactor(ocr): move ocr config to shared package for reuse
Centralize OCR configuration in shared package to avoid duplication and improve maintainability. This change affects multiple components that previously imported from renderer config.
2025-10-20 01:37:00 +08:00
icarus
9386a4d482 refactor(ocr): restructure ocr provider config handling
move provider configs from individual providers to a centralized config map
add migration for new ocr config structure
2025-10-20 01:26:37 +08:00
icarus
90e02e64b7 refactor(types): mark OcrProvider.config as deprecated
The config property is being phased out in favor of a more streamlined type structure. This change marks it as deprecated while maintaining backward compatibility.
2025-10-20 01:09:30 +08:00
icarus
08d8f70752 refactor(data): add type constraint to REDUX_STORE_MAPPINGS 2025-10-20 01:06:11 +08:00
icarus
695afb6f75 refactor(ocr): simplify ocr providers api by returning string array
Remove unused OcrProvider type and related endpoints. The GET endpoint now returns a simple array of provider IDs instead of full provider objects, as the detailed provider data will be handled separately.
2025-10-20 01:02:17 +08:00
icarus
471b1fae2d docs(IBaseService): add type parameter documentation to interface 2025-10-20 00:59:44 +08:00
icarus
9c740f82ad refactor(db): remove unused ocr provider schema table 2025-10-20 00:59:28 +08:00
icarus
ab7fed8907 docs(ocr): update provider schema comments with more details
Add more context about ID format for custom providers and clarify name usage for built-in providers
Explain JSON config validation requirements and mark timestamps as potentially unused
2025-10-20 00:48:40 +08:00
icarus
ec68886e4a refactor(ocr): convert OcrProvider type to zod schema
Use zod schema for better type safety and validation capabilities
2025-10-20 00:37:13 +08:00
icarus
a3bc279c74 feat(types): add OcrOvConfig to OcrProviderConfig union type 2025-10-20 00:36:04 +08:00
icarus
2e400d3f1c refactor(ocr): convert OcrProviderBaseConfig to zod schema
Use zod schema for type validation and inference to improve type safety
2025-10-20 00:35:26 +08:00
icarus
ed791a3bb3 refactor(ocr): replace manual type check with zod schema validation
Simplify type checking logic by using zod schema validation instead of manual type checks for OcrProviderApiConfig
2025-10-20 00:34:34 +08:00
icarus
2a8f819bee refactor(types): convert OcrModel interface to zod schema
Use zod schema for better type safety and validation capabilities
2025-10-20 00:34:08 +08:00
icarus
35280b4b8c refactor(ocr): replace manual record type with zod schema inference
Use zod's partialRecord and inference to define OcrProviderCapabilityRecord for better type safety and maintainability
2025-10-20 00:33:33 +08:00
icarus
b93ff89e9e refactor(types): add satisfies constraint to type assertions
Add satisfies constraint to BuiltinOcrProviderIds and OcrProviderCapabilities to ensure type safety and better intellisense
2025-10-20 00:31:31 +08:00
icarus
dedc591e1c refactor(ocr): replace manual capability check with zod schema
Use zod schema validation for OCR provider capabilities instead of manual object property check for better type safety and maintainability
2025-10-20 00:31:24 +08:00
icarus
5c049911ee refactor(ocr): replace manual type check with zod schema for provider ids
Use zod schema validation for BuiltinOcrProviderId type to improve type safety and maintainability
2025-10-20 00:30:08 +08:00
icarus
399f8cbd41 feat(db): add ocr provider schema with capabilities and config
Add new schema for OCR providers including fields for id, name, capabilities, and config. Capabilities and config are stored as JSON to accommodate various provider types and configurations.
2025-10-20 00:27:52 +08:00
icarus
c780552197 feat(ocr): add api schemas and handlers for ocr providers
Implement API schemas and handlers for OCR providers endpoints
Add TODO comments for future migration tasks
Fix endpoint path in OcrImageSettings component
2025-10-19 23:21:54 +08:00
icarus
d366ec5932 refactor(ocr-settings): simplify ocr settings by removing unused tab logic
Since only image OCR is currently supported, remove the tab component and related unused code while keeping the core functionality
2025-10-19 22:36:40 +08:00
icarus
d35d7029f7 refactor(ocr): simplify image provider state management
- Remove unnecessary state propagation between components
- Store image provider ID in preferences instead of redux
- Add null checks for provider existence
- Update tab navigation to use new ui components
2025-10-19 22:32:00 +08:00
icarus
2c78f5f906 feat(ui): add shadcn tabs component
Add new tabs component using @radix-ui/react-tabs as base implementation. Includes Tabs, TabsList, TabsTrigger and TabsContent subcomponents with styling utilities.
2025-10-19 22:28:37 +08:00
icarus
92638d138d refactor(ocr): rename OCR_ocr to OCR_Ocr for consistent naming 2025-10-19 19:11:37 +08:00
icarus
2dbf7c1c51 refactor(ocr): improve service initialization and registration
Move availability checks to service instantiation
Update registry to store service instances directly
Simplify registration logic by removing redundant bind calls
2025-10-19 19:00:13 +08:00
kangfenmao
b08228bdb5 refactor: update LaunchpadPage to use useSettings hook
- Replaced usePreference with useSettings in LaunchpadPage for improved state management.
- This change aligns with recent updates to enhance consistency across components.
2025-10-18 18:42:29 +08:00
kangfenmao
d2b6433609 feat: add Radix UI radio group component and update MCP settings UI
- Introduced a new RadioGroup component using Radix UI for better UI consistency.
- Updated MCPProviderSettings to utilize the new RadioGroup and adjusted button styles for improved UX.
- Added Radix UI radio group dependency to package.json and yarn.lock.
2025-10-18 18:31:00 +08:00
kangfenmao
3417acafe2 refactor: mcp servers settings 2025-10-18 18:07:52 +08:00
kangfenmao
f42afe28d7 refactor: update Chat, AgentItem, and LaunchpadPage components to use preference hooks
- Replaced useSettings with usePreference in AgentItem and LaunchpadPage for better state management.
- Adjusted Chat component's Main element to include width styling for improved layout consistency.
2025-10-18 18:07:43 +08:00
fullex
0da9252eb7 Merge branch 'main' of github.com:CherryHQ/cherry-studio into v2 2025-10-18 17:45:44 +08:00
Pleasure1234
b4810bb487
fix: improve api-server startup and error handling logic (#10794)
* fix: improve server startup and error handling logic

Refactored ApiServer to clean up failed server instances and ensure proper handling of server state. Updated loggerService import to use shared logger and improved error handling during server startup.

* Update server.ts
2025-10-18 14:15:08 +08:00
SuYao
dc0f9c5f08
feat: add Claude Haiku 4.5 model support and update related regex patterns (#10800)
* feat: add Claude Haiku 4.5 model support and update related regex patterns

* fix: update Claude model token limits for consistency
2025-10-18 14:10:50 +08:00
SuYao
595fd878a6
fix: handle AISDKError in chunk processing (#10801) 2025-10-18 14:10:00 +08:00
kangfenmao
9d45991181 chore: update release notes for v1.7.0-beta.2
- Added new features including session settings management, full-text search for notes, and integration with DiDi MCP server.
- Improved agent model selection and added support for Mistral AI and NewAPI providers.
- Enhanced UI/UX with navbar layout consistency and chat component responsiveness.
- Fixed various bugs related to assistant creation, streaming issues, and message layout.
2025-10-18 11:14:16 +08:00
Phantom
cf2f2fd707
fix: agent default model (#10774)
* refactor(AgentModal): simplify trigger prop structure and mark Agents as deprecated

- Replace trigger prop with children for simpler component usage
- Add deprecation notice to Agents component

* fix(AgentModal): set empty default model instead of 'claude-4-sonnet'

The default model should be empty to require explicit selection rather than defaulting to a specific model

* fix(AgentModal): wrap children in conditional check to prevent undefined errors

* refactor(agent-modal): simplify modal control by removing trigger props

Remove the trigger props pattern from AgentModal component and use explicit isOpen/onClose control. This makes the component's behavior more predictable and aligns with the usage pattern in the Agents page where modal state is managed externally.

Also remove unused ReactNode import and clean up related comments.

* refactor(UnifiedAddButton): replace useState with useDisclosure for agent modal

Use useDisclosure hook for better state management of agent modal
2025-10-18 04:07:44 +08:00
kangfenmao
d4b1db0407 fix: adjust Navbar and Chat components for better layout and responsiveness
- Updated Navbar styles to improve margin handling for macOS.
- Refactored Chat component to streamline layout and enhance responsiveness, including adjustments to main height calculations and navbar integration.
- Cleaned up commented code and improved the structure of the ChatNavbar for better clarity and maintainability.
- Enhanced styling in various components for consistent appearance and behavior across different screen sizes.
2025-10-18 00:12:38 +08:00
defi-failure
8470e252d6
feat: auto-start API server when agents exist (#10772)
* feat: auto-start API server when agents exist

* fix: only display not running alert when enabled
2025-10-17 20:53:08 +08:00
defi-failure
131444ac52
fix: agent supported model filter (#10788)
* Revert "fix: make anthropic model provided by cherryin visible to agent (#10695)"

This reverts commit 7b3b73d390.

* fix: agent supported model filter
2025-10-17 20:52:15 +08:00
defi-failure
ab3083f943
fix: fail to create assistant (#10796) 2025-10-17 20:48:40 +08:00