Commit Graph

8 Commits

Author SHA1 Message Date
impressionyang
146c84f118 fix: 增强模型文件选择的错误处理和日志输出
Some checks failed
Build Windows GUI / build-windows (push) Has been cancelled
Build Windows GUI / release (push) Has been cancelled
- 在 settingsPage.tsx 中添加详细的 console.log 调试信息
- 改进错误处理,显示具体错误消息
- 更新构建脚本以包含 capabilities 权限配置
2026-05-22 09:47:45 +08:00
impressionyang
b03ac2ab0b fix: 修复主题设置和模型文件选择功能
Some checks are pending
Build Windows GUI / build-windows (push) Waiting to run
Build Windows GUI / release (push) Blocked by required conditions
后端变更:
- src/app/commands.rs: 导入 Emitter trait
- src/app/commands.rs: set_theme 命令添加 emit 发送 theme-change 事件
- src/app/commands.rs: select_model_file 改进错误处理和消息提示

前端变更:
- web/src/pages/SettingsPage.tsx: 移除模型路径输入框的 onChange (与 readOnly 冲突)
- web/src/pages/SettingsPage.tsx: handleSelectModel 添加用户友好的错误提示
- web/src/pages/SettingsPage.tsx: 移除主题按钮的 emoji 图标

修复问题:
1. 主题设置不生效 - set_theme 命令现在发送 theme-change 事件通知前端
2. 模型文件不能选择 - 移除 onChange 冲突,改进错误处理

构建结果:
- Windows 包:dist/impress-asr-windows-x64-20260521_194309.zip
- 文件大小:5.0MB
2026-05-21 19:47:38 +08:00
impressionyang
6f4a7dafd4 fix: 添加缺失的波形动画 CSS 样式并优化主题监听器
Some checks are pending
Build Windows GUI / build-windows (push) Waiting to run
Build Windows GUI / release (push) Blocked by required conditions
CSS 变更:
- web/src/App.css: 新增 .waveform-animation 和 .wave-bar 样式
- web/src/App.css: 新增 @keyframes wave-animation 动画定义
- web/src/App.css: 新增 .waveform-placeholder 样式

前端变更:
- web/src/App.tsx: 优化主题监听器逻辑,使用 async/await 正确处理 listen 返回值

问题修复:
- 波形动画区域现在正确显示动画效果
- 主题监听器正确设置和清理
- 错误边界组件在发生未预期错误时显示友好提示

构建结果:
- Windows 包:dist/impress-asr-windows-x64-20260521_192207.zip
- 文件大小:5.0MB
2026-05-21 19:26:31 +08:00
impressionyang
66f4b7e0c4 fix: 增强错误处理,确保异常情况下也能显示页面
Some checks are pending
Build Windows GUI / build-windows (push) Waiting to run
Build Windows GUI / release (push) Blocked by required conditions
后端变更:
- src/app/mod.rs: 窗口 hide() 使用 _ 忽略错误,避免 unwrap() panic

前端变更:
- web/src/components/ErrorBoundary.tsx: 新增错误边界组件,捕获未处理的错误
- web/src/main.tsx: 使用 ErrorBoundary 包裹 App 组件
- web/src/App.tsx: 优化主题加载和监听器的错误处理,确保失败时使用默认主题

错误处理能力:
- 即使 Tauri 命令失败,页面也能正常显示
- 未捕获错误会显示友好的错误页面,提供刷新按钮
- 主题加载失败时自动使用 system 主题降级
- 事件监听器清理更安全,避免异步问题

