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
6 changes: 4 additions & 2 deletions crates/tui/src/localization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ fn english(id: MessageId) -> &'static str {
}
MessageId::CmdSlopDescription => "Inspect or export the SlopLedger",
MessageId::CmdStashDescription => {
"Park or restore a composer draft (Ctrl+S to push, /stash list/pop)"
"Park or restore a composer draft (Ctrl+S sends next queued message as a steer when the queue is non-empty; otherwise stash, /stash list/pop)"
}
MessageId::CmdStatusDescription => "Show runtime session status",
MessageId::CmdStatuslineDescription => "Configure which items appear in the footer",
Expand Down Expand Up @@ -1449,7 +1449,9 @@ fn english(id: MessageId) -> &'static str {
"Delete character before / after the cursor, or remove selected attachment"
}
MessageId::KbClearDraft => "Clear the current draft",
MessageId::KbStashDraft => "Stash the current draft (`/stash pop` to restore)",
MessageId::KbStashDraft => {
"Send next queued message as a steer, or stash the current draft (`/stash pop` to restore)"
}
MessageId::KbSearchHistory => "Search prompt history and recover local drafts",
MessageId::KbInsertNewline => "Insert a newline in the composer",
MessageId::KbSendDraft => "Send the current draft",
Expand Down
23 changes: 23 additions & 0 deletions crates/tui/src/tui/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4394,6 +4394,29 @@ async fn run_event_loop(
{
app.delete_word_backward();
}
KeyCode::Char('s') | KeyCode::Char('S')
if key.modifiers == KeyModifiers::CONTROL
&& !app.queued_messages.is_empty() =>
{
// Ctrl+S sends the next queued follow-up as a steer into
// the current turn, letting the user manually flush the
// queue without retyping it.
let message = app.pop_queued_message().expect("queue non-empty");
if let Err(err) = steer_user_message(app, &engine_handle, message.clone()).await
{
app.queued_messages.push_front(message);
app.status_message = Some(format!(
"Steer failed ({err}); {} queued — ↑ to edit, /queue list",
app.queued_message_count()
));
} else {
app.push_status_toast(
&format!("Steered queued message: {}", message.display),
StatusToastLevel::Info,
Some(3_000),
);
Comment on lines +4413 to +4417

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Passing a reference to format! (&format!(...)) to push_status_toast is inefficient. Since push_status_toast accepts impl Into<String>, passing the String returned by format! directly avoids an unnecessary reference creation and subsequent string clone.

Suggested change
app.push_status_toast(
&format!("Steered queued message: {}", message.display),
StatusToastLevel::Info,
Some(3_000),
);
app.push_status_toast(
format!("Steered queued message: {}", message.display),
StatusToastLevel::Info,
Some(3_000),
);

}
}
KeyCode::Char('s') | KeyCode::Char('S')
if key.modifiers == KeyModifiers::CONTROL && !app.input.is_empty() =>
{
Expand Down
Loading