Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

[Bug]: 桌面版对话输入框中文输入法(IME)间断性的无法激活,必须先粘贴中文才能恢复

未關閉
#150 0 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

@aliarain 已經在處理了。

開始於 2026年10月22日。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
electron, javascript, typescript

研究方向

Start by tracing the ChatComposer textarea and the VW restoreFocus and focusAtEnd paths named in the report, especially the mount effect, slash command dismissal, attachment selection, and prompt history. Check how programmatic focus and selection changes interact with Windows IME composition, while preserving the existing isComposing handling. Done means Chinese IME input works after focus and refocus without requiring a paste; the report does not identify a test file.

由索引模型根據 Issue 內容生成。

描述

bug p1
GUI version

0.1.55

Operating system

Windows

Reproduction steps
  1. 启动 Command Code 桌面版(Windows 11,Microsoft 拼音输入法)。
  2. 点击底部对话输入框(Chat Composer),直接用输入法打字。
  3. 观察:输入法候选框不弹出,中文按键无反应,只能输入英文 —— 「时好时坏」,与输入框获得焦点的时机相关。
  4. 从记事本等处复制几个汉字,切回 Command Code 粘贴到输入框。
  5. 观察:粘贴一完成,输入法立刻被激活,此后可以正常输入中文。
  6. 让输入框再次失焦/重新聚焦,问题可能复现。
Expected behavior

输入框获得焦点后,Windows 中文输入法应直接可用:按键即组字、候选框跟随光标、回车/空格上屏正常,不需要先粘贴任何内容来"激活"输入法。

Actual behavior

焦点落在对话输入框时,Windows IME 与该 textarea 没有正确挂接:候选框不弹出,中文按键被吞掉,只有英文能进。故障是间歇性的,取决于这次聚焦是用户点击还是应用程序化重聚焦。关键指纹:外部粘贴一段中文后 IME 立刻恢复可用 —— 粘贴是一次真实用户手势 + 一次 input 事件,会重建 IME 挂接,而之前那次聚焦没有建立起来。实际影响:每次想写中文都必须在别处打好字再复制粘贴。

Screenshots, recordings, or sanitized logs

版本:Command Code Desktop 0.1.55 / Windows 11 / zh-CN / Microsoft 拼音。Session id: 5ec5254a-700f-40a5-867b-89d1335d3f84

对话输入框是受控 textarea,位于已安装渲染进程包 resources/app/out/renderer/assets/workspace-screen-*.js(组件 ChatComposer,textarea 组件 p5):value 受控,onKeyDown: ta 内部已用 nativeEvent.isComposing 做了组合态保护,Enter 上屏路径本身没问题。

疑似触发点(假设,未定论):焦点管理 hook VW 的 restoreFocus / focusAtEnd 在 requestAnimationFrame 中连续两次调用 textarea.focus() 并随后执行 setSelectionRange()。程序化 focus + setSelectionRange 是 Chromium 上摘除 Windows IME 挂接的常见触发方式,而粘贴是一次真实用户手势会把 IME 重新挂回来,与观察一致。建议排查所有调用 restoreFocus / focusAtEnd 的路径(挂载 useEffect、斜杠命令面板关闭后 onRestoreFocus、附件选择后、提示词历史回溯 focusAtEnd),确认是否在 IME 组合过程中执行了重聚焦/重置选区。

附带小问题:桌面版内置反馈流程 buildFeedbackUrl() 的 platformOption() 只覆盖 macOS/Linux,Windows 下 platform 字段不会被预填。

已排除:非输入框完全不可用(粘贴后同一输入框立即可正常输入中文);非系统输入法问题(同机记事本/浏览器正常);非单一版本回归点,"最后一个可用版本"待确认。

Safety check
  • I removed credentials and private project information from this report.
主要語言
Shell
星號
104
分支
8
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

CommandCodeAI/desktop 的其他 Issue

查看 CommandCodeAI/desktop 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。