构建结果:
- Windows 包:dist/impress-asr-windows-x64-20260521_190528.zip
- 文件大小:5.0MB
2026-05-21 19:10:11 +08:00
impressionyang
f3fe6bafc4 fix: 修复 Windows 交叉编译错误
Some checks are pending
Build Windows GUI / build-windows (push) Waiting to run
Build Windows GUI / release (push) Blocked by required conditions
修复内容:
- src/app/state.rs: AppState::new() 添加 current_theme 和 allow_exit 字段初始化
- src/app/commands.rs: 修复 FilePath 类型转换,使用 into_path() 方法
- src/app/mod.rs: 导入 Emitter trait 以使用 emit() 方法,修复 unused variable 警告
- src/app/mod.rs: 将主题菜单从 Menu 改为 Submenu 以符合 IsMenuItem trait
- web/src/App.tsx: 修复 invoke 类型错误,使用 as 类型断言
- web/src/pages/SettingsPage.tsx: 修复 invoke 类型错误和 modelPath 类型推断

构建结果:
- Windows 包已生成:dist/impress-asr-windows-x64-20260521_185247.zip
- 文件大小:5.0MB
- 包含 GUI 程序、CLI 工具、manifest 文件和前端资源
2026-05-21 18:57:31 +08:00
impressionyang
a4d6353f1a feat: 添加自定义模型路径配置功能
Some checks are pending
Build Windows GUI / build-windows (push) Waiting to run
Build Windows GUI / release (push) Blocked by required conditions
后端变更:
- src/app/commands.rs: 新增 select_model_file 命令,使用 Tauri dialog 打开文件选择器
- src/app/mod.rs: 注册 select_model_file 命令到 invoke_handler

前端变更:
- web/src/pages/SettingsPage.tsx:
  - 添加 modelPath 字段到 Settings 接口
  - 添加 handleSelectModel 函数处理文件选择
  - 添加模型路径配置 UI(输入框 + 选择按钮)
- web/src/App.css: 添加.model-path-selector 样式

功能说明:
- 用户可通过托盘菜单或设置页面选择自定义 ONNX 模型文件
- 支持 .onnx 扩展名过滤
- 模型路径保存在配置中,可选功能,留空时使用内置模型
- 设置保存后应用到 ASR 引擎
2026-05-21 18:45:08 +08:00
impressionyang
7ad06cc54a feat: 完善托盘功能、完全退出和主题切换
Some checks are pending
Build Windows GUI / build-windows (push) Waiting to run
Build Windows GUI / release (push) Blocked by required conditions
托盘功能:
- 添加主题子菜单(浅色/深色/跟随系统)
- 添加完全退出菜单项
- 托盘图标使用应用默认图标

完全退出功能:
- 新增 AppState.allow_exit 状态控制
- 点击'完全退出'时允许应用真正退出
- 关闭窗口隐藏到托盘的默认行为

主题切换功能:
- 后端:添加 AppTheme 枚举和 set_theme/get_theme 命令
- 前端:实现主题切换逻辑,支持浅色/深色/跟随系统
- 前端:添加主题选择器 UI 组件和样式
- 通过 CSS 变量实现深色/浅色主题切换
- 支持 Tauri 事件监听实现后端主题同步

修改文件:
- src/app/state.rs: 添加 AppTheme 枚举和状态管理
- src/app/mod.rs: 完善托盘菜单和退出逻辑
- src/app/commands.rs: 添加主题相关 Tauri 命令
- web/src/App.tsx: 实现主题切换逻辑
- web/src/App.css: 添加主题 CSS 变量和选择器样式
- web/src/pages/SettingsPage.tsx: 添加主题选择器 UI
2026-05-21 18:07:38 +08:00
impressionyang
ceb2df18c4 初始提交:Windows 跨平台语音识别应用
Some checks are pending
Build Windows GUI / build-windows (push) Waiting to run
Build Windows GUI / release (push) Blocked by required conditions
功能:
- Tauri v2 GUI 应用
- 系统托盘支持
- 日志输出到文件
- 带时间戳的版本号
- 前端资源嵌入

修复:
- 前端路径使用相对路径
- 移除 devUrl 配置
- 窗口置顶设置
2026-05-21 17:58:18 +08:00