icarus
2dbd487a90
Merge branch 'feat/ocr' into feat/ocr-translate
2025-08-23 00:42:51 +08:00
icarus
a7838e0d72
refactor(ocr): 简化OCR文件类型检查逻辑
...
使用现有的isImageFile函数替代冗余的类型检查逻辑,提高代码复用性
2025-08-23 00:42:09 +08:00
icarus
66fff8fb76
Merge branch 'feat/ocr' into feat/ocr-translate
2025-08-23 00:38:20 +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
4891080ee7
Merge branch 'feat/ocr' into feat/ocr-translate
2025-08-23 00:36:16 +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
b062dff59c
Merge branch 'feat/ocr' into feat/ocr-translate
2025-08-22 20:55:20 +08:00
icarus
1f38428716
fix(useOcr): 修复未支持文件类型错误抛出位置
...
将不支持的OCR文件类型错误抛出逻辑移至条件判断内
2025-08-22 20:53:41 +08:00
icarus
ab091f15b3
Merge branch 'feat/ocr' into feat/ocr-translate
2025-08-22 20:49:20 +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
863cd0ee16
Merge branch 'feat/ocr' into feat/ocr-translate
2025-08-22 20:38:23 +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
ae134b9a24
refactor(ocr): 简化 DEFAULT_OCR_PROVIDER 的类型定义
2025-08-22 20:32:07 +08:00
icarus
7fa2e62dce
fix(ocr): 修复文件类型与OCR提供者能力不匹配时的错误抛出位置
...
将错误抛出语句移至else分支
2025-08-22 20:29:46 +08:00
icarus
5241f11eeb
refactor(ocr): 修改tesseractOcr返回完整识别结果而非仅文本
...
返回完整识别结果以便后续处理使用更多OCR信息,同时简化imageOcr中的条件判断逻辑
2025-08-22 20:28:33 +08:00
icarus
fbe4db0e50
refactor(preload): 移动OCR类型定义到共享类型文件
...
将OCR相关的类型定义(OcrProvider, OcrResult, SupportedOcrFile)从渲染进程类型文件移动到共享类型文件@types,以提高代码复用性和维护性
2025-08-22 20:23:23 +08:00
icarus
b4c0adff99
fix(translate): 在选择文件后清除文件状态以避免残留
...
在文件选择完成后调用clearFiles以清除文件状态
2025-08-22 20:22:39 +08:00
icarus
1cce646e4b
fix(ocr): 改进OCR处理中的消息管理和错误处理
...
在useOcr钩子中统一管理OCR处理的消息提示,并完善错误处理逻辑
移除TranslatePage中重复的消息管理代码,简化OCR处理流程
2025-08-22 20:21:29 +08:00
icarus
7afa9f7ab0
fix(hooks): 返回变量supportedFiles
2025-08-22 19:25:44 +08:00
icarus
e15363c71c
refactor(AttachmentButton): 移除类型注释,使用自动类型推断
2025-08-22 19:22:32 +08:00
icarus
0fdae33f51
fix(i18n): 更新文件大小限制错误信息并添加多语言支持
...
修改文件大小限制的错误信息格式,移除括号内的限制范围
为多种语言添加文件操作相关的翻译条目
在错误提示中动态显示文件大小限制范围
2025-08-22 19:20:29 +08:00
icarus
9d31ccb5ea
feat(翻译): 添加文件读取功能并改进错误处理
...
添加对文本文件的支持并优化文件处理流程
改进错误提示信息,包括文件过大和读取失败的场景
2025-08-22 19:18:24 +08:00
icarus
c04cd3b71e
feat(fs): 添加自动识别编码读取文本文件功能
...
实现通过自动检测文件编码来读取文本文件的功能
在IPC通道、预加载API和文件服务中添加相关方法
2025-08-22 19:18:09 +08:00
icarus
9609061d82
feat(i18n): 添加OCR功能的多语言支持
2025-08-22 18:51:57 +08:00
icarus
f74c63ff77
fix(translate): 处理未选择文件时提前返回以避免空指针异常
2025-08-22 18:47:18 +08:00
icarus
6c9202c5d5
style(translate): 调整浮动按钮位置从右上到左下
2025-08-22 18:45:52 +08:00
icarus
a4257d9efe
fix: 添加OCR未知错误的翻译并更新错误提示
...
在OCR处理失败时,使用翻译后的错误消息替代原始错误提示
2025-08-22 18:44:51 +08:00
icarus
97435c9294
fix(translate): 为OCR处理消息添加无限持续时间
...
防止OCR处理过程中消息自动消失,确保用户明确知道处理状态
2025-08-22 18:42:41 +08:00
icarus
377d75366e
feat(翻译页面): 添加OCR处理中的加载状态提示
...
在翻译页面中添加OCR处理时的加载状态提示,提升用户体验
2025-08-22 18:37:55 +08:00
icarus
c5d7d7b849
refactor(TesseractService): 添加日志记录并更新worker配置
...
添加loggerService用于记录worker日志,并更新createWorker配置以使用自定义logger
2025-08-22 18:32:31 +08:00
icarus
40cf92a246
refactor(ocr): 将Tesseract服务文件移动到tesseract子目录并更新配置
2025-08-22 18:16:03 +08:00
icarus
ad1fd990e3
build: 将 tesseract.js 从 devDependencies 移至 dependencies
...
确保生产环境能正确使用 tesseract.js 功能
2025-08-22 18:09:54 +08:00
icarus
e03686f9b5
feat(translate): 添加文件OCR功能支持
...
在翻译页面新增浮动按钮,支持通过OCR识别文件内容并自动填充到输入框。添加相关hooks和文件类型检查逻辑,提升用户输入便捷性。
2025-08-22 17:58:42 +08:00
icarus
1bd1c814a8
feat(hooks): 在useFiles钩子中暴露selecting状态
2025-08-22 17:57:10 +08:00
icarus
8b17694cdf
refactor(useFiles): 将参数从布尔值改为对象以增强可扩展性
2025-08-22 17:45:53 +08:00