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
George·Dong
fd7d2b7580
fix(codetool): quote executable path to handle spaces ( #9519 )
...
* fix(cmd): quote executable path on Windows in command string
Wrap the executable path in double quotes when running on Windows sopaths containing spaces are handled correctly. Previously the base
command used an unquoted path which could break execution for users
whose install location includes spaces. This change only alters the
Windows branch to produce a quoted executable path while keeping the
non-Windows command unchanged.
* fix(codetool): quote bun paths in shell commands to spaces
2025-08-25 20:02:13 +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
2633a1429a
chore(vscode): improve VSCode launch configurations for debugging ( #9483 )
2025-08-25 10:46:45 +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
beyondkmp
d6866052c4
fix: add copilot header to fix json error ( #9456 )
...
* add accept type in header
* add header
2025-08-23 18:59:29 +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
one
35968f4861
chore(ci): refine pr ci steps ( #9429 )
...
* chore(ci): refine pr ci steps
* fix: line errors
2025-08-22 22:52:03 +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
beyondkmp
f66cb2651f
refactor: simplify NotificationService initialization and use windowService for notifications ( #9411 )
...
* refactor: simplify NotificationService initialization and use windowService for notifications
- Removed the dependency on BrowserWindow in NotificationService constructor.
- Updated the notification handling to utilize windowService for showing notifications and sending events, improving code modularity.
* refactor: remove constructor from NotificationService for cleaner initialization
2025-08-22 14:41:36 +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
beyondkmp
b4a3a483e9
fix: change title bar overlay color for windows ( #9407 )
...
* fix: update titleBarOverlayDark color for improved visibility
* refactor: import isDev and isWin constants for cleaner configuration
2025-08-22 12:30:07 +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
Chen Tao
1c0e29f029
fix: knowledge encrypted ( #9385 )
2025-08-21 16:58:16 +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