Commit Graph

3320 Commits

Author SHA1 Message Date
one
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
2025-07-08 09:50:33 +08:00
Phantom
4111ee4c58
fix(databases): fix upgrade undefined error (#7929)
fix(databases): 修复升级到V8时语言对映射的逻辑错误

修复在数据库升级到V8版本时,语言对映射逻辑中未正确处理originPair为空的情况
2025-07-08 09:44:54 +08:00
Phantom
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的测试用例
2025-07-08 00:57:31 +08:00
Phantom
2b4ca03376
fix(store): fix store migrate and version (#7924)
* fix(store): 更新持久化存储版本号至121

更新版本号以匹配最新的迁移配置变更

* fix(store): 合并migrate版本121到120
2025-07-08 00:57:08 +08:00
Phantom
a314a43f0f
refactor(translate): Language Type (#7727)
* refactor(translate): 重构翻译功能使用语言枚举类型

统一翻译功能中的语言表示方式,使用枚举类型替代字符串
更新相关组件和服务以适配新的语言类型定义
添加数据库迁移脚本处理语言类型变更
添加store迁移处理语言类型变更

* refactor(translate): 移除调试用的console.log语句

* refactor(translate): 移除冗余的类型检查逻辑

* fix(db): 添加对TranslateHistory的db迁移

* fix(databases): 捕获数据库升级时的语言映射错误

添加错误处理以防止语言映射失败时中断升级过程

* fix(翻译组件): 修复语言比较和选择逻辑错误

修复语言比较时直接比较对象而非langCode的问题
更新Select组件使用langCode作为值并正确处理语言切换

* refactor(translate): 将saveTranslateHistory参数类型从Language改为LanguageCode

* refactor(hooks): 更新useMessageOperations中的语言代码类型

将targetLanguage和sourceLanguage参数类型从string更新为LanguageCode,提高类型安全性

* docs(translate): 更新JSDoc注释以使用TypeScript类型语法

* feat(备份服务): 升级数据库版本至v8并添加迁移逻辑

添加从v7到v8的数据库迁移支持
更新翻译历史记录中的语言代码映射
优化迁移过程中的日志记录和错误处理

* fix(store): 修复目标语言迁移时的默认值处理

确保在迁移配置时将旧版语言代码正确映射到新版格式,无法映射时使用默认英语

* refactor(translate): 将语言标签从字符串改为函数以支持动态翻译

* refactor(translate): 优化翻译窗口语言选择逻辑

重构翻译窗口的目标语言选择逻辑,使用语言代码获取完整语言信息
移除冗余的Space组件,简化Select选项渲染方式

* docs(技术文档): 新增数据库设置字段文档

添加数据库设置字段的说明文档,包含翻译相关字段的类型和用途

* refactor(translate): 修改db中biDirectionLangPair存储类型

将语言代码处理统一改为存储langCode而非Language对象
修改相关代码以使用getLanguageByLangcode进行转换
更新数据库升级逻辑以兼容新格式

* docs(translate): 为getLanguageByLangcode函数添加注释说明

* fix(数据库升级): 修复升级到V8时可能出现的空值访问问题

* refactor(databases): 优化语言映射错误处理逻辑

将不必要的try-catch块替换为if条件判断

* docs(technical): 修正数据库设置文档中的类型描述

* refactor: 优化语言代码处理和变量命名

* fix(ActionTranslate): 使用langCode存储双向翻译语言对

* fix(migrate): 修复错误的迁移过程

* refactor(translate): 重构语言选项从硬编码改为动态生成

将translateLanguageOptions从硬编码的数组改为通过LanguagesEnum动态生成,提高可维护性

* fix(store): 更新持久化存储版本并修复语言映射迁移问题

将持久化存储版本从119升级到120,并修复语言代码映射迁移问题。迁移过程中将旧的语言标识转换为新的标准语言代码格式。
2025-07-07 22:08:56 +08:00
George·Dong
278fd931fb
feat: object storage backup (#7791)
* chore: import opendal

* feat: 添加S3备份支持及相关设置界面

- 在IpcChannel中新增S3备份相关IPC事件,支持备份、恢复、
  列表、删除文件及连接检测
- 在ipc主进程注册对应的S3备份处理函数,集成backupManager
- 新增S3设置页面,支持配置Endpoint、Region、Bucket、AccessKey等
  参数,并提供同步和备份策略的UI控制
- 删除未使用的RemoteStorage.ts,简化代码库

提升备份功能的灵活性,支持S3作为远程存储目标

* feat(S3 Backup): 完善S3备份功能

- 支持自动备份
- 优化设置前端
- 优化备份恢复代码

* feat(i18n): add S3 storage translations

* feat(settings): 优化数据设置页面和S3设置页面UI

* feat(settings): optimize S3 settings state structure and update usage

* refactor: simplify S3 backup and restore modal logic

* feat(s3 backup): improve S3 settings defaults and modal props

* fix(i18n): optimize S3 access key translations

* feat(backup): optimize logging and progress reporting

* fix(settings): set S3 maxBackups as unlimited by default

* chore(package): restore opendal dependency in package.json

* feat(backup): migrate S3 Backup dependency from opendal to aws-sdk

* refactor(backup): simplify S3 config handling and partial updates

* refactor(backup): update Nutstore sync state to use RemoteSyncState

* feat(store): add migration 120 to initialize missing s3 settings

* feat(settings): add tooltip and help link for S3 storage

* fix(s3settings): disable backup button until all fields are set

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-07-07 21:00:51 +08:00
Phantom
1e0f0f47fa
feat(mcp): Add default args for built-in file system MCP server (#7865)
feat(mcp): 为内置文件系统MCP服务器添加允许目录参数
2025-07-07 11:05:47 +08:00
Konv Suu
942faf474b
fix(MessageMenubar): use classNames function to handle className (#7903) 2025-07-07 10:53:19 +08:00
one
9fd2583fd5
refactor(CodeEditor): add blur extension, move some extensions to hooks (#7882) 2025-07-07 10:51:56 +08:00
Chen Tao
463ca6185b
chore: move ocr and preprocess into knowledge folder (#7896)
chore: move ocr and preprocess into knowledge file
2025-07-07 07:29:15 +08:00
one
2c5bb5b699
chore: remove useless classnames (#7795)
* chore: remove useless classnames

* fix: respect filterIncludeUser
2025-07-07 01:46:11 +08:00
fullex
40519b48c5
fix(SelectionAssistant): overall bug fix from v1.4.8 (#7834)
* feat(SelectionService): enable toolbar visibility on all workspaces

* feat: update selection-hook to v1.0.5

* fix: show toolbar over fullscreen apps

* fix(SelectionService): adjust macOS window type handling for fullscreen apps
2025-07-06 23:41:20 +08:00
自由的世界人
7f8ad88c06
feat: add show/hide toggle for API keys in settings (#7883)
* feat: add show/hide toggle for API keys in settings

Introduces an eye icon button to toggle visibility of API keys and tokens in Joplin, Notion, Siyuan, and Yuque settings pages. Refactors input fields to allow users to view or hide sensitive credentials, improving usability and security. Also updates translation keys in AgentsSubscribeUrlSettings for consistency.

* refactor: settings pages to use Input.Password for tokens

Replaced custom password visibility toggles and related styled-components with Ant Design's Input.Password component in Joplin, Notion, Siyuan, and Yuque settings pages. This simplifies the codebase and improves consistency in handling sensitive input fields.

* fix: Improve layout of token input fields in settings

Wrapped token/password input and check button pairs in Joplin, Notion, and Siyuan settings with Ant Design's Space.Compact for better alignment and consistent UI.

* fix: trigger token change handler on blur in settings

Added onBlur event handlers to the Joplin and Siyuan token input fields to ensure token changes are handled when the input loses focus, improving reliability of token updates.
2025-07-06 21:37:17 +08:00
tommyzhang100504
c5d1f2dd7a
使自动更新版本号更健壮 (#7864) 2025-07-06 20:31:08 +08:00
one
8ab4682519
fix: hide scrollbars on capturing (#7867) 2025-07-06 19:51:59 +08:00
one
84b4ae0634
chore: update readme badges (#7888) 2025-07-06 19:50:47 +08:00
SuYao
8de304accf
fix: model recognize (#7887)
* fix(image generation): model recognize

* fix(grok): disable off option
2025-07-06 19:50:18 +08:00
Phantom
ed9ecd4667
fix(MCPSettings): ensure save button only restarts MCP server if it is running (#7869)
fix(MCPSettings): 修复服务器状态更新逻辑错误

仅在服务器激活时尝试重启,避免不必要的操作
2025-07-06 17:34:06 +08:00
Phantom
4c81efc5b3
fix(LMStudioSettings): prevent negative values in keepAliveMinutes input (#7868)
fix(LMStudioSettings): 修复keepAliveMinutes输入为负数的问题

确保输入值通过Math.floor处理且最小值为0,避免负数输入
2025-07-06 15:42:22 +08:00
one
a4620f8c68
refactor(ApiKeyList): add a popup for api key list (#7491)
* refactor(ApiKeyList): add a popup for api key list

- ApiKeyList for key management
- ApiKeyListPopup triggerred by a button
- Move formatApiKeys to utils for better reuse
- Simplify apikey related states in ProviderSettings for better
  integration with ApiKeyList
- Modify `updateProvider` to accept partial updates
- Update api key placeholder

* fix: strict type

* refactor: support websearch provider

* refactor: remove ApiCheckPopup

* refactor: simplify interfaces for ProviderSetting and WebSearchProviderSetting

* fix: sync input api key between sub-pages, futher simplification

* fix: bold title

* refactor: extract status icon colors

* refactor: add a status indicator to input box on error, update type definitions

* refactor: further simplification, make data flow clearer

* feat: support api key list for preprocess settings

* refactor: better naming, less confusion
2025-07-06 15:10:44 +08:00
SuYao
bf7e713eec
fix: qwen3 empty think block (#7873) 2025-07-06 14:40:55 +08:00
Phantom
c25f1f856a
fix(QuickPhrasesButton): resolve QuickPhrases database error (#7872)
fix(QuickPhrasesButton): 修复依赖assistant导致的频繁更新报错问题
2025-07-06 14:22:06 +08:00
Jason Young
60a3cac80d
fix: improve abortController robustness with defensive programming (#7856) 2025-07-06 14:18:03 +08:00
Jason Young
a1304054ce
test: add comprehensive unit tests for asyncInitializer and copy utilities (#7858)
* test: add unit tests for asyncInitializer and copy utilities

- Add tests for asyncInitializer class functionality
- Add tests for clipboard copy operations

* refactor(test): improve copy.test.ts structure and maintainability

- Remove complex shared testCopyFunction in favor of individual test cases
- Simplify mock cleanup by removing redundant afterEach
- Split test scenarios into focused, independent test cases
- Improve test readability with clear Chinese comments
- Maintain full test coverage while following TEST_UTILS.md guidelines
- Fix minor formatting in asyncInitializer.test.ts

* test: remove unnecessary test cases

- Remove AsyncInitializer type support test
- Remove maintain separate instances test
- These tests verify language features rather than business logic

* refactor(test): reorganize copy and export test structure

Restructure test organization based on PR review feedback:

- Move export functionality tests from copy.test.ts to export.test.ts
- Remove unnecessary "clipboard API not available" test
- Merge duplicate empty content tests for better coverage
- Add boundary tests for special characters and Markdown formatting
- Fix ESLint formatting issues

Test responsibilities are now clearer:
- copy.test.ts: Focus on clipboard operations (8 tests)
- export.test.ts: Focus on content conversion and edge cases

* fix(test): correct markdown formatting test for list items

Fix the regex pattern to properly handle markdown list items.
Replace  with separate patterns to avoid removing
the dash from list items incorrectly.

* fix(test): format prettier style for markdown test
2025-07-06 04:51:41 +08:00
fullex
a567666c79
docs: add testplan md (#7854) 2025-07-05 17:19:25 +08:00
one
1ebf546b70
chore: fix vite warning on dynamic imports (#7852) 2025-07-05 15:08:02 +08:00
Jason Young
19e9ba773f
test: add comprehensive tests for CopyIcon and MinAppIcon components (#7833)
* test: add comprehensive tests for CopyIcon and MinAppIcon components

- Add tests for CopyIcon covering default rendering, className merging, and prop passing
- Add tests for MinAppIcon covering default props, custom size, sidebar mode, styles, and edge cases
- Include snapshot tests for both components

* fix: update test snapshots after component styling changes

Update snapshots for CopyIcon and MinAppIcon components to match current
styled-components implementation (replaces inline styles with generated classes).

* refactor: simplify icon component tests based on PR review feedback

- CopyIcon: replace multiple redundant tests with single snapshot test
- MinAppIcon: remove duplicate test that overlaps with snapshot test
- Keep essential business logic tests for MinAppIcon (sidebar behavior, null return)
- Update test snapshots accordingly
2025-07-05 13:28:33 +08:00
SuYao
619aadce41
fix(models): update glm-4 model regex for improved matching (#7793)
- Changed the glm-4 model entry to use a regex pattern for better flexibility in version matching, allowing for optional version numbers and suffixes.
2025-07-05 13:25:19 +08:00
beyondkmp
a924da10c2
fix(WindowService): update default window dimensions to improve user experience (#7789)
- Changed the default width from 1080 to 960 and height from 670 to 600 for the main window.
- Adjusted minimum width and height settings to match the new defaults, enhancing compatibility with various screen sizes.
2025-07-05 00:13:22 +08:00
Konv Suu
ee4c4b16ec
fix(message-group): revert grid layout to use min-width (#7830) 2025-07-04 23:56:22 +08:00
one
f8c221f51a
fix(CodePreview): line height rounding (#7835) 2025-07-04 23:55:31 +08:00
one
2a48babd50
fix: update websearch i18n, allow more search results (#7797) 2025-07-04 23:50:42 +08:00
Chen Tao
e5d94d9a53
fix(MinerU): remove check quota (#7804)
fix: remove check quota
2025-07-04 17:47:52 +08:00
beyondkmp
8cfe6a5848
feat(settings): add option to disable hardware acceleration (#7811)
* feat(settings): add option to disable hardware acceleration

- Introduced a new setting to allow users to disable hardware acceleration.
- Added corresponding IPC channel and configuration management methods.
- Updated UI components to reflect the new setting and prompt for app restart.
- Localized confirmation messages for hardware acceleration changes in multiple languages.

* fix(settings): add delay before relaunching app after disabling hardware acceleration

- Introduced a 500ms delay before the application relaunches to ensure settings are applied correctly.
- This change improves user experience by allowing time for the setting to take effect before the app restarts.

* fix lint

* fix(settings): handle errors when disabling hardware acceleration

- Wrapped the hardware acceleration disabling function in a try-catch block to manage potential errors.
- Added user feedback through an error message if the operation fails, improving overall robustness.
2025-07-04 17:19:22 +08:00
SuYao
134ea51b0f
fix: websearch block and citation formatting (#7776)
* feat: enhance citation handling for Perplexity web search results

- Implemented formatting for Perplexity citations in MainTextBlock, including data-citation attributes.
- Updated citation processing in message store and thunk to support new citation structure.
- Added utility functions for link completion based on web search results.
- Enhanced tests to verify correct handling of Perplexity citations and links.

* refactor: streamline chunk processing in OpenAIApiClient

- Replaced single choice handling with a loop to process all choices in the chunk.
- Improved handling of content sources, ensuring fallback mechanisms are in place for delta and message fields.
- Enhanced tool call processing to accommodate missing function names and arguments.
- Maintained existing functionality for web search data and reasoning content processing.

* fix: improve citation handling and web search integration

- Enhanced citation formatting to support legacy data compatibility in messageBlock.ts.
- Updated messageThunk.ts to manage main text block references and citation updates more effectively.
- Removed unnecessary web search flag and streamlined block processing logic.

* fix: improve citation transforms to skip code blocks
- Add withCitationTags for better code structure
- Add tests
- Remove outdated code
- The Citation type in @renderer/types/index.ts is not referenced anywhere, so removed
- Move the actual Citation type from @renderer/pages/home/Messages/CitationsList.tsx to @renderer/types/index.ts
- Allow text selecting in tooltip

* test: update tests

* refactor(messageThunk): streamline citation handling in response processing

- Removed redundant citation block source retrieval during text chunk processing.
- Updated citation references handling to ensure proper inclusion only when available.
- Simplified the logic for managing citation references in both streaming and final text updates.

* refactor: simplify determineCitationSource for backward compatibility

---------

Co-authored-by: one <wangan.cs@gmail.com>
2025-07-04 17:03:45 +08:00
MyPrototypeWhat
2fad7c0ff6
refactor(messageThunk): streamline loading state management for topics (#7809)
* refactor(messageThunk): streamline loading state management for topics

- Reintroduced the handleChangeLoadingOfTopic function to manage loading states more effectively.
- Updated thunk implementations to ensure loading state is correctly set after message processing.
- Removed commented-out code for clarity and maintainability.

* fix(messageThunk): ensure loading state is managed correctly after message sending

- Added a finally block to guarantee that the loading state is updated after the sendMessage thunk execution.
- Removed commented-out code for improved clarity and maintainability.
2025-07-04 16:07:13 +08:00
Konv Suu
985859f1c3
feat(message-group): improve layout style (#7803) 2025-07-04 12:57:17 +08:00
one
d7f2ebcb6e
perf(CodePreview): virtual list for shiki code block (#7621)
* perf(CodePreview: virtual list for shiki code block

- move code highlighting to a hook
- use @tanstack/react-virtual dynamic list for CodePreview
- highlight visible items on demand

* refactor: change absolute position to relative position

* refactor: update shiki styles, set scrollbar color for shiki themes
2025-07-04 03:11:30 +08:00
Calcium-Ion
e3057f90ea
feat: add NewAPI provider (#7774)
* feat(provider): add NewAPI provider

* feat(providers): Enhance New API model discovery and configuration

This commit refactors the model fetching mechanism for the "New API" provider to improve user experience and support more detailed model information.

The `NewAPIClient` now fetches models directly from the `/models` endpoint, which provides richer metadata, including a new `supported_endpoint_types` field.

Key changes:
- The "Edit Models" popup now automatically adds a model if its `supported_endpoint_types` are provided by the API, using the first available type.
- The manual "Add Model" popup is now a fallback for models that do not declare their endpoint types.
- A new `NewApiModel` type is introduced to handle the structured API response.
- Added support for the `jina-rerank` endpoint type.

* chore(store): update version to 119 and adjust migration function for state management

* fix: adjust label column flex for New API provider in ModelEditContent and NewApiAddModelPopup

* feat: Implement batch adding for New API provider

* feat: Add useDynamicLabelWidth hook for adaptive label widths in forms and fix localization typos

* fix: update dependencies in various components to include translation function

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-07-04 01:22:22 +08:00
kangfenmao
244a42f3be chore(docs): update README files and remove Japanese version
- Updated the English and Chinese README files to improve layout and add new language options.
- Removed the Japanese README file as part of the documentation cleanup.
- Enhanced badge visibility and adjusted image sizes for better presentation.
- Added GitHub statistics section to provide insights into project activity.
2025-07-04 01:15:31 +08:00
Jason Young
8c06a87582
test: add comprehensive tests for IndicatorLight and Spinner components (#7781)
- Add tests for IndicatorLight component covering size, color conversion, shadow, and animation props
- Add tests for Spinner component with proper motion/react mocking
- Include snapshot tests for both components
2025-07-04 00:54:11 +08:00
kangfenmao
637019b0a8 chore(version): 1.4.8 2025-07-03 23:57:14 +08:00
kangfenmao
e3775b13a6 style: update modal close margin and adjust settings layout
- Added margin to the modal close button for improved spacing.
- Removed unnecessary divider in OCR settings for a cleaner layout.
- Set a minimum width for the search max result title to enhance alignment and readability.
2025-07-03 23:47:53 +08:00
kangfenmao
7fae55863e refactor(llm, migrate): reorganize PH8 provider configuration and migration logic
- Moved the PH8 provider configuration within the INITIAL_PROVIDERS array for better structure.
- Updated migration logic to ensure the PH8 provider is added and positioned correctly in the state during configuration migration.
- Removed redundant code related to provider initialization in the migration process, streamlining the overall logic.
2025-07-03 23:28:18 +08:00
kangfenmao
52d6c372ed fix(i18n): add provider key confirmation messages in multiple languages
- Added new localization strings for provider API key management, including confirmation and error messages for existing keys.
- Updated English, Japanese, Russian, Simplified Chinese, and Traditional Chinese localization files to reflect these changes, enhancing user experience and clarity in API key operations.
2025-07-03 23:16:40 +08:00
kangfenmao
3bced85fc3 refactor(AddKnowledgePopup): streamline settings panel and enhance advanced options
- Removed the left menu and integrated settings directly into the main panel for a more cohesive user experience.
- Introduced a toggle for advanced settings, allowing users to expand or collapse additional configuration options.
- Updated layout and styling for improved usability, including adjustments to padding and margins.
- Enhanced scroll behavior for the advanced settings section to ensure visibility when expanded.
- Minor adjustments to component imports and state management for better performance and clarity.
2025-07-03 23:16:40 +08:00
littleRiceZhou
f163ace86c
feat: add PH8 provider support (#7756)
- Introduced PH8 provider with configuration and logo.
- Updated SYSTEM_MODELS to include PH8 models.
- Added PH8 to internationalization files for multiple languages.
- Implemented migration logic to integrate PH8 into the existing provider structure.

Co-authored-by: jack.li <jack.li@enflame-tech.com>
2025-07-03 23:16:25 +08:00
Chen Tao
25d6a1f02f
HotFix: QuotaTag 循环调用 (#7788) 2025-07-03 18:22:29 +08:00
SuYao
9847db5c83
HotFix/dexie error (#7778)
* fix(dexieError): initialize database connection before fetching phrases

- Added an `init` method to the `QuickPhraseService` to ensure the Dexie database is opened before retrieving all quick phrases.
- Updated the `getAll` method to call the `init` method, improving reliability in data retrieval.

* fix(QuickPhraseService): ensure database initialization before updating phrases

- Added calls to the `init` method in the `update` and `updateOrder` methods to guarantee the database connection is established before performing updates, enhancing data integrity and reliability.

* fix(QuickPhraseService): prevent multiple database initializations

- Added a static flag to ensure the database initialization occurs only once, preventing redundant calls to the `init` method and improving performance.
2025-07-03 17:48:25 +08:00
fullex
4c353f4eee
fix(SelectionAssistant): [macOS] enable AXAPI in Chrome and Electron Apps (#7782)
* feat(SelectionAssistant): add macOS support and process trust handling

- Updated the selection assistant to support macOS, including new IPC channels for process trust verification.
- Enhanced the SelectionService to check for accessibility permissions on macOS before starting the service.
- Added user interface elements to guide macOS users in granting necessary permissions.
- Updated localization files to reflect macOS support and provide relevant user instructions.
- Refactored selection-related configurations to accommodate both Windows and macOS environments.

* feat(SelectionService): update toolbar window settings for macOS and Windows

- Set the toolbar window to be hidden in Mission Control and accept the first mouse click on macOS.
- Adjusted visibility settings for the toolbar window to ensure it appears correctly on all workspaces, including full-screen mode.
- Refactored the MacProcessTrustHintModal component to improve layout and styling of buttons in the modal footer.

* feat(SelectionToolbar): enhance styling and layout of selection toolbar components

* feat(SelectionService): enhance toolbar window settings and refactor position calculation

* feat(SelectionToolbar): update button padding and add last button padding for improved layout

* chore(dependencies): update selection-hook to version 1.0.2 and refine build file exclusions in electron-builder.yml

* feat(SelectionService): center action window on screen when not following toolbar

* fix(SelectionService): implement workaround to prevent other windows from bringing the app to front on macOS when action window is closed

* fix(SelectionService): refine macOS workaround to prevent other windows from bringing the app to front when action window is closed; update selection-toolbar logo padding in styles

* fix(SelectionService): implement macOS toolbar reload to clear hover status; optimize display retrieval logic

* fix(SelectionService): update macOS toolbar hover status handling by sending mouseMove event instead of reloading the window

* chore: update selection-hook dependency to version 1.0.3 in package.json and yarn.lock

* fix(SelectionService): improve toolbar visibility handling on macOS and ensure focusability of other windows when hiding the toolbar

* chore: update selection-hook dependency to version 1.0.4 in package.json and yarn.lock

---------

Co-authored-by: Teo <cheesen.xu@gmail.com>
2025-07-03 17:06:02 +08:00