Repository navigation
feat(settings): configurable send key (Enter or Ctrl+Enter) - #1001
Merged
Merged
Conversation
Add a 'Send key' preference in Settings > General > Chat that lets desktop users choose between Enter-to-send (default, current behavior) and Ctrl+Enter-to-send. - new useEnterSendMode hook (localStorage 'pi-enter-send-mode', useSyncExternalStore, same pattern as useChatAppearance) - ChatInput sendShortcut branches on the preference; Shift+Enter always inserts a newline; mobile behavior unchanged (Ctrl/Cmd+Enter only) - segmented control in SettingsPanel styled like the theme selector - i18n strings for en / zh-CN / zh-TW - update SettingsPanel.test.mjs chat-options assertions (4 -> 5)
- Slash, @ file and history menus accept plain Enter in either send mode on a desktop keyboard. They used the send shortcut, so in Ctrl+Enter mode Enter inserted a newline instead of picking the highlighted item. In that mode Enter completes an exact slash command rather than sending it. - The IME composition-end guard also covers plain Enter, so Safari's Enter that confirms a candidate does not add a newline in Ctrl+Enter mode. - Mobile keeps its existing behavior. - Settings: one row like the other chat options, with single-line "Enter" / "Ctrl/Cmd+Enter" choices; the two-line labels wrapped into three lines in Chinese. Drop aria-checked from the labels, since the native radios already expose it. - The handler reads enterSendMode directly; the tests provide it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
|
Thanks @vill-jiang! A Ctrl/Cmd+Enter send option is small and genuinely useful, especially with IME input and long multi-line prompts. The store ( I pushed a few fixes:
Checked in the browser: in Ctrl+Enter mode, Enter inserts a newline (list continuation still applies), and Enter in the slash menu completes Generated by Claude Code |
Kano-u
pushed a commit
to Kano-u/pi-web
that referenced
this pull request
Oct 2, 2026
解开 agegr#981 的 DirectoryPicker 冲突后,这一段(390e70f..f52fd84)实测 0 冲突: - agegr#992 移动端输入框停在键盘上方并给打字更多空间 - agegr#997 限制每客户端 SSE 积压 - agegr#1001 可配置发送键(Enter / Ctrl+Enter) - agegr#1006 从 pi 的 provider catalog 解析 discovery endpoint - agegr#1017 空闲关闭被禁用时回收 Stop 无法解除的运行 - agegr#1016 Stop 结束输出被幸存进程持住的命令 - agegr#1015 保留用户消息里输入的换行 - agegr#1019 在 Safari / iOS 16.2 上可加载(新增 browserslist,无新依赖)
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 6, 2026
* feat(settings): configurable send key (Enter or Ctrl+Enter) Add a 'Send key' preference in Settings > General > Chat that lets desktop users choose between Enter-to-send (default, current behavior) and Ctrl+Enter-to-send. - new useEnterSendMode hook (localStorage 'pi-enter-send-mode', useSyncExternalStore, same pattern as useChatAppearance) - ChatInput sendShortcut branches on the preference; Shift+Enter always inserts a newline; mobile behavior unchanged (Ctrl/Cmd+Enter only) - segmented control in SettingsPanel styled like the theme selector - i18n strings for en / zh-CN / zh-TW - update SettingsPanel.test.mjs chat-options assertions (4 -> 5) * refactor: drop comments, use Ctrl/Cmd-Enter wording for cross-platform clarity * fix(settings): two-line send key labels for narrow segmented control * chore: remove inline comment * chore: remove send shortcut comments * fix(chat): keep Enter for menus in Ctrl+Enter send mode - Slash, @ file and history menus accept plain Enter in either send mode on a desktop keyboard. They used the send shortcut, so in Ctrl+Enter mode Enter inserted a newline instead of picking the highlighted item. In that mode Enter completes an exact slash command rather than sending it. - The IME composition-end guard also covers plain Enter, so Safari's Enter that confirms a candidate does not add a newline in Ctrl+Enter mode. - Mobile keeps its existing behavior. - Settings: one row like the other chat options, with single-line "Enter" / "Ctrl/Cmd+Enter" choices; the two-line labels wrapped into three lines in Chinese. Drop aria-checked from the labels, since the native radios already expose it. - The handler reads enterSendMode directly; the tests provide it. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: villjiang <[email protected]> Co-authored-by: Alex Yang <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 8, 2026
* feat(settings): configurable send key (Enter or Ctrl+Enter) Add a 'Send key' preference in Settings > General > Chat that lets desktop users choose between Enter-to-send (default, current behavior) and Ctrl+Enter-to-send. - new useEnterSendMode hook (localStorage 'pi-enter-send-mode', useSyncExternalStore, same pattern as useChatAppearance) - ChatInput sendShortcut branches on the preference; Shift+Enter always inserts a newline; mobile behavior unchanged (Ctrl/Cmd+Enter only) - segmented control in SettingsPanel styled like the theme selector - i18n strings for en / zh-CN / zh-TW - update SettingsPanel.test.mjs chat-options assertions (4 -> 5) * refactor: drop comments, use Ctrl/Cmd-Enter wording for cross-platform clarity * fix(settings): two-line send key labels for narrow segmented control * chore: remove inline comment * chore: remove send shortcut comments * fix(chat): keep Enter for menus in Ctrl+Enter send mode - Slash, @ file and history menus accept plain Enter in either send mode on a desktop keyboard. They used the send shortcut, so in Ctrl+Enter mode Enter inserted a newline instead of picking the highlighted item. In that mode Enter completes an exact slash command rather than sending it. - The IME composition-end guard also covers plain Enter, so Safari's Enter that confirms a candidate does not add a newline in Ctrl+Enter mode. - Mobile keeps its existing behavior. - Settings: one row like the other chat options, with single-line "Enter" / "Ctrl/Cmd+Enter" choices; the two-line labels wrapped into three lines in Chinese. Drop aria-checked from the labels, since the native radios already expose it. - The handler reads enterSendMode directly; the tests provide it. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: villjiang <[email protected]> Co-authored-by: Alex Yang <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
设置面板增加发送快捷键的选项,默认Enter发送,可以切换为Ctrl/Cmd-Enter发送。
展示效果

移动端不论设置都是Enter都是输入换行
