fix: restore Enter annotation attach on textarea composers (DSH ≤0.1.1) - #56
Merged
Merged
Conversation
1.4.6 适配 0.1.2 的 div[data-composer-input] 输入区时移除了 keydown 门控的 textarea 分支,旧核心上 Enter 不再拼入批注块(发送按钮路径不受影响, Enter 发送会静默丢弃待发送批注)。门控恢复双分支: div[data-composer-input] 与 textarea 并行。 验证:DSH 0.1.1-rc.2 + 真实 Web 会话 CDP 全流程 (选区 → 批注 → Enter → 模型收到编号批注块),div 分支代码未动。
插件只有 zh / en 两套文案,而 DSH 的 locale 服务不止这两种:节点选定 ru 后 setLang 把一切非 zh/en 当成 zh,整套批注 UI(工具条、编辑窗口、 提示、协议块)退回中文。现在只保留 zh,其余一律英文,并加测试固定 ru/ru-RU/fr/de/zh-Hans 都走英文。
在 zh / en 之外补齐俄语:工具条、编辑窗口、提示、胶囊、回复引用与 批注协议块。setLang 接受 ru;zh/en 输出逐字未变。 解析侧同步补齐,否则俄语块认不出来: - BLOCK_HEADS / BLOCK_MARKERS / PARSE_MARKERS 增加 ru; - 反解析的注记前缀认识 Примечание:; - 纯批注块的快路径改用词典自身的语言列表(原来写死 zh/en, 俄语纯批注块会走标记路径,被原文里的「提问:」切断)。 协议块里的回复格式保留拉丁 «Annotation N: …»:回复芯片替换按它 工作,与界面语言无关。数量词用新增的 plural() 按俄语变格,zh/en 单词条不受影响。 测试:message-block 往返扩到三种语言,locale-fallback 覆盖 ru 与 未知语言走英文。
This was referenced Sep 30, 2026
Collaborator
|
感谢 @EagerBeager。这条分支已合入 main(3e4b452),三笔提交都保留:
|
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.
Bug
On DSH cores ≤0.1.1 (plain
textareacomposer), pressing Enter with pending annotations no longer attaches the annotation block to the outgoing message — only the send-button path works. A bare Enter sends the question without the block, and the pending annotations are silently dropped (the plugin clears its pending set on the draft present→empty transition).Root cause
v1.4.6 adapted the Enter handler to the DSH 0.1.2
div[data-composer-input]composer and dropped thetextareabranch of the keydown gate. On cores whose composer is a plain<textarea>inside[data-composer-card],attachAndSend()is never reached, so the block is never spliced into the draft.Fix
The keydown gate now accepts both branches in parallel:
div[data-composer-input]— DSH ≥0.1.2, code unchangedtextareainside[data-composer-card]— DSH ≤0.1.1, restoredOne-line change in
client.js+ a CHANGELOG entry. No core changes, no Node-half changes (it is an empty implementation).Verification
DSH 0.1.1-rc.2, real web session, full CDP-driven flow: send question → reply → select passage in the assistant step → annotate (with a note) → Enter with the question. The model received the numbered block (quote + note) and answered
Annotation 1: …; the raw block stays hidden from the user bubble (zero-flicker surgery intact). Plugin console log confirms the splice:[annotation] 批注块已拼入草稿,回车将随消息发送.The
div[data-composer-input]branch is byte-identical to 1.4.10, so ≥0.1.2 hosts are unaffected.Note for maintainers
Since 1.4.9 the client also injects
@deepseek-ai/dsh-client-ui-session, which does not exist in ≤0.1.1 cores — so 0.1.1 hosts cannot mount this line at all. This fix restores the Enter path for the 0.1.1-compatible release line (a 1.4.x patch or backport); it is a no-op addition for ≥0.1.2 hosts.