mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add Cmd/Ctrl+Enter send setting (#25062)
Adds an Agents General setting to require Cmd/Ctrl+Enter before sending
chat messages. When enabled, plain Enter inserts a newline in agent chat
inputs while the send button remains available.
The preference is now persisted server-side through
`/api/v2/users/{user}/preferences`, alongside the existing user
preference settings, and is applied to both the create-agent input and
existing chat composer. Storybook and API coverage verify the setting,
keyboard behavior, validation, and persistence.
<details>
<summary>Coder Agents notes</summary>
Generated by Coder Agents from a Slack request. Dogfooded with
agent-browser against the Storybook settings and chat input stories.
</details>
This commit is contained in:
Generated
+28
-10
@@ -1412,6 +1412,20 @@
|
||||
|-----------|--------|----------|--------------|-------------|
|
||||
| `license` | string | true | | |
|
||||
|
||||
## codersdk.AgentChatSendShortcut
|
||||
|
||||
```json
|
||||
"enter"
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
#### Enumerated Values
|
||||
|
||||
| Value(s) |
|
||||
|---------------------------|
|
||||
| `enter`, `modifier_enter` |
|
||||
|
||||
## codersdk.AgentConnectionTiming
|
||||
|
||||
```json
|
||||
@@ -12867,6 +12881,7 @@ Restarts will only happen on weekdays in this list on weeks which line up with W
|
||||
|
||||
```json
|
||||
{
|
||||
"agent_chat_send_shortcut": "enter",
|
||||
"code_diff_display_mode": "auto",
|
||||
"task_notification_alert_dismissed": true,
|
||||
"thinking_display_mode": "auto"
|
||||
@@ -12875,11 +12890,12 @@ Restarts will only happen on weekdays in this list on weeks which line up with W
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|-------------------------------------|--------------------------------------------------------------|----------|--------------|-------------|
|
||||
| `code_diff_display_mode` | [codersdk.AgentDisplayMode](#codersdkagentdisplaymode) | false | | |
|
||||
| `task_notification_alert_dismissed` | boolean | false | | |
|
||||
| `thinking_display_mode` | [codersdk.ThinkingDisplayMode](#codersdkthinkingdisplaymode) | false | | |
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|-------------------------------------|------------------------------------------------------------------|----------|--------------|-------------|
|
||||
| `agent_chat_send_shortcut` | [codersdk.AgentChatSendShortcut](#codersdkagentchatsendshortcut) | false | | |
|
||||
| `code_diff_display_mode` | [codersdk.AgentDisplayMode](#codersdkagentdisplaymode) | false | | |
|
||||
| `task_notification_alert_dismissed` | boolean | false | | |
|
||||
| `thinking_display_mode` | [codersdk.ThinkingDisplayMode](#codersdkthinkingdisplaymode) | false | | |
|
||||
|
||||
## codersdk.UpdateUserProfileRequest
|
||||
|
||||
@@ -13455,6 +13471,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
|
||||
|
||||
```json
|
||||
{
|
||||
"agent_chat_send_shortcut": "enter",
|
||||
"code_diff_display_mode": "auto",
|
||||
"task_notification_alert_dismissed": true,
|
||||
"thinking_display_mode": "auto"
|
||||
@@ -13463,11 +13480,12 @@ If the schedule is empty, the user will be updated to use the default schedule.|
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|-------------------------------------|--------------------------------------------------------------|----------|--------------|-------------|
|
||||
| `code_diff_display_mode` | [codersdk.AgentDisplayMode](#codersdkagentdisplaymode) | false | | |
|
||||
| `task_notification_alert_dismissed` | boolean | false | | |
|
||||
| `thinking_display_mode` | [codersdk.ThinkingDisplayMode](#codersdkthinkingdisplaymode) | false | | |
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|-------------------------------------|------------------------------------------------------------------|----------|--------------|-------------|
|
||||
| `agent_chat_send_shortcut` | [codersdk.AgentChatSendShortcut](#codersdkagentchatsendshortcut) | false | | |
|
||||
| `code_diff_display_mode` | [codersdk.AgentDisplayMode](#codersdkagentdisplaymode) | false | | |
|
||||
| `task_notification_alert_dismissed` | boolean | false | | |
|
||||
| `thinking_display_mode` | [codersdk.ThinkingDisplayMode](#codersdkthinkingdisplaymode) | false | | |
|
||||
|
||||
## codersdk.UserQuietHoursScheduleConfig
|
||||
|
||||
|
||||
Generated
+3
@@ -1301,6 +1301,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/preferences \
|
||||
|
||||
```json
|
||||
{
|
||||
"agent_chat_send_shortcut": "enter",
|
||||
"code_diff_display_mode": "auto",
|
||||
"task_notification_alert_dismissed": true,
|
||||
"thinking_display_mode": "auto"
|
||||
@@ -1333,6 +1334,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/preferences \
|
||||
|
||||
```json
|
||||
{
|
||||
"agent_chat_send_shortcut": "enter",
|
||||
"code_diff_display_mode": "auto",
|
||||
"task_notification_alert_dismissed": true,
|
||||
"thinking_display_mode": "auto"
|
||||
@@ -1352,6 +1354,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/preferences \
|
||||
|
||||
```json
|
||||
{
|
||||
"agent_chat_send_shortcut": "enter",
|
||||
"code_diff_display_mode": "auto",
|
||||
"task_notification_alert_dismissed": true,
|
||||
"thinking_display_mode": "auto"
|
||||
|
||||
Reference in New Issue
Block a user