Skip to content

fix: restore Cmd/Ctrl+Enter pure-annotation send (issue #17) - #18

Open
taekchef wants to merge 1 commit into
mainfrom
fix/17-cmd-ctrl-enter-direct-send
Open

fix: restore Cmd/Ctrl+Enter pure-annotation send (issue #17)#18
taekchef wants to merge 1 commit into
mainfrom
fix/17-cmd-ctrl-enter-direct-send

Conversation

@taekchef

@taekchef taekchef commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

问题

issue #17 报告:注释完之后还需要在对话框输入有效字符才能发送消息,无法像 Codex 一样直接发送纯注释。

根因

v1.3.18(issue #10 的修复,PR #14)把 onKeyDown 的拦截条件改成了“只拦裸 Enter”:

if (e.key === 'Enter' && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey ...)

这把 Cmd/Ctrl+Enter(官方 accelerated 提交)也一起排除了。因此空草稿时按 Cmd/Ctrl+Enter 不会触发 attachAndSend(),composer 看到的是空草稿,纯批注发不出去;用户必须输入一个有效字符才能发送。

普通 Enter 仍然可以纯批注发送。

修改

  • 只排除 Shift+Enter(换行)和 Alt+Enter(默认路径),允许裸 Enter 与 Cmd/Ctrl+Enter。
  • Cmd/Ctrl+Enter 在 capture 阶段 attachAndSend() 后主动 stopPropagation 并调用 shell.submit('queue'),避免 composer 的 accelerated 路径在“运行中 + 有排队消息”时走 steerQueue 而把批注块明文留在输入框。
  • attachAndSend() 改为返回布尔值,供 Cmd/Ctrl+Enter 分支判断是否已拼好批注块。

验证

本地 3080 实测:

  • 普通 Enter:纯批注发送成功,输入框清空、chip 消失。
  • Meta+Enter:纯批注发送成功。
  • Ctrl+Enter:批注块拼入并提交,输入框不残留明文、chip 消失。
  • Shift+Enter:不触发拼稿,输入框保留换行、chip 保留。

Fixes #17

v1.3.18 (issue #10) excluded all modified Enter from attachAndSend, so
Cmd/Ctrl+Enter could no longer send a pure annotation from an empty
draft. Keep Shift/Alt+Enter excluded, but allow Cmd/Ctrl+Enter and
submit directly in the capture phase to avoid the composer's accelerated
steerQueue path leaving the annotation block visible in the input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

能否像Codex一样支持纯注释回复

1 participant