Phantom
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>
2025-08-28 15:28:27 +08:00
one
168cc36410
fix(i18n): backup/restore progress ( #9622 )
2025-08-28 14:26:45 +08:00
Teo
2dbe9c1e0e
feat(Link): add hyperlink tooltips ( #9620 )
2025-08-28 11:54:50 +08:00
Phantom
e222ba5459
fix: missing dependency ( #9615 )
...
fix: 修复依赖缺失
2025-08-28 11:52:10 +08:00
Phantom
7407bb335d
feat: more abort control ( #9267 )
...
* feat(abort): 添加 abortKey 参数支持以自定义中止控制
支持通过参数传入 abortKey 来替代 messageId,提供更灵活的中止控制方式
* fix(aiCore): 修复checkApi时未正确abort的问题
* feat(翻译): 添加翻译中止功能
支持在翻译过程中中止操作,包括添加中止键状态管理、中止错误处理和界面停止按钮
添加相关国际化文案
* feat(i18n): 添加翻译中止相关文本和多语言支持
* style(translate): 调整停止按钮图标大小以保持视觉一致性
* fix(TranslateService): 改进翻译错误处理逻辑
正确处理翻译中止和失败的情况,统一错误信息格式化方式
* fix(aiCore): 去除不必要的类型断言
* style(TabContainer): 移除多余的空格并保持代码整洁
* fix(translate): 添加翻译前校验并修复文件处理异步问题
在翻译前添加couldTranslate校验,防止无效操作
将processFile改为异步调用以正确处理文件处理流程
2025-08-27 23:56:11 +08:00
Phantom
aaa0eb7140
feat: user filter models ( #8953 )
...
* feat(组件): 添加模型标签组件并重构相关引用
添加新的模型标签组件(EmbeddingTag, ReasoningTag等)并集中导出
重构ModelTagsWithLabel组件使用新的标签组件
移除旧的ModelCapabilities引用
* refactor(Tags): 移除FreeTag组件中未使用的showLabel属性
* feat(模型选择弹窗): 添加按标签筛选模型功能
在模型选择弹窗中新增标签筛选功能,支持按视觉、网页搜索、推理、工具调用、免费、嵌入和重排等标签类型筛选模型
* feat(i18n): 添加按标签筛选的翻译文本
* feat(SelectModelPopup): 优化模型筛选逻辑并添加类型安全的objectKeys工具函数
重构模型筛选逻辑,简化条件判断并支持外部传入的filterTypes控制显示。添加类型安全的objectKeys工具函数用于获取对象键名。调整筛选标签的显示逻辑,仅在相关filterTypes存在时显示对应标签。
* refactor(SelectModelPopup): 移除已注释的冗余代码
* fix(SelectModelPopup): 修复布局偏移问题并调整内边距
为弹出容器添加动态高度以避免布局偏移
调整过滤容器的内边距
* refactor(model): 将isFreeModel函数移动到单独的文件并添加模型标签功能
重构模型相关工具函数,将isFreeModel从utils/index.ts移动到utils/model.ts
新增getModelTags函数用于获取模型标签状态
更新相关导入路径以保持一致性
* refactor(SelectModelPopup): 重构扁平列表项类型定义以提高类型安全性
将 FlatListItem 拆分为 FlatListGroup 和 FlatListModel 两种具体类型
确保模型项必须包含 model 属性而分组项不包含
更新相关组件代码以适配新的类型定义
* docs(utils/model): 添加getModelTags函数的注释说明
* refactor(SelectModelPopup): 重构模型筛选逻辑,优化标签管理
- 将模型筛选逻辑拆分为用户筛选和搜索筛选两部分
- 去除内置筛选
- 使用getModelTags获取模型标签
- 优化筛选条件判断逻辑,提高可读性
* refactor(SelectModelButton): 重构模型选择按钮的过滤逻辑
使用模型类型判断函数替代硬编码的过滤类型数组
* fix(MessageMenubar): 修复模型提及过滤逻辑,排除嵌入和重排模型
默认过滤条件现在会排除嵌入和重排模型,确保视觉模型检查时也应用此过滤
* feat(AssistantModelSettings): 添加模型过滤功能以排除嵌入和重排模型
* perf(SelectModelPopup): 使用useMemo优化模型列表计算性能
避免在每次渲染时重新计算模型列表,仅在modelFilter或providers变化时重新计算
* test(model): 将 isFreeModel 测试迁移到 model.test.ts 并添加 getModelTags 测试
* feat(types): 添加类型安全的对象键值对转换函数
* feat(模型选择弹窗): 优化标签筛选功能并添加已选标签显示
重构标签筛选逻辑,使用更简洁的预测函数配置方式
添加已选标签显示区域,提升用户操作体验
更新国际化文件添加"已选标签"翻译
* feat(i18n): 添加多语言翻译的"selected tags"字段和"code"模块
为过滤功能添加"selected tags"翻译字段
新增"code"模块的多语言翻译内容
* refactor(SelectModelPopup): 优化标签筛选逻辑和样式布局
移除重复的标签选择逻辑,合并为单一标签组件
调整筛选区域的布局和样式,简化界面结构
将PAGE_SIZE从11改为12以适应布局需求
2025-08-27 22:55:14 +08:00
Phantom
6376bbb9a7
fix: mcp-auto-install cannot start ( #9015 )
...
* refactor(types): 将内置MCPServer类型从MCPServer分离并添加类型守卫
将内置MCPServer相关逻辑从通用MCPServer类型中分离,新增BuiltinMCPServer类型和类型守卫函数
* refactor(MCPService): 使用isBuiltinMCPServer检查内置服务器类型
修改传输层创建逻辑,通过isBuiltinMCPServer函数判断是否为内置服务器,并排除特定服务器
* refactor(types): 统一内置MCP服务器名称的键值格式并优化类型定义
将BuiltinMCPServers对象的键改为与值相同的格式,使结构更一致
同时简化BuiltinMCPServerName类型定义和isBuiltinMCPServerName检查逻辑
* refactor(types): 为内置MCP服务器名称添加类型定义
为`MCP_AUTO_INSTALL_SERVER_NAME`和`builtInMcpDescriptionKeyMap`添加`BuiltinMCPServerName`类型定义,提高类型安全性
* refactor(types): 重命名BuiltinMCPServers为BuiltinMCPServerNames以更准确描述用途
* style: 移除 TabContainer 组件中的多余空行
* refactor(mcpServers): 使用类型化的BuiltinMCPServerName替换字符串参数
将createInMemoryMCPServer函数的name参数从string类型改为BuiltinMCPServerName类型,提高类型安全性
* refactor(types): 重构内置MCPServer名称常量及类型定义
将BuiltinMCPServerNames的键名改为驼峰命名,并添加BuiltinMCPServerNamesArray常量
修改isBuiltinMCPServerName函数使用数组进行判断
* refactor(mcp): 使用枚举替换硬编码的服务器名称字符串
2025-08-27 22:46:42 +08:00
Pleasure1234
c01642ef22
fix: decode Bing redirect URLs in LocalBingProvider ( #9593 )
...
Added logic to extract and decode the actual target URL from Bing redirect links in LocalBingProvider. Also introduced debug logging in SearchService to log search URLs.
2025-08-27 21:34:01 +08:00
SuYao
72f4584b0f
fix(aihubmix): gemini image generation ( #9601 )
2025-08-27 16:26:46 +08:00
Phantom
941f86008b
fix: restrict using gemini native tools and mcp tools simultaneously ( #9361 )
...
* feat(providers): 添加对支持URL上下文的提供者类型的检查
新增 `isSupportUrlContextProvider` 函数用于检查提供者是否支持URL上下文功能
* fix(InputbarTools): 修复URL上下文按钮显示条件判断
添加对模型提供者是否支持URL上下文的检查
* fix(gemini): 修复原生工具与函数调用同时启用时的冲突
当同时启用web搜索和URL上下文工具时,如果已存在函数调用工具,则添加警告日志提示当前不支持同时使用
* feat(i18n): 限制 Gemini 同时使用网页上下文与 MCP 工具
添加多语言翻译文案和功能实现,当用户尝试同时启用网页上下文和 MCP 工具时,显示警告提示并自动禁用网页上下文
* perf(WebSearchButton): 使用定时器优化更新性能避免卡顿
移除startTransition并使用useTimer的setTimeoutTimer来延迟更新操作,解决updateAssistant导致的快捷面板关闭卡顿问题
* feat(i18n): 限制 Gemini 原生搜索工具与函数调用的同时使用
添加对 Gemini 原生搜索工具与函数调用同时使用时的冲突检测
更新相关国际化文案和功能实现
* fix(GeminiAPIClient): 修复工具使用模式判断逻辑
当工具使用模式为'prompt'时应该允许使用native tool
* reafactor: 简化 Gemini 模型下工具使用模式的 URL 上下文和网页搜索检查逻辑
* fix(WebSearchButton): 修复条件判断
* refactor(utils): 提取函数工具使用模式判断逻辑到单独函数
* test(assistant): 添加工具使用模式功能的单元测试
* refactor(InputbarTools): 使用isGeminiModel函数替代字符串检查
简化模型类型检查逻辑,提高代码可读性和维护性
* perf(Inputbar): 使用setTimeoutTimer替代startTransition解决性能问题
2025-08-27 14:37:46 +08:00
one
fac8e91d3a
refactor(DraggableList): remove antd List component ( #9565 )
...
* refactor(DraggableList): remove antd List component
The DraggableList component was unnecessarily wrapped in an antd List component. This change removes the antd List and replaces it with a standard div.
A `className` has been added to the new div for testing purposes. The `listProps` prop is preserved and its type is updated to `React.HTMLAttributes<HTMLDivElement>`.
The tests have been updated to reflect the new DOM structure, using a class selector instead of a data-testid. The antd mock has been removed, and the snapshot has been updated.
* test: fix
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-08-27 14:37:26 +08:00
yyhhyyyyyy
ce14d15ba3
feat: support openrouter gemini 2.5 flash image preview ( #9587 )
...
* feat: support openrouter gemini 2.5 flash image preview
* feat: improve image content handling with type safety
* fix: code fmt
2025-08-27 13:03:50 +08:00
SuYao
f273621082
fix(models): enhance model type checks for function calling and web s… ( #9579 )
...
fix(models): enhance model type checks for function calling and web search models
2025-08-27 00:50:47 +08:00
one
ddc5f46e9b
feat: goto provider settings from models popup ( #9573 )
...
* feat: goto provider settings from models popup
* refactor: improve paddings
* refactor: update types
* refactor: update types
* doc: update comments
* refactor: more comments
* refactor: scroll to the selected provider on navigation
* test: update mocks
2025-08-27 00:04:52 +08:00
Phantom
7a0da13676
fix(qwen3): fix qwen3 thinking control by soft command ( #9568 )
...
fix(qwen3): 修复Qwen3模型思考模式处理逻辑
重构processPostsuffixQwen3Model函数,简化后缀处理逻辑
添加nvidia到不支持思考模式的提供商列表
移除postsuffix参数
2025-08-26 22:41:10 +08:00
Yricky
267b41242d
fix: move topic prompt handling to message thunk and fix prompt logic ( #9569 )
2025-08-26 22:20:16 +08:00
beyondkmp
eac71f1f43
refactor(TranslateService): remove content parameter to reduce token ( #9567 )
...
* refactor(TranslateService): remove content parameter from fetchTranslate function
- Updated fetchTranslate function to eliminate the content parameter, simplifying its signature.
- Adjusted related calls to ensure compatibility with the new function definition, maintaining functionality while improving code clarity.
* Update src/renderer/src/services/TranslateService.ts
---------
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
2025-08-26 19:30:23 +08:00
Phantom
bd4ba47e61
feat(models): support qwen-flash & deepseek v3.1 (limited) ( #9539 )
...
* feat(models): 添加 qwen-flash 模型支持并更新相关配置
* feat(ai): 添加对deepseek-v3.1模型的支持(dashscope)
添加deepseek_hybrid类型到ThinkModelTypes,并实现相关推理逻辑
* refactor(openai): 移除调试日志语句以清理代码
* feat(推理模型): 增强DeepSeek混合推理模型支持并优化逻辑顺序
重构DeepSeek混合推理模型的判断逻辑,支持更多版本格式
将Doubao思考模式处理逻辑移至更合理的位置
添加对DeepSeek模型在不同provider下的思考控制处理
* fix(deepseek): 支持openrouter的deepseek-chat-v3.1模型推理控制
统一处理不同provider的DeepSeek混合推理模型控制方式,添加对openrouter的deepseek-chat-v3.1模型支持
* fix(模型): 修正函数调用模型的判断逻辑
更新函数调用模型的判断条件,明确不支持v3.1函数调用的提供商并处理openrouter的特殊情况
* feat(openai): 为silicon模型添加enable_thinking配置
* fix(模型配置): 修正深度求索混合推理模型的函数调用支持逻辑
更新深度求索混合推理模型的函数调用判断逻辑,默认支持函数调用
* feat(模型支持): 为DeepSeek V3.1添加白名单支持
添加对DeepSeek V3.1混合推理模型的白名单支持,目前仅允许openrouter、dashscope和doubao作为提供商
* feat(config): 添加silicon到DeepSeek V3.1支持的白名单中
* feat(sdk): 添加对NVIDIA推理参数的支持
在ReasoningEffortOptionalParams类型中添加chat_template_kwargs参数,用于支持NVIDIA的推理配置。同时在模型支持列表中新增nvidia提供商,并在OpenAIApiClient中实现对应的参数处理逻辑。
* refactor(openai): 使用SystemProviderIds替换硬编码的provider id字符串
2025-08-26 17:43:29 +08:00
Phantom
5e31c809e1
fix(openai): Gemma system message ( #9561 )
...
* fix(openai): 修复不支持系统消息的模型处理逻辑
当模型不支持系统消息时,将其转换为用户消息,确保请求消息的正确构建
* fix(openai): 处理不支持系统消息的模型时合并用户消息
当模型不支持系统消息时,将系统消息内容合并到第一条用户消息中
添加空用户消息的警告日志
2025-08-26 16:32:45 +08:00
kangfenmao
f9869ef453
Revert "fix(hooks): type safe useAssistant ( #9428 )"
...
This reverts commit 4833f36e0b .
https://github.com/CherryHQ/cherry-studio/pull/9428#issuecomment-3222381185
2025-08-26 11:02:31 +08:00
Phantom
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 f23e37941a .
* feat(ocr): 为Tesseract OCR添加多语言支持配置
添加对简体中文、繁体中文和英文的语言支持配置,扩展OCR功能以满足多语言识别需求
* refactor(types): 将Tesseract.LanguageCode重命名为TesseractLangCode以提高可读性
* feat(OCR设置): 添加OCR提供商设置组件及状态管理
新增OCR提供商设置组件,支持显示当前选择的OCR提供商信息
在OCR图片设置中添加状态管理,同步提供商选择到父组件
添加Tesseract OCR设置组件,支持多语言选择(暂不可用)
* fix(DocProcessSettings): 修复OCR语言选择默认值问题
* feat(i18n): 添加OCR提供商相关错误和警告的翻译
* fix(ocr): 将 Tesseract 语言配置类型改为部分
* fix(ocr): 修复ocrImage函数未使用await导致的问题
* fix(ocr): 修复迁移配置中ocr状态的初始化方式
将分散的属性赋值改为对象整体赋值,避免潜在的属性丢失问题
* chore: 移除不再使用的@types/tesseract.js依赖
* refactor(OCR设置): 添加错误边界处理并移除无用注释
在OCR设置组件中添加ErrorBoundary以处理潜在错误
移除OcrTesseractSettings中的TODO注释
* build: 添加 sharp 依赖以支持图片处理功能
* refactor(ocr): 添加OCR图像预处理功能并优化TesseractService
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* refactor(ocr): 移除独立的灰度处理模块并改进预处理流程
将灰度处理功能直接集成到OCR预处理中,不再需要单独的image模块
添加normalise和threshold处理以提升OCR识别效果
* feat(i18n): 添加文件上传tool tip的翻译文本
* feat(hooks): 添加useDrag钩子实现拖拽功能
* feat(translate): 添加拖拽上传文件功能
实现文件拖拽上传功能,包括拖拽区域高亮显示和提示文本
添加多文件上传错误提示和未知错误处理
* feat(i18n): 添加文件拖拽和多文件上传错误提示的翻译
* refactor(PasteService): 优化粘贴服务逻辑并移除不必要的翻译依赖
将`t`参数改为布尔类型的`showMessage`参数,简化消息显示逻辑
添加默认的粘贴文本长度阈值
使文件扩展名检查变为可选参数
更新相关调用处的参数传递
* Revert "refactor(PasteService): 优化粘贴服务逻辑并移除不必要的翻译依赖"
This reverts commit 07c7ecd0cf .
* fix(preload): 为文件获取方法添加返回类型声明
添加Promise<FileMetadata | null>返回类型以明确get方法的返回值类型,提高代码可读性和类型安全性
* refactor(TopView): 移除未使用的loggerService导入和调用
* feat(TranslatePage): 添加对粘贴上传文件的支持
新增粘贴上传文件功能,处理剪贴板中的文件数据并支持图片临时文件创建
添加文件类型检查和不支持类型的错误提示
重构文件选择逻辑到通用函数 getSingleFile
* feat(i18n): 添加不支持文件类型的多语言翻译
* feat(translate): 添加翻译输入状态并优化内容更新逻辑
添加translateInput状态以存储翻译输入内容
优化setTranslatedContent reducer直接修改状态而非返回新对象
* refactor(translate): 将文本输入状态迁移至redux存储
移除本地状态_text和使用useState管理的text,改为从redux store中获取和管理输入文本
* fix(translate): 修复依赖数组中缺少setText导致的状态更新问题
* fix(store): 初始化翻译输入为空字符串
修复迁移配置时未初始化翻译输入的问题,避免潜在的undefined错误
* fix(hooks): 使 useDrag 的 onDrop 参数变为可选
处理 onDrop 未定义时的调用情况,避免运行时错误
* fix(拖拽): 修复拖拽状态未正确更新的问题
修复 handleDragOver 中未设置 isDragging 状态的问题
为输入区域添加独立的拖拽状态处理
防止容器元素意外触发文件拖放
* refactor(translate): 在文件拖放错误处理中移动错误提示位置
将文件拖放错误提示从空文件检查移动到文件读取错误捕获中
* improve image preprocess
---------
Co-authored-by: beyondkmp <beyondkmp@gmail.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2025-08-26 00:21:26 +08:00
Phantom
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 f23e37941a .
* feat(ocr): 为Tesseract OCR添加多语言支持配置
添加对简体中文、繁体中文和英文的语言支持配置,扩展OCR功能以满足多语言识别需求
* refactor(types): 将Tesseract.LanguageCode重命名为TesseractLangCode以提高可读性
* feat(OCR设置): 添加OCR提供商设置组件及状态管理
新增OCR提供商设置组件,支持显示当前选择的OCR提供商信息
在OCR图片设置中添加状态管理,同步提供商选择到父组件
添加Tesseract OCR设置组件,支持多语言选择(暂不可用)
* fix(DocProcessSettings): 修复OCR语言选择默认值问题
* feat(i18n): 添加OCR提供商相关错误和警告的翻译
* fix(ocr): 将 Tesseract 语言配置类型改为部分
* fix(ocr): 修复ocrImage函数未使用await导致的问题
* fix(ocr): 修复迁移配置中ocr状态的初始化方式
将分散的属性赋值改为对象整体赋值,避免潜在的属性丢失问题
* chore: 移除不再使用的@types/tesseract.js依赖
* refactor(OCR设置): 添加错误边界处理并移除无用注释
在OCR设置组件中添加ErrorBoundary以处理潜在错误
移除OcrTesseractSettings中的TODO注释
* build: 添加 sharp 依赖以支持图片处理功能
* refactor(ocr): 添加OCR图像预处理功能并优化TesseractService
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* refactor(ocr): 移除独立的灰度处理模块并改进预处理流程
将灰度处理功能直接集成到OCR预处理中,不再需要单独的image模块
添加normalise和threshold处理以提升OCR识别效果
* improve image preprocess
---------
Co-authored-by: beyondkmp <beyondkmp@gmail.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2025-08-26 00:13:24 +08:00
Phantom
3d7a64a11d
fix: stream output option should not be true when undefined ( #9518 )
...
fix: 修复streamOutput默认值设置问题
2025-08-25 20:41:26 +08:00
one
548916e6e1
feat(McpServersList): add a search bar ( #9520 )
...
* feat(McpServersList): add a search bar
* refactor: show different empty tips
2025-08-25 20:35:48 +08:00
one
ffa2eb57b1
refactor(Svg): relax sanitizer rules ( #9522 )
2025-08-25 20:35:32 +08:00
SuYao
57702f545d
fix(OpenAIApiClient): 适配glm 4.5 toolcall ( #9516 )
...
* fix(OpenAIApiClient): update toolCalls handling to support dynamic index assignment
* refactor(OpenAIApiClient): streamline toolCalls management with reusable object structure
2025-08-25 19:49:52 +08:00
Phantom
1764be8a30
style(selection-toolbar): use primary color for selection toolbar ( #9515 )
...
* style(selection-toolbar): 统一使用主色变量并移除冗余样式
移除重复定义的颜色变量,统一使用 --color-primary 作为悬停状态的主色
* style: 移除重复的 --color-primary 变量定义
2025-08-25 19:49:23 +08:00
SuYao
e90b9a5a95
fix: unexpected anthropic model recognization ( #9517 )
...
* fix: unexpected anthropic model recognization
* refactor(RawStreamListenerMiddleware): replace model provider retrieval with API client instance check
2025-08-25 19:41:00 +08:00
Jason Young
a398010213
feat(QuickPanel): Soft hide and symbol toggle fix( #9326 ) ( #9371 )
...
* feat(QuickPanel): 软隐藏与符号切换;性能优化与清理
- 交互改进
- 无匹配时“软隐藏”(不销毁、折叠且不拦截)
- 回删修正后有结果自动展开
- 输入新符号(/ 或 @)即切换到对应面板
- 性能优化
- 搜索 50ms 防抖,降低高频输入开销
- 按搜索词只构建一次模糊匹配正则
- 使用 WeakMap 缓存每项拼音,避免重复转换
- 折叠时不渲染列表、不注册全局键盘监听
- 代码清理
- 删除 noMatchTimeoutRef 及其清理 effect
- 删除未使用的 currentMessageId 引用
- 移除重复的 setText('') 清空逻辑
- 保持不变
- 多选/固定/清空等既有模型面板逻辑
- ESC、外部点击、删除符号的关闭语义
- 初始空查询直接展示可选项
* feat(quickpanel): 清除模型时同时删除@符号和搜索文本
- 在MentionModelsButton中记录触发信息
- 清除操作时根据触发类型删除@符号
- 仅处理输入触发的场景,按钮触发不需要处理
* refactor(quickpanel): 提取通用的删除@符号函数
- 创建 removeAtSymbolAndText 函数统一处理删除逻辑
- 支持两种模式:精确删除(ESC,使用searchText)和自动查找(清除)
- ESC和清除操作现在使用相同的核心逻辑
- 提高代码可维护性和一致性
* handleInput 中的 ctx.close('delete-symbol') 替换为本地 handleClose('delete-symbol'),确保 Backspace 删除触发符时同步受控输入值。
* - 统一 @ 清除逻辑:基于光标+搜索词的锚点定位
- 修复 ESC/清除误删邮箱/URL 中 @ 的问题
- 精确匹配优先:从光标左侧最近的 “@+searchText”
- 失败兜底:验证触发位 position,一致删整段,不一致仅删单个 @
- 清除按钮:未知搜索词时按光标左侧最近 @ 删至空格/换行
- 保持行为一致:ESC 与“清除模型”共用同一删除函数
* - 修复:无匹配时“清除”被过滤导致不可用的问题
- 方案:为“清除”项添加 alwaysVisible 标记,不参与过滤并始终置顶展示
- 过滤改造:QuickPanel 将列表拆分为固定项与普通项,仅对普通项执行包含/模糊/拼音过滤,最终合并渲染
- 折叠逻辑:collapsed 仅依据“非固定项”的匹配数;当仅剩“清除”时仍折叠隐藏,UI 不受影响
2025-08-25 16:06:14 +08:00
Chen Tao
c49201f365
fix: Knowledge Search Not Open Target ( #9504 )
...
* fix : #9488
* chore
2025-08-25 14:20:15 +08:00
one
070614cd3c
feat: new dnd list ( #9311 )
...
* feat: add Sortable
* refactor: update SortableItem style, fix grid layout
* refactor: dragOverlay
* refactor: use Sortable grid in mcp server list
* refactor: improve style
* refactor: support custom dropAnimation for drag overlay
* fix: cursor grabbing
* fix: unexpected drag
* fix: z-index
* revert: assistants tab
* refactor: improve button layout
* docs: update comments
* fix: interaction between Sortable and portal elements
* refactor: improve McpServerCard dnd experience
* refactor: prevent pointer events on drag overlay
* refactor: rename and extraction
* refactor: simplify usage
* refactor: add showGhost
2025-08-25 14:19:56 +08:00
JwinPBE
cce88745c2
feat: add seed-36b <seed:think></seed:think> parser support ( #9498 )
...
* feat: add seed-36b thinking tag parser support
Signed-off-by: jwinpbe <jwin_pbe@proton.me>
* fix: capitalize model name for proper parsing
Signed-off-by: jwinpbe <jwin_pbe@proton.me>
* Revert "fix: capitalize model name for proper parsing"
This reverts commit dd9b45e3f4 .
* fix: make seed-36b model parser case-insensitive
Signed-off-by: jwinpbe <jwin_pbe@proton.me>
* refactor(ThinkingTagExtractionMiddleware): 使用getLowerBaseModelName统一处理模型ID
简化模型ID比较逻辑,避免重复调用toLowerCase方法
---------
Signed-off-by: jwinpbe <jwin_pbe@proton.me>
Co-authored-by: jwinpbe <jwin_pbe@proton.me>
Co-authored-by: icarus <eurfelux@gmail.com>
2025-08-25 14:12:14 +08:00
Yuhang
4b02878390
fix: follow-up to PR#9384 ( #9495 )
...
* fix: set the default text color of 'P' to change with the theme
* Update AddProviderPopup.tsx
* refactor(utils): 将 generateColorFromChar 函数从 naming 模块移动到 style 模块
移动 generateColorFromChar 函数到更合适的 style 模块,并更新相关测试文件
* feat(style): 添加十六进制颜色验证和前景色计算功能
添加颜色工具函数包括:
- 十六进制颜色格式验证
- RGB值转换
- 相对亮度计算
- 根据背景色自动选择前景色功能
这些功能用于确保颜色可访问性和文字可读性
* refactor(types): 将HexColor类型移动到types模块
将HexColor类型定义从style.ts移动到types/index.ts中,保持类型定义集中管理
* feat(ProviderSettings): 为自定义提供商添加前景色计算
添加 getForegroundColor 工具函数用于计算自定义提供商 logo 的前景色
在 ProvidersList 和 AddProviderPopup 组件中应用前景色计算
确保 logo 文字在不同背景色下保持可读性
* refactor(types): 将 isHexColor 函数从 utils/style.ts 移动到 types/index.ts
统一颜色相关类型和函数的存放位置,提高代码组织性
* feat(图标): 添加PoeLogo图标并支持自定义尺寸
在ProviderSettings页面中添加PoeLogo图标支持,并扩展getProviderAvatar函数以支持自定义尺寸参数
修复SVGIcon组件中fill-rule属性的命名错误,统一使用camelCase命名规范
* refactor(providers): 移除poe.svg并使用svg图标组件
* fix(SVGIcon): 修正SVG属性stop-color为stopColor以符合React规范
* Update src/renderer/src/types/index.ts
---------
Co-authored-by: icarus <eurfelux@gmail.com>
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
2025-08-25 13:16:15 +08:00
George·Dong
b2e33f892a
fix(CodeTool): Code页面显示不全 ( #9492 )
2025-08-25 10:46:18 +08:00
Phantom
8925d7d546
feat: translate history star ( #9433 )
...
* feat(types): 为翻译历史记录添加收藏状态字段
* feat(翻译服务): 添加更新翻译历史记录功能
新增updateTranslateHistory方法用于更新翻译历史记录,支持修改原文、译文、语言及收藏状态
* refactor(TranslateService): 简化更新翻译历史记录的参数结构
* fix(TranslateService): 添加删除翻译历史的错误处理
捕获删除翻译历史时的异常并记录日志,避免静默失败
* feat(翻译历史): 添加收藏功能并优化删除操作
- 新增翻译历史项的收藏功能
- 将删除操作从右键菜单移至显式按钮
- 增加删除失败的国际化提示
- 调整列表项高度以适应新功能
* feat(翻译历史): 添加收藏筛选功能
新增显示已收藏翻译历史的功能,用户可以通过点击星标按钮切换筛选状态
* feat(i18n): 添加翻译历史删除失败的错误消息
为翻译历史功能添加删除操作失败时的错误提示消息,支持多语言显示
* fix(翻译历史): 将删除按钮文本改为"删除翻译历史"并添加确认弹窗
修改删除按钮文本使其更明确,并添加确认弹窗防止误操作
* style(TabContainer): 移除多余的空行以保持代码整洁
2025-08-25 00:10:41 +08:00
one
56cec26858
fix: topics tab tooltip not hide ( #9457 )
2025-08-24 21:10:33 +08:00
Phantom
107c01913d
feat: error boundary ( #9462 )
...
* build: 添加 react-error-boundary 依赖
添加 react-error-boundary 包以增强 React 应用的错误处理能力
* feat(组件): 添加ErrorBoundary组件用于错误边界处理
* feat(home): 为HomeTabs和Chat组件添加错误边界处理
* refactor(ErrorBoundary): 移除多余的ErrorContainer包装并优化结构
* feat(ErrorBoundary): 添加重新加载按钮并优化错误边界样式
添加重新加载功能按钮,方便用户快速恢复应用
调整错误边界容器的布局样式,使其居中显示
* style(ErrorBoundary): 移除ErrorContainer的固定高度以改善布局灵活性
* test(ErrorBoundary): 添加测试错误边界组件的功能按钮
添加一个用于测试错误边界组件功能的按钮组件,该按钮点击后会抛出错误以验证错误边界是否正常工作。此组件仅用于测试,合并前需要删除。
* feat(路由): 为路由组件添加错误边界处理
在Router组件中包裹ErrorBoundary以捕获并处理子组件中的错误
* fix(ErrorBoundary): 修复错误边界中翻译键的拼写错误
* feat(i18n): 添加边界错误处理和主题不存在错误的多语言支持
* refactor(ErrorBoundary): 移除用于测试的ThrowError组件
2025-08-24 18:49:14 +08:00
co63oc
6d102ccef8
chore: fix typos ( #9477 )
2025-08-24 17:15:35 +08:00
Phantom
fba358c0fc
fix(selection): fix missing settings ( #9454 )
...
* fix(selection): 修复流式输出设置合并问题并添加调试日志
确保assistant的settings在设置streamOutput时保留原有属性
在ActionGeneral组件中添加处理消息前的调试日志
* style: 移除 TabContainer 组件中的多余空行
* fix(HomeWindow): 修复助手设置被覆盖的问题
* refactor(assistant): 优化助手设置处理逻辑,避免重复创建对象
统一处理助手设置逻辑,确保streamOutput属性存在
在多个地方避免直接修改currentAssistant,改为创建新对象
* fix: 使用cloneDeep替代对象展开并显式关闭功能
修复对象浅拷贝可能导致的问题,使用lodash的cloneDeep进行深拷贝
显式关闭web搜索、mcp服务和知识库功能以确保一致性
* refactor: 注释掉未使用的功能配置以提升代码可读性
2025-08-24 17:00:49 +08:00
Phantom
17cee98617
fix(WebSearch): fix web search condition check ( #9310 )
...
* fix(web搜索): 修正web搜索功能的条件判断和逻辑处理
修复web搜索启用条件的判断逻辑,统一使用webSearchProviderId作为启用标志
重命名相关函数以更准确表达其功能,并优化quickPanel打开逻辑
* fix(WebSearchButton): 修复快速面板点击逻辑
重构 web search provider 更新逻辑,提取为独立的 updateQuickPanelItem 方法
添加 onClick 处理函数统一管理按钮点击行为
* refactor(WebSearchButton): 更新依赖项数组
* refactor(WebSearchButton): 移除重复的颜色计算并简化图标组件
将颜色计算逻辑从WebSearchIcon组件中移出,统一在父组件中处理
2025-08-24 13:42:10 +08:00
one
3be7c2e1a8
fix: HtmlArtifacts title overflow ( #9434 )
...
* fix: HtmlArtifacts title overflow
* style: fix lint errors
2025-08-23 17:31:10 +08:00
Phantom
375f966e9a
fix(AttachmentPreview): ext should not be case sensitive ( #9426 )
...
fix(AttachmentPreview): 修复图片扩展名大小写敏感问题
2025-08-23 12:24:38 +08:00
Phantom
4833f36e0b
fix(hooks): type safe useAssistant ( #9428 )
...
* fix(hooks): 修复useAssistant中可能存在的未定义引用
确保在访问assistant.settings前检查assistant是否存在,避免潜在的运行时错误
* fix(assistants): useAssistant 类型安全
添加助手时检查ID是否已存在,避免重复添加
为助手不存在和添加失败的情况添加多语言提示
当助手不存在时回退到默认助手并显示警告
2025-08-23 00:16:46 +08:00
Jason Young
e3ca927306
fix(renderer): prevent overlays from entering titlebar drag region via no-drag; fixes #9123 ( #9154 )
...
* fix(renderer): prevent overlays from entering titlebar drag region via no-drag and platform safe gap; cap modal body height; fixes #9123
* fix: modal close button intercepted by drag region in small window mode
- Set modal content as no-drag to ensure button clickability
- Use z-index layering for titlebar drag region management
- Remove redundant platform detection and CSS variables
* refine: only disable drag on modal close button instead of entire modal content
This allows users to still drag the window by clicking on modal header or other areas,
improving UX in small window scenarios while still protecting the close button interaction.
2025-08-22 22:46:33 +08:00
one
c2aff60127
refactor(CodeBlock): closed fence detection for html ( #9424 )
...
* refactor(CodeBlock): closed fence detection for html
* refactor: improve type, fix test
* doc: add comments
2025-08-22 22:37:34 +08:00
Max
ae203b5c7c
fix(NewApiPage): 修复newApi图片编辑请求体没有携带model字段问题 ( #9403 )
...
Signed-off-by: hripleh <hripleh@gmail.com>
Co-authored-by: hripleh <hripleh@gmail.com>
2025-08-22 22:10:08 +08:00
one
6a4627cddc
fix(Markdown): hide programmed style in MarkdownShadowDOMRenderer ( #9417 )
...
* fix(Markdown): hide programmed style in MarkdownShadowDOMRenderer
* refactor: remove redundant style
2025-08-22 22:07:44 +08:00
one
a4cdb5d45f
perf: history page search performance and loading state ( #9344 )
...
* refactor(HistoryPage): add loading state to search results
* refactor: add min height
* perf: speedup message search
* refactor: use cached topics map in onTopicClick
* refactor: smooth scrolling
* refactor: use MutationObserver for better scroll timing
* refactor: remove search.length restrictions
* refactor: use getTopicById in TopicMessages, improve error messages
* fix: i18n
2025-08-22 14:39:57 +08:00
亢奋猫
3501d377f6
refactor(CodeToolsPage): streamline CLI tool management and enhance p… ( #9386 )
...
* refactor(CodeToolsPage): streamline CLI tool management and enhance provider filtering logic
- Removed hardcoded CLI tool options and supported providers, replacing them with imported constants for better maintainability.
- Optimized provider filtering to include additional providers for Claude and Gemini tools.
- Updated environment variable handling for CLI tools to utilize a centralized API base URL function.
* refactor(CodeToolsPage): enhance CLI tool management and environment variable handling
- Updated provider filtering logic to utilize a centralized mapping for CLI tools, improving maintainability and extensibility.
- Refactored environment variable generation and parsing to streamline the launch process for different CLI tools.
- Simplified state management for tool selection and directory handling, enhancing code clarity.
2025-08-22 12:42:27 +08:00
Yuhang
76c025d53b
Feat/add built-in provider avatar options when adding a provider ( #9350 )
...
* Add 'builtin avatar' option to avatar dropdown
-Introduces a new 'builtin avatar' option to the avatar selection dropdown in AddProviderPopup.
-Updates i18n translation files for all supported languages to include the 'builtin' avatar label.
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Add provider logo picker for builtin avatar selection
-Introduces a ProviderLogoPicker component for selecting a builtin provider logo as an avatar in AddProviderPopup.
-Updates provider logo handling in ProviderSettings.(If deleting the logoFile caused any issues, I sincerely apologize.)
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Adjust ProviderLogoPicker layout dimensions and grid
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Fix ProviderLogoPicker popover trigger behavior
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Merge branch 'main' into feat/add-builtin-provider-avatars
* Update index.tsx
---------
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
2025-08-22 09:42:24 +08:00
one
cd1b0e01a0
fix: add provider check in isMandatoryWebSearchModel ( #9398 )
...
* fix: add provider check in isMandatoryWebSearchModel
* Fix: Add provider check in isMandatoryWebSearchModel
The isMandatoryWebSearchModel function was throwing an error when the provider was undefined. This change adds a check to ensure the provider exists before accessing its properties, similar to how it's handled in isWebSearchModel.
The position of the check has also been moved to be between the provider and modelId initializations for better code flow.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-08-22 09:09:21 +08:00
Phantom
44b2d09e63
fix: throw error when translate language detection failed ( #9393 )
...
* docs(ApiService): 为语言检测函数添加详细注释并修改错误处理
移除冗余的try-catch块,改为依赖shouldThrow参数控制错误抛出
* fix(翻译动作): 添加语言检测错误处理
捕获语言检测时的异常并记录错误日志,防止未处理的异常导致应用崩溃
* docs(ApiService): 修正语言检测函数的返回注释说明
原注释说明检测失败会返回空字符串,实际实现会抛出错误,修正注释以反映实际行为
* fix: 移除语言检测中多余的或空字符串检查
2025-08-22 00:05:04 +08:00
Phantom
c7dcbdcb5b
fix: gpt-oss should support temperature and topP ( #9390 )
...
* fix: 修复OpenAI推理模型温度控制判断逻辑
添加isOpenAIOpenWeightModel检查以排除开源权重模型
* fix(openai): 修正开发者角色设置条件逻辑
修改系统消息中开发者角色设置的条件判断,增加对OpenAIOpenWeightModel的检查
2025-08-21 23:51:36 +08:00
Phantom
daaf685c9e
feat(TopicsTab): double click topic name to edit ( #9382 )
...
* feat(TopicsTab): 添加双击话题名称开始编辑功能
* feat(话题标签): 添加通过弹窗重命名话题的功能
* refactor(TopicsTab): 移除未使用的topicEdit参数
* style(TopicsTab): 调整主题名称容器的样式和输入框边框
移除主题编辑输入框的边框和阴影效果,并设置固定高度
* feat(i18n): 添加话题重命名提示文本并支持在弹窗中显示
为话题编辑功能添加多语言提示文本,说明双击可快速重命名
在PromptPopup组件中新增extraNode属性以支持显示额外提示信息
* docs(i18n): 为话题重命名提示添加"提示"前缀
2025-08-21 23:46:30 +08:00
one
9c2a88179b
refactor: increase dropdown menu maxHeight ( #9279 )
2025-08-21 23:43:12 +08:00
Yuhang
a2d24a5cda
fix: incorrect default avatar casing in custom provider ( #9384 )
...
* fix: incorrect default avatar casing in custom provider
* add background color to default avatar in custom provider
distinction among providers.
* set ProviderInitialsLogo text color to white
添加完背景色后发现,模型列表中默认头像字体始终为白色,而编辑提供商时默认头像字体颜色会随主题色而变,黑色字体某些背景色下不清晰(比如a),所以改成始终白色
* fix: default avatar fallback when no text is entered
-设置背景色后发现,未输入文本时的背景色是根据上一个背景色继续保持的,该情况下回退到默认背景颜色
-回退后白色字体又看不清,该情况下字体颜色回退到黑色
-最终效果就是未输入文本时显示的默认头像回退到与之前一致
2025-08-21 19:54:48 +08:00
one
4191d878f2
fix: do not reset citation block ( #9383 )
...
* fix: do not reset citation block id
* refactor: disable external websearch for mandatory websearch models
* refactor: predicate
* refactor: include openrouter perplexity
2025-08-21 16:59:04 +08:00
Phantom
25d3b519d9
fix(translate): fix translating state management ( #9387 )
...
* fix(translate): 修复翻译状态管理逻辑
调整翻译状态设置的位置,确保在翻译开始和结束时正确更新状态
* fix(translate): 添加缺失的setTranslating属性
* fix(translate): 去除检测语言结果中的空格
检测语言返回的结果可能包含多余空格,导致后续处理出现问题。通过trim()去除前后空格确保结果干净
2025-08-21 16:48:22 +08:00
kangfenmao
39b1332e49
feat(DraggableList): add listProps support for custom list configurations
...
- Enhanced DraggableList component to accept listProps, allowing for customization of the Ant Design List component.
- Updated MCPSettings to utilize the new listProps feature, providing a custom empty state message when no servers are available.
2025-08-21 15:14:27 +08:00
Phantom
0da122281e
fix(AttachmentButton): Add selection state to prevent repeated file selection triggering ( #9379 )
...
fix(AttachmentButton): 添加选择状态防止重复触发文件选择
添加 selecting 状态变量以防止在文件选择过程中重复触发选择操作,避免潜在的文件选择窗口冲突
2025-08-21 15:09:39 +08:00
Phantom
4615e97ad5
fix(translate): improve auto translate language detection ( #9375 )
...
fix(translate): 调整语言检测阈值并增加回退逻辑
当文本较短时使用LLM检测语言,较长时优先使用franc检测
当franc检测失败时回退到LLM检测
同时将LLM检测的文本长度限制从50提高到100
2025-08-21 14:55:11 +08:00
beyondkmp
4dabc214f2
feat: enhance file extension handling in Inputbar ( #9269 )
...
* feat: add isTextFile functionality and improve file selection handling
- Introduced a new IPC channel for checking if a file is a text file.
- Implemented isTextFile method in FileStorage service to determine file type based on content.
- Enhanced AttachmentButton to filter selected files based on text file validation.
- Updated translations to include support for displaying unsupported file counts across multiple languages.
- Added utility functions for text file validation and filtering in file utilities.
* refactor(FileStorage): replace hardcoded buffer size with constant for improved readability
* restore yarn lock
* add isbinaryfile dep
* refactor: 整理导入顺序
* fix(preload): 为isTextFile方法添加返回类型Promise<boolean>
* refactor(FileManager): update getSafePath to use file metadata for path retrieval
- Modified getSafePath method to utilize the path from file metadata instead of a hardcoded file path.
- Enhanced handling for files not stored in the file storage system.
* refactor(FileUtilities): rename text file functions for clarity
- Updated function names from isTextFile to isSupportedFile and filterTextFiles to filterSupportedFiles to better reflect their purpose.
- Adjusted related imports and usages in AttachmentButton and PasteService components to align with the new naming conventions.
* fix drop files
* refactor(MarkdownStyles): remove last-child margin override; adjust MessageFooter margin and clean up unused code in MessageAttachments
* feat(Sidebar): add 'code_tools' icon and route; enhance CodeToolsPage layout with Navbar and improved provider filtering
* feat(CodeTools): add environment variable support for CLI tools; update UI to manage environment variables and enhance localization for related strings
* refactor(Sidebar): remove unused imports and code related to documentation; streamline sidebar functionality
* refactor(SvgPreview): use transparent container for SVG (#9294 )
* refactor(SvgPreview): use transparent container for SVG
* test: fix snapshot
* refactor(CodeToolsService): replace npm package version fetching with direct API call; simplify command construction for installation
* chore: release v1.5.7-rc.1
* refactor(CodeToolsService): adjust command construction for Windows compatibility; streamline installation command handling
* refactor(Markdown): update disallowed elements to include 'script' for enhanced security
* feat: quick model (#9290 )
* refactor(i18n): 将话题命名模型相关文案更新为摘要模型
更新所有语言文件中关于话题命名模型的文案,统一改为摘要模型,以反映功能的扩展和更通用的用途
* refactor(设置页面): 优化主题命名弹窗组件性能
使用useCallback和useMemo优化回调函数和渲染性能
将重复的JSX代码提取为独立组件
* feat(设置): 在模型设置中添加话题命名折叠面板
将话题命名设置从直接显示改为折叠面板形式,提升界面整洁度
* refactor(i18n): 重构话题命名相关翻译字段结构
* docs(i18n): 添加生成图像的高度、宽度和安全容忍度翻译占位符
* fix(settings): 修正主题命名弹窗中的翻译键名
* style(ui): 调整主题命名弹窗的间距和文本区域高度
移除多余的上下边距,并使用自适应高度的文本区域
* refactor(llm): 将 topicNamingModel 重命名为 summaryModel
更新相关函数、状态和测试用例以反映命名变更
增加迁移逻辑处理旧状态数据
更新持久化版本号至133
* fix(ApiService): 优先使用摘要模型替代默认模型
当获取摘要时,优先使用getSummaryModel()返回的模型,其次才是助手指定的模型或默认模型,以确保摘要生成的一致性
* docs(i18n): 更新摘要模型描述中的搜索关键词提炼
将"搜索结果摘要"修改为"搜索关键字提炼"以更准确描述功能
* fix(i18n): 更新多语言翻译文件中的摘要模型相关文本
* feat(i18n): 为摘要模型设置添加工具提示说明
添加摘要模型设置的工具提示,建议用户选择轻量模型而非思考模型
* refactor(i18n): 将摘要模型相关文案更新为快速模型
更新国际化文案和组件引用,将"摘要模型"统一改为"快速模型"以更准确描述功能用途
* feat(i18n): 将摘要模型重命名为快速模型并更新相关描述
* refactor(llm): 将summaryModel重命名为quickModel以提升语义清晰度
* test(api): 在ApiService测试中添加LlmState类型和awsBedrock配置
添加LlmState类型以满足类型检查要求,并补充awsBedrock的mock配置以完善测试覆盖
* Revert "feat(设置): 在模型设置中添加话题命名折叠面板"
This reverts commit 4d58c053da .
* refactor(settings): 重命名并移动 TopicNamingModalPopup 组件文件
将 TopicNamingModalPopup.tsx 重命名为 QuickModelPopup.tsx 并移动到相应目录
* refactor(QuickModelPopup): 优化主题命名设置布局和样式
移除 TopicNamingSettings 组件内联实现,直接整合到 Modal 中
调整间距和样式,提升视觉一致性
修复文本区域 onChange 去除换行的逻辑
* feat(模型设置): 在快速模型弹窗中添加重置按钮图标并调整布局
将重置按钮改为图标形式并内联显示,同时调整输入区域的高度样式
* docs(i18n): 更新快速模型相关翻译文本
* fix: 将迁移错误日志从133更新为134
* style(settings): 替换模型设置中的图标为Rocket图标以提升视觉一致性
* fix: unexpected quitting full screen mode (#9200 )
* fix(Inputbar): 修正拼写错误,将expend改为expand
* fix: 修复Escape键事件冒泡问题并改进全屏处理
修复多个组件中Escape键事件未阻止冒泡的问题
添加全屏控制IPC通道
将全屏退出逻辑移至渲染进程处理
移除主进程中冗余的全屏退出处理代码
* fix(SelectModelPopup): 修复键盘事件处理并移除无效的useEffect
将键盘事件监听从window移动到Modal容器,避免事件冒泡问题
移除无效的useEffect并更新键盘事件类型定义
* fix(QuickPanel): 拦截window上的keydown事件
* fix(QuickPanel): 修复事件监听器移除时未使用相同参数的问题
* fix(TopView): 修复左侧导航栏布局崩坏问题
* fix: 修正变量名拼写错误,将expended改为expanded
* Revert "fix(SelectModelPopup): 修复键盘事件处理并移除无效的useEffect"
This reverts commit 4211780b95 .
* feat: use quick model to detect translate language (#9315 )
* refactor(语言检测): 移除翻译模型依赖,改用快速或默认模型
* feat(i18n): 添加希腊语翻译支持
* fix(i18n): 更新i18n
统一将翻译模型提示改为快速模型提示,优化多语言文件中的描述
* Revert "feat(i18n): 添加希腊语翻译支持"
This reverts commit 42613cb2e2 .
* feat: add 'code_tools' to sidebar icons and update related components
* fix: KaTeX math engine render
* feat: 同步百炼服务器功能 (#9205 )
* 同步百炼服务器功能
* cr修改
---------
Co-authored-by: yunze <yunze.wyz@alibaba-inc.com>
* fix(SelectionHook): improve validation for selected text range to handle empty strings and ensure valid extraction (#9329 )
chore: update selection-hook dependency to version 1.0.10 in package.json and yarn.lock
* fix: web search references missing caused by early reset (#9328 )
* feat(openai): handle special tokens for zhipu api (#9323 )
* feat(openai): 添加对智谱特殊token的过滤处理
在OpenAIAPIClient中添加对智谱AI特殊token的过滤逻辑,避免不需要的token被输出
* docs(OpenAIApiClient): 添加注释
* refactor(zhipu): 重命名并更新智谱特殊token处理逻辑
将 ZHIPU_SPECIAL_TOKENS_TO_FILTER 重命名为 ZHIPU_RESULT_TOKENS 以更准确描述用途
修改智谱API特殊token处理逻辑,不再过滤而是用**标记结果token
* feat: support openai codex (#9332 )
* support openai codex
* lint
* refactor: remove unused codeTools enum from constant.ts
* fix build
* fix lin
* fix: add support for qwenCode CLI tool and improve error handling in CodeToolsService
* fix: timeout memory leak (#9312 )
* fix(MinappPopupContainer): 修复内存泄漏问题,清理未使用的定时器
在组件卸载时清理setTimeout定时器,避免潜在的内存泄漏
* fix(SelectModelButton): 修复模型选择后更新导致的卡顿问题
使用useRef存储定时器并在组件卸载时清理,避免内存泄漏
* fix(QuickPanel): 修复定时器未清理导致的内存泄漏问题
添加 clearSearchTimerRef 和 focusTimerRef 来管理定时器
在组件清理和状态变化时清理所有定时器
* fix(useInPlaceEdit): 修复编辑模式下定时器未清理的问题
添加清理定时器的逻辑,避免组件卸载时内存泄漏
* refactor(useKnowledge): 使用ref管理定时器并统一检查知识库逻辑
将分散的setTimeout调用统一为checkAllBases方法
使用useRef管理定时器并在组件卸载时清理
* fix(useScrollPosition): 修复滚动位置恢复时的内存泄漏问题
添加清理函数以清除未完成的定时器,防止组件卸载时内存泄漏
* fix(WebSearchProviderSetting): 清理定时器防止内存泄漏
在组件卸载时清理检查API有效性的定时器,避免潜在的内存泄漏问题
* fix(selection-toolbar): 修复选中文本时定时器未清理的问题
* fix(translate): 修复复制文本时定时器未清理的问题
添加 copyTimerRef 来管理复制操作的定时器,并在组件卸载时清理定时器
* fix(WebSearchSettings): 使用useRef管理订阅验证定时器以避免内存泄漏
* fix(MCPSettings): 修复定时器未清理导致的内存泄漏问题
添加 useRef 来存储定时器引用,并在组件卸载时清理定时器
* refactor(ThinkingBlock): 使用 useTemporaryValue 替换手动 setTimeout
移除手动设置的 setTimeout 来重置 copied 状态,改用 useTemporaryValue hook 自动处理
* refactor(ChatNavigation): 使用 useRef 替代 useState 管理定时器
简化定时器管理逻辑,避免不必要的状态更新
* fix(AddAssistantPopup): 清理创建助手时的定时器以避免内存泄漏
添加useEffect清理定时器,防止组件卸载时内存泄漏
* feat(hooks): 添加useTimer钩子管理定时器
实现一个自定义hook来集中管理setTimeout和setInterval定时器
自动在组件卸载时清理所有定时器防止内存泄漏
* refactor(Inputbar): 使用 useTimer 替换 setTimeout 实现延迟更新
将 setTimeout 替换为 useTimer 的自定义 setTimeoutTimer 方法,提高代码可维护性并统一计时器管理
* refactor(WindowFooter): 使用 useTimer 替换 setTimeout 以管理定时器
* docs(useTimer): 更新定时器hook的注释格式和描述
* feat(hooks): 为useTimer添加返回清理函数的功能
允许从setTimeoutTimer和setIntervalTimer返回清理函数,便于手动清除定时器
* refactor(ImportAgentPopup): 使用useTimer替换setTimeout以管理定时器
* refactor: 使用useTimer替代setTimeout以优化定时器管理
* refactor(SearchResults): 使用useTimer替换setTimeout以管理定时器
* refactor(消息组件): 使用useTimer替换setTimeout以管理定时器
* refactor: 使用useTimer替换setTimeout以优化定时器管理
* refactor(AssistantsDrawer): 使用useTimer替换setTimeout以优化定时器管理
* refactor(Inputbar): 使用useTimer替换setTimeout以优化定时器管理
* refactor(MCPToolsButton): 使用useTimer优化定时器管理
* refactor(QuickPhrasesButton): 使用useTimer替换setTimeout以优化定时器管理
* refactor(ChatFlowHistory): 使用useTimer替换setTimeout以管理定时器
* refactor(Message): 使用useTimer替换setTimeout以管理定时器
* refactor(MessageAnchorLine): 使用useTimer替换setTimeout以优化定时器管理
* refactor(MessageGroup): 使用useTimer替换setTimeout以优化定时器管理
* refactor(MessageMenubar): 使用 useTemporaryValue 替换手动 setTimeout 逻辑
* refactor(Messages): 使用 useTimer 优化定时器管理
* refactor(MessageTools): 使用useTimer替换setTimeout以管理定时器
* fix(SelectionBox): 修复鼠标移动时未清除定时器导致的内存泄漏
在鼠标移动事件处理中增加定时器清理逻辑,避免组件卸载时未清除定时器导致的内存泄漏问题
* refactor(ErrorBlock): 使用自定义hook替换setTimeout
使用useTimer中的setTimeoutTimer替代原生setTimeout,便于统一管理定时器
* refactor(GeneralSettings): 使用useTimer替换setTimeout以实现更好的定时器管理
* refactor(ShortcutSettings): 使用useTimer替换setTimeout以优化定时器管理
* refactor(AssistantModelSettings): 使用useTimer替换setTimeout以优化定时器管理
* refactor(DataSettings): 使用useTimer替换setTimeout以增强定时器管理
统一使用useTimer hook管理所有定时器操作,提高代码可维护性
* refactor(NutstoreSettings): 使用useTimer优化setTimeout管理
替换直接使用setTimeout为useTimer hook的setTimeoutTimer方法,提升定时器管理的可维护性
* refactor(MCPSettings): 使用useTimer替换setTimeout以提升代码可维护性
* refactor(ProviderSetting): 使用useTimer优化setTimeout管理
* refactor(ProviderSettings): 使用 useTimer 替换 setTimeout 以优化定时器管理
* refactor(InputBar): 使用useTimer替换setTimeout以实现更好的定时器管理
* refactor(MessageEditor): 使用useTimer替换setTimeout以管理定时器
使用自定义hook useTimer来替代原生setTimeout,便于统一管理和清理定时器
* docs(useTimer): 添加 useTimer hook 的使用示例和详细说明
* refactor(MinappPopupContainer): 使用useTimer替换setTimeout实现
替换直接使用setTimeout为自定义hook useTimer,简化组件清理逻辑
* refactor(AddAssistantPopup): 使用useTimer替换手动定时器管理
用useTimer钩子替代手动管理定时器,简化代码并提高可维护性
* refactor(WebSearchSettings): 使用 useTimer 替换手动定时器管理
移除手动管理的定时器逻辑,改用 useTimer hook 统一处理
* refactor(WebSearchProviderSetting): 使用自定义hook替代原生定时器
用useTimer hook替换原有的setTimeout和clearTimeout逻辑,提高代码可维护性
* refactor(translate): 使用 useTemporaryValue 替换手动实现的复制状态定时器
* refactor(SelectionToolbar): 使用 useTimer 钩子替换 setTimeout 和 clearTimeout
重构 SelectionToolbar 组件,使用自定义的 useTimer 钩子来管理定时器,提升代码可维护性
清理隐藏时的定时器逻辑,避免内存泄漏
* fix(Translate): update settings into db (#9305 )
* fix(翻译): 修复设置没有储存到db的错误
* fix(translate): 修复自动检测方法设置更新失败的问题
添加错误处理逻辑,当更新自动检测方法设置失败时显示错误信息
* Fix AWS Bedrock models not receiving uploaded document content (#9337 )
* Initial plan
* Add file content processing to AWS Bedrock client convertMessageToSdkParam method
Co-authored-by: caozhiyuan <3415285+caozhiyuan@users.noreply.github.com>
* Fix file content format to match other AI clients and update tests
Co-authored-by: caozhiyuan <3415285+caozhiyuan@users.noreply.github.com>
* Update src/renderer/src/aiCore/clients/aws/AwsBedrockAPIClient.ts
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: caozhiyuan <3415285+caozhiyuan@users.noreply.github.com>
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
* feat(migrate): initialize default assistant settings if not present (#9303 )
* feat(migrate): update migration logic for version 134; initialize default assistant settings if not present
* Update src/renderer/src/store/migrate.ts
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
---------
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
* feat: support language aliases for code editor (#9336 )
* feat(CodeEditor): support language aliases
* fix: mermaid
* refactor: lookup
* chore: sort package.json
* fix(SelectionHook): [macOS] add type safety to prevent crashes (#9354 )
chore: update selection-hook dependency to version 1.0.11 in package.json and yarn.lock
* fix: sidebar code icon reset bug (#9307 ) (#9333 )
* fix: 修复侧边栏重置时 Code 图标消失的问题 (#9307 )
问题原因:
- types/index.ts 中的 SidebarIcon 类型定义缺少 'code_tools'
- 存在重复的类型定义和常量定义导致不一致
修复内容:
- 在 types/index.ts 的 SidebarIcon 类型中添加 'code_tools'
- 删除 minapps.ts 中重复的 DEFAULT_SIDEBAR_ICONS 常量
- 统一从 @renderer/types 导入 SidebarIcon 类型
- 删除 settings.ts 中重复的 SidebarIcon 类型定义
这确保了在导航栏设置为左侧时,点击侧边栏设置的重置按钮后,
Code 图标能够正确显示。
* refactor: 将侧边栏配置移至 config 目录
根据 code review 建议,将侧边栏相关配置从 store/settings.ts
移动到 config/sidebar.ts,使配置管理更加清晰。
改动内容:
- 创建 config/sidebar.ts 存放侧边栏配置常量
- 更新相关文件的导入路径
- 在 settings.ts 中重新导出以保持向后兼容
- 添加 REQUIRED_SIDEBAR_ICONS 常量便于未来扩展
这个改动保持了最小化原则,不影响现有功能。
* refactor: improve locate highlight animation (#9345 )
* feat(utils): show weekday in date and datetime prompt variables (#9362 )
* feat(utils): 优化日期时间变量替换格式
为 {{date}} 和 {{datetime}} 变量替换添加更详细的格式选项,包括星期、年月日和时间信息
* test(prompt): 更新测试中日期时间的本地化格式
* refactor(CodeToolsPage): simplify CLI tool change handling and optimize provider filtering logic
* fix(newMessage): reduce default display count from 20 to 10
* feat(AssistantService): introduce DEFAULT_ASSISTANT_SETTINGS for consistent assistant configuration and update migration logic for version 136
* chore: release v1.5.7-rc.2
* fix(Markdown/Link): set href to undefined when it's empty (#9343 )
fix(Markdown/Link): 处理空链接时设置href为undefined
* fix(Inputbar): update file handling to use functional state update for setFiles
* refactor(file): update isSupportedFile function to accept filePath instead of FileMetadata for improved clarity and consistency in file handling
---------
Co-authored-by: icarus <eurfelux@gmail.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: one <wangan.cs@gmail.com>
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
Co-authored-by: alickreborn0 <i@guyi.me>
Co-authored-by: yunze <yunze.wyz@alibaba-inc.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Co-authored-by: caozhiyuan <568022847@qq.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: caozhiyuan <3415285+caozhiyuan@users.noreply.github.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: Jason Young <44939412+farion1231@users.noreply.github.com>
2025-08-21 14:19:51 +08:00
Phantom
ea6a1752e7
feat: reasoning effort cache ( #9357 )
...
* feat(useAssistant): 修改模型切换时推理努力值回退逻辑
当模型切换时,确保推理努力值回退到模型支持的第一个有效值,并默认开启思考模式。使用useRef优化设置引用,避免不必要的依赖。
* feat(assistant): 添加 reasoning_effort_cache 以保留思考模型设置
当从非思考模型切换回思考模型时,恢复上次使用的 reasoning_effort 值
* fix(assistant): 修复思考模式切换时缓存未正确更新的问题
* fix(useAssistant): 修复模型选项回退逻辑以支持推理模式
当启用推理模式时,回退到支持推理的选项,否则回退到默认选项
* docs(types): 完善 AssistantSettings 类型注释中的 TODO 说明
2025-08-21 14:18:19 +08:00
Phantom
062b3b0a33
feat: search translate history ( #9342 )
...
* feat(翻译历史): 添加搜索翻译历史UI
在翻译历史页面添加搜索框
* feat(翻译历史): 优化搜索功能并添加延迟渲染
- 将搜索逻辑提取为独立函数并使用useDeferredValue优化性能
- 重构类型命名和状态管理
- 格式化日期显示并移入memo计算
* feat(i18n): 为翻译历史添加搜索框占位文本
* refactor(translate): 移除未使用的InputRef引用和inputRef变量
2025-08-21 12:48:27 +08:00
Phantom
1af4a2686b
fix(Markdown/Link): set href to undefined when it's empty ( #9343 )
...
fix(Markdown/Link): 处理空链接时设置href为undefined
2025-08-21 11:02:41 +08:00
kangfenmao
84212d0b1d
feat(AssistantService): introduce DEFAULT_ASSISTANT_SETTINGS for consistent assistant configuration and update migration logic for version 136
2025-08-21 10:57:56 +08:00
kangfenmao
6e9b77a97a
fix(newMessage): reduce default display count from 20 to 10
2025-08-21 10:52:12 +08:00
kangfenmao
c93b96a03f
refactor(CodeToolsPage): simplify CLI tool change handling and optimize provider filtering logic
2025-08-21 10:28:44 +08:00
Phantom
a671f95bee
feat(utils): show weekday in date and datetime prompt variables ( #9362 )
...
* feat(utils): 优化日期时间变量替换格式
为 {{date}} 和 {{datetime}} 变量替换添加更详细的格式选项,包括星期、年月日和时间信息
* test(prompt): 更新测试中日期时间的本地化格式
2025-08-21 10:03:07 +08:00
one
0e750c64db
refactor: improve locate highlight animation ( #9345 )
2025-08-21 08:42:20 +08:00
Jason Young
27eef50b9f
fix: sidebar code icon reset bug ( #9307 ) ( #9333 )
...
* fix: 修复侧边栏重置时 Code 图标消失的问题 (#9307 )
问题原因:
- types/index.ts 中的 SidebarIcon 类型定义缺少 'code_tools'
- 存在重复的类型定义和常量定义导致不一致
修复内容:
- 在 types/index.ts 的 SidebarIcon 类型中添加 'code_tools'
- 删除 minapps.ts 中重复的 DEFAULT_SIDEBAR_ICONS 常量
- 统一从 @renderer/types 导入 SidebarIcon 类型
- 删除 settings.ts 中重复的 SidebarIcon 类型定义
这确保了在导航栏设置为左侧时,点击侧边栏设置的重置按钮后,
Code 图标能够正确显示。
* refactor: 将侧边栏配置移至 config 目录
根据 code review 建议,将侧边栏相关配置从 store/settings.ts
移动到 config/sidebar.ts,使配置管理更加清晰。
改动内容:
- 创建 config/sidebar.ts 存放侧边栏配置常量
- 更新相关文件的导入路径
- 在 settings.ts 中重新导出以保持向后兼容
- 添加 REQUIRED_SIDEBAR_ICONS 常量便于未来扩展
这个改动保持了最小化原则,不影响现有功能。
2025-08-21 00:49:42 +08:00
one
4e54733d38
feat: support language aliases for code editor ( #9336 )
...
* feat(CodeEditor): support language aliases
* fix: mermaid
* refactor: lookup
* chore: sort package.json
2025-08-21 00:03:27 +08:00
SuYao
bd9b34b9a0
feat(migrate): initialize default assistant settings if not present ( #9303 )
...
* feat(migrate): update migration logic for version 134; initialize default assistant settings if not present
* Update src/renderer/src/store/migrate.ts
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
---------
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
2025-08-21 00:01:03 +08:00
caozhiyuan
b1e843973c
Fix AWS Bedrock models not receiving uploaded document content ( #9337 )
...
* Initial plan
* Add file content processing to AWS Bedrock client convertMessageToSdkParam method
Co-authored-by: caozhiyuan <3415285+caozhiyuan@users.noreply.github.com>
* Fix file content format to match other AI clients and update tests
Co-authored-by: caozhiyuan <3415285+caozhiyuan@users.noreply.github.com>
* Update src/renderer/src/aiCore/clients/aws/AwsBedrockAPIClient.ts
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: caozhiyuan <3415285+caozhiyuan@users.noreply.github.com>
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
2025-08-20 18:26:38 +08:00
Phantom
11b130736c
fix(Translate): update settings into db ( #9305 )
...
* fix(翻译): 修复设置没有储存到db的错误
* fix(translate): 修复自动检测方法设置更新失败的问题
添加错误处理逻辑,当更新自动检测方法设置失败时显示错误信息
2025-08-20 17:42:33 +08:00
Phantom
25531ecd76
fix: timeout memory leak ( #9312 )
...
* fix(MinappPopupContainer): 修复内存泄漏问题,清理未使用的定时器
在组件卸载时清理setTimeout定时器,避免潜在的内存泄漏
* fix(SelectModelButton): 修复模型选择后更新导致的卡顿问题
使用useRef存储定时器并在组件卸载时清理,避免内存泄漏
* fix(QuickPanel): 修复定时器未清理导致的内存泄漏问题
添加 clearSearchTimerRef 和 focusTimerRef 来管理定时器
在组件清理和状态变化时清理所有定时器
* fix(useInPlaceEdit): 修复编辑模式下定时器未清理的问题
添加清理定时器的逻辑,避免组件卸载时内存泄漏
* refactor(useKnowledge): 使用ref管理定时器并统一检查知识库逻辑
将分散的setTimeout调用统一为checkAllBases方法
使用useRef管理定时器并在组件卸载时清理
* fix(useScrollPosition): 修复滚动位置恢复时的内存泄漏问题
添加清理函数以清除未完成的定时器,防止组件卸载时内存泄漏
* fix(WebSearchProviderSetting): 清理定时器防止内存泄漏
在组件卸载时清理检查API有效性的定时器,避免潜在的内存泄漏问题
* fix(selection-toolbar): 修复选中文本时定时器未清理的问题
* fix(translate): 修复复制文本时定时器未清理的问题
添加 copyTimerRef 来管理复制操作的定时器,并在组件卸载时清理定时器
* fix(WebSearchSettings): 使用useRef管理订阅验证定时器以避免内存泄漏
* fix(MCPSettings): 修复定时器未清理导致的内存泄漏问题
添加 useRef 来存储定时器引用,并在组件卸载时清理定时器
* refactor(ThinkingBlock): 使用 useTemporaryValue 替换手动 setTimeout
移除手动设置的 setTimeout 来重置 copied 状态,改用 useTemporaryValue hook 自动处理
* refactor(ChatNavigation): 使用 useRef 替代 useState 管理定时器
简化定时器管理逻辑,避免不必要的状态更新
* fix(AddAssistantPopup): 清理创建助手时的定时器以避免内存泄漏
添加useEffect清理定时器,防止组件卸载时内存泄漏
* feat(hooks): 添加useTimer钩子管理定时器
实现一个自定义hook来集中管理setTimeout和setInterval定时器
自动在组件卸载时清理所有定时器防止内存泄漏
* refactor(Inputbar): 使用 useTimer 替换 setTimeout 实现延迟更新
将 setTimeout 替换为 useTimer 的自定义 setTimeoutTimer 方法,提高代码可维护性并统一计时器管理
* refactor(WindowFooter): 使用 useTimer 替换 setTimeout 以管理定时器
* docs(useTimer): 更新定时器hook的注释格式和描述
* feat(hooks): 为useTimer添加返回清理函数的功能
允许从setTimeoutTimer和setIntervalTimer返回清理函数,便于手动清除定时器
* refactor(ImportAgentPopup): 使用useTimer替换setTimeout以管理定时器
* refactor: 使用useTimer替代setTimeout以优化定时器管理
* refactor(SearchResults): 使用useTimer替换setTimeout以管理定时器
* refactor(消息组件): 使用useTimer替换setTimeout以管理定时器
* refactor: 使用useTimer替换setTimeout以优化定时器管理
* refactor(AssistantsDrawer): 使用useTimer替换setTimeout以优化定时器管理
* refactor(Inputbar): 使用useTimer替换setTimeout以优化定时器管理
* refactor(MCPToolsButton): 使用useTimer优化定时器管理
* refactor(QuickPhrasesButton): 使用useTimer替换setTimeout以优化定时器管理
* refactor(ChatFlowHistory): 使用useTimer替换setTimeout以管理定时器
* refactor(Message): 使用useTimer替换setTimeout以管理定时器
* refactor(MessageAnchorLine): 使用useTimer替换setTimeout以优化定时器管理
* refactor(MessageGroup): 使用useTimer替换setTimeout以优化定时器管理
* refactor(MessageMenubar): 使用 useTemporaryValue 替换手动 setTimeout 逻辑
* refactor(Messages): 使用 useTimer 优化定时器管理
* refactor(MessageTools): 使用useTimer替换setTimeout以管理定时器
* fix(SelectionBox): 修复鼠标移动时未清除定时器导致的内存泄漏
在鼠标移动事件处理中增加定时器清理逻辑,避免组件卸载时未清除定时器导致的内存泄漏问题
* refactor(ErrorBlock): 使用自定义hook替换setTimeout
使用useTimer中的setTimeoutTimer替代原生setTimeout,便于统一管理定时器
* refactor(GeneralSettings): 使用useTimer替换setTimeout以实现更好的定时器管理
* refactor(ShortcutSettings): 使用useTimer替换setTimeout以优化定时器管理
* refactor(AssistantModelSettings): 使用useTimer替换setTimeout以优化定时器管理
* refactor(DataSettings): 使用useTimer替换setTimeout以增强定时器管理
统一使用useTimer hook管理所有定时器操作,提高代码可维护性
* refactor(NutstoreSettings): 使用useTimer优化setTimeout管理
替换直接使用setTimeout为useTimer hook的setTimeoutTimer方法,提升定时器管理的可维护性
* refactor(MCPSettings): 使用useTimer替换setTimeout以提升代码可维护性
* refactor(ProviderSetting): 使用useTimer优化setTimeout管理
* refactor(ProviderSettings): 使用 useTimer 替换 setTimeout 以优化定时器管理
* refactor(InputBar): 使用useTimer替换setTimeout以实现更好的定时器管理
* refactor(MessageEditor): 使用useTimer替换setTimeout以管理定时器
使用自定义hook useTimer来替代原生setTimeout,便于统一管理和清理定时器
* docs(useTimer): 添加 useTimer hook 的使用示例和详细说明
* refactor(MinappPopupContainer): 使用useTimer替换setTimeout实现
替换直接使用setTimeout为自定义hook useTimer,简化组件清理逻辑
* refactor(AddAssistantPopup): 使用useTimer替换手动定时器管理
用useTimer钩子替代手动管理定时器,简化代码并提高可维护性
* refactor(WebSearchSettings): 使用 useTimer 替换手动定时器管理
移除手动管理的定时器逻辑,改用 useTimer hook 统一处理
* refactor(WebSearchProviderSetting): 使用自定义hook替代原生定时器
用useTimer hook替换原有的setTimeout和clearTimeout逻辑,提高代码可维护性
* refactor(translate): 使用 useTemporaryValue 替换手动实现的复制状态定时器
* refactor(SelectionToolbar): 使用 useTimer 钩子替换 setTimeout 和 clearTimeout
重构 SelectionToolbar 组件,使用自定义的 useTimer 钩子来管理定时器,提升代码可维护性
清理隐藏时的定时器逻辑,避免内存泄漏
2025-08-20 16:38:13 +08:00
beyondkmp
332ba5d678
feat: support openai codex ( #9332 )
...
* support openai codex
* lint
* refactor: remove unused codeTools enum from constant.ts
* fix build
* fix lin
* fix: add support for qwenCode CLI tool and improve error handling in CodeToolsService
2025-08-20 15:46:44 +08:00
Phantom
1da1721ec2
feat(openai): handle special tokens for zhipu api ( #9323 )
...
* feat(openai): 添加对智谱特殊token的过滤处理
在OpenAIAPIClient中添加对智谱AI特殊token的过滤逻辑,避免不需要的token被输出
* docs(OpenAIApiClient): 添加注释
* refactor(zhipu): 重命名并更新智谱特殊token处理逻辑
将 ZHIPU_SPECIAL_TOKENS_TO_FILTER 重命名为 ZHIPU_RESULT_TOKENS 以更准确描述用途
修改智谱API特殊token处理逻辑,不再过滤而是用**标记结果token
2025-08-20 15:11:07 +08:00
one
f8120c2ebb
fix: web search references missing caused by early reset ( #9328 )
2025-08-20 13:25:22 +08:00
alickreborn0
4f2b1e23a9
feat: 同步百炼服务器功能 ( #9205 )
...
* 同步百炼服务器功能
* cr修改
---------
Co-authored-by: yunze <yunze.wyz@alibaba-inc.com>
2025-08-20 11:26:38 +08:00
kangfenmao
47f49532c6
fix: KaTeX math engine render
2025-08-20 11:12:42 +08:00
kangfenmao
cffaf99b17
feat: add 'code_tools' to sidebar icons and update related components
2025-08-20 10:56:44 +08:00
Phantom
973ece9eb9
feat: use quick model to detect translate language ( #9315 )
...
* refactor(语言检测): 移除翻译模型依赖,改用快速或默认模型
* feat(i18n): 添加希腊语翻译支持
* fix(i18n): 更新i18n
统一将翻译模型提示改为快速模型提示,优化多语言文件中的描述
* Revert "feat(i18n): 添加希腊语翻译支持"
This reverts commit 42613cb2e2 .
2025-08-20 10:07:10 +08:00
Phantom
a21fc91915
fix: unexpected quitting full screen mode ( #9200 )
...
* fix(Inputbar): 修正拼写错误,将expend改为expand
* fix: 修复Escape键事件冒泡问题并改进全屏处理
修复多个组件中Escape键事件未阻止冒泡的问题
添加全屏控制IPC通道
将全屏退出逻辑移至渲染进程处理
移除主进程中冗余的全屏退出处理代码
* fix(SelectModelPopup): 修复键盘事件处理并移除无效的useEffect
将键盘事件监听从window移动到Modal容器,避免事件冒泡问题
移除无效的useEffect并更新键盘事件类型定义
* fix(QuickPanel): 拦截window上的keydown事件
* fix(QuickPanel): 修复事件监听器移除时未使用相同参数的问题
* fix(TopView): 修复左侧导航栏布局崩坏问题
* fix: 修正变量名拼写错误,将expended改为expanded
* Revert "fix(SelectModelPopup): 修复键盘事件处理并移除无效的useEffect"
This reverts commit 4211780b95 .
2025-08-19 21:32:53 +08:00
Phantom
80dfcf05a7
feat: quick model ( #9290 )
...
* refactor(i18n): 将话题命名模型相关文案更新为摘要模型
更新所有语言文件中关于话题命名模型的文案,统一改为摘要模型,以反映功能的扩展和更通用的用途
* refactor(设置页面): 优化主题命名弹窗组件性能
使用useCallback和useMemo优化回调函数和渲染性能
将重复的JSX代码提取为独立组件
* feat(设置): 在模型设置中添加话题命名折叠面板
将话题命名设置从直接显示改为折叠面板形式,提升界面整洁度
* refactor(i18n): 重构话题命名相关翻译字段结构
* docs(i18n): 添加生成图像的高度、宽度和安全容忍度翻译占位符
* fix(settings): 修正主题命名弹窗中的翻译键名
* style(ui): 调整主题命名弹窗的间距和文本区域高度
移除多余的上下边距,并使用自适应高度的文本区域
* refactor(llm): 将 topicNamingModel 重命名为 summaryModel
更新相关函数、状态和测试用例以反映命名变更
增加迁移逻辑处理旧状态数据
更新持久化版本号至133
* fix(ApiService): 优先使用摘要模型替代默认模型
当获取摘要时,优先使用getSummaryModel()返回的模型,其次才是助手指定的模型或默认模型,以确保摘要生成的一致性
* docs(i18n): 更新摘要模型描述中的搜索关键词提炼
将"搜索结果摘要"修改为"搜索关键字提炼"以更准确描述功能
* fix(i18n): 更新多语言翻译文件中的摘要模型相关文本
* feat(i18n): 为摘要模型设置添加工具提示说明
添加摘要模型设置的工具提示,建议用户选择轻量模型而非思考模型
* refactor(i18n): 将摘要模型相关文案更新为快速模型
更新国际化文案和组件引用,将"摘要模型"统一改为"快速模型"以更准确描述功能用途
* feat(i18n): 将摘要模型重命名为快速模型并更新相关描述
* refactor(llm): 将summaryModel重命名为quickModel以提升语义清晰度
* test(api): 在ApiService测试中添加LlmState类型和awsBedrock配置
添加LlmState类型以满足类型检查要求,并补充awsBedrock的mock配置以完善测试覆盖
* Revert "feat(设置): 在模型设置中添加话题命名折叠面板"
This reverts commit 4d58c053da .
* refactor(settings): 重命名并移动 TopicNamingModalPopup 组件文件
将 TopicNamingModalPopup.tsx 重命名为 QuickModelPopup.tsx 并移动到相应目录
* refactor(QuickModelPopup): 优化主题命名设置布局和样式
移除 TopicNamingSettings 组件内联实现,直接整合到 Modal 中
调整间距和样式,提升视觉一致性
修复文本区域 onChange 去除换行的逻辑
* feat(模型设置): 在快速模型弹窗中添加重置按钮图标并调整布局
将重置按钮改为图标形式并内联显示,同时调整输入区域的高度样式
* docs(i18n): 更新快速模型相关翻译文本
* fix: 将迁移错误日志从133更新为134
* style(settings): 替换模型设置中的图标为Rocket图标以提升视觉一致性
2025-08-19 20:39:52 +08:00
kangfenmao
0368583cfc
refactor(Markdown): update disallowed elements to include 'script' for enhanced security
2025-08-19 18:11:20 +08:00
one
cc8915842a
refactor(SvgPreview): use transparent container for SVG ( #9294 )
...
* refactor(SvgPreview): use transparent container for SVG
* test: fix snapshot
2025-08-19 17:22:05 +08:00
kangfenmao
2e2cfc2409
refactor(Sidebar): remove unused imports and code related to documentation; streamline sidebar functionality
2025-08-19 16:42:20 +08:00
kangfenmao
2265ecab21
feat(CodeTools): add environment variable support for CLI tools; update UI to manage environment variables and enhance localization for related strings
2025-08-19 16:39:50 +08:00
kangfenmao
29d4e37f6b
feat(Sidebar): add 'code_tools' icon and route; enhance CodeToolsPage layout with Navbar and improved provider filtering
2025-08-19 15:38:03 +08:00
kangfenmao
e0bc3bb2c5
refactor(MarkdownStyles): remove last-child margin override; adjust MessageFooter margin and clean up unused code in MessageAttachments
2025-08-19 13:53:46 +08:00
one
6d602d5d48
fix: MentionModelsButton re-rendering ( #9296 )
2025-08-19 13:46:29 +08:00
Phantom
1e7718162d
feat(ProviderSetting): add tooltip for api options ( #9292 )
...
feat(ProviderSetting): 为API选项按钮添加工具提示说明
添加工具提示以解释按钮功能,提升用户体验
2025-08-19 12:59:29 +08:00
one
e3c52a6174
fix(ImagePreview): add relaxed sanitize rules for svg ( #9293 )
2025-08-19 12:58:45 +08:00
one
585e49ac65
fix: svg rendering ( #9291 )
...
* fix: svg max-width
* fix: disable sanitizer
2025-08-19 12:21:48 +08:00
kangfenmao
86545f4fff
refactor(i18n): remove 'enable_delete_model' translations from multiple language files and related settings; streamline Inputbar and SettingsTab components by eliminating backspace delete model functionality.
2025-08-19 12:19:41 +08:00
Konv Suu
b57ec9fe70
fix: update invalid link ( #9285 )
...
* fix: update invalid link
* update
2025-08-19 12:15:53 +08:00
kangfenmao
b96af0fdef
fix(useAssistant): ensure safe access to assistant settings and update reasoning effort handling logic
2025-08-19 11:55:22 +08:00
kangfenmao
b0ea7ad71c
feat(i18n): integrate internationalization for minapp names across multiple languages; update minapp configuration to use localized names for better user experience.
2025-08-19 11:39:36 +08:00
kangfenmao
c8c0d22787
refactor(Inputbar): remove MentionModelsInput and KnowledgeBaseInput components; update InputbarTools and Inputbar to handle model mentions and knowledge base selections directly. Update icons to use Hammer instead of SquareTerminal in various components. Enhance i18n translations for clear actions across multiple languages.
2025-08-19 11:11:49 +08:00
one
263166c9d1
refactor: improve mcp server list ( #9257 )
...
* refactor: mcp server list
* feat: add a delete button, improve button style
* refactor(McpServerList): extract McpServerCard
* feat: show numbers in tab titles
* refactor(preload): 明确getServerVersion返回类型为Promise<string | null>
* refactor(hooks): 移除MCPServer数组的类型断言
* refactor(MCPSettings): 简化服务器标签的渲染逻辑
* Revert "refactor(MCPSettings): 简化服务器标签的渲染逻辑"
This reverts commit 1dd08909af .
* doc: add comments
---------
Co-authored-by: icarus <eurfelux@gmail.com>
2025-08-19 10:26:06 +08:00
Gophlet
f3884af4b9
fix(Artboard): update dimensions to use CSS variables for better layout control ( #9277 )
2025-08-18 18:18:44 +08:00
Phantom
9a4200ac1a
feat(translate): Automatic language detection based on LLM ( #7798 )
...
* docs(i18n): 添加LLM语言检测相关i18n文本
* feat(translate): 添加语言自动检测功能支持
新增语言自动检测方法选择,支持算法检测、LLM检测和智能选择模式
添加未知语言类型支持并更新多语言翻译配置
重构语言检测逻辑,移除旧版基于Unicode的检测方法
* fix: 从依赖数组中移除未使用的autoDetectMethod
* refactor(translate): 修复命名语法错误
* fix(translate): 移除历史记录点击时设置源语言的操作
* refactor(Inputbar): 使用useTranslate钩子替换直接导入的翻译函数
将直接导入的getLanguageByLangcode函数替换为useTranslate钩子中的实现,以保持代码一致性
* refactor(翻译): 将translateLanguageOptions移动到utils/translate中获取
* refactor(TextEditPopup): 使用useTranslate钩子替代直接导入翻译工具
将直接导入的getLanguageByLangcode函数替换为useTranslate钩子中的实现,保持代码一致性
* refactor(translate): 调整翻译设置界面的语言检测方法位置
将语言检测方法选项从中间位置移动到底部,并更新相关标签文本
* refactor(types): 将AutoDetectionMethod类型移至types文件并添加类型守卫
将AutoDetectionMethod类型定义从translate.ts移动到types/index.ts
添加AutoDetectionMethods常量和isAutoDetectionMethod验证方法
* style(translate): 调整翻译设置页面的样式和内联条件渲染
优化翻译设置页面的布局间距,使用条件渲染替代display属性控制元素显示
* refactor(translate): 使用useCallback优化setTranslating函数
* feat(i18n): 添加语言自动检测方法的翻译文本
* fix(翻译动作): 修复源语言与目标语言比较逻辑错误
* fix(翻译设置): 修复未保存设置的问题
* fix(QwenMT): 修复QwenMT模型语言检测问题并添加错误处理
当使用QwenMT模型进行语言检测时自动回退到默认模型,并添加相关错误提示
更新i18n翻译文本以支持新的错误消息
* feat(translate): 添加日志记录以跟踪语言检测过程
添加日志记录来跟踪语言检测方法的选择和检测结果
* feat(i18n): 添加模型不存在提示和语言检测相关翻译
* fix(翻译提示): 更新语言检测提示以避免输出多余内容
* fix(翻译): 改进未知语言处理和日志记录
修复未知语言检测时的处理逻辑,当检测到未知语言时直接使用目标语言
为ActionTranslate组件添加日志上下文
在日志中记录检测到的语言信息
* fix: 将语言检测的callType从lang-detect更新为translate-lang-detect
* refactor(translate): 使用token计数替代字符长度判断语言检测方式
将基于字符长度的语言检测阈值判断改为基于token计数,提高检测准确性
使用sliceByTokens方法替代简单的slice,确保截取的文本符合token限制
* fix(i18n): 更新未知语言检测的错误消息并移除废弃字段
统一将未知语言错误提示从'translate.error.detected_unknown'迁移至'translate.error.detect.unknown',并移除所有语言文件中废弃的'detected_unknown'字段
* docs(schemas): 添加测试调用和翻译语言检测的callType选项文档
2025-08-18 18:00:08 +08:00
one
32d5f7477a
fix: markdown span wrap ( #9264 )
2025-08-18 13:40:59 +08:00
one
ecf1f816c3
refactor: bump antd to 5.27.0, update Input.Password suffix ( #9263 )
2025-08-18 13:39:56 +08:00
Phantom
f9056b0680
fix(providers): update poe url ( #9262 )
...
* fix(providers): 修正poe api的url结尾缺少斜杠的问题
* feat(types): 扩展 ReasoningEffortOptionalParams 中的 extra_body 类型
为 extra_body 添加具体的 google 配置类型,包括 thinking_config 及其属性
* feat(openai): 为Poe提供商添加推理参数传递支持
在Poe提供商的消息处理中,根据模型类型将reasoning_effort和thinking_budget参数附加到用户消息内容。支持GPT5、Claude和Gemini模型的特定参数传递。
* docs(openai): 添加关于poe reasoning_effort参数的注释
2025-08-18 11:55:10 +08:00
one
afae33d588
refactor: remove rc-virtual-list from DraggableList ( #9258 )
2025-08-18 09:36:15 +08:00
one
0b8c6ee536
perf(DraggableList): skip update if dnd to the same position ( #9255 )
2025-08-17 21:34:37 +08:00
Phantom
e652c1d783
fix: set developer role and service tier to default not supported ( #9245 )
...
* refactor(api): 将 isNotSupportDeveloperRole 替换为 isSupportDeveloperRole
重构开发者角色支持逻辑,使用正向命名的 isSupportDeveloperRole 替代反向命名的 isNotSupportDeveloperRole
更新相关迁移逻辑和配置检查逻辑
* refactor(api): 替换 isNotSupportServiceTier 为 isSupportServiceTier
将服务层级支持的否定式参数改为肯定式参数,修改默认行为为不支持
2025-08-17 19:48:41 +08:00
Phantom
aed9566409
fix: thinking button doesn't update assistant reasoning effort ( #9247 )
...
* feat(思考模式): 添加doubao_no_auto模型支持并重构选项回退逻辑
将思考模式选项回退逻辑从组件移至配置文件中统一管理
添加doubao_no_auto模型类型及其支持的选项配置
* refactor(assistant): 将模型兼容性检查逻辑移至useAssistant钩子
将ThinkingButton组件中的模型兼容性检查逻辑重构到useAssistant钩子中,使逻辑更集中
移除不再需要的useEffect导入
* refactor(useAssistant): 移除不必要的类型断言
* refactor: 移除THINKING_OPTION_FALLBACK并使用支持选项的第一个值作为回退
不再使用预定义的选项回退映射表,改为直接使用模型支持选项列表中的第一个值作为回退选项
2025-08-17 19:43:56 +08:00
one
33ec5c5c6b
refactor: improve html artifact style ( #9242 )
...
* refactor: use code font family in HtmlArtifactsCard
* fix: pass onSave to HtmlArtifactsPopup
* feat: add a save button
* fix: avoid extra blank lines
* feat: make split view resizable
* refactor: improve streaming check, simplify Markdown component
* refactor: improve button style and icons
* test: update snapshots, add tests
* refactor: move font family to TerminalPreview
* test: update
* refactor: add explicit type for Node
* refactor: remove min-height
* fix: type
* refactor: improve scrollbar and splitter style
2025-08-17 19:42:40 +08:00
one
b53a5aa3af
test: add tests for rehypeScalableSvg ( #9248 )
2025-08-17 18:46:33 +08:00
one
635bc084b7
refactor: rename some MCP list ( #9253 )
...
- BuiltinMCPServersSection -> BuiltinMCPServerList
- McpResourcesSection -> McpMarketList
2025-08-17 17:55:59 +08:00
Phantom
f0bd6c97fa
fix(providers): update not support enable_thinking providers ( #9251 )
...
fix(providers): 更新不支持enable_thinking参数的系统提供商列表
将不支持enable_thinking参数的系统提供商明确设置为'ollama'和'lmstudio',移除之前的注释说明
2025-08-17 17:28:39 +08:00
one
ded941b7b9
refactor(Mermaid): render mermaid in shadow dom ( #9187 )
...
* refactor(Mermaid): render mermaid in shadow dom
* refactor: pass style overrides to renderSvgInShadowHost
* refactor(MermaidPreview): separate measurement from rendering
* refactor: rename hostCss to customCss
* refactor: use custom properties in shadow host
* test: update snapshots
* fix: remove svg max-width
* refactor: add viewBox to svg (experimental)
* Revert "refactor: add viewBox to svg (experimental)"
This reverts commit 8a265fa8a4 .
2025-08-17 13:22:59 +08:00
Jason Young
535dcf4778
Fix/at symbol deletion issue ( #9206 )
...
* fix: prevent incorrect @ symbol deletion in QuickPanel
- Track trigger source (input vs button) and @ position
- Only delete @ when triggered by input with model selection
- Button-triggered panels never delete text content
- Validate @ still exists at recorded position before deletion
* feat: delete search text along with @ symbol
- Pass searchText from QuickPanel to onClose callback
- Delete both @ and search text (e.g., @cla) when model selected
- Validate text matches before deletion for safety
- Fallback to deleting only @ if text doesn't match
* refactor: clarify ESC vs Backspace behavior in QuickPanel
- ESC: Cancel operation, delete @ + searchText when models selected
- Backspace: Natural editing, @ already deleted by browser, no extra action
- Clear separation of intent improves predictability and UX
2025-08-17 11:43:44 +08:00
George·Dong
4dad2a593b
fix(export): robustly export reasoning and handle errors ( #9221 )
...
* fix(export): robustly export reasoning and handle errors
* fix(export): normalize <br> to newline before notion parsing
* feat(i18n): add notion truncation and unify export warn keys
* refactor(export): add typing, state guards, and error logging
* fix(export): preserve existing <br> in reasoning when convert to html
* feat(export): add DOMPurify sanitization for reasoning content
* chore(deps): remove unused @types/dompurify dev dep
* chore(deps): remove dompurify dependency
Remove dompurify from package.json and yarn. The changes
delete dompurify entries and simplify the lockfile resolution so the
project no longer declares dompurify as a direct dependency.
This cleans up unused dependency declarations and prevents installing
dompurify when it is not required.
2025-08-17 00:41:48 +08:00
chenxue
8b5a3f734c
feat(aihubmix): painting support flux model & update web search rules & update default models ( #9220 )
...
* feat: add painting flux model & update web search models
* feat: update flux api
---------
Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
2025-08-17 00:40:06 +08:00
Caelan
b3643944f3
feat(DMXAPI): new add painting seededit ( #9226 )
...
adjust api
2025-08-16 23:32:26 +08:00
one
e2e8ded2c0
refactor: improve style for ManageModelList and Tooltips ( #9227 )
...
* refactor(ManageModelsPopup): remove margin of Empty
* chore: use destroyOnHidden rather than deprecated destroyTooltipOnHide
* refactor: center Empty
2025-08-16 23:20:38 +08:00
one
72d0fea3a1
refactor(SvgPreview,Markdown): make svg size adaptive ( #9232 )
...
* refactor(Svg): make svg preview scalable
* feat: make svg in markdown scalable
* refactor: add measureElementSize
* refactor: improve rehypeScalableSvg, add MarkdownSvgRenderer
* fix: svg namespace
* perf: improve namespace correction
* refactor: rename makeSvgScalable to makeSvgSizeAdaptive
* test: fix tests for renderSvgInShadowHost
* refactor: improve MarkdownSvgRenderer re-render
* feat: sanitize svg before rendering
* feat: make MarkdownSvgRenderer clickable
* test: fix
* Revert "feat: make MarkdownSvgRenderer clickable"
This reverts commit 73af8fbb8c .
* refactor: use context menu in MarkdownSvgRenderer
* refactor: remove preserveAspectRatio from svg
2025-08-16 23:19:47 +08:00
beyondkmp
62a6a0a8be
fix: Update KnowledgeBase form and service to handle preprocess provider correctly ( #9229 )
...
* fix: Update KnowledgeBase form and service to handle preprocess provider correctly
- Enhanced useKnowledgeBaseForm hook to set preprocessProvider with the correct providerId type.
- Modified getKnowledgeBaseParams function to retrieve preprocess provider from the store instead of the base, ensuring accurate provider assignment.
* fix: Remove unused providerId from preprocessProvider in useKnowledgeBaseForm hook
- Cleaned up the useKnowledgeBaseForm hook by removing the unused providerId property from the preprocessProvider object, ensuring a more accurate representation of the data structure.
* format code
* feat: Sync preprocess provider updates across knowledge bases
- Added a new action to synchronize updates to the preprocess provider across all knowledge bases that reference it.
- Updated the usePreprocessProvider hook to dispatch the new sync action after updating the provider.
- Modified getKnowledgeBaseParams to ensure the correct preprocess provider is assigned when retrieving knowledge base parameters.
* fix: Update sync logic for preprocess provider updates
- Modified the syncPreprocessProvider action to merge updates directly into the existing provider object instead of replacing it.
- Adjusted the usePreprocessProvider hook to only dispatch the sync action when specific fields (apiHost, apiKey, model) are updated, improving efficiency.
2025-08-16 21:14:47 +08:00
miro
04326eba21
feat: Use different window name for Quick Assistant ( #9217 )
...
Co-authored-by: Miro Klarin <miro.klarin@proton.me>
2025-08-16 11:21:29 +08:00
Pleasure1234
a02b4b3955
fix: websearch ( #9222 )
...
Update LocalSearchProvider.ts
2025-08-16 04:00:32 +08:00
SuYao
e0dbd2d2db
fix/9165 ( #9194 )
...
* fix/9165
* fix: early return
2025-08-15 22:56:40 +08:00
陈天寒
748ac600fa
fix(aws-bedrock): support thinking mode ( #9172 )
...
* fix(aws-bedrock): support thinking mode
* fix(aws-bedrock): fix code review suggestions
* fix(aws-bedrock): Add thinking processing for other models
2025-08-15 15:13:48 +08:00
Phantom
c2561726e0
style(Inputbar): use primary color for buttons ( #9174 )
...
style(Inputbar): 统一按钮激活状态颜色为主题色
将输入栏中多个按钮的激活状态颜色从链接色(--color-link)统一为主题色(--color-primary),保持UI一致性
2025-08-15 14:31:49 +08:00
SuYao
d1e19aad51
fix: unexpected loading ( #9193 )
...
fix
2025-08-15 09:28:43 +08:00
Phantom
bef0180e4c
feat: web search icons ( #9147 )
...
* feat(类型): 添加WebSearchProviderIds常量并更新WebSearchProvider类型
* refactor(web-search): 重构网络搜索提供商配置和logo获取逻辑
将webSearchProviders.ts中的提供商logo获取函数移动到使用组件中
并优化提供商配置的类型定义
* feat(WebSearchButton): 添加不同搜索引擎的图标支持
为WebSearchButton组件添加多个搜索引擎的图标支持,包括Baidu、Google、Bing等
* feat(types): 添加预处理和网页搜索提供者的类型校验函数
添加 PreprocessProviderId 和 WebSearchProviderId 的类型校验函数 isPreprocessProviderId 和 isWebSearchProviderId,用于验证字符串是否为有效的提供者 ID
* refactor(types): 重命名ApiProviderUnion并添加更新函数类型
添加用于更新不同类型API提供者的函数类型,提高类型安全性
* refactor(websearch): 将搜索提供商配置提取到单独文件
将websearch store中的搜索提供商配置提取到单独的配置文件,提高代码可维护性
* refactor(PreprocessSettings): 移除未使用的 system 选项禁用逻辑
由于 system 字段实际未使用,移除相关代码以简化逻辑
* refactor(api-key-popup): 移除providerKind参数,改用providerId判断类型
* refactor(preprocessProviders): 使用类型定义优化预处理提供者配置
将 providerId 参数类型从 string 改为 PreprocessProviderId
为 PREPROCESS_PROVIDER_CONFIG 添加类型定义
* refactor(hooks): 使用PreprocessProviderId类型替换字符串类型参数
* refactor(hooks): 使用 WebSearchProviderId 类型替换字符串类型参数
将 useWebSearchProvider 钩子的 id 参数类型从 string 改为 WebSearchProviderId,提高类型安全性
* refactor(knowledge): 将providerId类型改为PreprocessProviderId
* refactor(PreprocessSettings): 移除未使用的options相关代码
清理PreprocessSettings组件中已被注释掉的options状态和相关逻辑,简化代码结构
* refactor(WebSearchProviderSetting): 将providerId类型从string改为WebSearchProviderId
* refactor(websearch): 移除WebSearchProvider类型中不必要的id字段约束
* style(WebSearchButton): 调整图标大小和样式以保持视觉一致性
* fix(ApiKeyListPopup): 修正LLM提供者判断逻辑
使用'models'属性检查替代原有逻辑,更准确地判断是否为LLM provider
* fix(ApiKeyListPopup): 修复预处理provider判断逻辑
处理mistral同时提供预处理和llm服务的情况,避免误判
2025-08-14 23:19:17 +08:00
SuYao
37dccd93e9
fix: modelname ( #9183 )
2025-08-14 20:06:57 +08:00
Teo
bf30bf28a9
fix(TopicMessages): fix topic style ( #9178 )
...
* fix(TopicMessages): fix topic style
2025-08-14 16:55:08 +08:00
Jason Young
1bf380a921
fix: auto-close panel when no commands match ( #7824 ) ( #8784 )
...
* fix(QuickPanel): auto-close panel when no commands match (#7824 )
Fixes the issue where QuickPanel remains visible when user types
invalid slash commands. Now the panel intelligently closes after
300ms when no matching commands are found.
- Add smart delayed closing mechanism for unmatched searches
- Optimize memory management with proper timer cleanup
- Preserve existing trigger behavior for / and @ symbols
* feat(inputbar): intelligent @ symbol handling on model selection panel close
- Add smart @ character deletion when user selects models and closes panel with ESC/Backspace
- Preserve @ character when user closes panel without selecting any models
- Implement action tracking using useRef to detect user model interactions
- Support both ESC key and Backspace key for consistent behavior
- Use React setState instead of DOM manipulation for proper state management
Resolves user experience issue where @ symbol always remained after closing model selection panel
* perf(QuickPanel): optimize timer management and fix React anti-patterns
- Move side effects from useMemo to useEffect for proper React lifecycle
- Add automatic timer cleanup on component unmount and dependency changes
- Remove unnecessary timer creation/destruction on each search input
- Improve memory management and prevent potential memory leaks
- Maintain existing smart auto-close functionality with better performance
Fixes React anti-pattern where side effects were executed in useMemo,
which should be a pure function. This improves performance especially
when users type quickly in the search input.
* refactor(QuickPanel): remove redundant timer cleanup useEffect
Remove duplicate timer cleanup logic as the existing useEffect at line 141-164
already handles component unmount cleanup properly.
* refactor(QuickPanel): optimize useEffect dependencies and timer cleanup logic
- Replace overly broad `ctx` dependency with precise `[ctx.isVisible, searchText, list.length, ctx.close]`
- Move timer cleanup before visibility check to ensure proper cleanup on panel hide
- Add early return when panel is invisible to prevent unnecessary timer creation
- Improve performance by avoiding redundant effect executions
- Fix edge case where timers might not be cleared when panel becomes invisible
Addresses review feedback about dependency array optimization while maintaining
existing auto-close functionality and improving memory management.
* feat(QuickPanel): implement smart re-opening with dependency optimization
Features:
- Implement smart re-opening during deletion with real-time matching
- Only reopen panel when actual matches exist to avoid unnecessary interactions
- Add intelligent @ symbol handling on model selection panel close
- Optimize search text length limits (≤10 chars) for performance
Fixes:
- Fix useMemo dependency from overly broad [ctx, searchText] to precise [ctx.isVisible, ctx.symbol, ctx.list, searchText]
- Resolve trailing whitespace formatting issues
- Eliminate ESLint exhaustive-deps warnings while maintaining stability
- Prevent unnecessary re-renders when unrelated ctx properties change
Performance improvements ensure optimal QuickPanel responsiveness while maintaining
existing auto-close functionality and improving user experience.
* fix(ci): add eslint-disable comment for exhaustive-deps warning
The useEffect dependency array [ctx.isVisible, searchText, list.length, ctx.close]
is intentionally precise to avoid unnecessary re-renders when unrelated ctx
properties change. Adding ctx object would cause performance degradation.
* refactor(QuickPanel): remove smart re-opening logic during deletion
- Remove 62 lines of complex deletion detection logic from Inputbar component
- Eliminates performance overhead from frequent string matching during typing
- Reduces code complexity and potential edge cases
- Maintains simple and predictable QuickPanel behavior
- Improves maintainability by removing unnecessary "smart" features
The deletion-triggered smart reopening feature added unnecessary complexity
without significant user benefit. Users can simply type / or @ again to
reopen panels when needed.
2025-08-14 16:35:14 +08:00
周子健
a4c61bcd66
fix: @cherry/memory i18n key wrong ( #9164 )
2025-08-14 10:00:45 +08:00
one
a172a1052a
refactor: use hook useTemporaryValue in Table, CitationList, TranslatePage ( #9134 )
2025-08-13 16:58:50 +08:00
Phantom
f4ef2ec934
fix: remove gpt-5-chat from OpenAI reasoning models ( #9136 )
...
fix: 从OpenAI推理模型判断中移除gpt-5-chat
2025-08-13 16:30:24 +08:00
one
4cda5f1787
feat(Markdown): support disabling single dollar math ( #9131 )
...
* feat(Markdown): support disabling single dollar math
* fix: lint error
2025-08-13 16:14:59 +08:00
Teo
ceef19e55b
feat: add message outline ( #9090 )
...
* feat: add message outline feature
2025-08-13 14:57:58 +08:00
Phantom
0634baf780
fix(providers): qiniu doesn't support developer role ( #9125 )
...
fix(providers): 更新不支持developer角色的提供商列表
2025-08-13 14:51:23 +08:00
one
d424bb1224
fix: codeblock special view ( #9120 )
...
* Revert "fix(CodeBlockView): initial view mode (#9047 )"
This reverts commit 28e6135f8c .
* fix: code block border radius
* chore: bump mermaid to 11.9.0
2025-08-13 14:41:13 +08:00
anghunk
f97943006e
fix: set the inconsistency of column background color issue ( #9109 )
2025-08-13 11:53:44 +08:00
one
ea8b7f317d
fix: selection toolbar in CodeViewer ( #9103 )
2025-08-13 11:37:31 +08:00
kangfenmao
2dd2bee940
refactor(settings): reorganize the menu layout in the settings page
...
- Introduced QuickPhraseSettings component for managing quick phrases with add, edit, and delete functionality.
- Added PreprocessSettings component to configure document preprocessing options, including provider selection.
- Updated SettingsPage to include links to the new Quick Phrase and Preprocess settings.
- Removed the deprecated ToolSettings component and its associated routes.
- Enhanced WebSearchSettings with new compression settings and improved UI for managing web search providers.
2025-08-13 10:54:35 +08:00
one
df587fc61f
chore: use destroyOnHidden instead of deprecated destroyOnClose ( #9102 )
...
* chore: use destroyOnHidden instead of deprecated destroyOnClose
* Update src/renderer/src/components/MinApp/MinappPopupContainer.tsx
* Update src/renderer/src/pages/settings/SelectionAssistantSettings/components/SelectionFilterListModal.tsx
---------
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
2025-08-13 10:08:36 +08:00
Phantom
7c2a9d141e
fix: web search button memory leak ( #9100 )
...
* refactor(InputbarTools): 重命名getMenuItems为menuItems以提高可读性
* docs(Inputbar): 添加内存泄露风险注释
* Revert "refactor(InputbarTools): 重命名getMenuItems为menuItems以提高可读性"
This reverts commit 6076d5b74c .
* perf(WebSearchButton): 使用startTransition优化性能并移除setTimeout
移除setTimeout延迟更新,减少内存泄露,改用startTransition来优化UI卡顿问题,提升用户体验
2025-08-13 10:05:40 +08:00
亢奋猫
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.
2025-08-12 11:54:38 +08:00
kangfenmao
793ccf978e
feat(ProviderSettings): add API options settings and popup for providers
...
- Introduced ApiOptionsSettings component to manage API options for providers.
- Added ApiOptionsSettingsPopup for displaying API options in a modal.
- Updated ProviderSetting to include a button for opening the API options popup for non-system providers.
- Refactored imports and adjusted layout in ProviderSetting for better UI consistency.
2025-08-12 11:53:38 +08:00
kangfenmao
ef57e543c6
fervert: feat(ProviderSettings): resizable provider settings ( #9004 )
...
This reverts commit 5713a278cd .
2025-08-12 11:32:04 +08:00
Phantom
42800a6195
style(Inputbar): use primary color for inputbar tools ( #9058 )
...
style(Inputbar): 将激活状态图标颜色从--color-link改为--color-primary
2025-08-12 11:26:44 +08:00
Phantom
be29f163a3
refactor(models.ts): Adjust the logo matching order of the GPT-5 model ( #9073 )
...
* refactor(models.ts): 调整GPT-5模型logo匹配顺序
* refactor(models): 简化GPT-5模型logo的正则匹配模式
* Revert "Update gpt-5.png"
This reverts commit 1e8143eb8c .
2025-08-12 11:25:05 +08:00
beyondkmp
207f2e1689
refactor(proxy): update proxy handling logic in useAppInit and GeneralSettings ( #9081 )
...
- Simplified proxy setting logic by removing unnecessary dispatches for 'system' and 'none' modes.
- Updated useAppInit to set proxy to undefined for 'system' mode and clarified direct mode handling with comments.
2025-08-12 11:21:47 +08:00