Commit Graph

7 Commits

Author SHA1 Message Date
da5d0d8ad2 feat: 打通录音核心链路,连接前后端命令
Some checks failed
Build Windows GUI / build-windows (push) Has been cancelled
Build Windows GUI / release (push) Has been cancelled
- 重构 capture.rs:添加 start_recording/stop_recording 支持真正的开始/停止控制
- 更新 AppState:引入 RecordingHandle 字段管理录音状态
- 重构 commands.rs:start_recording 立即返回,stop_recording 停止并保存文件
- 新增 recognize_file/recognize_last_recording 命令
- 前端 RecordPage:调用真实后端命令,监听 recording-stopped 事件自动识别
- 前端 FileConvertPage:连接 recognize_file 命令,支持导出识别结果
- 前端 SettingsPage:通过 save_config 持久化配置,支持配置加载

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 20:19:44 +08:00
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
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