Commit Graph
225 Commits
Author SHA1 Message Date
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 229b871d27 docs(github-tracking): add dual-hotkey tracking docs 2026-05-02 05:19:11 +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 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 27dbeadcfd fix: make capsule click-through outside recording 2026-05-02 00:54:37 +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
Cooper-X-Oak 5815b7022c fix(llm): 更新 DeepSeek 模型引用名 2026-05-01 19:56:05 +08:00
baiqing 27a954e90b chore: release 1.2.9 2026-05-01 19:55:59 +08:00
baiqing a7813094b0 Merge pull request #124 from Cooper-X-Oak/codex/volcengine-asr-field-mapping
fix(settings): clarify Volcengine ASR credential mapping

火山 ASR credential 字段命名统一:App Key/Access Key/Resource ID → 用
volcengine* 前缀的 i18n key 标明对应 APP ID/Access Token/Resource ID,
加 mappingNote 一行说明 Secret Key 当前不需要、Resource ID 默认值。

Settings.tsx 冲突解决:保留 #124 的多行 JSX + volcengine* key 写法
(main 上 #122 加的 appIdLabel 等老 key 留着不删,避免影响其他引用)。
2026-05-01 19:43:10 +08:00
Cooper-X-Oak 46134eb6b2 fix(settings): align Volcengine labels with console 2026-05-01 19:35:51 +08:00
Cooper-X-Oak f0eba9ea36 fix(settings): clarify Volcengine ASR credential mapping 2026-05-01 19:35:51 +08:00
TRIP 949c51199f Merge pull request #121 from Cooper-X-Oak/codex/windows-current-caret-insertion
fix(windows): 粘贴前校验原目标窗口已恢复
2026-05-01 19:34:06 +08:00
TRIP 6614fe2c15 Merge pull request #120 from Cooper-X-Oak/codex/windows-asr-final-timeout
fix(windows): ASR final result 等待加超时保护
2026-05-01 19:32:51 +08:00
TRIP b79a1e76b4 Merge pull request #119 from appergb/feat/selection-voice-qa
feat: 划词语音问答(Selection + Voice Q&A)— closes #118
2026-05-01 19:32:18 +08:00
Cooper-X-Oak f14811c47e fix(asr): 适配火山 2.0 资源 ID 并稳定保存凭据 2026-05-01 19:24:21 +08:00
Chris233 b7fda0d18e Merge pull request #126 from Cooper-X-Oak/codex/volcengine-guide
docs: 新增火山 ASR 极简配置指南
2026-05-01 18:03:10 +08:00
baiqing fab31d23e1 Merge remote-tracking branch 'origin/main' into feat/selection-voice-qa
# Conflicts:
#	openless-all/app/src-tauri/src/lib.rs
2026-05-01 17:47:26 +08:00
baiqing 6e49281519 feat(qa): v2 多轮对话 + 流式输出 + macOS 浮窗修复
issue #118 v2 完整闭环。

## 多轮对话
- QaSessionState 加 messages: Vec<QaChatMessage> + panel_visible flag。
- Cmd+Shift+/ 现在 toggle 浮窗可见性(不再启动录音);浮窗可见时 rightOption
  路由到 QA recording,不可见时仍是主听写。open_qa_panel / close_qa_panel 分离。
- 第一轮 user message 嵌选区原文(# 选区原文 / # 我的问题),之后只送提问。
- 前端 QaPanel 渲染气泡列表(user 蓝色靠右 / assistant 灰色 markdown 靠左)。

## 流式输出
- chat_completion_history → chat_completion_history_streaming:开 stream:true
  + SSE chunk 解析,on_delta 回调把每 chunk emit 成 qa:state{kind:"answer_delta"}。
- 前端 streamingAnswer state + StreamingAssistantBubble(带蓝色闪烁 caret)。
- answer 事件落定后清空 buffer,最终 messages 接管。

## macOS 浮窗修复(v1 一直存在的雷)
- capabilities/default.json 加 "qa" 到 windows 数组。否则前端 listen("qa:state")
  被 Tauri 权限拦截,浮窗永远收不到事件。
- show_qa_window 用 NSWindow.orderFrontRegardless 替代 window.show()
  (后者在 macOS 走 makeKeyAndOrderFront 抢 frontmost)。这样 capture_selection
  的 AX read / Cmd+C fallback 能稳定从原 app 读到选区。
- 所有 ObjC msg_send 必须 wrap 进 app.run_on_main_thread —— macOS 26 对
  NSWindow 主线程要求是硬断言(违反直接 SIGTRAP)。
- NSWindow.movableByWindowBackground=YES:浮窗任意空白处可拖。
- QA hotkey 注册在主线程:global-hotkey crate 在 macOS 用 Carbon
  RegisterEventHotKey,事件回调要靠主 run loop dispatch。

## 胶囊状态同步
- QA 录音 / 转写 / 思考 同步推 capsule:state,让用户在底部胶囊也看到状态。
- schedule_capsule_idle 同时检查 dictation 和 QA 都 Idle 才隐藏,避免旧
  dictation Done timer 把 QA 的胶囊误关。
- open_qa_panel 进入时先 emit Idle 清掉 dictation 残留 message + insertedChars。

## 设置页
- SelectionAsk 独立成一级 tab;预设减到 4 个 cmd+shift+ 系列(Option 跟主听写
  共用,不放进 QA hotkey)。
- howto / hotkey / privacy 文案重写,反映 v2 的「先开浮窗、再 Option 录音」流程。
- prefs 默认 qaHotkey = cmd+shift+;。

## 后续路线图
- docs/qa-reasoning-roadmap.md:思考能力 v2.2 设计稿(C 路线 reasoner model
  切换 + reasoning_content delta + 折叠思考块)。
2026-05-01 17:40:22 +08:00
Cooper-X-Oak b8e43c8a0c docs: link Volcengine guide from README and usage 2026-05-01 17:35:23 +08:00
Cooper-X-Oak 57efa8e64d docs: add OpenLess settings screenshot 2026-05-01 17:34:17 +08:00
Cooper-X-Oak a24ac6e380 docs: add simple Volcengine ASR setup guide 2026-05-01 17:31:31 +08:00
Chris233 6ef2374e9c Merge pull request #122 from H-Chris233/main
feat(settings): 增加供应商鉴权与模型拉取
2026-05-01 17:19:42 +08:00
H-Chris233 1967ba75b2 Prevent stale provider model selections
Validation could leave a previously fetched model list visible after credentials changed or validation failed, and model selection updated before persistence completed. Clear stale models before validation and only reflect selected models after the credential save succeeds.

Constraint: Address review feedback without changing provider discovery scope.

Confidence: high

Scope-risk: narrow

Tested: npm run build

Tested: git diff --check
2026-05-01 17:16:18 +08:00
Chris233 0284ff7b92 Merge branch 'appergb:main' into main 2026-05-01 15:33:21 +08:00