mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 03:10:08 +08:00
dcdd1bf852
93 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e268e69597
|
refactor(config): centralize home directory constant to shared config (#11158)
Some checks failed
Auto I18N Weekly / Auto I18N (push) Has been cancelled
Replace hardcoded '.cherrystudio' directory references with HOME_CHERRY_DIR constant |
||
|
|
dc06c103e0
|
chore[lint]: add import type lint (#11091)
chore: add import type lint |
||
|
|
352ecbc506
|
✨ feat: add plugin management system for Claude Agent (agents, commands, skills) (#10854)
* ✨ feat: add claude-code-templates via git submodule with build-time copy - Add git submodule for davila7/claude-code-templates - Create scripts/copy-templates.js to copy components at build time - Update package.json build script to include template copying - Add resources/data/components/ to .gitignore (generated files) Templates are now automatically synced from external repo to resources/data/components/ during build process, avoiding manual file copying. To update templates: git submodule update --remote --merge * fix: update target directory for copying Claude Code templates * ✨ feat: merge Anthropics skills into template sync * 📝 docs: add agent plugins management implementation spec Add comprehensive implementation plan for plugin management feature: - Security validation and transactional operations - Plugin browsing, installation, and management UI - IPC handlers and PluginService architecture - Metadata caching and database integration * ✨ feat: add plugin management backend infrastructure Backend implementation for Claude Code plugin management: - Add PluginService with security validation and caching - Create IPC handlers for plugin operations (list, install, uninstall) - Add markdown parser with safe YAML frontmatter parsing - Extend AgentConfiguration schema with installed_plugins field - Update preload bridge to expose plugin API to renderer - Add plugin types (PluginMetadata, PluginError, PluginResult) Features: - Transactional install/uninstall with rollback - Path traversal prevention and file validation - 5-minute plugin list caching for performance - SHA-256 content hashing for integrity checks - Duplicate plugin handling (auto-replace) Dependencies added: - gray-matter: Markdown frontmatter parsing - js-yaml: Safe YAML parsing with FAILSAFE_SCHEMA * ✨ feat: add plugin management UI and integration Complete frontend implementation for Claude Code plugin management: **React Hooks:** - useAvailablePlugins: Fetch and cache available plugins - useInstalledPlugins: List installed plugins with refresh - usePluginActions: Install/uninstall with loading states **UI Components (HeroUI):** - PluginCard: Display plugin with install/uninstall actions - CategoryFilter: Multi-select chip-based category filter - InstalledPluginsList: Table view with uninstall confirmation - PluginBrowser: Search, filter, pagination, responsive grid - PluginSettings: Main container with Available/Installed tabs **Integration:** - Added "Plugins" tab to AgentSettingsPopup - Full i18n support (English, Simplified Chinese, Traditional Chinese) - Toast notifications for success/error states - Loading skeletons and empty states **Features:** - Search plugins by name/description - Filter by category and type (agents/commands) - Pagination (12 items per page) - Install/uninstall with confirmation dialogs - Real-time plugin list updates - Responsive grid layout (1-3 columns) All code formatted with Biome and follows existing patterns. * 🐛 fix: add missing plugin i18n keys at root level Add plugin translation keys at root 'plugins.*' level to match component usage: - Search and filter UI strings - Pluralization support for result counts - Empty state messages - Action button labels - Confirmation dialog text Translations added for all three locales (en-US, zh-CN, zh-TW). * 🐛 fix: use getResourcePath() utility for plugin directory resolution Replace manual path calculation with getResourcePath() utility which correctly handles both development and production environments. This fixes the issue where plugins were not loading because __dirname was resolving to the wrong location. Fixes: - Plugins now load correctly in development mode - Path resolution consistent with other resource loading in the app - Removed unused 'app' import from electron * 🎨 fix: improve plugin UI scrolling and category filter layout Fixes two UI issues: 1. Enable scrolling for plugin list: - Changed overflow-hidden to overflow-y-auto on tab containers - Plugin grid now scrollable when content exceeds viewport 2. Make category filter more compact: - Added max-h-24 (96px) height limit to category chip container - Enabled vertical scrolling for category chips - Prevents category filter from taking too much vertical space UI improvements enhance usability when browsing large plugin collections. * 🎨 fix: ensure both agent and command badges have visible backgrounds Changed Chip variant from 'flat' to 'solid' for plugin type badges. This ensures both agent (primary) and command (secondary) badges display with consistent, visible background colors instead of command badges appearing as text-only. * ✨ feat: add plugin detail modal for viewing full plugin information Add modal to display complete plugin details when clicking on a card: Features: - Click any plugin card to view full details in a modal - Shows complete description (not truncated) - Displays all metadata: version, author, tools, allowed_tools, tags - Shows file info: filename, size, source path, install date - Install/uninstall actions available in modal - Hover effect on cards to indicate clickability - Button clicks don't trigger card click (event.stopPropagation) Components: - New PluginDetailModal component with scrollable content - Updated PluginCard to be clickable (isPressable) - Updated PluginBrowser to manage modal state UI improvements provide better plugin exploration and decision-making. * 🐛 fix: render plugin detail modal above agent settings modal Use React portal to render PluginDetailModal directly to document.body, ensuring it appears above the agent settings modal instead of being blocked by it. Changes: - Import createPortal from react-dom - Wrap modal content in createPortal(modalContent, document.body) - Add z-[9999] to modal wrapper for proper layering Fixes modal visibility issue where plugin details were hidden behind the parent agent settings modal. * ✨ feat: add plugin content viewing and editing in detail modal - Added IPC channels for reading and writing plugin content - Implemented readContent() and writeContent() methods in PluginService - Added IPC handlers for content operations with proper error handling - Exposed plugin content API through preload bridge - Updated PluginDetailModal to fetch and display markdown content - Added edit mode with textarea for modifying plugin content - Implemented save/cancel functionality with optimistic UI updates - Added agentId prop to component chain for write operations - Updated AgentConfigurationSchema to include all plugin metadata fields - Moved plugin types to shared @types for cross-process access - Added validation and security checks for content read/write - Updated content hash in DB after successful edits * 🐛 fix: change event handler from onPress to onClick for uninstall and install buttons * 📝 docs: update AI Assistant Guide to clarify proposal and commit guidelines * 📝 docs: add skills support extension spec for agent plugins management * ✨ feat: add secure file operation utilities for skills plugin system - Implement copyDirectoryRecursive() with security protections - Implement deleteDirectoryRecursive() with path validation - Implement getDirectorySize() for folder size calculation - Add path traversal protection using isPathInside() - Handle symlinks securely to prevent attacks - Add recursion depth limits to prevent stack overflow - Preserve file permissions during copy - Handle race conditions and missing files gracefully - Skip special files (pipes, sockets, devices) Security features: - Path validation against allowedBasePath boundary - Symlink detection and skip to prevent circular loops - Input validation for null/empty/relative paths - Comprehensive error handling and logging Updated spec status to "In Progress" and added implementation progress checklist. * ✨ feat: add skill type support and skill metadata parsing Type System Updates (plugin.ts): - Add PluginType export for 'agent' | 'command' | 'skill' - Update PluginMetadataSchema to include 'skill' in type enum - Update InstalledPluginSchema to support skill type - Update all option interfaces to support skill type - Add skills array to ListAvailablePluginsResult - Document filename semantics differences between types Markdown Parser Updates (markdownParser.ts): - Implement parseSkillMetadata() function for SKILL.md parsing - Add comprehensive input validation (absolute path check) - Add robust error handling with specific PluginErrors - Add try-catch around file operations and YAML parsing - Add type validation for frontmatter data fields - Add proper logging using loggerService - Handle getDirectorySize() failures gracefully - Document hash scope decision (SKILL.md only vs entire folder) - Use FAILSAFE_SCHEMA for safe YAML parsing Security improvements: - Path validation to ensure absolute paths - Differentiate ENOENT from permission errors - Type validation for all frontmatter fields - Safe YAML parsing to prevent deserialization attacks Updated spec progress tracking. * ✨ feat: implement complete skill support in PluginService Core Infrastructure: - Add imports for parseSkillMetadata and file operation utilities - Add PluginType to imports for type-safe handling Skill-Specific Methods: - sanitizeFolderName() - validates folder names (no dots allowed) - scanSkillDirectory() - scans skills/ for skill folders - installSkill() - copies folders with transaction/rollback - uninstallSkill() - removes folders with transaction/rollback Updated Methods for Skills Support: - listAvailable() - now scans and returns skills array - install() - branches on type to handle skills vs files - uninstall() - branches on type for skill/file handling - ensureClaudeDirectory() - handles 'skills' subdirectory - listInstalled() - validates skill folders on filesystem - writeContent() - updated signature to accept PluginType Key Implementation Details: - Skills use folder names WITHOUT extensions - Agents/commands use filenames WITH .md extension - Different sanitization rules for folders vs files - Transaction pattern with rollback for all operations - Comprehensive logging and error handling - Maintains backward compatibility with existing code Updated spec progress tracking. * ✨ feat: add skill support to frontend hooks and UI components Frontend Hooks (usePlugins.ts): - Add skills state to useAvailablePlugins hook - Return skills array in hook result - Update install() to accept 'skill' type - Update uninstall() to accept 'skill' type UI Components: - PluginCard: Add 'skill' type badge with success color - PluginBrowser: Add skills prop and include in plugin list - PluginBrowser: Update type definitions to include 'skill' - PluginBrowser: Include skills in tab filtering Complete frontend integration for skills plugin type. Updated spec progress tracking. * ♻️ refactor: remove unused variable in installSkill method * 📝 docs: mark implementation as complete with summary Implementation Status: COMPLETE (11/12 tasks) Completed: - ✅ File operation utilities with security protections - ✅ Skill metadata parsing with validation - ✅ Plugin type system updated to include 'skill' - ✅ PluginService skill methods (scan, install, uninstall) - ✅ PluginService updated for skill support - ✅ IPC handlers (no changes needed - already generic) - ✅ Frontend hooks updated for skills - ✅ UI components updated (PluginCard, PluginBrowser) - ✅ Build check passed with lint fixes Deferred (non-blocking): - ⏸️ Session integration - requires further investigation into session handler location and implementation The core skills plugin system is fully implemented and functional. Skills can be browsed, installed, and uninstalled through the UI. All security requirements met with path validation and transaction rollback. Code passes lint checks and follows project patterns. * 🐛 fix: pass skills prop to PluginBrowser component Fixed "skills is not iterable" error by: - Destructuring skills from useAvailablePlugins hook - Updating type annotations to include 'skill' type - Passing skills prop to PluginBrowser component This completes the missing UI wiring for skills support. * ✨ feat: add Skills tab to plugin browser Added missing Skills tab to PluginBrowser component: - Added Skills tab to type tabs - Added translations for skills in all locales (en-us, zh-cn, zh-tw) - English: "Skills" - Simplified Chinese: "技能" - Traditional Chinese: "技能" This completes the UI integration for the skills plugin type. * ✨ feat: add 'skill' type to AgentConfiguration and GetAgentSessionResponse schemas * ⬆️ chore: upgrade @anthropic-ai/claude-agent-sdk to v0.1.25 with patch - Updated from v0.1.1 to v0.1.25 - Applied fork/IPC patch to new version - Removed old patch file - All tests passing * 🐛 fix: resolve linting and TypeScript type errors in build check - Add external/** and resources/data/claude-code-plugins/** to lint ignore patterns to exclude git submodules and plugin templates from linting - Fix TypeScript error handling in IPC handlers by properly typing caught errors - Fix AgentConfiguration type mismatches by providing default values for permission_mode and max_turns when spreading configuration - Replace control character regex with String.fromCharCode() to avoid ESLint no-control-regex rule in sanitization functions - Fix markdownParser yaml.load return type by adding type assertion - Add getPluginErrorMessage helper to properly extract error messages from PluginError discriminated union types Main process TypeScript errors: Fixed (0 errors) Linting errors: Fixed (0 errors from 4397) Remaining: 4 renderer TypeScript errors in settings components * ♻️ refactor: improve plugin error handling and reorganize i18n structure * ⬆️ chore: update @anthropic-ai/claude-agent-sdk to include patch and additional dependencies * 🗑️ chore: remove unused Claude code plugins and related configurations - Deleted `.gitmodules` and associated submodules for `claude-code-templates` and `anthropics-skills`. - Updated `.gitignore`, `.oxlintrc.json`, and `eslint.config.mjs` to exclude `claude-code-plugins`. - Modified `package.json` to remove the build script dependency on copying templates. - Adjusted `PluginService.ts` to handle plugin paths without relying on removed resources. * format code * delete * delete * fix(i18n): Auto update translations for PR #10854 * ✨ feat: enhance PluginService and markdownParser with recursive skill directory search - Added `findAllSkillDirectories` function to recursively locate directories containing `SKILL.md`. - Updated `scanSkillDirectory` method in `PluginService` to utilize the new recursive search. - Modified `PluginDetailModal` to append `/SKILL.md` to the source path for skill plugins. * fix(i18n): Auto update translations for PR #10854 * remove specs * update claude code plugins files --------- Co-authored-by: suyao <sy20010504@gmail.com> Co-authored-by: beyondkmp <beyondkmp@gmail.com> Co-authored-by: GitHub Action <action@github.com> |
||
|
|
4063c20505
|
feat: support germen (#10879)
* feat: support germen * format code * translate * update trans * format * add de --------- Co-authored-by: Payne Fu <payne@Paynes-MBP.rcoffice.ringcentral.com> |
||
|
|
cfdeb124b9 | Merge branch 'main' of github.com:CherryHQ/cherry-studio into feat/agents-new | ||
|
|
1df6e8c732
|
refactor(notes): improve notes management with local state and file handling (#10395)
* refactor(notes): improve notes management with local state and file handling - Replace UUID-based IDs with SHA1 hash of file paths for better consistency - Remove database storage for notes tree, use local state management instead - Add localStorage persistence for starred and expanded states - Improve cross-platform path normalization (replace backslashes with forward slashes) - Refactor tree operations to use optimized in-memory operations - Enhance file watcher integration for better sync performance - Simplify notes service with direct file system operations - Remove database dependencies from notes tree management 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "Merge remote-tracking branch 'origin/main' into refactor/note" This reverts commit |
||
|
|
781b01ee17 | feat: refactor shell environment handling and move to utils | ||
|
|
c37af25525 | Merge remote-tracking branch 'origin/main' into feat/agents-new | ||
|
|
58dbb514e0 |
feat: Implement Claude Code service with streaming support and tool integration
- Added `aisdk-stream-protocel.md` to document text and data stream protocols. - Created `ClaudeCodeService` for invoking and streaming responses from the Claude Code CLI. - Introduced built-in tools for Claude Code, including Bash, Edit, and WebFetch. - Developed transformation functions to convert Claude Code messages to AI SDK format. - Enhanced OCR utility with delayed loading of the Sharp module. - Updated agent types and session message structures to accommodate new features. - Modified API tests to reflect changes in session creation and message streaming. - Upgraded `uuid` package to version 13.0.0 for improved UUID generation. |
||
|
|
4d1d3e316f
|
feat: use oxlint to speed up lint (#10168)
* build: add eslint-plugin-oxlint dependency Add new eslint plugin to enhance linting capabilities with oxlint rules * build(eslint): add oxlint plugin to eslint config Add oxlint plugin as recommended in the documentation to enhance linting capabilities * build: add oxlint v1.15.0 as a dependency * build: add oxlint to linting commands Add oxlint alongside eslint in test:lint and lint scripts for enhanced static analysis * build: add oxlint configuration file Configure oxlint with a comprehensive set of rules for JavaScript/TypeScript code quality checks * chore: update oxlint configuration and related settings - Add oxc to editor code actions on save - Update oxlint configs to use eslint, typescript, and unicorn presets - Extend ignore patterns in oxlint configuration - Simplify oxlint command in package.json scripts - Add oxlint-tsgolint dependency * fix: lint warning * chore: update oxlintrc from eslint.recommended * refactor(lint): update eslint and oxlint configurations - Add src/preload to eslint ignore patterns - Update oxlint env to es2022 and add environment overrides - Adjust several lint rule severities and configurations * fix: lint error * fix(file): replace eslint-disable with oxlint-disable in sanitizeFilename The linter was changed from ESLint to oxlint, so the directive needs to be updated accordingly. * fix: enforce stricter linting by failing on warnings in test:lint script * feat: add recommended ts-eslint rules into exlint * docs: remove outdated comment in oxlint config file * style: disable typescript/no-require-imports rule in oxlint config * docs(utils): fix comment typo from NODE to NOTE * fix(MessageErrorBoundary): correct error description display condition The error description was incorrectly showing in production and hiding in development. Fix the logic to show detailed errors only in development mode * chore: add oxc-vscode extension to recommended list * ci(workflows): reorder format check step in pr-ci.yml * chore: update yarn.lock |
||
|
|
5f999d3c84
|
fix: improve notes sidebar functionality and i18n text updates (#10112)
* fix: improve notes sidebar functionality and i18n text updates - Update breadcrumb navigation with clickable folder navigation and proper overflow handling - Add file selection dialog for markdown imports alongside drag-and-drop - Improve button order in sidebar header (new note first, then new folder) - Update i18n text: "markdown" → ".md" for clarity and "star" → "favorite note" for consistency - Fix file upload logic for better parent node handling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: code review --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
b647017c43
|
ci: auto i18n (#9889)
* refactor(i18n): 将日语和俄语迁移到translate目录 * refactor(i18n): 将日语和俄语翻译文件移动到机器翻译目录 * docs(i18n): 更新翻译目录的README说明 * ci: 添加自动国际化翻译的 GitHub Actions 工作流 * Potential fix for code scanning alert no. 48: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * fix(i18n): 修复国际化文件末尾缺少换行符的问题 * ci(workflow): 修改自动i18n工作流触发条件为pull_request 将触发条件从push到main分支改为在pull_request的opened、synchronize和reopened事件时触发 * ci(workflow): 更新自动i18n工作流的权限和推送配置 添加pull-requests写入权限以支持PR操作 将推送动作更新为github-push-action并改为推送至PR分支 * ci(github): 更新自动i18n工作流以支持PR分支 修改自动i18n工作流,在检出步骤中添加ref参数以支持PR分支 更新提交消息格式以包含PR编号 * ci(workflows): 更新自动i18n工作流以使用yarn 将依赖管理从npm切换到yarn,并添加corepack启用步骤 * ci(workflow): 优化自动翻译工作流的依赖安装步骤 修改依赖安装命令,使用更精确的参数避免不必要的锁定文件生成,并确保安装开发依赖 * ci(workflow): 更新i18n翻译脚本的执行方式 * ci(workflow): 移除不必要的生产环境标志以简化依赖安装 移除 yarn add 命令中的 --production=false 标志,因为在此上下文中不需要区分生产环境依赖 * ci(workflow): 更新依赖安装命令以跳过构建步骤 * fix(i18n): Auto update translations for PR #9889 * ci(workflow): 优化依赖安装步骤以减少构建时间 将直接使用yarn安装依赖改为在临时目录中通过npm安装,避免全局安装影响 * ci(i18n): 在自动翻译工作流中忽略 package.json 和 yarn.lock 的更改 重置 package.json 和 yarn.lock 的更改,避免在自动更新翻译时提交这些文件 * ci(workflow): 简化自动i18n工作流的依赖安装步骤 移除不必要的corepack启用步骤,直接使用npm安装所需依赖 * Revert "fix(i18n): Auto update translations for PR #9889" This reverts commit |
||
|
|
b6d10656f9
|
feat: refactor Knowledge Base (#8384)
Co-authored-by: icarus <eurfelux@gmail.com> Co-authored-by: eeee0717 <chentao020717@outlook.com> |
||
|
|
5ce7261678
|
refactor: Improve linux build for system-ocr (#9775)
* refactor(ocr): streamline OCR service registration and improve image preprocessing - Simplified the registration of the system OCR service by removing the conditional check for Linux. - Updated SystemOcrService to directly import necessary modules, enhancing clarity. - Refactored image preprocessing to use a static import of the 'sharp' library for better performance. * add patch for system-ocr * add patch * add patch again * add patch * delete setting * delete i18n * lint error * add isLinux * Revert "delete i18n" This reverts commit |
||
|
|
80f49aecd7 |
feat(ocr): enhance OCR service for Linux compatibility and update image processing
- Added conditional registration of the system OCR service for non-Linux platforms. - Updated SystemOcrService to handle Linux by returning an empty text response. - Modified image preprocessing to dynamically require the 'sharp' library, improving compatibility and performance. - Included additional files in the electron-builder configuration for packaging. |
||
|
|
ce4cad67a6
|
Fix/newNode (#9727)
* feat: enhance note saving functionality with immediate cache invalidation * fix: improve file name handling and localization updates * feat: implement multi-level note sorting and enhance state management - Introduced sorting options for notes by name, update time, and creation time, allowing users to sort notes in ascending and descending order. - Updated NotesPage and NotesSidebar components to handle sorting functionality. - Enhanced Redux store to manage the sorting type, improving state management for note organization. - Refactored related services to support recursive sorting logic, ensuring a consistent user experience. * feat(i18n): add new file upload messages for multiple languages * fix(styles): adjust padding in richtext.scss to accommodate scrollbar * style(NotesSidebar): add border-top-left-radius to enhance sidebar aesthetics * feat(RichEditPopup): add isFullWidth prop to enhance popup layout * feat(RichEditPopup): disable keyboard interaction for improved user experience * feat(NotesPage): integrate sorting after node deletion and movement - Added sorting functionality to be triggered after deleting or moving nodes, ensuring notes are organized immediately. - Updated dependencies in useCallback hooks to include sortType for consistent behavior across operations. * feat(NotesService): update initWorkSpace and sortAllLevels to accept sortType - Modified initWorkSpace to include sortType for improved note organization during initialization. - Enhanced sortAllLevels to optionally accept a tree parameter, allowing for more flexible sorting operations. - Updated NotesPage to utilize the new parameters, ensuring consistent sorting behavior across various actions. * feat(NotesSidebar): implement in-place editing for note renaming - Introduced a new hook, useInPlaceEdit, to manage in-place editing of note names, enhancing user experience during renaming. - Updated the NotesSidebar component to utilize this hook, streamlining the editing process and improving state management. - Removed redundant state variables related to editing, simplifying the component's logic. * refactor(NotesPage): remove commented code for clarity - Removed a comment regarding folder selection behavior to streamline the code and improve readability. - This change does not affect functionality but enhances the overall code quality. * feat(NotesSettings): update initWorkSpace to include default sort type - Modified initWorkSpace calls in NotesSettings to accept a default sort type of 'sort_a2z', ensuring consistent note organization during path updates and resets. - This change enhances the initialization process by applying a predefined sorting method. |
||
|
|
dfb3322b28
|
feat: add notes module (#8871)
* feat: integrate rich text editing
- Replaced the TextEditPopup with RichEditPopup for adding and editing notes, enhancing the editing experience with rich text capabilities.
- Updated note previews to display HTML content appropriately, improving usability and visual representation.
- Added a styled component for note previews to enhance user interaction.
* feat(RichEditor): enhance rich text editing capabilities
- Added new command system for rich text editing, allowing users to execute commands like headings, lists, and formatting.
- Integrated drag handle functionality for better content manipulation within the editor.
- Updated toolbar to include additional formatting options such as strikethrough and code blocks.
- Improved markdown and HTML content handling, enabling seamless conversion and previewing.
- Introduced new utility functions for markdown conversion and sanitization.
- Added tests for command list popover and rich editor functionalities to ensure reliability.
* refactor(RichEditor): remove debug log from command suggestion
* feat(RichEditor): add link and unlink functionality
- Introduced link and unlink commands in the RichEditor toolbar, enhancing text formatting capabilities.
- Updated placeholder text for the RichEditor to provide clearer user guidance.
- Refactored styles and removed unused code to streamline the RichEditor component.
- Added internationalization support for new toolbar items and placeholder text in both English and Chinese.
* wip: custom codeblock
* feat: add new dependencies for markdown processing
- Introduced `he` for HTML entity decoding and `striptags` for stripping HTML tags in markdown conversion.
- Updated `package.json` and `yarn.lock` to include new type definitions and library versions.
* feat(RichEditor): enhance image and math input capabilities
- Added ImageUploader component for embedding images with URL support and drag-and-drop functionality.
- Introduced MathInputDialog for entering LaTeX formulas, allowing real-time updates and integration with the editor.
- Enhanced RichEditor toolbar with new commands for image and math insertion.
- Updated styles for better user experience and accessibility.
- Added internationalization support for new features in multiple languages.
* refactor(CodeBlockView): change export to local variable
- Changed the export of CodeHeader to a local variable within CodeBlockView.
- Removed unused export from code-block-shiki index file.
* feat(RichEditor): enhance command management and toolbar functionality
- Added support for disabling specific commands in the RichEditPopup.
- Implemented dynamic command registration and management in the RichEditor, allowing for initial commands to be registered on mount.
- Updated toolbar to dynamically generate items based on command groups, improving organization and accessibility.
- Introduced new command definitions for text formatting, including bold, italic, underline, and strikethrough, with toolbar visibility options.
- Enhanced command handling capabilities, including the ability to unregister commands and set their availability based on editor context.
* refactor(RichEditPopup): remove translation functionality and related components
- Eliminated translation handling logic, including the translate button and associated state management.
- Cleaned up imports and unused variables to streamline the RichEditPopup component.
- Simplified the content change handling by focusing solely on rich content management.
* feat(ImageUploader): enhance image upload functionality and styling
- Added custom image upload button with improved styling and theme support.
- Refactored image display logic to use a more flexible layout.
- Updated file acceptance criteria to restrict uploads to PNG and JPEG formats.
- Simplified the upload process by preventing default behavior and customizing request handling.
- Improved overall component structure and styling for better user experience.
* feat(AssistantPromptSettings): implement throttled update functionality and enhance UI
- Introduced throttling for the update function to improve performance and reduce unnecessary updates.
- Added a save button to the UI for manual saving of changes, enhancing user experience.
- Refactored the component to streamline the handling of emoji selection and markdown changes.
- Updated layout with Flex component for better alignment of buttons in the settings interface.
* feat(RichEditor): integrate internationalization for placeholder text
- Updated the placeholder property to utilize the i18next translation function, enhancing support for multiple languages.
- Improved user experience by providing localized placeholder text in the RichEditor component.
* fix(styles): update list styles for ordered and unordered lists in richtext.scss
- Removed default list style for ordered lists and added decimal style.
- Added disc style for unordered lists to enhance visual consistency.
* fix(styles): improve table cell background handling in richtext.scss
- Added !important to header background color to ensure consistency.
- Set table cell backgrounds to transparent to prevent inheritance issues during drag operations.
- Updated ProseMirror widget styles to maintain transparency for table cells.
- Enhanced overall table styling to improve user experience.
* fix(styles): update padding and overflow handling in RichEditor
- Increased padding in the tiptap class for improved spacing.
- Modified overflow-x property in EditorContent to allow horizontal scrolling, preventing the drag handle from being cut off.
- Ensured proper positioning and visibility of the drag handle with updated styles.
- Adjusted ProseMirror editor content to maintain drag handle positioning.
* refactor(CodeBlockNodeView, shikijsPlugin): improve language handling for code blocks
- Updated language options to ensure 'text' is always available.
- Introduced a set of languages to skip syntax highlighting, enhancing performance and user experience.
- Simplified logic for checking loaded languages, avoiding unnecessary fallbacks for unsupported languages.
* fix(RichEditor): improve link handling and selection behavior
- Enhanced link insertion logic to ensure the entire paragraph is selected when creating a link.
- Added error handling to toggle link state if selection fails.
- Cleaned up code by moving paragraph text retrieval to the appropriate location for better readability.
* fix(styles): update inline code background and text colors in color.scss
- Changed inline code background color to a solid value for better visibility.
- Updated inline code text color to use RGB format for consistency.
* refactor(RichEditor): simplify editable state management and improve UI interactions
- Removed the disabled prop from RichEditor, simplifying the editable state logic.
- Updated the useRichEditor hook to directly manage the editable state based on the editable prop.
- Enhanced the AssistantPromptSettings component by streamlining the RichEditor rendering logic and improving the save button functionality.
* chore(tests): move useRichEditor test suite
* refactor(RichEditor): enhance command handling and UI responsiveness
- Removed the 'unlink' command from the command list and toolbar for a cleaner interface.
- Improved command filtering logic by removing the maxResults limit.
- Updated command positioning to use fixed strategy with enhanced middleware for better responsiveness.
- Integrated a dynamic virtual list for command suggestions, improving performance and user experience.
- Added internationalization support for 'undo' and 'redo' commands in multiple languages.
* fix(styles): adjust strong tag styling in richtext.scss
- Updated the strong tag styling to apply font-weight to all child elements, ensuring consistent text formatting within rich text content.
* fix(RichEditor): prevent codeBlock nodes from being skipped during drag operations
- Updated the placeholder extension to check for drag operations, ensuring that codeBlock nodes are not skipped when dragging is in progress. This improves the user experience by maintaining expected behavior during content manipulation.
* feat(markdown): integrate turndown-plugin-gfm for enhanced markdown support
- Added turndown-plugin-gfm to enable support for tables and additional markdown features.
- Updated the markdown converter to include new rules for underlining and table elements.
- Enhanced HTML sanitization to allow table-related attributes, improving markdown conversion accuracy.
* feat(markdown): add task list support and enhance markdown conversion
- Integrated @rxliuli/markdown-it-task-lists for task list functionality in markdown.
- Updated markdown converter to handle task list syntax, converting it to appropriate HTML structure.
- Enhanced styles for task lists in richtext.scss to improve visual representation.
- Modified useRichEditor to include task list extensions, ensuring proper functionality within the editor.
* fix(styles): update table header styling in richtext.scss
- Modified table header styling to apply background color and font weight to all child elements, ensuring consistent formatting within tables.
* fix(styles): enhance strong tag styling in richtext.scss
- Added styling for the strong tag to ensure consistent font-weight application across all child elements, improving text formatting in rich text content.
* refactor(markdown): remove @rxliuli/markdown-it-task-lists and implement custom task list plugin
- Removed dependency on @rxliuli/markdown-it-task-lists and integrated a custom task list plugin for markdown-it.
- Enhanced markdown conversion to support task lists with improved HTML structure and sanitization.
- Updated tests to validate task list functionality and ensure proper conversion between markdown and HTML.
* refactor(tests): remove redundant task item label test from markdownConverter tests
- Deleted the test case that checked for the absence of label wrapping around task items, as it is no longer relevant with the updated markdown conversion logic.
- Ensured that existing tests continue to validate the preservation of labels in sanitized HTML for task lists.
* feat(extension-table-plus): add new table extension for Tiptap
- Introduced the @cherrystudio/extension-table-plus package, providing a comprehensive table extension for Tiptap.
- Implemented core functionalities including table, table cell, header, and row management.
- Enhanced the editor with a TableKit for easier table manipulation and integration.
- Updated styles for improved table presentation and interaction within the rich text editor.
- Modified useRichEditor to utilize the new TableKit, ensuring seamless integration with existing features.
* chore(package): remove @tiptap/extension-table dependency
- Deleted the @tiptap/extension-table from package.json and yarn.lock as it is no longer needed.
- Updated dependency management to streamline the project and reduce unnecessary packages.
* chore(package): update package.json for @cherrystudio/extension-table-plus
- Changed the description to reflect the forked nature of the extension.
- Downgraded the version to 3.0.10 to align with the new release strategy.
- Updated the homepage URL to point to the new project site.
- Modified the repository URL to reflect the new GitHub location and directory structure.
* chore(package): update @cherrystudio/extension-table-plus version in package.json
- Changed the version of @cherrystudio/extension-table-plus from workspace:* to ^3.0.10 to align with the new release strategy.
* chore(yarn): update @cherrystudio/extension-table-plus version in yarn.lock
- Changed the version of @cherrystudio/extension-table-plus from workspace:* to npm:^3.0.10 to align with the updated package management strategy.
* chore(useRichEditor): clean up comments and improve code clarity
* chore(package): update @cherrystudio/extension-table-plus version to workspace:^ in package.json and yarn.lock
- Changed the version of @cherrystudio/extension-table-plus from ^3.0.10 to workspace:^ to align with the updated package management strategy.
* chore(tsconfig): add path mapping for @cherrystudio/extension-table-plus in tsconfig.web.json
- Updated tsconfig.web.json to include path mapping for the @cherrystudio/extension-table-plus package, enhancing module resolution for TypeScript.
* chore(dependencies): update ESLint and Prettier configurations
- Added ESLint and Prettier as development dependencies in package.json and yarn.lock.
- Updated lint script to format code and fix issues automatically.
- Enhanced type safety by specifying Node type in TableKit extension.
* fix(deleteTableWhenAllCellsSelected): ensure function returns true after cell count check
- Updated the deleteTableWhenAllCellsSelected function to return true after counting selected table cells, improving the logic for table deletion when all cells are selected.
* chore(electron.config): add path mapping for @cherrystudio/extension-table-plus
- Updated electron.vite.config.ts to include path mapping for the @cherrystudio/extension-table-plus package, improving module resolution for Electron builds.
* refactor(table-cell): rename allowNestedTables to allowNestedNodes and update content type
- Changed the TableCell option from allowNestedTables to allowNestedNodes for clarity on nested node support.
- Updated content type in TableCell and TableHeader from 'block+' to 'paragraph+' to better reflect intended structure.
- Adjusted logic in Table to disallow inserting tables inside nested nodes based on the new option.
* fix: math block bug
* feat(richEditor): add inline and block math commands with updated toolbar support
- Introduced 'inlineMath' and 'blockMath' commands for inserting inline and block mathematical formulas.
- Updated the toolbar to include new commands and their respective tooltips.
- Enhanced the math input dialog to handle both inline and block math types.
- Adjusted markdown conversion to support new math syntax for inline and block math.
- Updated localization files to include translations for new commands.
* feat(table-cell): add cell selection styling and decorations
- Implemented a new plugin for cell selection styling in table cells.
- Added logic to create decorations for selected cells, enhancing visual feedback.
- Updated CSS to style selected cells with borders based on selection edges.
* feat(table): enhance table action handling with new row/column action triggers
- Added optional callbacks for row and column action triggers in TableOptions.
- Implemented row and column action buttons in TableView, allowing for dynamic actions on selected rows and columns.
- Introduced utility functions for calculating cell selection bounds and element border widths.
- Updated styles to accommodate new action buttons and ensure proper positioning.
- Integrated action menu in RichEditor for managing table actions, enhancing user interaction.
* feat(table): enhance table action menu and localization support
- Updated TableOptions to include optional position parameters for row and column action callbacks.
- Refactored TableView to utilize new action callbacks for row and column actions, improving interaction.
- Integrated ActionMenu in RichEditor for better management of table actions, replacing the previous event-based approach.
- Added localization strings for new table action commands in multiple languages, enhancing user accessibility.
* feat(richEditor): update table action icons for improved clarity
- Replaced icons for row insertion actions in the table action menu, using ArrowUp for inserting a row before and ArrowDown for inserting a row after.
- Enhanced visual representation of table actions to better align with user expectations.
* chore(package): bump version to 3.0.11 for @cherrystudio/extension-table-plus
* feat(richtext): enhance table cell styling and resize handle functionality
- Added styles for text overflow handling in table cells to improve readability.
- Introduced a column resize handle with specific positioning and visibility rules.
- Updated the RichEditor to support resizable tables, enhancing user interaction with table elements.
* fix: auto scroll to incomplete command list
* fix: cli
* feat: add MdiDragHandle icon and update RichEditor to use it
- Introduced a new MdiDragHandle SVG icon in the SVGIcon component.
- Replaced the MdiLightbulbOn icon with MdiDragHandle in the RichEditor component for improved functionality.
* feat(RichEditor): add onPaste callback for handling paste events
- Introduced an onPaste callback in both RichEditorProps and UseRichEditorOptions interfaces to allow custom handling of paste events.
- Implemented paste event handling in the useRichEditor hook, converting pasted text to HTML and dispatching it to the editor.
* feat(markdownConverter): extend allowed attributes for HTML sanitization
- Added 'width', 'height', and 'loading' to the list of allowed attributes in the sanitizeHtml function to enhance HTML sanitization capabilities.
* refactor(richtext): update paragraph and heading styles for improved layout
- Removed default margins from paragraphs and adjusted margins for headings to enhance spacing.
- Updated font sizes for headings to improve hierarchy and readability.
- Enhanced blockquote styling with a new border color and italic font style.
- Added specific margin rules for the first and last paragraphs to ensure consistent spacing.
* style(richtext): adjust margins for headings and paragraphs
- Updated heading margins from 'em' to 'rem' for consistency.
- Modified paragraph margins to improve spacing and readability.
- Removed redundant margin rules for first and last paragraphs.
* feat(AssistantPromptSettings): implement draft prompt handling for improved token estimation
- Introduced a draftPrompt ref to manage prompt changes before committing.
- Updated token count estimation to use the draft prompt instead of the current prompt.
- Enhanced the onUpdate function to commit the draft prompt when saving changes.
- Modified handleMarkdownChange to update the draft prompt directly.
* refactor(RichEditor): optimize command handling with useCallback
- Refactored the handleCommand function to use useCallback for improved performance.
- Cleaned up the command handling logic for better readability and maintainability.
- Ensured consistent behavior for link handling and other formatting commands.
* style(richtext): reorganize list styles and enhance task item appearance
- Moved list styles for unordered and ordered lists to a new section for better organization.
- Ensured consistent padding and margin for list items.
- Updated task item styles to improve visual clarity, including checked checkbox appearance.
- Adjusted paragraph margins within list items for improved readability.
* feat(richtext): add table of contents support in RichEditor
- Introduced a new table of contents extension to enhance document navigation.
- Updated RichEditor component to conditionally render the table of contents based on the new `showTableOfContents` prop.
- Integrated table of contents functionality within the useRichEditor hook, allowing for dynamic updates based on document structure.
- Styled the table of contents for improved visibility and usability.
- Updated package.json and yarn.lock to include the new @tiptap/extension-table-of-contents dependency.
* feat(richtext): enhance RichEditor with content search functionality
- Added `enableContentSearch` prop to RichEditor for in-editor content search.
- Integrated ContentSearch component, allowing users to search within the editor.
- Introduced `showUserToggle` and `positionMode` props for ContentSearch customization.
- Updated styling for Container and SearchBarContainer to support new positioning options.
- Adjusted RichEditor settings in AssistantPromptSettings to reflect new content search feature.
* fix: renderer
* fix: styles
* fix: code styles
* fix: table save
* styles: a link
* feat: link editor
* perf: don't show when editable equals to false
* chore: remove some log
* feat: link remove
* style: reduce space for nested list
* fix/link
* feat: add PlusButton to RichEditor and adjust padding in richtext styles
* style: increase font size in richtext styles
* feat: add task list functionality to RichEditor with toolbar integration and localization support
* feat: enhance math dialog positioning and toolbar integration in RichEditor
* feat: enhance Table of Contents functionality with dynamic item display and scroll behavior
* feat: enhance markdown rendering by properly escaping HTML entities in code blocks and inline code
* feat: update link handling in RichEditor to use enhancedLink functionality and auto-update href based on text content
* feat: improve link hover functionality in RichEditor by calculating position based on full link range
* refactor: remove unused MdiDragHandle component from SVGIcon
* fix: update markdown conversion tests to ensure proper HTML output for line breaks and code blocks
* feat: enhance RichEditor functionality by adding code block handling for paste events and keyboard shortcuts for indentation
* feat: enhance code block language options in RichEditor by dynamically loading available languages from Shiki
* feat: update math syntax handling in RichEditor and markdown converter to use $$ for block and inline math
* feat: allow mathPlaceholder node to accept block content in EnhancedMath extension
* feat: improve paste handling in RichEditor by conditionally cleaning HTML based on cursor position and paragraph state
* fix: correct HTML cleaning logic in RichEditor to remove only outer paragraph tags during content insertion
* feat: enhance markdown conversion to support LaTeX in table cells and improve escaping logic
* fix: enhance link hover positioning in RichEditor to account for document boundaries and improve accuracy near the end of the document
* feat: add note book feature (#8234)
* feat: add notes feature with sidebar integration
Introduces a new Notes page and integrates it into the sidebar and routing. Updates sidebar icon types, default icons, and migration logic to support the new 'notes' icon. Adds initial types for notes and folders, and provides a basic NotesPage component. Also updates Chinese locale for notes.
* feat: add notes feature with sidebar, editor, and storage
Introduces a full notes management feature, including a sidebar for folders and notes, a markdown editor using Vditor, and persistent storage of the notes tree. Adds new components (NotesNavbar, NotesSidebar), a NotesService utility for CRUD operations, and updates settings and migration logic to support workspace visibility. Also updates Chinese i18n for notes, and refines the notes type definition.
* feat: enhance notes functionality with auto-save and file name synchronization
* feat: add export to Notes feature
Introduced the ability to export messages and topics to the Notes workspace. Updated UI components, i18n strings, settings, migration logic, and export utilities to support the new export option.
* fix: merge main branch error
* fix: build check error
* Update src/renderer/src/utils/export.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/utils/export.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/App.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/pages/home/Tabs/TopicsTab.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/pages/notes/NotesPage.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Revert "Update src/renderer/src/pages/notes/NotesPage.tsx"
This reverts commit
|
||
|
|
f95b9cef77
|
feat: System (MacOS & Windows) OCR (#9572)
* build: 添加 macOS 系统 OCR 作为可选依赖 * refactor: 移动TesseractService * feat(ocr): 添加MacOS Vision OCR支持并优化类型定义 添加对MacOS Vision OCR的支持,同时重构OCR相关类型定义以提升可维护性。新增PDF文件元数据类型为后续功能做准备。 * refactor(types): 重命名 isImageFile 为 isImageFileMetadata 以更准确描述功能 * refactor(ocr): 更新导入 * feat(ocr): 实现MacOS Vision OCR服务并重构OCR基础结构 添加MacOcrService以支持MacOS Vision OCR功能 创建OcrBaseService作为OCR服务的基类 清理MacOS OCR配置中的冗余字段 * fix(store): 更新持久化存储版本至138并添加MAC OCR提供者 添加内置OCR提供者支持并清空翻译输入框 * chore: 更新 @cherrystudio/mac-system-ocr 依赖至 0.2.4 版本 * feat(ocr): 添加 macOS 原生 OCR 服务支持 添加 macOS 原生 OCR 服务作为内置 OCR 提供商 在设置页面显示不可配置提示 添加相关 logo 和翻译文本 * build: 将 @cherrystudio/mac-system-ocr 从可选依赖移至常规依赖 * fix(ocr): 临时使用any类型替代平台特定依赖的类型定义 为了避免在Linux上运行类型检查CI时抛出错误,暂时将MacOCR属性的类型从平台特定依赖的类型定义改为any类型 * refactor(build): 将mac-system-ocr移至optionalDependencies并更新vite配置 将@cherrystudio/mac-system-ocr从dependencies移至optionalDependencies 更新electron.vite.config.ts中的external配置以包含该依赖 * feat(OCR设置): 根据平台过滤OCR提供商选项 添加平台检测逻辑,在非Mac平台隐藏Mac内置OCR提供商选项 * feat(OCR): 添加非MacOS系统的错误提示 在OCR图片设置中添加对非MacOS系统的错误提示,当用户尝试在非Mac系统上使用OCR功能时显示错误标签 * feat(i18n): 添加 OCR 相关多语言翻译 为 OCR 功能添加错误提示和配置项的多语言翻译,包括非 MacOS 系统提示和无配置项提示 * fix(MacOcrService): 忽略macOS专属模块的类型检查错误 添加@ts-ignore注释以避免在非macOS平台上的类型检查错误,该模块仅在macOS上可用 * build: 添加 @napi-rs/system-ocr 依赖以支持OCR功能 * chore: 移除未使用的mac-system-ocr依赖 * refactor(ocr): 将 MacOS OCR 重构为跨平台的系统 OCR 重构 OCR 服务,将原本仅支持 MacOS 的 OCR 功能扩展为支持 Windows 和 MacOS 的系统 OCR 更新相关类型定义、配置和界面适配 * feat(hooks): 添加设置图片OCR提供商的功能 * refactor(ocr): 重构OCR提供者相关逻辑,优化代码结构 - 将OCR提供者相关工具函数和hook合并到useOcrProvider中 - 替换mac提供者为system提供者 - 优化OCR设置界面的错误处理和UI展示 - 删除不再使用的ocr.ts工具文件 * refactor(OCR设置): 移除多余的SettingGroup包装并优化provider设置逻辑 移除OcrSettings中多余的SettingGroup包装,将主题样式直接应用于OcrProviderSettings组件 优化OcrProviderSettings逻辑,对于system provider直接返回null * fix(i18n): 移除OCR服务中不可配置项的翻译并更新系统OCR支持提示 * fix(ocr): 根据系统平台设置默认OCR提供商 在Windows和Mac平台上使用系统OCR作为默认提供商,其他平台继续使用Tesseract * build: 从外部依赖中移除 @cherrystudio/mac-system-ocr * fix(i18n): 更新多语言OCR相关翻译 * fix(store): 在迁移配置中移除翻译输入的清空操作 * refactor(hooks): 将 getOcrProviderLogo 重命名为 OcrProviderLogo 并改为组件形式 将 useOcrProviders 中的 getOcrProviderLogo 函数重构为 OcrProviderLogo 组件 更新 OcrProviderSettings 中对应的调用方式 * support jpg * refactor(ocr): 重构OCR服务基础结构并支持多语言配置 重构OCR基础服务类,提取公共接口为抽象类 为系统OCR和Tesseract服务添加多语言配置支持 * refactor(ocr): 重构OCR类型定义以提高可维护性 将OcrProviderConfig拆分为基础配置和具体实现配置类型 优化类型结构以更清晰地区分不同OCR提供者的配置 * feat(组件): 新增错误标签组件 ErrorTag * refactor(ocr): 替换自定义标签组件为ErrorTag组件以简化代码 * fix(ocr): 在macOS下忽略语言参数 * feat(组件): 添加警告标签组件用于显示警告信息 * feat(ocr): 添加系统OCR支持并优化语言配置 - 新增系统OCR设置组件,支持Windows和MacOS平台 - 为系统OCR添加语言选择功能,Windows需配置语言包 - 创建SuccessTag组件用于显示配置状态 - 统一OCR语言设置相关翻译键名 - 修复系统OCR在非Windows/Mac平台下的显示问题 * feat(i18n): 添加 OCR 设置页面的多语言支持 为 OCR 设置页面添加了新的多语言翻译,包括支持的语言列表和系统 OCR 的相关提示信息 * feat(ocr): 支持自定义 Tesseract OCR 语言选择 添加 Tesseract OCR 语言映射配置和动态语言选择功能 在设置界面实现多语言选择器,支持用户自定义 OCR 语言 更新相关类型定义和工具提示信息 * docs(i18n): 为Tesseract OCR添加自定义语言支持提示文本 * fix(i18n): 移除OCR服务中临时语言支持提示 * fix(ocr): 修复OCR服务未传递provider配置的问题 * fix(ocr): 修复OCR服务未传递provider配置的问题 * fix(TesseractService): 修复worker没有显式dispose的问题 * feat(拖拽): 在useDrag钩子中暴露setIsDragging方法 允许外部组件直接控制拖拽状态,用于在TranslatePage中处理文件拖放时重置拖拽状态 * feat(i18n): 更新输入框占位文本以支持OCR功能 * fix(ocr): 添加错误处理并记录日志以改进Tesseract服务 在TesseractService中添加错误处理回调函数,捕获并抛出worker创建过程中的错误 同时增加调试日志以跟踪语言数组和worker创建过程 * refactor(ocr): 重构OCR状态管理,使用ID引用图像提供者并添加选择器 将imageProvider字段改为imageProviderId以简化状态管理 添加getImageProvider选择器方便获取当前图像提供者 * update cn data * refactor(ocr): 重构OCR提供者管理逻辑,使用自定义hook统一处理 - 将OCR提供者状态管理从Redux迁移到自定义hook useOcrProviders - 修复默认OCR提供者初始化问题 - 优化OCR图片识别逻辑,使用useCallback提升性能 * fix(ocr): 修复Tesseract worker初始化错误处理逻辑 重构worker初始化流程,使用Promise处理错误而非全局变量 修正非CN地区语言包下载URL为空的问题 * fix(ocr): 修复url * feat(OCR设置): 在Tesseract语言选择器中添加自定义标签渲染 添加CustomTag组件以禁用默认的关闭操作 * refactor(translate): 优化拖拽上传文件的hooks调用顺序 将useDrag hooks的声明移到使用位置附近,提高代码可读性 * perf(ocr): 移除不必要的await提升图像预处理性能 * feat(translate): 添加文本文件类型检查并优化文件处理逻辑 在翻译页面中增加对文本文件类型的检查,避免处理非文本文件。同时优化文件处理流程,包括错误处理和加载状态管理。 * feat(i18n): 添加文件类型检查错误的多语言翻译 * docs(i18n): 更新输入框占位符文本以更清晰描述支持的功能 --------- Co-authored-by: beyondkmp <beyondkmp@gmail.com> |
||
|
|
961984df24
|
fix: add sharp dependency for image processing and improve ocr (#9554)
build: add sharp dependency for image processing * Added sharp as a dependency in package.json to enhance image processing capabilities. * Removed sharp from the devDependencies section. * Refactored OCR image preprocessing by integrating grayscale and normalization directly into the process, improving overall efficiency. |
||
|
|
7bb3826cdd
|
feat: ocr image to translate (#9423)
* build: 添加 tesseract.js 及其类型定义依赖 * feat(ocr): 添加OCR类型定义文件以支持OCR功能扩展 * feat(ocr): 添加 Tesseract OCR 提供程序配置 * feat(ocr): 添加Tesseract.js的logo * refactor(settings): 重构文档预处理设置模块结构 将PreprocessSettings重命名为DocProcessSettings并调整文件结构 更新相关路由和组件引用以保持功能一致性 * refactor(config): 重命名OCR_PROVIDER_CONFIG为BUILTIN_OCR_PROVIDERS以更准确描述用途 * refactor(ocr): 更改文件名 * refactor(ocr): 将获取OCR提供商logo的功能移动到utils目录 将getOcrProviderLogo函数从config/ocr.ts移动到utils/ocr.ts,保持功能集中 * refactor(ocr): 重构OCR配置结构以支持默认提供者 将内置OCR提供者数组重构为单独定义的常量,并添加默认OCR提供者映射。这提高了代码的可维护性并支持未来扩展。 * feat(store): 添加OCR状态管理切片 实现OCR提供商的增删改查功能,使用Redux Toolkit管理OCR相关状态 * feat(types): 添加图片文件类型守卫函数 添加 ImageFileMetadata 类型和 isImageFile 类型守卫函数,用于检查文件是否为图片类型 * feat(ocr): 添加对OCR支持文件类型的类型定义和校验函数 添加SupportedOcrFileType类型和isSupportedOcrFileType校验函数 添加SupportedOcrFile类型和isSupportedOcrFile校验函数 * feat(ocr): 添加OCR功能支持 实现基于Tesseract的OCR功能,包括文件类型检查、服务接口和IPC通信 新增OCR相关类型定义和服务实现 * refactor(OcrService): 更新日志上下文为'main:OcrService' * feat(ocr): 添加OCR服务基础功能 实现OCR服务的基础功能,通过调用window.api.ocr接口处理支持的文件类型 * feat(store): 添加ocr模块到redux store * feat(ocr): 添加OCR功能支持及文件类型校验 添加OCR功能钩子useOcr,支持图片文件识别 添加不支持文件类型的错误提示国际化文案 * refactor(ocr): 重命名updatePreprocessProvider为updateOcrProvider以保持命名一致性 * feat(ocr): 添加设置图片OCR提供商的功能 * refactor(ocr): 统一OCR类型导入路径 将所有OCR相关类型从'@renderer/types/ocr'改为从'@renderer/types'或'@types'导入 优化DEFAULT_OCR_PROVIDER类型定义 * feat(store): 更新持久化存储版本并添加OCR配置迁移 添加137版本迁移逻辑,初始化OCR提供者和默认图像提供者配置 * feat(ocr): 添加OCR服务设置界面及提供商选择功能 实现OCR服务设置界面,包含图片OCR提供商的选择功能 修复ocr.ts中imageProvider的类型定义 添加相关国际化文本 * fix(ocr): 添加图像大小检查并优化错误处理 检查图像文件大小是否超过50MB限制 使用buffer读取文件替代直接路径识别 简化错误处理逻辑,直接抛出原始错误 * feat(OCR服务): 支持base64字符串作为OCR输入 扩展tesseractOcr函数以接受base64字符串或图像文件作为输入 * feat(hooks): 添加useFiles钩子用于文件选择功能 * refactor(useFiles): 移除multipleSelections参数并重构文件选择逻辑 将multipleSelections从组件props移动到onSelectFile方法参数中,简化组件接口 重构文件选择逻辑,移除不必要的useMemo,提升代码可维护性 * refactor(useFiles): 使用useMemo优化扩展名处理逻辑 将扩展名处理逻辑移至useMemo中,避免不必要的重复计算。当props.extensions未提供时默认返回['*'] * feat(文件选择): 增强文件选择功能并添加清除文件方法 - 为文件选择API添加返回类型声明 - 完善文件选择回调函数的文档注释 - 修改文件选择逻辑以返回选中的文件数组 - 添加清除文件列表的方法 * refactor(useFiles): 将参数从布尔值改为对象以增强可扩展性 * feat(hooks): 在useFiles钩子中暴露selecting状态 * feat(translate): 添加文件OCR功能支持 在翻译页面新增浮动按钮,支持通过OCR识别文件内容并自动填充到输入框。添加相关hooks和文件类型检查逻辑,提升用户输入便捷性。 * build: 将 tesseract.js 从 devDependencies 移至 dependencies 确保生产环境能正确使用 tesseract.js 功能 * refactor(ocr): 将Tesseract服务文件移动到tesseract子目录并更新配置 * refactor(TesseractService): 添加日志记录并更新worker配置 添加loggerService用于记录worker日志,并更新createWorker配置以使用自定义logger * feat(翻译页面): 添加OCR处理中的加载状态提示 在翻译页面中添加OCR处理时的加载状态提示,提升用户体验 * fix(translate): 为OCR处理消息添加无限持续时间 防止OCR处理过程中消息自动消失,确保用户明确知道处理状态 * fix: 添加OCR未知错误的翻译并更新错误提示 在OCR处理失败时,使用翻译后的错误消息替代原始错误提示 * style(translate): 调整浮动按钮位置从右上到左下 * fix(translate): 处理未选择文件时提前返回以避免空指针异常 * feat(i18n): 添加OCR功能的多语言支持 * feat(fs): 添加自动识别编码读取文本文件功能 实现通过自动检测文件编码来读取文本文件的功能 在IPC通道、预加载API和文件服务中添加相关方法 * feat(翻译): 添加文件读取功能并改进错误处理 添加对文本文件的支持并优化文件处理流程 改进错误提示信息,包括文件过大和读取失败的场景 * fix(i18n): 更新文件大小限制错误信息并添加多语言支持 修改文件大小限制的错误信息格式,移除括号内的限制范围 为多种语言添加文件操作相关的翻译条目 在错误提示中动态显示文件大小限制范围 * refactor(AttachmentButton): 移除类型注释,使用自动类型推断 * fix(hooks): 返回变量supportedFiles * fix(ocr): 改进OCR处理中的消息管理和错误处理 在useOcr钩子中统一管理OCR处理的消息提示,并完善错误处理逻辑 移除TranslatePage中重复的消息管理代码,简化OCR处理流程 * fix(translate): 在选择文件后清除文件状态以避免残留 在文件选择完成后调用clearFiles以清除文件状态 * refactor(preload): 移动OCR类型定义到共享类型文件 将OCR相关的类型定义(OcrProvider, OcrResult, SupportedOcrFile)从渲染进程类型文件移动到共享类型文件@types,以提高代码复用性和维护性 * refactor(ocr): 修改tesseractOcr返回完整识别结果而非仅文本 返回完整识别结果以便后续处理使用更多OCR信息,同时简化imageOcr中的条件判断逻辑 * fix(ocr): 修复文件类型与OCR提供者能力不匹配时的错误抛出位置 将错误抛出语句移至else分支 * refactor(ocr): 简化 DEFAULT_OCR_PROVIDER 的类型定义 * build: 将 tesseract.js 从 devDependencies 移至 dependencies 确保生产环境能正确使用 tesseract.js 功能 * refactor(ocr): 将Tesseract服务文件移动到tesseract子目录并更新配置 * refactor(TesseractService): 添加日志记录并更新worker配置 添加loggerService用于记录worker日志,并更新createWorker配置以使用自定义logger * feat(i18n): 添加OCR功能的多语言支持 * refactor(preload): 移动OCR类型定义到共享类型文件 将OCR相关的类型定义(OcrProvider, OcrResult, SupportedOcrFile)从渲染进程类型文件移动到共享类型文件@types,以提高代码复用性和维护性 * refactor(ocr): 修改tesseractOcr返回完整识别结果而非仅文本 返回完整识别结果以便后续处理使用更多OCR信息,同时简化imageOcr中的条件判断逻辑 * fix(ocr): 修复文件类型与OCR提供者能力不匹配时的错误抛出位置 将错误抛出语句移至else分支 * refactor(ocr): 简化 DEFAULT_OCR_PROVIDER 的类型定义 * fix(ocr): 改进OCR处理中的消息管理和错误处理 在useOcr钩子中统一管理OCR处理的消息提示,并完善错误处理逻辑 移除TranslatePage中重复的消息管理代码,简化OCR处理流程 * feat(i18n): 添加OCR相关的错误和状态翻译文本 * fix(useOcr): 修复未支持文件类型错误抛出位置 将不支持的OCR文件类型错误抛出逻辑移至条件判断内 * refactor(ocr): ocrImage实现使用OcrService并更新日志上下文 将ocrImage函数从useOcr钩子移动到OcrService中,提高代码复用性 更新日志服务上下文从'main'改为'renderer'以更准确反映模块位置 * style(TabContainer): 移除多余的空行并保持代码整洁 * refactor(ocr): 简化OCR文件类型检查逻辑 使用现有的isImageFile函数替代冗余的类型检查逻辑,提高代码复用性 * fix: 将迁移错误日志从136更新为137 * feat(ocr): enhance Tesseract service with language support and worker management - Added support for multiple Tesseract languages: Chinese (Simplified and Traditional) and English. - Refactored Tesseract worker management into a class for better encapsulation and reuse. - Introduced methods to dynamically determine language path based on IP country and manage worker lifecycle. * update cn url * support cn data * change to asyn * use register design mode * add type * use bind function * refactor(ipc): 简化OCR处理程序参数 * refactor(ocr): 修改ocrProviderCapabilityRecord类型定义 允许只定义部分能力 * refactor(ocr): 将Tesseract相关配置移至服务内部 将语言列表和下载URL常量从共享配置移至Tesseract服务内部 使用常量定义图片大小阈值以提高可读性 * refactor(ocr): 统一使用 SupportedOcrFile 类型替换 FileMetadata 更新 OCR 服务及其 Tesseract 实现,使用 SupportedOcrFile 类型替代原有的 FileMetadata 类型,以提高类型安全性和一致性。同时在 OcrService 中添加重复注册的警告日志。 * refactor(ocr): 重构OCR类型定义以支持模型和API配置 将OCR提供者配置拆分为独立类型,增加模型能力记录和API配置类型检查 添加OCR处理程序类型定义,为未来扩展提供更好的类型支持 * refactor(OcrService): 移除重复的OcrHandler类型定义 已在@types中定义OcrHandler类型,移除重复定义以提高代码一致性 * refactor(ocr): 将OcrService移动到ocr目录下并更新引用路径 * feat(ocr): 添加OCR API客户端工厂及示例实现 实现OCR API客户端工厂模式,支持根据不同提供商创建对应的客户端 新增OcrBaseApiClient作为基础类,提供通用功能 添加OcrExampleApiClient作为示例实现 修改OcrService以使用新的客户端工厂 * refactor(ocr): 添加日志记录以跟踪OCR文件处理 在OCR服务中添加日志记录功能,便于跟踪文件处理过程 * fix(deps): 更新 tesseract.js 依赖并添加补丁文件 修复 tesseract.js 类型定义问题并添加语言常量支持 * refactor(ocr): 移除注释掉的tesseract语言映射代码 使用Tesseract.js的LanguageCode类型替代硬编码的语言列表,提高类型安全性 * feat(ocr): 添加 Tesseract OCR 配置类型 * refactor(OCR设置): 重命名OcrImageProviderSettings为OcrImageSettings并优化代码结构 * refactor(ocr): 将 Tesseract 相关类型移动到文件底部以改善代码组织 * feat(ocr): 添加 Tesseract OCR 提供者类型检查函数 * feat(ocr): 添加更新OCR提供者配置的功能 * feat: 添加OCR提供者钩子函数 实现useOcrProvider钩子用于获取和更新OCR提供者配置 * refactor(ocr): 修改removeOcrProvider参数为字符串id 简化removeOcrProvider方法的参数类型,直接使用字符串id进行过滤,提高代码简洁性 * refactor(ocr): 将内置OCR提供者从数组改为映射结构 重构OCR配置模块,使用映射结构存储内置OCR提供者以便于扩展和维护 * refactor(ocr): 将BUILTIN_OCR_PROVIDERS改为只读数组 使用Object.freeze确保数组不可变,提高代码安全性 * feat(ocr): 添加OCR提供者管理功能并改进错误处理 添加useOcrProviders钩子用于管理OCR提供者的添加和删除 当内置OCR提供者不存在时自动恢复默认配置 改进错误提示信息并增加国际化支持 * Revert "refactor(ocr): 将BUILTIN_OCR_PROVIDERS改为只读数组" This reverts commit |
||
|
|
0af5a85f67
|
feat: Image OCR (#9409)
* build: 添加 tesseract.js 及其类型定义依赖
* feat(ocr): 添加OCR类型定义文件以支持OCR功能扩展
* feat(ocr): 添加 Tesseract OCR 提供程序配置
* feat(ocr): 添加Tesseract.js的logo
* refactor(settings): 重构文档预处理设置模块结构
将PreprocessSettings重命名为DocProcessSettings并调整文件结构
更新相关路由和组件引用以保持功能一致性
* refactor(config): 重命名OCR_PROVIDER_CONFIG为BUILTIN_OCR_PROVIDERS以更准确描述用途
* refactor(ocr): 更改文件名
* refactor(ocr): 将获取OCR提供商logo的功能移动到utils目录
将getOcrProviderLogo函数从config/ocr.ts移动到utils/ocr.ts,保持功能集中
* refactor(ocr): 重构OCR配置结构以支持默认提供者
将内置OCR提供者数组重构为单独定义的常量,并添加默认OCR提供者映射。这提高了代码的可维护性并支持未来扩展。
* feat(store): 添加OCR状态管理切片
实现OCR提供商的增删改查功能,使用Redux Toolkit管理OCR相关状态
* feat(types): 添加图片文件类型守卫函数
添加 ImageFileMetadata 类型和 isImageFile 类型守卫函数,用于检查文件是否为图片类型
* feat(ocr): 添加对OCR支持文件类型的类型定义和校验函数
添加SupportedOcrFileType类型和isSupportedOcrFileType校验函数
添加SupportedOcrFile类型和isSupportedOcrFile校验函数
* feat(ocr): 添加OCR功能支持
实现基于Tesseract的OCR功能,包括文件类型检查、服务接口和IPC通信
新增OCR相关类型定义和服务实现
* refactor(OcrService): 更新日志上下文为'main:OcrService'
* feat(ocr): 添加OCR服务基础功能
实现OCR服务的基础功能,通过调用window.api.ocr接口处理支持的文件类型
* feat(store): 添加ocr模块到redux store
* feat(ocr): 添加OCR功能支持及文件类型校验
添加OCR功能钩子useOcr,支持图片文件识别
添加不支持文件类型的错误提示国际化文案
* refactor(ocr): 重命名updatePreprocessProvider为updateOcrProvider以保持命名一致性
* feat(ocr): 添加设置图片OCR提供商的功能
* refactor(ocr): 统一OCR类型导入路径
将所有OCR相关类型从'@renderer/types/ocr'改为从'@renderer/types'或'@types'导入
优化DEFAULT_OCR_PROVIDER类型定义
* feat(store): 更新持久化存储版本并添加OCR配置迁移
添加137版本迁移逻辑,初始化OCR提供者和默认图像提供者配置
* feat(ocr): 添加OCR服务设置界面及提供商选择功能
实现OCR服务设置界面,包含图片OCR提供商的选择功能
修复ocr.ts中imageProvider的类型定义
添加相关国际化文本
* fix(ocr): 添加图像大小检查并优化错误处理
检查图像文件大小是否超过50MB限制
使用buffer读取文件替代直接路径识别
简化错误处理逻辑,直接抛出原始错误
* feat(OCR服务): 支持base64字符串作为OCR输入
扩展tesseractOcr函数以接受base64字符串或图像文件作为输入
* build: 将 tesseract.js 从 devDependencies 移至 dependencies
确保生产环境能正确使用 tesseract.js 功能
* refactor(ocr): 将Tesseract服务文件移动到tesseract子目录并更新配置
* refactor(TesseractService): 添加日志记录并更新worker配置
添加loggerService用于记录worker日志,并更新createWorker配置以使用自定义logger
* feat(i18n): 添加OCR功能的多语言支持
* refactor(preload): 移动OCR类型定义到共享类型文件
将OCR相关的类型定义(OcrProvider, OcrResult, SupportedOcrFile)从渲染进程类型文件移动到共享类型文件@types,以提高代码复用性和维护性
* refactor(ocr): 修改tesseractOcr返回完整识别结果而非仅文本
返回完整识别结果以便后续处理使用更多OCR信息,同时简化imageOcr中的条件判断逻辑
* fix(ocr): 修复文件类型与OCR提供者能力不匹配时的错误抛出位置
将错误抛出语句移至else分支
* refactor(ocr): 简化 DEFAULT_OCR_PROVIDER 的类型定义
* fix(ocr): 改进OCR处理中的消息管理和错误处理
在useOcr钩子中统一管理OCR处理的消息提示,并完善错误处理逻辑
移除TranslatePage中重复的消息管理代码,简化OCR处理流程
* feat(i18n): 添加OCR相关的错误和状态翻译文本
* fix(useOcr): 修复未支持文件类型错误抛出位置
将不支持的OCR文件类型错误抛出逻辑移至条件判断内
* refactor(ocr): ocrImage实现使用OcrService并更新日志上下文
将ocrImage函数从useOcr钩子移动到OcrService中,提高代码复用性
更新日志服务上下文从'main'改为'renderer'以更准确反映模块位置
* style(TabContainer): 移除多余的空行并保持代码整洁
* refactor(ocr): 简化OCR文件类型检查逻辑
使用现有的isImageFile函数替代冗余的类型检查逻辑,提高代码复用性
* fix: 将迁移错误日志从136更新为137
* feat(ocr): enhance Tesseract service with language support and worker management
- Added support for multiple Tesseract languages: Chinese (Simplified and Traditional) and English.
- Refactored Tesseract worker management into a class for better encapsulation and reuse.
- Introduced methods to dynamically determine language path based on IP country and manage worker lifecycle.
* update cn url
* support cn data
* change to asyn
* use register design mode
* add type
* use bind function
* refactor(ipc): 简化OCR处理程序参数
* refactor(ocr): 修改ocrProviderCapabilityRecord类型定义
允许只定义部分能力
* refactor(ocr): 将Tesseract相关配置移至服务内部
将语言列表和下载URL常量从共享配置移至Tesseract服务内部
使用常量定义图片大小阈值以提高可读性
* refactor(ocr): 统一使用 SupportedOcrFile 类型替换 FileMetadata
更新 OCR 服务及其 Tesseract 实现,使用 SupportedOcrFile 类型替代原有的 FileMetadata 类型,以提高类型安全性和一致性。同时在 OcrService 中添加重复注册的警告日志。
* refactor(ocr): 重构OCR类型定义以支持模型和API配置
将OCR提供者配置拆分为独立类型,增加模型能力记录和API配置类型检查
添加OCR处理程序类型定义,为未来扩展提供更好的类型支持
* refactor(OcrService): 移除重复的OcrHandler类型定义
已在@types中定义OcrHandler类型,移除重复定义以提高代码一致性
* refactor(ocr): 将OcrService移动到ocr目录下并更新引用路径
* feat(ocr): 添加OCR API客户端工厂及示例实现
实现OCR API客户端工厂模式,支持根据不同提供商创建对应的客户端
新增OcrBaseApiClient作为基础类,提供通用功能
添加OcrExampleApiClient作为示例实现
修改OcrService以使用新的客户端工厂
* refactor(ocr): 添加日志记录以跟踪OCR文件处理
在OCR服务中添加日志记录功能,便于跟踪文件处理过程
* fix(deps): 更新 tesseract.js 依赖并添加补丁文件
修复 tesseract.js 类型定义问题并添加语言常量支持
* refactor(ocr): 移除注释掉的tesseract语言映射代码
使用Tesseract.js的LanguageCode类型替代硬编码的语言列表,提高类型安全性
* feat(ocr): 添加 Tesseract OCR 配置类型
* refactor(OCR设置): 重命名OcrImageProviderSettings为OcrImageSettings并优化代码结构
* refactor(ocr): 将 Tesseract 相关类型移动到文件底部以改善代码组织
* feat(ocr): 添加 Tesseract OCR 提供者类型检查函数
* feat(ocr): 添加更新OCR提供者配置的功能
* feat: 添加OCR提供者钩子函数
实现useOcrProvider钩子用于获取和更新OCR提供者配置
* refactor(ocr): 修改removeOcrProvider参数为字符串id
简化removeOcrProvider方法的参数类型,直接使用字符串id进行过滤,提高代码简洁性
* refactor(ocr): 将内置OCR提供者从数组改为映射结构
重构OCR配置模块,使用映射结构存储内置OCR提供者以便于扩展和维护
* refactor(ocr): 将BUILTIN_OCR_PROVIDERS改为只读数组
使用Object.freeze确保数组不可变,提高代码安全性
* feat(ocr): 添加OCR提供者管理功能并改进错误处理
添加useOcrProviders钩子用于管理OCR提供者的添加和删除
当内置OCR提供者不存在时自动恢复默认配置
改进错误提示信息并增加国际化支持
* Revert "refactor(ocr): 将BUILTIN_OCR_PROVIDERS改为只读数组"
This reverts commit
|
||
|
|
4a62bb6ad7
|
refactor: replace axios and node fetch with electron's net module (#9212)
* refactor: replace axios and node fetch with electron's net module for network requests in preprocess providers - Updated Doc2xPreprocessProvider and MineruPreprocessProvider to use net.fetch instead of axios for making HTTP requests. - Improved error handling for network responses across various methods. - Removed unnecessary AxiosRequestConfig and related code to streamline the implementation. * lint * refactor(Doc2xPreprocessProvider): enhance file validation and upload process - Added file size validation to prevent loading files larger than 300MB into memory. - Implemented file size check before reading the PDF to ensure efficient memory usage. - Updated the file upload method to use a stream, setting the 'Content-Length' header for better handling of large files. * refactor(brave-search): update net.fetch calls to use url.toString() - Modified all instances of net.fetch to use url.toString() for better URL handling. - Ensured consistency in how URLs are passed to the fetch method across various functions. * refactor(MCPService): improve URL handling in net.fetch calls - Updated net.fetch to use url.toString() for better type handling of URLs. - Ensured consistent URL processing across the MCPService class. * feat(ProxyManager): integrate axios with fetch proxy support - Added axios as a dependency to enable fetch proxy usage. - Implemented logic to set axios's adapter to 'fetch' for proxy handling. - Preserved original axios adapter for restoration when disabling the proxy. |
||
|
|
1c7b7a1a55
|
feat: add code tools (#9043)
* feat: add code tools * feat(CodeToolsService): add CLI executable management and installation check - Introduced methods to determine the CLI executable name based on the tool. - Added functionality to check if a package is installed and create the necessary bin directory if it doesn't exist. - Enhanced the run method to handle installation and execution of CLI tools based on their installation status. - Updated terminal command handling for different operating systems with improved comments and error messages. * feat(ipService): implement IP address country detection and npm registry URL selection - Added a new module for IP address country detection using the ipinfo.io API. - Implemented functions to check if the user is in China and to return the appropriate npm registry URL based on the user's location. - Updated AppUpdater and CodeToolsService to utilize the new ipService functions for improved user experience based on geographical location. - Enhanced error handling and logging for better debugging and user feedback. * feat: remember cli model * feat(CodeToolsService): update options for auto-update functionality - Refactored the options parameter in CodeToolsService to replace checkUpdate and forceUpdate with autoUpdateToLatest. - Updated logic to handle automatic updates when the CLI tool is already installed. - Modified related UI components to reflect the new auto-update option. - Added corresponding translations for the new feature in multiple languages. * feat(CodeToolsService): enhance CLI tool launch with debugging support - Added detailed logging for CLI tool launch process, including environment variables and options. - Implemented a temporary batch file for Windows to facilitate debugging and command execution. - Improved error handling and cleanup for the temporary batch file after execution. - Updated terminal command handling to use the new batch file for safer execution. * refactor(CodeToolsService): simplify command execution output - Removed display of environment variable settings during command execution in the CLI tool. - Updated comments for clarity on the command execution process. * feat(CodePage): add model filtering logic for provider selection - Introduced a modelPredicate function to filter out embedding, rerank, and text-to-image models from the available providers. - Updated the ModelSelector component to utilize the new predicate for improved model selection experience. * refactor(CodeToolsService): improve logging and cleanup for CLI tool execution - Updated logging to display only the keys of environment variables during CLI tool launch for better clarity. - Introduced a variable to store the path of the temporary batch file for Windows. - Enhanced cleanup logic to remove the temporary batch file after execution, improving resource management. * feat(Router): replace CodePage with CodeToolsPage and add new page for code tools - Updated Router to import and route to the new CodeToolsPage instead of the old CodePage. - Introduced CodeToolsPage component, which provides a user interface for selecting CLI tools and models, managing directories, and launching code tools with enhanced functionality. * refactor(CodeToolsService): improve temporary file management and cleanup - Removed unused variable for Windows batch file path. - Added a cleanup task to delete the temporary batch file after 10 seconds to enhance resource management. - Updated logging to ensure clarity during the execution of CLI tools. * refactor(CodeToolsService): streamline environment variable handling for CLI tool execution - Introduced a utility function to remove proxy-related environment variables before launching terminal processes. - Updated logging to display only the relevant environment variable keys, enhancing clarity during execution. * refactor(MCPService, CodeToolsService): unify proxy environment variable handling - Replaced custom proxy removal logic with a shared utility function `removeEnvProxy` to streamline environment variable management across services. - Updated logging to reflect changes in environment variable handling during CLI tool execution. |
||
|
|
27af64f2bd
|
fix: change jschardet to chardet (#8577)
* fix: change jschardet to chardet * Update file.test.ts * fix: error * fix: test fail * fix: test error * Update file.test.ts * fix: optimize details * Update file.test.ts * Update file.ts * Update file.ts * Update file.test.ts |
||
|
|
c4182a950f
|
fix: add isPathInside functionality to check path relationships (#8590)
* feat(ipc): add isPathInside functionality to check path relationships - Introduced a new IPC channel for checking if a path is inside another path, enhancing path validation capabilities. - Implemented the isPathInside function in the file utility, which accurately determines parent-child path relationships, handling edge cases. - Updated relevant components to utilize the new isPathInside function for validating app data and backup paths, ensuring better user experience and error handling. - Added comprehensive tests for isPathInside to cover various scenarios, including edge cases and error handling. * format code |
||
|
|
6cc29c5005
|
chore(i18n): forced nested structure to support i18n ally (#8457)
* chore(i18n): 更新i18n文件为嵌套结构以适应插件 * feat(i18n): 添加自动翻译脚本处理待翻译文本 添加自动翻译脚本auto-translate-i18n.ts,用于处理以[to be translated]开头的待翻译文本 在package.json中添加对应的运行命令auto:i18n * chore(i18n): 更新嵌套结构 * chore(i18n): 更新多语言翻译文件并改进翻译逻辑 更新了多个语言的翻译文件,替换了"[to be translated]"标记为实际翻译内容 改进auto-translate-i18n.ts中的翻译逻辑,添加错误处理和日志输出 部分数组格式的翻译描述自动改为对象格式 * fix(i18n): 修复嵌套结构检查并改进错误处理 添加对嵌套结构中使用点符号的检查,确保使用严格嵌套结构 改进错误处理,在检查失败时输出更清晰的错误信息 * fix(测试): 更新下载失败测试中的翻译键名 * test(下载): 移除重复的下载失败翻译并更新测试 * feat(eslint): 添加规则,警告不建议在t()函数中使用模板字符串 * style: 使用单引号替换模板字符串中的反引号 * docs(.vscode): 添加i18n-ally扩展推荐到vscode配置 * fix: 在自动翻译脚本中停止进度条显示 确保在脚本执行完成后正确停止进度条,避免控制台输出混乱 * fix(i18n): 修复模型列表添加确认对话框的翻译键名 更新多语言文件中模型管理部分的翻译结构,将"add_listed"从字符串改为包含"confirm"和"key"的对象 同时修正EditModelsPopup组件中对应的翻译键引用 * chore: 注释掉i18n-ally命名空间配置 * docs: 添加国际化(i18n)最佳实践文档 添加中英文双语的技术文档,详细介绍项目中的i18n实现方案、工具链和最佳实践 包含i18n ally插件使用指南、自动化脚本说明以及代码规范要求 * docs(国际化): 更新i18n文档中的键名格式示例 将文档中错误的flat格式示例从下划线命名改为点分隔命名,以保持一致性 * refactor(i18n): 统一翻译键名从.key后缀改为.label后缀 * chore(i18n): sort * refactor(locales): 使用 Object.fromEntries 重构 locales 对象 * feat(i18n): 添加机器翻译的语言支持 新增希腊语、西班牙语、法语和葡萄牙语的机器翻译支持,并调整语言资源加载顺序 |
||
|
|
03b996d626
|
feat: support Relative Path Input for Backup Directory (#8471)
* chore(env): add .env.example file and update .gitignore - Introduced a new .env.example file with NODE_OPTIONS configuration. - Updated .gitignore to exclude .env.example from being ignored. - Added instructions in dev.md for copying .env.example to .env. * fix(MessageTools): improve error handling and logging in message preview rendering (#8453) - Enhanced the rendering logic for message previews by adding a try-catch block to handle JSON parsing errors more gracefully. - Updated the error handling to provide clearer error messages in the preview when exceptions occur. - Added debug logging to track the rendering process of message content. * refactor(Theme): update theme management to use setTheme function - Replaced toggleTheme with setTheme for more explicit theme handling. - Removed unused SunMoon icon from TabContainer and Sidebar components. - Updated theme icon rendering logic to directly reflect the current theme state. - Adjusted ThemeProvider to include setTheme in context for better theme management. * refactor(ModelList): streamline button layout and improve accessibility - Removed tooltip wrappers from manage and add model buttons for a cleaner UI. - Introduced a new Flex container for primary and default buttons, enhancing layout consistency. - Updated button rendering to improve accessibility and user experience. * feat(ModelList): add bulk add/remove functionality for models with confirmation dialog - Implemented onAddAll and onRemoveAll functions to handle bulk actions for models. - Added confirmation dialog for adding all models to the list, enhancing user experience. - Updated translations for confirmation messages in multiple languages. * chore(languages): update languages with a script (#8445) * chore(languages): update languages with a script * refactor: update languages and merge it into constants * refactor: add usf and ush * refactor(ipc): enhance write permission check and add untildify utility - Updated the hasWritePermission function to resolve paths using the new untildify utility, improving path handling. - Modified IPC handler to await the permission check for better asynchronous handling. - Introduced a new untildify function to convert paths starting with '~' to the user's home directory. * fix(ModelEdit): enhance model type management and introduce new selection logic (#8420) * fix(ModelEdit): enhance model type management and introduce new selection logic - Added support for 'rerank' model type in the ModelEditContent component. - Refactored type selection logic to utilize new utility functions for finding differences and unions in model types. - Updated model type handling to include user selection status, improving user experience in type management. - Adjusted migration logic to initialize newType for existing models, ensuring backward compatibility. - Introduced isUserSelectedModelType utility to streamline model type checks across the application. * refactor(isFunctionCallingModel): simplify model type check logic - Replaced the inline check for 'function_calling' model type with a call to the new utility function isUserSelectedModelType, enhancing code clarity and maintainability. * feat(collection): add utility functions for array operations - Introduced `findIntersection`, `findDifference`, and `findUnion` functions to handle array operations with support for custom key selectors and comparison functions. - Removed previous implementations from `index.ts` to streamline utility exports. - Added comprehensive tests for new functions covering basic types and object types with various edge cases. * refactor(collection): rename utility functions for clarity - Renamed `findIntersection`, `findDifference`, and `findUnion` to `getIntersection`, `getDifference`, and `getUnion` respectively for improved clarity and consistency in naming. - Updated corresponding tests to reflect the new function names, ensuring all tests pass with the updated utility functions. * refactor(ModelEditContent): update model type management and improve selection logic - Replaced utility function calls to `findDifference` and `findUnion` with `getDifference` and `getUnion` for consistency. - Introduced temporary state management for model types to enhance user selection handling. - Added a reset functionality for model type selections, improving user experience. - Updated the rendering logic to conditionally disable certain model types based on user selections. * fix(ModelEditContent): enhance model type selection logic with conditional disabling - Introduced logic to conditionally disable 'rerank' and 'embedding' model types based on user selections. - Updated the state management for model types to ensure correct user selection handling. - Improved the confirmation modal to reflect the updated selection logic for better user experience. * fix(ModelEditContent): refine model type selection and update confirmation logic - Enhanced the logic for model type selection to ensure accurate user selections for 'rerank' and 'embedding'. - Updated the confirmation modal to reflect changes in selection handling, improving user experience. - Adjusted state management to correctly handle updates based on selected model types. * fix(models): update model support logic to include 'qwen3-235b-a22b-instruct' * refactor(models): rename 'newType' to 'capabilities' and update related logic in ModelEditContent and migration scripts * feat(ipc): add App_ResolvePath channel and update path handling - Introduced a new IPC channel `App_ResolvePath` to resolve file paths, enhancing path management. - Updated the `hasWritePermission` function to log the original directory instead of the resolved one. - Modified the `LocalBackupSettings` component to utilize the new `resolvePath` method for improved directory validation. * add ut * fix comments * fix clear manually * delete duplicate var --------- Co-authored-by: kangfenmao <kangfenmao@qq.com> Co-authored-by: SuYao <sy20010504@gmail.com> Co-authored-by: one <wangan.cs@gmail.com> |
||
|
|
c2086fdb15
|
refactor[Logger]: strict type check for Logger (#8363)
* fix: strict type check of logger * feat: logger format in renderer * fix: error type |
||
|
|
f13ae2d3c1
|
refactor: move initAppDataDir function to a new utils module (#8337)
* refactor: move initAppDataDir function to a new utils module - Updated the import path for initAppDataDir in bootstrap.ts to reflect its new location in the utils/init module. - Removed the initAppDataDir function and related code from file.ts to streamline the file and improve organization. * refactor: update import structure in ipc.ts - Removed the import of updateAppDataConfig from file.ts and added it to the new init module for better organization and clarity in the code structure. * refactor: rename getConfigPath to getConfigDir and update related references - Renamed the function getConfigPath to getConfigDir for clarity. - Updated references to the renamed function in getAppDataPathFromConfig and updateAppDataConfig to reflect the new naming convention. |
||
|
|
d0c375aa0a
|
fix(ipc): add support for portable executable paths on Windows (#8274) | ||
|
|
40f9601379
|
refactor: Unified Logger / 统一日志管理 (#8207)
* Revert "feat: optimize minapp cache with LRU (#8160)"
This reverts commit
|
||
|
|
ee4553130b
|
[1.5.0-rc] feat(MCP): Add DXT format support for MCP server installation (#7618)
* feat(MCP): Add DXT format support for MCP server installation
- Add comprehensive DXT package upload and extraction functionality
- Support for DXT manifest validation and MCP server configuration
- Hierarchical UI structure: Quick Add | JSON Import | DXT Import
- Variable substitution for DXT args (${__dirname} replacement)
- Automatic cleanup of DXT server directories on removal
- Enhanced error handling and connectivity checks
- Full internationalization support (EN/CN)
- Uses existing node-stream-zip for efficient extraction
- Proper working directory setup for DXT-based servers
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 🐛 fix(MCP): Fix DXT server installation and deletion issues
- Replace fs.renameSync with cross-filesystem compatible moveDirectory method to handle temp->mcp directory moves across different mount points
- Add recursive copy fallback when rename fails (ENOENT error fix)
- Sanitize server names with slashes to prevent subdirectory creation during installation
- Improve cleanupDxtServer to handle sanitized names and provide fallback lookup
- Add proper error logging and directory existence warnings
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(MCP): Implement comprehensive DXT MCP configuration support
- Add platform_overrides support to DXT manifest interface
- Implement complete variable substitution system (${__dirname}, ${HOME}, ${DESKTOP}, ${DOCUMENTS}, ${pathSeparator}, ${user_config.KEY})
- Add platform detection utilities (getPlatformIdentifier)
- Create resolved MCP configuration system with applyPlatformOverrides
- Export ResolvedMcpConfig interface and utility functions
- Integrate DXT configuration resolution into MCPService runtime
- Support platform-specific command, args, and environment overrides
- Add comprehensive logging for configuration resolution
Addresses DXT MANIFEST.md mcp_configuration requirements:
- Platform-specific configuration variations
- Cross-platform variable substitution
- Flexible command and environment management
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: add downloads directory variable substitution and simplify platform detection
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
a7b78c547a
|
fix(encoding): encoding detection and decoding logic (#8024) | ||
|
|
4ac8a38834
|
style: set eol to lf, code formatting (#7923)
* chore(gitattributes): set eol to lf * chore: git renormalize * style: reformatting * chore: keep eslint prettier plugin consistent on eol |
||
|
|
05b8afd681
|
feat: more encoding (#7898)
* feat(文件处理): 添加文件编码支持以正确处理不同编码的文本文件 添加文件编码检测和指定编码读取功能 - 在FileMetadata接口中添加encoding字段 - 添加iconv-lite和jschardet依赖用于编码处理和检测 - 文件上传时自动检测文本文件编码 - 文件读取时支持指定编码参数 - 更新所有API客户端以传递文件编码参数 * feat(文件处理): 添加文件编码检测和UTF-8读取功能 新增文件编码检测工具函数和UTF-8读取功能,统一处理不同编码的文件读取 移除重复的编码检测逻辑,优化代码结构 * refactor(FileStorage): 使用 readFileUTF8 替换 decodeBuffer 读取文件 移除冗余的 decodeBuffer 逻辑,直接使用封装好的 readFileUTF8 方法读取文件内容 * docs(utils): 为文件编码相关函数添加注释说明 添加对 detectEncoding、decodeBuffer 和 readFileUTF8 函数的详细注释,说明其功能和使用方法 * fix(utils): 为detectEncoding函数添加返回类型声明 * refactor(文件处理): 移除冗余的decodeBuffer函数并直接使用iconv.decode 简化文件读取逻辑,直接调用iconv.decode而不是通过中间函数decodeBuffer * test(file): 添加文件编码检测的测试用例 * test(文件编码检测): 移除ISO-8859-1编码的测试匹配 * refactor(file): 移除文件编码相关逻辑,统一使用UTF-8读取文本文件 移除FileMetadata接口中的encoding字段及相关检测逻辑 将所有文件读取操作统一改为使用readTextFileUTF8方法 * fix(文件读取): 改进文本文件解码逻辑以处理编码识别错误 当自动识别的编码包含错误字符时,尝试其他可能的编码 * refactor(utils): 将 console 日志替换为 electron-log 记录器 * refactor(文件存储): 移除文件读取时的可选编码参数 简化文件读取逻辑,始终使用UTF-8编码读取文本文件 * fix(utils): 修复文件编码检测中的文件描述符泄漏 在detectEncoding函数中,文件描述符在使用后未关闭,可能导致资源泄漏 * refactor(文件处理): 将readTextFileUTF8重命名为readTextFileWithAutoEncoding并改进编码检测 修复文件编码检测中未正确关闭文件描述符的问题 改进文本文件读取功能以支持自动编码检测 * test(file): 重构编码检测测试用例并改进测试结构 - 将 describe 块重命名为更明确的 detectEncoding - 提取公共的 mock 逻辑到 beforeEach - 更新测试描述为英文并保持一致性 - 简化测试实现,移除重复代码 * test(file): 添加对readTextFileWithAutoEncoding的测试用例 |
||
|
|
e35b4d9cd1
|
feat(knowledge): support doc2x, mistral, MacOS, MinerU... OCR (#3734)
Co-authored-by: suyao <sy20010504@gmail.com> Co-authored-by: 亢奋猫 <kangfenmao@qq.com> |
||
|
|
c79ea7d5ad
|
fix: cannot move data dir in linux (#7643)
* fix: cannot move data dir in linux * delete verion info in path --------- Co-authored-by: beyondkmp <beyondkmp@debian12.beyondkmp.com> |
||
|
|
df47b174ca
|
feat(AppUpdater): integrate User-Agent generation for autoUpdater req… (#7751)
* feat(AppUpdater): integrate User-Agent generation for autoUpdater requests; add systemInfo utility module * feat(systemInfo): enhance macOS version handling using macos-release package for improved accuracy; update package.json and yarn.lock to include macos-release and opendal dependencies |
||
|
|
a8e23966fa
|
feat(FileStorage): add support for .doc files using word-extractor (#7374)
* feat(FileStorage): add support for .doc files and integrate word-extractor * chore(package): add word-extractor to devdependencies |
||
|
|
c660aaba3d
|
fix: 修复数据目录迁移的bug (#7386)
* fix: move initAppDataDir function inline and remove export from utils/file.ts * fix some bugs * fix shouldcopy error * fix: handle appDataPath initialization and update logic in file.ts; update defaultChecked in DataSettings component * fix: improve appDataPath handling and migration logic in file.ts * fix: add error message for selecting the same app data path in DataSettings component and update localization files * fix: ensure migration confirmation modal is shown correctly in DataSettings component * feat: add new IPC channel for retrieving data path from arguments and update related components for migration handling * fix: update app data path validation to check for prefix match in DataSettings component * refactor: simplify data migration logic in DataSettings component by removing unnecessary flag * fix: update initAppDataDir invocation to check for app packaging status in bootstrap.ts |
||
|
|
d409ac1b73
|
feat: Add app data path selection and relaunch functionality (#6096)
* feat: Add app data path selection and relaunch functionality * Introduced new IPC channels for selecting and setting the app data path. * Implemented logic to initialize the app data path on startup. * Added confirmation modal for changing the app data directory in the settings. * Updated translations for new app data path features in multiple languages. * feat: Implement user data copying and app data path management * Added IPC channels for copying user data to a new location and setting the app data path. * Enhanced the user interface to support data copying with progress notifications. * Updated translations to reflect new features related to app data management. * Refactored file utility functions to streamline data path handling. * refactor: update IPC channel names and streamline app data path handling - Renamed IPC channels for selecting app data path and copying user data for clarity. - Simplified the logic for selecting and setting app data paths, removing unnecessary success/error handling. - Updated related functions and components to reflect the new IPC channel names and improved data handling. - Removed unused copyUserDataToNewLocation function to clean up the codebase. * fix: update app data directory selection text in multiple locales - Changed the text for selecting the app data directory from "Select Directory" to "Modify Directory" in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese locales to better reflect the action being performed. * refactor: remove redundant success messages in DataSettings component - Eliminated unnecessary success messages related to app data copying and app relaunching to streamline user feedback and improve code clarity. * refactor: streamline file utility functions and update app data initialization - Moved `getDataPath` function to the `utils/index.ts` for better organization and accessibility. - Renamed `initUserDataDir` to `initAppDataDir` for clarity in its purpose. - Removed commented-out code in `ConfigManager` to enhance code cleanliness. * refactor: update import paths and localization strings for app data - Refactored import statements for `getDataPath` to streamline utility access. - Updated localization strings for app data in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese to enhance clarity and consistency. * update i18n * add fc * fix: handle errors in app data path retrieval - Added error handling to the `getAppDataPathFromConfig` function to return null if the configuration file cannot be read or parsed, improving robustness. * refactor: simplify app data path handling in IPC - Removed error handling for setting the app data path in the IPC channel, streamlining the process by directly updating the configuration and user data path without try-catch blocks. * fix: update userData path handling for portable applications - Modified the initAppDataDir function to set the userData path based on the PORTABLE_EXECUTABLE_DIR environment variable, ensuring compatibility with portable application setups. * feat: enhance app data path migration with progress indication - Implemented a loading modal with progress tracking during the app data path migration process. - Added visual feedback using a progress bar to inform users of the copying status. - Improved error handling and user notifications for successful and failed migrations. - Refactored the modal confirmation logic to streamline user interactions during the path selection and migration process. * feat: add migration paths and update UI for data migration process - Introduced new translation keys for migration paths in Japanese, Russian, Simplified Chinese, and Traditional Chinese. - Enhanced the DataSettings component with a structured layout for displaying original and new paths during data migration. - Updated modal titles and content to improve user experience during the migration process. * feat: enhance data migration process with improved UI and progress tracking - Refactored the DataSettings component to streamline the data migration workflow. - Added a new function to display progress during the migration process, enhancing user feedback. - Updated modal logic to improve clarity and user experience when selecting new app data paths. - Implemented error handling and notifications for successful and failed migrations. * feat: add stop quit app functionality during data migration - Introduced a new IPC channel to manage the application's quit behavior during data transfer. - Updated the DataSettings component to prevent the app from quitting while migration is in progress, enhancing user experience. - Improved modal configurations for better responsiveness and visual appeal. * feat: enhance app data path handling and localization updates - Updated IPC handler to use 'filePath' for clarity in app data path management. - Improved validation to ensure the new app data path is not the root path, enhancing user feedback during path selection. - Added new translation keys for error messages related to app data path selection in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese, improving localization support. * feat: add write permission check and enhance quit prevention during data migration - Introduced a new IPC channel to check write permissions for the app data path. - Updated the DataSettings component to validate write permissions before proceeding with data migration. - Enhanced the quit prevention logic to include a reason for blocking the app from quitting during data transfer. - Added new localization keys for error messages related to write permissions in multiple languages, improving user feedback. * feat: enhance confirmation modal in DataSettings component - Updated the confirmation modal to include danger styling for the OK button, improving visual feedback. - Added localized text for the OK and Cancel buttons, enhancing user experience through better accessibility. * feat: add localization keys and improve quit prevention during data migration - Added new localization keys for data migration, including titles and original path labels, enhancing user experience. - Updated the DataSettings component to ensure the app does not quit during data migration, improving reliability and user feedback. * feat(DataSettings): add data copying option and update related messages - Introduced a switch to allow users to choose whether to copy data from the original directory when changing the app data path. - Updated user notifications and progress messages to reflect the new functionality, including warnings about data copying. - Enhanced localization files for multiple languages to include new strings related to data copying options and notifications. * fix(DataSettings): set default for data copying option to true - Updated the DataSettings component to set the default state of the data copying option to true. - Added a new CopyDataContent component to enhance the user interface by displaying the data copying option alongside the existing path settings. - Improved layout by ensuring proper spacing and alignment for better user experience. --------- Co-authored-by: beyondkmp <beyondkmkp@gmail.com> |
||
|
|
665a62080b
|
test: more unit tests (#5130)
* test: more unit tests - Adjust vitest configuration to handle main process and renderer process tests separately - Add unit tests for main process utils - Add unit tests for the renderer process - Add three component tests to verify vitest usage: `DragableList`, `Scrollbar`, `QuickPanelView` - Add an e2e startup test to verify playwright usage - Extract `splitApiKeyString` and add tests for it - Add and format some comments * fix: mock individual properties * test: add tests for CustomTag * test: add tests for ExpandableText * test: conditional rendering tooltip of tag * chore: update dependencies |
||
|
|
6356e1c0c2
|
refactor: improve sanitization and formatting in buildFunctionCallToo… (#6152)
refactor: improve sanitization and formatting in buildFunctionCallToolName function |
||
|
|
1475f75a35
|
feat: add buildFunctionCallToolName utility for generating tool names (#6136) | ||
|
|
71ae6f2713
|
fix: font-family changed in Windows with new Electron (#6079) | ||
|
|
1e40bd013d
|
fix: remove undici dependency and clean up ProxyManager code (#6020) | ||
|
|
392a821c6c |
feat: add cache size retrieval functionality and integrate with UI (#5689)
* feat: add cache size retrieval functionality and integrate with UI * chore: clean * update * update |
||
|
|
d4fe5dfa32 |
refactor: update zoom handling in IPC and settings (#5868)
* refactor: update zoom handling in IPC and settings * renamed zoom-related IPC channels for clarity * refactored zoom handling logic in ipc.ts and ShortcutService * removed unused zoom factor state management from settings * updated DisplaySettings component to manage zoom via buttons * localized zoom settings in multiple languages * refactor: remove unused zoom factor state from settings * eliminated the zoomFactor state from initialSettings as part of the zoom handling refactor * refactor: improve zoom handling in DisplaySettings component * initialized current zoom value on component mount * refactored resize event listener to prevent memory leaks * added cleanup for resize event listener to enhance performance * refactor: enhance resize event handling in DisplaySettings component * added logic to track previous window width to prevent unnecessary updates during resize events * improved comments for clarity on zoom handling and resize event listener functionality * refactor: streamline zoom handling across IPC and ShortcutService * updated handleZoomFactor function to accept an array of BrowserWindows for batch processing * simplified zoom factor adjustments in IPC and shortcut handlers * removed unnecessary window destruction checks for improved performance |
||
|
|
f258f5b2cb
|
fix: remove redundant local variables (#5654) | ||
|
|
e17765f1bf
|
fix: more robust portable data dir setup logic (#5347) |