Repository navigation
把「发送/换行」做成可配置键位:Enter 换行、Ctrl+Enter 发送 #7883
Junikusam4
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
环境:DSH Desktop 0.1.7-rc.2(Windows),客户端包来自
resources/app.asar里的@deepseek-ai/dsh-client-ui-conversation。现状:对话框的 Enter 语义是写死的。
lib/client.js里 Lexical 的KEY_ENTER_COMMAND:即:普通 Enter = 发送,Shift+Enter = 换行,Ctrl/Cmd+Enter = 加速手势(忙碌时是
busyEnter的反面)。设置里能调的只有「忙碌时 Enter 是排队还是插入」(设置 → 通用 的composer-enter行,字段busyEnter),没有「Enter 是发送还是换行」这一项。问题:很多人的肌肉记忆是 Enter 换行、Ctrl+Enter 发送——VS Code、Slack、飞书、微信桌面版都是这个键位,写长 prompt 时尤其明显:每写一行都要伸手够 Shift。目前用户只有两条路,都不理想:
app.asar里那 712 KB 的client.js——Desktop 是打包发布 + 自动更新,改了会被覆盖;keydown→preventDefault+stopImmediatePropagation→ 注入insertLineBreak)。能做(我本地就是这么绕的),但输入法组合态、/命令菜单抢 Enter、其它编辑器实例这些边界情况都得靠启发式判断,稳定性不如一个官方设置项。建议:在已有的
ui-conversation设置命名空间里加一个字段(例如enterBehavior: "send" | "newline",默认"send"保持现行为),并复用现在只放了busyEnter的composer-enter行,加一个二选一控件:为什么改动很小:
shiftKey === true本来就是「插换行」分支,handlers.submit(accelerated)本来就区分普通手势和 Ctrl/Cmd 手势;真正要动的只有「普通 Enter 走插换行还是走提交」这一处判断,加上一个设置字段和一个控件。busyEnter(排队/插入)语义独立,建议保持不变,默认值也不变,老用户无感。附带期望:设置搜索里能命中「Enter」「换行」「发送」这些词——现在只能搜到「忙碌时行为」,用户很难发现按键语义其实不可配。
English summary
Feature request: make the composer submit/newline keymap configurable.
Today the composer keymap is fixed in
@deepseek-ai/dsh-client-ui-conversation: plain Enter submits, Shift+Enter inserts a line break, and Ctrl/Cmd+Enter is the accelerated chord (the complement ofbusyEnterwhile busy). Settings only exposebusyEnter(queue|steer) on thecomposer-enterrow — there is no "Enter sends vs. Enter breaks the line" option.Many users expect Enter = newline, Ctrl+Enter = send (VS Code, Slack, Feishu, and most chat clients), which matters a lot when writing long prompts; today they must either patch the packed
app.asar(lost on every auto-update) or interceptkeydownfrom a plugin with heuristics for IME composition and for Enter-owning popups such as the/menu.Suggestion: add a field such as
enterBehavior: "send" | "newline"(default"send") to the existingui-conversationsettings namespace, and surface it next tobusyEnteron thecomposer-enterrow:The change is small:
shiftKey === truealready routes to line-break andsubmit(accelerated)already distinguishes the plain from the accelerated gesture, so only the plain-Enter branch plus one settings field and one control are needed. KeepingbusyEnteruntouched and the default unchanged makes it a no-op for existing users.All reactions