Commit Graph
243 Commits
Author SHA1 Message Date
TRIP f5ffd9ef0f Merge pull request #175 from appergb/fix/issue-168-qa-recorder-error-monitor
fix(qa): QA recorder error monitor (closes #168)
2026-05-02 10:51:36 +08:00
TRIP fcd37fbc71 Merge pull request #174 from appergb/fix/issue-169-macos-exit-main-thread
fix(macos): stop_qa_hotkey_listener 包 run_on_main_thread (closes #169)
2026-05-02 10:51:30 +08:00
baiqing 65d4b5243b fix(qa): 加 QA recorder runtime error monitor (closes #168)
QA 录音中麦克风设备消失 / cpal 内部 panic 时,QA 流程之前**没有**对应
runtime error 监听器(recorder_errors 用 _ 弃用),导致:
- QA 浮窗一直显示"录音中"
- 用户按 Option 第二次没反应
- 必须按 Esc 才能脱困

修:
- 新增 spawn_qa_recorder_error_monitor,镜像 dictation 现有 spawn_recorder_error_monitor
- begin_qa_session Recorder::start 成功后启动监听器
- 用 qa_state.session_id 守卫 stale 事件
- 收到 error → finish_qa_with_error("录音设备异常: ..") → emit 错误胶囊 + 浮窗错误状态

测试:
- cargo check ✅
2026-05-02 10:46:03 +08:00
TRIP ca7b68053b Merge pull request #173 from appergb/fix/issue-162-qa-level-listener
fix(qa): QaPanel 加 qa:level 监听 + LevelBar (closes #162)
2026-05-02 10:44:48 +08:00
baiqing 7ac0421a3f fix(macos): stop_qa_hotkey_listener 包 run_on_main_thread (closes #169)
QaHotkeyMonitor::drop 在 macOS 底层调 Carbon RemoveEventHotKey,要求主线程。
RunEvent::Exit 回调不保证在 AppKit 主线程跑——drop 漏到 tokio worker 上
触发 macOS dispatch_assert_queue_fail SIGTRAP,退出时偶发崩溃。

修:
- coordinator.rs::stop_qa_hotkey_listener 把 .take() 包到 run_on_main_thread
- AppHandle 已 None 时(极端 shutdown 序)直接 drop 兜底(最坏崩也是退出时机)

测试:
- cargo check ✅
2026-05-02 10:44:25 +08:00
TRIP e0614e3c7e Merge pull request #172 from appergb/fix/issue-163-windows-startup-gate-timeout
fix(windows): 启动 gate pollHotkeyStatus 加 10s 超时 (closes #163)
2026-05-02 10:43:33 +08:00
baiqing a8f4b891a0 fix(qa): QaPanel 加 qa:level 监听 + LevelBar 电平条 (closes #162)
后端 coordinator.rs:1743 在 QA 录音时每帧 33ms 推 qa:level 事件,
但 QaPanel 之前只 listen qa:state / qa:dismiss,qa:level 完全无人接 →
QA 录音用户看不到电平反馈,不知道麦克风是否收音。

修复:
- QaPanel 加 listen('qa:level') 累积 level state(cleanup 加 unlistenLevel)
- 新增 LevelBar 组件:4px 高蓝色进度条,宽度 = level × 100%
- RecordingHeader / TurnIndicator(recording) 都加 LevelBar 渲染
- 状态切换非 recording 时 setLevel(0) 避免残留

测试:
- npm run build ✅
- macOS 实测:QA 录音电平条跟随声音起伏(同 capsule 体验)
2026-05-02 10:38:44 +08:00
baiqing 4627eb4615 fix(windows): 启动 gate pollHotkeyStatus 加 10s 超时 (closes #163)
Windows 上 OS 拒绝低层键盘 hook 安装(反作弊/EDR/UAC 拦)时,
hotkey 永远 starting → 前端 while(!cancelled) 永不退出 → UI 卡 "正在启动" 灰屏。

加 50 × 200ms = 10s 上限:超时后强 setGate('ready'),让用户能进 Permissions
页看 hotkey_status.lastError 处理(页面已能显示错误 + 重试入口)。

非 Windows 路径不变。

测试:
- npm run build ✅
2026-05-02 10:36:13 +08:00
TRIP 490b391022 Merge pull request #171 from appergb/chore/issue-170-cleanup-warnings
chore: cargo clippy --fix 清理 small lints (closes #170 第一波)
2026-05-02 10:35:20 +08:00
baiqing f9d31b68c8 fix(insertion): 修 clippy --fix 误删的 Duration import 在 Windows/Linux cfg 下被用 2026-05-02 10:30:10 +08:00
baiqing 6fde92417b chore: cargo clippy --fix 自动清理小手术 (closes #170)
cargo clippy --fix 自动修了 8 个 lint,warnings 从 18 降到 16。

改动文件:
- asr/mod.rs / coordinator.rs / hotkey.rs / insertion.rs / polish.rs / types.rs
- 主要是 needless_borrow / single_match / useless_conversion / 多余 cast

build 跑过:
- cargo check ✅
- npm run build ✅

剩余 16 个 warning 都是有意保留的(test-only helpers、future-API placeholder、
类似 TodayMetrics 这种历史接口),不动这些避免破坏 surface。issue #170
里更深层的整洁度(SettingsWriter dedupe / force 参数删除等)后续 PR 跟进。
2026-05-02 10:24:21 +08:00
TRIP 68298d253c Merge pull request #138 from Cooper-X-Oak/codex/auto-update-download-acceleration
fix(tauri): 加速自动更新下载
2026-05-02 09:51:13 +08:00
TRIP 124778036d Merge pull request #145 from Cooper-X-Oak/codex/windows-cold-start-ui-pr
fix(windows): 收口 startup visible-ready 生命周期并进入评审观察
2026-05-02 09:48:13 +08:00
baiqing 0f4d29fdec fix(capsule): 三平台统一恢复 Done/Cancelled/Error toast
PR #140 在 Windows 上把 emit_capsule 的 visible 判定从 !Idle 缩窄到
仅 Recording/Transcribing/Polishing,副作用是 macOS / Linux 用户也失去了
"已粘贴 N 字" / "已取消" / 错误文案这一组完成 toast。

本 commit 把 visible 切回原本的 `!matches!(state, CapsuleState::Idle)`,
覆盖三平台。Windows 上 linger 的真实问题(dead zone / 截图选中 / 拖动卡顿)
由 PR #140 引入的 hide_capsule_window_if_present() Win32 hard-hide 路径
在 visible=false 分支处理——不依赖改 visible 语义。

closes the visible-narrowing follow-up referenced in PR #140 review comment。
2026-05-02 09:47:19 +08:00
baiqing 9dd9b0b066 Merge pull request #140 from Cooper-X-Oak/codex/fix-windows-capsule-dead-zone-followup
fix(windows): 收口 Capsule helper-window 生命周期并进入回归评审

合入 PR #140 全部修复(保留 #140 author 提交)。冲突点(Win32 use 块导入排序)
取 main HEAD 排序——两边导入相同符号,仅字母顺序不同,无语义差异。

合并后 emit_capsule 的 visible 判定将三平台统一回 !Idle,由后续 commit 跟进——
保留 macOS 已习惯的 Done/Cancelled/Error toast,Windows linger 由本 PR 加的
hide_capsule_window_if_present() Win32 hard-hide 路径解决,不靠改 visible 语义。
2026-05-02 09:46:50 +08:00
Cooper-X-Oak d58c9500c6 docs(windows): add tracking docs for issue 139 and pr 140 2026-05-02 09:46:39 +08:00
Cooper-X-Oak c74ea1bcb2 fix(windows): fully hide inactive capsule helper window 2026-05-02 09:46:39 +08:00
TRIP 4d06f0cad2 Merge pull request #160 from Cooper-X-Oak/codex/continue-from-main
fix(windows): 延后剪贴板恢复并补齐插入回归覆盖
2026-05-02 09:32:45 +08:00
TRIP 7c6b4250b7 Merge pull request #150 from Cooper-X-Oak/codex/issue-147-qa-hotkey-refresh
fix(windows): 对齐 QA hotkey 设置写回与运行态监听器
2026-05-02 09:31:52 +08:00
TRIP c8bb0899d6 Merge pull request #151 from Cooper-X-Oak/codex/issue-148-qa-hotkey-normalization
fix(windows): 归一 QA hotkey 的跨平台修饰键语义
2026-05-02 09:31:21 +08:00
TRIP cc030c8f88 Merge pull request #155 from Cooper-X-Oak/codex/issue-154-windows-dual-hotkey-pr
docs(windows): 跟踪双热键事件源生命周期
2026-05-02 09:30:17 +08:00
Cooper-X-Oak bcb00c60c1 fix(qa): refresh QA hotkey listener on settings writes 2026-05-02 06:01:56 +08:00
Cooper-X-Oak a758cfa998 fix(qa): normalize cmd modifier to ctrl on Windows 2026-05-02 06:01:56 +08:00
Cooper-X-Oak e8df0cd971 docs(tracking): tighten windows insertion handoff 2026-05-02 05:42:52 +08:00
Cooper-X-Oak 4f6df56744 docs(windows): refresh pr 145 review-ready tracking summary 2026-05-02 05:25:11 +08:00
Cooper-X-Oak 229b871d27 docs(github-tracking): add dual-hotkey tracking docs 2026-05-02 05:19:11 +08:00
Cooper-X-Oak da13e8ca37 docs(windows): add tracking docs for issue 98 and pr 145 2026-05-02 05:18:01 +08:00
Cooper-X-Oak 780a4a4483 docs(tracking): add windows clipboard restore handoff 2026-05-02 05:15:32 +08:00
Cooper-X-Oak 283cfdf9f3 test(windows): stabilize lifecycle regression coverage 2026-05-02 05:07:40 +08:00
Cooper-X-Oak 734c430339 test(windows): automate openless lifecycle evidence 2026-05-02 04:47:37 +08:00
Cooper-X-Oak 23207beb8e docs(windows): record clipboard regression evidence 2026-05-02 04:25:17 +08:00
Cooper-X-Oak 02a3e0a225 fix(windows): delay clipboard restore after synthetic paste 2026-05-02 03:59:01 +08:00
Cooper-X-Oak 31e3f541d1 fix(windows): gate main window visibility on startup readiness 2026-05-02 03:29:49 +08:00
Cooper-X-Oak 93cbd03305 docs(windows): 跟踪双热键事件源生命周期 2026-05-02 01:46:49 +08:00
Cooper-X-Oak fb3455af88 docs(windows): 占位承接 QA hotkey 跨平台归一修复 (#148) 2026-05-02 01:32:42 +08:00
Cooper-X-Oak efa1537049 docs(windows): 占位承接 QA hotkey 监听器刷新修复 (#147) 2026-05-02 01:32:34 +08:00
Cooper-X-Oak 20d67da5c4 docs(windows): 为 issue 143 建立冷启动占位 2026-05-02 01:23:22 +08:00
Cooper-X-Oak 27dbeadcfd fix: make capsule click-through outside recording 2026-05-02 00:54:37 +08:00
Cooper-X-Oak e34b3feee7 fix updater download acceleration 2026-05-01 23:47:58 +08:00
Chris233 08e48cc852 Merge pull request #135 from H-Chris233/main
fix(polish): 调整热词注入提示措辞
2026-05-01 23:46:33 +08:00
H-Chris233 e8ba67a45f Only cache capsule geometry after a successful relayout
The capsule geometry cache must reflect only applied layout, otherwise a transient resize or position failure would permanently suppress future retries for the same monitor and translation state. The cache is now written only after the relayout call succeeds, so a failed attempt can be retried on later emits.

Constraint: Keep the fix local to the capsule relayout path.
Rejected: Cache before calling relayout | can strand the capsule on stale geometry after a transient failure.
Confidence: high
Scope-risk: narrow
Directive: Never treat capsule geometry as applied until the window manager has accepted the resize/reposition.
Tested: cargo test --manifest-path src-tauri/Cargo.toml --lib -- --nocapture
Not-tested: Live retry behavior under actual window-manager failures.
2026-05-01 23:38:24 +08:00
H-Chris233 1dfcf7f302 Avoid relayouting capsule on every audio tick
The capsule window now tracks its last applied geometry and only resizes/repositions when the monitor or translation state actually changes. That keeps steady-state level updates from churning the native window manager while preserving the current placement behavior when geometry really does change.

Constraint: Keep the fix minimal and avoid introducing a broader window-management abstraction.
Rejected: Leave the unconditional relayout in place | it adds avoidable compositor churn during recording.
Confidence: high
Scope-risk: narrow
Directive: Any future capsule geometry change should update the cached geometry key, not reintroduce unconditional relayout.
Tested: cargo test --manifest-path src-tauri/Cargo.toml --lib -- --nocapture
Not-tested: Live compositor/jitter behavior on Windows/macOS/Linux.
2026-05-01 23:33:08 +08:00
H-Chris233 320c97485c Reuse capsule height for QA anchoring
QA positioning had kept its own fixed capsule height constant after the capsule window was resized to match the visible pill. Reusing the shared capsule height source keeps the documented gap intact without widening the change surface.

Constraint: Keep the change minimal and avoid a separate geometry model for QA.
Rejected: Keep the old QA constant | would drift from the new capsule geometry again.
Confidence: high
Scope-risk: narrow
Directive: If capsule geometry changes again, update QA anchoring from the shared capsule source instead of introducing another fixed constant.
Tested: cargo test --manifest-path src-tauri/Cargo.toml --lib -- --nocapture
Not-tested: Live QA window placement on each platform.
2026-05-01 22:58:23 +08:00
H-Chris233 f62762a17f Keep capsule hitbox aligned with visible UI
The capsule window used a fixed oversized frame even when only the pill was visible, so transparent padding could block clicks on underlying apps. The runtime now resizes and repositions the capsule to the actual visible content, expanding only when the translation badge is shown.

Constraint: Keep the fix minimal and preserve the translation badge when it is actually visible.
Rejected: Add click-through behavior to transparent pixels | too risky and platform-specific for this narrow fix.
Confidence: high
Scope-risk: moderate
Directive: Keep capsule window geometry in sync with rendered content; do not reintroduce a larger transparent hitbox without a matching click-through strategy.
Tested: cargo test --manifest-path src-tauri/Cargo.toml --lib -- --nocapture; npm ci; npm run build; git diff --check
Not-tested: Live mouse hit-testing on Windows/macOS/Linux after the resize change.
2026-05-01 22:38:15 +08:00
H-Chris233 6c74bfa7ec Make hotword prompt wording more directive
The hotword injection copy now tells the model to prefer the user's spelling proactively while still avoiding unrelated mechanical replacements. That keeps the intent of issue #63 aligned with the existing prompt structure and only changes the wording that users see indirectly through polish behavior.

Constraint: Keep the change minimal and avoid changing the surrounding prompt architecture.
Rejected: Broaden the prompt or add new prompt sections | unnecessary for this issue.
Confidence: high
Scope-risk: narrow
Directive: Keep future hotword guidance user-facing and proactive, but still avoid blanket replacement language.
Tested: cargo test --manifest-path src-tauri/Cargo.toml polish::tests -- --nocapture; cargo check --manifest-path src-tauri/Cargo.toml
Not-tested: Live LLM output quality against the updated prompt wording.
2026-05-01 22:25:37 +08:00
baiqing 110332580a chore: release 1.2.11 2026-05-01 21:37:59 +08:00
baiqing 65c9707029 fix(qa): Windows preset 用 Ctrl+Shift+ 替代 Cmd+Shift+
issue: Windows 用户在划词追问设置页看到的 dropdown 全是 Cmd+Shift+...,
选了之后 prefs 写入 modifiers:['cmd', 'shift'],后端 global-hotkey crate
把 cmd 翻译成 Win 键 → Win+Shift+; 大概率被 OS 占用 / 注册失败 → 浮窗永远不弹。

修:SelectionAsk.tsx 按 detectOS() 区分 preset。
- macOS:Cmd+Shift+;/// (维持现状,Cmd 是 macOS 主修饰键)
- Windows:Ctrl+Shift+;/// (Ctrl 是 macOS Cmd 的对等键)

为什么**不**用 Fn+Shift+/:Windows 的 Win32 全局热键 API
(RegisterHotKey 和 WH_KEYBOARD_LL)都收不到 Fn 的虚拟键码——Fn 是
硬件级 modifier,在 OS 内核 / 键盘驱动之下被吃掉。Linux 同理。

后端 types.rs::QaHotkeyBinding::default() 已经按平台返回正确默认值
(macOS=cmd+shift+;, Windows=ctrl+shift+;),本次只补前端 preset 的平台分流。
2026-05-01 21:29:32 +08:00
baiqing 541e07018a chore: release 1.2.10 2026-05-01 21:19:58 +08:00
TRIP 277f50a6f6 Merge pull request #133 from Cooper-X-Oak/codex/fix-deepseek-model-reference
fix(llm): 更新 DeepSeek 模型引用名
2026-05-01 21:19:38 +08:00
TRIP 60b75de65e Merge pull request #129 from Cooper-X-Oak/codex/fix-volcengine-seedasr-resource
fix(asr): 适配火山 2.0 资源 ID 并稳定保存凭据
2026-05-01 21:19:22 +08:00