Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions apps/maple-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,14 @@ agent runtime; its desktop Agent page points users to Maple Work.
are settings.
- The composer spell checks as you type; right-click a word for
suggestions or to add it to your dictionary.
- Message queue: Enter during a run queues the message for the next turn,
Ctrl+Enter (Cmd+Enter) steers it into the current turn. The composer has
one button. It is Send, and it becomes Stop while a run is active and the
field is empty. Typing or attaching an image turns it back into Send, and
that click queues. Queued messages can be sent now, edited in the composer
(the message keeps its place in the queue), or removed.
- Message queue: Enter during a run queues the message for the next turn by
default. Settings → General → Steer messages into active runs makes Enter
and Send steer new messages instead; this viewing-computer preference also
applies to remote tasks. Ctrl+Enter (Cmd+Enter) always steers. The composer
has one button. It is Send, and it becomes Stop while a run is active and
the field is empty. Typing or attaching an image turns it back into Send.
Queued messages can be sent now, edited in the composer (ordinary submission
keeps the message's place in the queue), or removed.
- Sidebar search filters tasks and projects by name; Escape clears it.
- Up and Down in an empty composer recall prompts sent in this window.
- Optional composer-only Vim editing provides Normal, Insert, and characterwise
Expand Down
3 changes: 3 additions & 0 deletions apps/maple-agent/app/locales/de/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ settings-reduce-motion = Bewegung reduzieren
settings-reduce-motion-description = Ladeanzeigen und pulsierende Punkte anhalten und Einblendanimationen überspringen.
settings-tool-summaries = Werkzeugaufrufe zusammenfassen
settings-tool-summaries-description = Abgeschlossene Werkzeugaufrufe mit langer Ausgabe erhalten eine einzeilige Zusammenfassung auf ihren Karten.
settings-steer-active-run-messages = Nachrichten in aktive Durchläufe steuern
settings-steer-active-run-messages-description = Während eine Aufgabe arbeitet, neue Nachrichten mit Eingabetaste oder Senden in den aktuellen Durchlauf steuern, statt sie für den nächsten Durchlauf einzureihen.
settings-composer-vim = Vim-Modus im Eingabefeld
settings-composer-vim-description = Normal-, Einfüge- und visuellen Modus im Haupteingabefeld des Chats verwenden. Andere Textfelder bleiben unverändert.
settings-application-vim = Vim-Navigation in der gesamten App
Expand Down Expand Up @@ -1518,6 +1520,7 @@ chat-shrink-composer = Eingabefeld verkleinern
chat-expand-composer = Eingabefeld vergrößern
chat-stop-run = Ausführung stoppen
chat-queue-next-turn = Für nächsten Durchlauf einreihen
chat-steer-current-run = In aktuellen Durchlauf steuern
chat-send = Senden
chat-model = Modell
# The model panel's sections and the badge on a popular model.
Expand Down
3 changes: 3 additions & 0 deletions apps/maple-agent/app/locales/en/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ settings-reduce-motion = Reduce motion
settings-reduce-motion-description = Hold spinners and pulsing dots still and skip reveal animations.
settings-tool-summaries = Summarize tool calls
settings-tool-summaries-description = Completed tool calls with long output get a one-line summary on their cards.
settings-steer-active-run-messages = Steer messages into active runs
settings-steer-active-run-messages-description = While a task is working, Enter and Send steer new messages into the current turn instead of queueing them for the next turn.
settings-composer-vim = Vim mode in composer
settings-composer-vim-description = Use Normal, Insert, and Visual editing modes in the main chat composer. Other text fields stay unchanged.
settings-application-vim = Vim navigation across the app
Expand Down Expand Up @@ -1518,6 +1520,7 @@ chat-shrink-composer = Shrink composer
chat-expand-composer = Expand composer
chat-stop-run = Stop the run
chat-queue-next-turn = Queue for next turn
chat-steer-current-run = Steer into current run
chat-send = Send
chat-model = Model
# The model panel's sections and the badge on a popular model.
Expand Down
3 changes: 3 additions & 0 deletions apps/maple-agent/app/locales/es/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ settings-reduce-motion = Reducir el movimiento
settings-reduce-motion-description = Mantiene estáticos los indicadores de carga y los puntos intermitentes, y omite las animaciones de aparición.
settings-tool-summaries = Resumir las llamadas a herramientas
settings-tool-summaries-description = Las llamadas a herramientas completadas con resultados largos muestran un resumen de una línea en sus tarjetas.
settings-steer-active-run-messages = Dirigir mensajes a turnos activos
settings-steer-active-run-messages-description = Mientras una tarea está trabajando, Intro y Enviar dirigen los mensajes nuevos al turno actual en lugar de ponerlos en cola para el siguiente turno.
settings-composer-vim = Modo Vim en el cuadro de mensaje
settings-composer-vim-description = Usa los modos Normal, Insertar y Visual en el cuadro de mensaje principal del chat. Los demás campos de texto no cambian.
settings-application-vim = Navegación Vim en toda la aplicación
Expand Down Expand Up @@ -1413,6 +1415,7 @@ chat-shrink-composer = Reducir cuadro de mensaje
chat-expand-composer = Expandir cuadro de mensaje
chat-stop-run = Detener ejecución
chat-queue-next-turn = Poner en cola para el siguiente turno
chat-steer-current-run = Dirigir al turno actual
chat-send = Enviar
chat-model = Modelo
chat-model-group-capable = Más capaces
Expand Down
3 changes: 3 additions & 0 deletions apps/maple-agent/app/locales/ko/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ settings-reduce-motion = 동작 줄이기
settings-reduce-motion-description = 스피너와 깜박이는 점을 멈추고 표시 애니메이션을 생략해요.
settings-tool-summaries = 도구 호출 요약
settings-tool-summaries-description = 출력이 긴 완료된 도구 호출은 카드에 한 줄 요약이 표시돼요.
settings-steer-active-run-messages = 실행 중인 턴에 메시지 바로 전달
settings-steer-active-run-messages-description = 작업이 진행 중일 때 새 메시지를 다음 턴 대기열에 넣지 않고 현재 턴에 바로 전달해요.
settings-composer-vim = 메시지 입력창에서 Vim 모드 사용
settings-composer-vim-description = 기본 채팅 메시지 입력창에서 Normal, Insert, Visual 편집 모드를 사용해요. 다른 텍스트 필드는 바뀌지 않아요.
settings-application-vim = 앱 전체에서 Vim 탐색 사용
Expand Down Expand Up @@ -1467,6 +1469,7 @@ chat-shrink-composer = 메시지 입력창 축소
chat-expand-composer = 메시지 입력창 확대
chat-stop-run = 실행 중지
chat-queue-next-turn = 다음 턴 대기열에 추가
chat-steer-current-run = 현재 턴에 바로 전달
chat-send = 보내기
chat-model = 모델
# The model panel's sections and the badge on a popular model.
Expand Down
26 changes: 26 additions & 0 deletions apps/maple-agent/app/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ pub struct AppSettings {
/// Whether completed tool calls get a one-line model summary.
#[serde(default = "default_tool_summaries")]
pub tool_summaries: bool,
/// Send new messages into an active run instead of queueing them.
#[serde(default)]
pub steer_active_run_messages: bool,
/// Enable modal Vim editing only in the main chat composer.
#[serde(default)]
pub composer_vim_enabled: bool,
Expand Down Expand Up @@ -296,6 +299,7 @@ impl Default for AppSettings {
tool_details: default_tool_details(),
new_task_permission_mode: None,
tool_summaries: default_tool_summaries(),
steer_active_run_messages: false,
composer_vim_enabled: false,
application_vim_enabled: false,
shortcut_overrides: std::collections::BTreeMap::new(),
Expand Down Expand Up @@ -1273,6 +1277,28 @@ mod tests {
assert!(!settings.composer_vim_enabled);
}

#[test]
fn active_run_steering_defaults_to_queue_and_round_trips_through_the_host() {
let settings: AppSettings = serde_json::from_value(serde_json::json!({})).unwrap();
assert!(!settings.steer_active_run_messages);

let root = tempfile::tempdir().unwrap();
let store =
maple_agent::store::Store::open(maple_agent::store::StorePaths::new(root.path()))
.unwrap();
apply_host_patch(
&store,
None,
&serde_json::json!({"steer_active_run_messages": true}),
)
.unwrap();
assert!(
load_host_settings(&store, None)
.unwrap()
.steer_active_run_messages
);
}

#[test]
fn existing_settings_files_default_application_vim_to_off() {
let mut json = serde_json::to_value(AppSettings::default()).expect("serialize");
Expand Down
8 changes: 6 additions & 2 deletions apps/maple-agent/app/src/ui/chat/composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ impl ChatScreen {
let can_send = !disabled && attachments_ready && (has_text || has_attachments);
// One control. Stop only while a run is active and nothing is
// waiting to send. Text, or an file that is still being prepared,
// turns it back into Send, which queues behind the run.
// turns it back into Send, which follows the active-run default.
let drafting = has_text || has_attachments;
let show_stop = running && !self.booting && !pending_create && !drafting;
let usage_tray = self
Expand Down Expand Up @@ -1756,7 +1756,11 @@ impl ChatScreen {
let button_label: SharedString = if show_stop {
tr("chat-stop-run")
} else if running && drafting {
tr("chat-queue-next-turn")
if self.steer_active_run_messages && self.queue_edit.is_none() {
tr("chat-steer-current-run")
} else {
tr("chat-queue-next-turn")
}
} else {
tr("chat-send")
};
Expand Down
10 changes: 9 additions & 1 deletion apps/maple-agent/app/src/ui/chat/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,8 @@ pub struct ChatScreen {
composer: Option<Entity<TextInput>>,
/// Persisted opt-in for modal editing in this composer only.
composer_vim_enabled: bool,
/// Whether new messages steer an active run rather than wait in its queue.
steer_active_run_messages: bool,
/// Independent, persisted application-level Vim navigation profile.
application_vim_enabled: bool,
/// Stable-ID semantic selection and count state for application Vim.
Expand Down Expand Up @@ -1562,6 +1564,7 @@ impl ChatScreen {
context_limit: 0,
composer: None,
composer_vim_enabled: settings.composer_vim_enabled,
steer_active_run_messages: settings.steer_active_run_messages,
application_vim_enabled: settings.application_vim_enabled,
application_vim: ApplicationVimState::default(),
application_focus: None,
Expand Down Expand Up @@ -3503,6 +3506,7 @@ impl ChatScreen {
self.apply_notification_settings(settings);
self.summaries_enabled = settings.tool_summaries;
self.composer_vim_enabled = settings.composer_vim_enabled;
self.steer_active_run_messages = settings.steer_active_run_messages;
if let Some(composer) = self.composer.clone() {
composer.update(cx, |input, cx| {
input.set_vim_enabled(settings.composer_vim_enabled, cx)
Expand Down Expand Up @@ -5456,7 +5460,11 @@ impl ChatScreen {
model,
context_limit,
vision_capable,
steer: steer && (run_active || queue_id.is_some()),
// Only new messages follow the viewing computer's default. A
// queue edit keeps its place unless steering was explicit. The
// selected local or remote backend forwards this same request.
steer: (steer || (run_active && queue_id.is_none() && self.steer_active_run_messages))
&& (run_active || queue_id.is_some()),
queue_id,
attachments: Vec::new(),
};
Expand Down
45 changes: 45 additions & 0 deletions apps/maple-agent/app/src/ui/chat/upload_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,51 @@ fn slow_upload_keeps_stop_queue_and_steer_operational(cx: &mut TestAppContext) {
});
}

#[gpui::test]
fn steer_default_changes_only_new_active_run_messages(cx: &mut TestAppContext) {
let host = UploadHost::new();
let (chat, cx) = chat_window(&host, cx);
chat.update(cx, |chat, _| chat.steer_active_run_messages = true);

type_followup(&chat, cx, "steer by default", false);
wait_for(cx, "default steering admission", |_| {
host.requests("send_message").len() == 1
});
let steering = host.requests("send_message")[0].clone();
assert_eq!(steering.params[1]["text"], "steer by default");
assert_eq!(steering.params[1]["steer"], true);
assert_eq!(steering.params[1]["queueId"], Value::Null);
host.reply(&steering, Ok(json!("run-1")));
wait_for(cx, "default steering acknowledgement", |cx| {
chat.update(cx, |chat, _| !chat.send_pending())
});

// The preference is only for new messages. Ordinary submission of an
// existing queue edit retains its place, exactly as it does in Queue mode.
chat.update(cx, |chat, cx| {
chat.queue_edit = Some(QueueEdit {
queue_id: "q1".into(),
draft: "draft before editing".into(),
});
chat.composer
.clone()
.unwrap()
.update(cx, |input, cx| input.set_text("edited queued message", cx));
chat.send_inner(cx);
});
wait_for(cx, "queue edit admission", |_| {
host.requests("send_message").len() == 2
});
let edited = host.requests("send_message")[1].clone();
assert_eq!(edited.params[1]["text"], "edited queued message");
assert_eq!(edited.params[1]["steer"], false);
assert_eq!(edited.params[1]["queueId"], "q1");
host.reply(&edited, Ok(json!("run-1")));
wait_for(cx, "queue edit acknowledgement", |cx| {
chat.update(cx, |chat, _| !chat.send_pending())
});
}

#[gpui::test]
fn uploaded_prompt_waits_for_unknown_text_receipt_without_replaying_text(cx: &mut TestAppContext) {
let host = UploadHost::new();
Expand Down
8 changes: 8 additions & 0 deletions apps/maple-agent/app/src/ui/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,14 @@ impl SettingsScreen {
self.edit_setting(move |settings| settings.tool_summaries = next, cx);
}

fn toggle_steer_active_run_messages(&mut self, cx: &mut Context<Self>) {
let next = !self.settings.steer_active_run_messages;
self.edit_setting(
move |settings| settings.steer_active_run_messages = next,
cx,
);
}

fn toggle_composer_vim(&mut self, cx: &mut Context<Self>) {
let next = !self.settings.composer_vim_enabled;
self.edit_setting(move |settings| settings.composer_vim_enabled = next, cx);
Expand Down
12 changes: 12 additions & 0 deletions apps/maple-agent/app/src/ui/settings/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ impl SettingsScreen {
)
.into_any_element(),
),
self.application_target(
|| SettingsTarget::General(GeneralTarget::SteerActiveRunMessages),
localized_toggle_row(
"steer-active-run-messages",
&tr("settings-steer-active-run-messages"),
&tr("settings-steer-active-run-messages-description"),
self.settings.steer_active_run_messages,
cx.listener(|this, _event, _window, cx| {
this.toggle_steer_active_run_messages(cx);
}),
),
),
];
let notifications_rows = vec![
self.application_target(
Expand Down
10 changes: 10 additions & 0 deletions apps/maple-agent/app/src/ui/settings/navigation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub(super) enum SettingsRegion {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(super) enum GeneralTarget {
Language,
SteerActiveRunMessages,
Notifications,
PasswordNotificationDetails,
ComposerVim,
Expand Down Expand Up @@ -196,6 +197,7 @@ impl SettingsScreen {
match self.section {
Section::General => [
GeneralTarget::Language,
GeneralTarget::SteerActiveRunMessages,
GeneralTarget::Notifications,
GeneralTarget::PasswordNotificationDetails,
GeneralTarget::ComposerVim,
Expand Down Expand Up @@ -553,6 +555,7 @@ impl SettingsScreen {
fn activate_general_target(&mut self, target: GeneralTarget, cx: &mut Context<Self>) {
match target {
GeneralTarget::Language => self.toggle_setting_menu(SettingMenu::Language, cx),
GeneralTarget::SteerActiveRunMessages => self.toggle_steer_active_run_messages(cx),
GeneralTarget::Notifications => self.toggle_desktop_notifications(cx),
GeneralTarget::PasswordNotificationDetails => {
self.toggle_password_notification_details(cx);
Expand Down Expand Up @@ -1260,6 +1263,13 @@ mod tests {
Some(&SettingsTarget::General(GeneralTarget::Language))
);
this.move_application_selection(1, 1, window, cx);
assert_eq!(
this.application_vim.target,
Some(SettingsTarget::General(
GeneralTarget::SteerActiveRunMessages
))
);
this.move_application_selection(1, 1, window, cx);
assert_eq!(
this.application_vim.target,
Some(SettingsTarget::General(GeneralTarget::Notifications))
Expand Down
3 changes: 3 additions & 0 deletions apps/maple-agent/app/translation-revisions/de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ chat-status-failed 3aa7979f86ebefa0
chat-status-running 5e43dba3cfc269c8
chat-status-stopped 2adaa7a3d7affb04
chat-status-waiting 9734b0e528982b88
chat-steer-current-run 08305435ba1930b1
chat-stop 1ef05f0684d0533b
chat-stop-recording 9b266308b8bc857c
chat-stop-run 7233bc9296bca9c5
Expand Down Expand Up @@ -1861,6 +1862,8 @@ settings-speech-speed 7abfaab28291aba5
settings-speech-speed-description 108a3287d8633d34
settings-speech-voice a1bd6f42451aab37
settings-speech-voice-description 6e6cba09626879d8
settings-steer-active-run-messages 11d0a16e3c2b4c7a
settings-steer-active-run-messages-description 0bf4d597e6510b9d
settings-text-size aa4d8e4805ea9511
settings-text-size-description 5cd2782d7f3991c4
settings-theme-label-dark aa6ad56172aedfb3
Expand Down
3 changes: 3 additions & 0 deletions apps/maple-agent/app/translation-revisions/es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ chat-status-failed 3aa7979f86ebefa0
chat-status-running 5e43dba3cfc269c8
chat-status-stopped 2adaa7a3d7affb04
chat-status-waiting 9734b0e528982b88
chat-steer-current-run 08305435ba1930b1
chat-stop 1ef05f0684d0533b
chat-stop-recording 9b266308b8bc857c
chat-stop-run 7233bc9296bca9c5
Expand Down Expand Up @@ -1861,6 +1862,8 @@ settings-speech-speed 7abfaab28291aba5
settings-speech-speed-description 108a3287d8633d34
settings-speech-voice a1bd6f42451aab37
settings-speech-voice-description 6e6cba09626879d8
settings-steer-active-run-messages 11d0a16e3c2b4c7a
settings-steer-active-run-messages-description 0bf4d597e6510b9d
settings-text-size aa4d8e4805ea9511
settings-text-size-description 5cd2782d7f3991c4
settings-theme-label-dark aa6ad56172aedfb3
Expand Down
3 changes: 3 additions & 0 deletions apps/maple-agent/app/translation-revisions/ko.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ chat-status-failed 3aa7979f86ebefa0
chat-status-running 5e43dba3cfc269c8
chat-status-stopped 2adaa7a3d7affb04
chat-status-waiting 9734b0e528982b88
chat-steer-current-run 08305435ba1930b1
chat-stop 1ef05f0684d0533b
chat-stop-recording 9b266308b8bc857c
chat-stop-run 7233bc9296bca9c5
Expand Down Expand Up @@ -1861,6 +1862,8 @@ settings-speech-speed 7abfaab28291aba5
settings-speech-speed-description 108a3287d8633d34
settings-speech-voice a1bd6f42451aab37
settings-speech-voice-description 6e6cba09626879d8
settings-steer-active-run-messages 11d0a16e3c2b4c7a
settings-steer-active-run-messages-description 0bf4d597e6510b9d
settings-text-size aa4d8e4805ea9511
settings-text-size-description 5cd2782d7f3991c4
settings-theme-label-dark aa6ad56172aedfb3
Expand Down
Loading