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 摘要。