Skip to content

[Windows][P0] 当前插入链路没有真正的 current-caret 保证,只是盲发 Ctrl+V #96

@Cooper-X-Oak

Description

@Cooper-X-Oak

Summary

当前 Windows 输出路径没有保存原目标窗口/控件,也没有恢复焦点或验证 caret 所属控件;本质上只是“写剪贴板 + 在当前焦点处发 Ctrl+V”。同时 Windows 端 insertStatus 永远降级成 copiedFallback,系统自己也无法证明“已经成功插入”。

Repro

  1. 让某个目标输入框先获得焦点。
  2. 录音过程中切换窗口,或让 OpenLess 主窗 / capsule / 其他窗口抢前台。
  3. 结束录音,观察文本是否回到原输入位置。

Expected

  • 插入前应有“原目标窗口/控件仍为活跃输入目标”的保证。
  • 至少应能区分“已插入”与“仅复制待手动粘贴”。

Actual

  • Windows 路径没有保存目标窗口,没有恢复前台窗口,也没有验证当前 caret。
  • 非 macOS 路径即使 simulate_paste() 成功,也固定返回 CopiedFallback

Evidence

Verified:

  • openless -all/app/src-tauri/src/coordinator.rs:543-624
  • openless -all/app/src-tauri/src/insertion.rs:64-90
  • openless -all/app/scripts/windows-real-asr-insertion-smoke.ps1

补充:现有 smoke 仍依赖把目标窗口重新置前后再做回读,且脚本本身也接受 insertStatus == copiedFallback

Impact

这是 Windows 主链的核心可用性缺口:文本可能粘到错误窗口、完全没粘上,或者只能留在剪贴板里等用户手动二次 Ctrl+V

Owner Note

Owner intent: @Cooper-X-Oak plans to fix this personally. Please do not pick this up or reassign it unless asked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions