Commit Graph

3923 Commits

Author SHA1 Message Date
icarus
dbf35b79ad fix: 将迁移错误日志从136更新为137 2025-08-23 02:22:55 +08:00
icarus
a7838e0d72 refactor(ocr): 简化OCR文件类型检查逻辑
使用现有的isImageFile函数替代冗余的类型检查逻辑,提高代码复用性
2025-08-23 00:42:09 +08:00
icarus
ae027e4978 style(TabContainer): 移除多余的空行并保持代码整洁 2025-08-23 00:38:04 +08:00
icarus
d3e338e6a8 Merge remote-tracking branch 'upstream' into feat/ocr 2025-08-23 00:37:48 +08:00
icarus
e59279e962 refactor(ocr): ocrImage实现使用OcrService并更新日志上下文
将ocrImage函数从useOcr钩子移动到OcrService中,提高代码复用性
更新日志服务上下文从'main'改为'renderer'以更准确反映模块位置
2025-08-23 00:35:50 +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
icarus
1f38428716 fix(useOcr): 修复未支持文件类型错误抛出位置
将不支持的OCR文件类型错误抛出逻辑移至条件判断内
2025-08-22 20:53:41 +08:00
icarus
bbf3af070a feat(i18n): 添加OCR相关的错误和状态翻译文本 2025-08-22 20:49:05 +08:00
icarus
a46697c5c3 fix(ocr): 改进OCR处理中的消息管理和错误处理
在useOcr钩子中统一管理OCR处理的消息提示,并完善错误处理逻辑
移除TranslatePage中重复的消息管理代码,简化OCR处理流程
2025-08-22 20:46:26 +08:00
icarus
9ac7d7f95e refactor(ocr): 简化 DEFAULT_OCR_PROVIDER 的类型定义 2025-08-22 20:37:03 +08:00
icarus
364a0f8bb7 fix(ocr): 修复文件类型与OCR提供者能力不匹配时的错误抛出位置
将错误抛出语句移至else分支
2025-08-22 20:36:45 +08:00
icarus
cf0e6a8f73 refactor(ocr): 修改tesseractOcr返回完整识别结果而非仅文本
返回完整识别结果以便后续处理使用更多OCR信息,同时简化imageOcr中的条件判断逻辑
2025-08-22 20:36:37 +08:00
icarus
239c9c7205 refactor(preload): 移动OCR类型定义到共享类型文件
将OCR相关的类型定义(OcrProvider, OcrResult, SupportedOcrFile)从渲染进程类型文件移动到共享类型文件@types,以提高代码复用性和维护性
2025-08-22 20:36:04 +08:00
icarus
a37e81fc4f feat(i18n): 添加OCR功能的多语言支持 2025-08-22 20:35:16 +08:00
icarus
94b71dde60 refactor(TesseractService): 添加日志记录并更新worker配置
添加loggerService用于记录worker日志,并更新createWorker配置以使用自定义logger
2025-08-22 20:34:39 +08:00
icarus
9d8eea7f2e refactor(ocr): 将Tesseract服务文件移动到tesseract子目录并更新配置 2025-08-22 20:33:56 +08:00
icarus
3e454a262f build: 将 tesseract.js 从 devDependencies 移至 dependencies
确保生产环境能正确使用 tesseract.js 功能
2025-08-22 20:32:57 +08:00
icarus
af05960cd3 feat(OCR服务): 支持base64字符串作为OCR输入
扩展tesseractOcr函数以接受base64字符串或图像文件作为输入
2025-08-22 16:54:57 +08:00
icarus
1864419e70 fix(ocr): 添加图像大小检查并优化错误处理
检查图像文件大小是否超过50MB限制
使用buffer读取文件替代直接路径识别
简化错误处理逻辑,直接抛出原始错误
2025-08-22 16:52:02 +08:00
icarus
6a467ceca4 feat(ocr): 添加OCR服务设置界面及提供商选择功能
实现OCR服务设置界面,包含图片OCR提供商的选择功能
修复ocr.ts中imageProvider的类型定义
添加相关国际化文本
2025-08-22 16:41:16 +08:00
icarus
e79bfcee77 feat(store): 更新持久化存储版本并添加OCR配置迁移
添加137版本迁移逻辑,初始化OCR提供者和默认图像提供者配置
2025-08-22 16:31:46 +08:00
icarus
a6aee21a96 refactor(ocr): 统一OCR类型导入路径
将所有OCR相关类型从'@renderer/types/ocr'改为从'@renderer/types'或'@types'导入
优化DEFAULT_OCR_PROVIDER类型定义
2025-08-22 16:12:25 +08:00
icarus
2b463374ac feat(ocr): 添加设置图片OCR提供商的功能 2025-08-22 15:50:48 +08:00
icarus
1634e7dcf9 refactor(ocr): 重命名updatePreprocessProvider为updateOcrProvider以保持命名一致性 2025-08-22 15:49:51 +08:00
icarus
37d9ff59cc feat(ocr): 添加OCR功能支持及文件类型校验
添加OCR功能钩子useOcr,支持图片文件识别
添加不支持文件类型的错误提示国际化文案
2025-08-22 15:41:43 +08:00
icarus
523ce9b7dc feat(store): 添加ocr模块到redux store 2025-08-22 15:35:49 +08:00
icarus
01360e3a4b feat(ocr): 添加OCR服务基础功能
实现OCR服务的基础功能,通过调用window.api.ocr接口处理支持的文件类型
2025-08-22 15:33:04 +08:00
icarus
01ad89eb54 refactor(OcrService): 更新日志上下文为'main:OcrService' 2025-08-22 15:30:49 +08:00
icarus
9d438be48f feat(ocr): 添加OCR功能支持
实现基于Tesseract的OCR功能,包括文件类型检查、服务接口和IPC通信
新增OCR相关类型定义和服务实现
2025-08-22 15:30:02 +08:00
icarus
6011805527 feat(ocr): 添加对OCR支持文件类型的类型定义和校验函数
添加SupportedOcrFileType类型和isSupportedOcrFileType校验函数
添加SupportedOcrFile类型和isSupportedOcrFile校验函数
2025-08-22 15:01:47 +08:00
icarus
69cb81db85 feat(types): 添加图片文件类型守卫函数
添加 ImageFileMetadata 类型和 isImageFile 类型守卫函数,用于检查文件是否为图片类型
2025-08-22 14:52:54 +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
icarus
807861d207 feat(store): 添加OCR状态管理切片
实现OCR提供商的增删改查功能,使用Redux Toolkit管理OCR相关状态
2025-08-22 14:35:22 +08:00
icarus
dc1777cc81 refactor(ocr): 重构OCR配置结构以支持默认提供者
将内置OCR提供者数组重构为单独定义的常量,并添加默认OCR提供者映射。这提高了代码的可维护性并支持未来扩展。
2025-08-22 14:34:54 +08:00
icarus
2529b51a17 refactor(ocr): 将获取OCR提供商logo的功能移动到utils目录
将getOcrProviderLogo函数从config/ocr.ts移动到utils/ocr.ts,保持功能集中
2025-08-22 14:31:46 +08:00
icarus
bbe3c2f48c refactor(ocr): 更改文件名 2025-08-22 14:29:02 +08:00
icarus
d537442be8 refactor(config): 重命名OCR_PROVIDER_CONFIG为BUILTIN_OCR_PROVIDERS以更准确描述用途 2025-08-22 14:22:25 +08:00
icarus
250dd53c97 refactor(settings): 重构文档预处理设置模块结构
将PreprocessSettings重命名为DocProcessSettings并调整文件结构
更新相关路由和组件引用以保持功能一致性
2025-08-22 14:01:28 +08:00
icarus
1da7492b42 feat(ocr): 添加Tesseract.js的logo 2025-08-22 13:50:55 +08:00
icarus
277bf1dc74 feat(ocr): 添加 Tesseract OCR 提供程序配置 2025-08-22 13:50:27 +08:00
icarus
6229cbd4d2 feat(ocr): 添加OCR类型定义文件以支持OCR功能扩展 2025-08-22 13:50:07 +08:00
icarus
1c99a13312 build: 添加 tesseract.js 及其类型定义依赖 2025-08-22 13:49:36 +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