fix: restore Cmd/Ctrl+Enter pure-annotation send (issue #17) - #18
Open
taekchef wants to merge 1 commit into
Open
fix: restore Cmd/Ctrl+Enter pure-annotation send (issue #17)#18taekchef wants to merge 1 commit into
taekchef wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
issue #17 报告:注释完之后还需要在对话框输入有效字符才能发送消息,无法像 Codex 一样直接发送纯注释。
根因
v1.3.18(issue #10 的修复,PR #14)把
onKeyDown的拦截条件改成了“只拦裸 Enter”:这把 Cmd/Ctrl+Enter(官方 accelerated 提交)也一起排除了。因此空草稿时按 Cmd/Ctrl+Enter 不会触发
attachAndSend(),composer 看到的是空草稿,纯批注发不出去;用户必须输入一个有效字符才能发送。普通 Enter 仍然可以纯批注发送。
修改
Shift+Enter(换行)和Alt+Enter(默认路径),允许裸 Enter 与 Cmd/Ctrl+Enter。attachAndSend()后主动stopPropagation并调用shell.submit('queue'),避免 composer 的 accelerated 路径在“运行中 + 有排队消息”时走steerQueue而把批注块明文留在输入框。attachAndSend()改为返回布尔值,供 Cmd/Ctrl+Enter 分支判断是否已拼好批注块。验证
本地 3080 实测:
Fixes #17