fix(tui): every slash submit echoes a user row

A command that clears the composer must leave what the user typed in
the thread: bare left-bar error lines with no user row read as a void
(commercial-bar finding 1/4). Message submits already echo in
dispatch_user_message_with_recovery; this covers the slash branch of
both the launch and session submit tails. Test to follow on the
headless-terminal seam (AppTerminal is Stdout-bound, so the existing
dispatchers are not directly callable from tests).
This commit is contained in:
CodeWhale Bot
2026-09-01 11:21:36 -07:00
parent a65942b1c8
commit 3e1b0ae02f

View File

@@ -859,6 +859,10 @@ async fn dispatch_launch_composer_submit(
return Ok(false);
}
if looks_like_slash_command_input(&input) {
// Every submit echoes (see submit_decided_composer_input).
app.add_message(HistoryCell::User {
content: input.clone(),
});
if execute_command_input(
terminal,
app,
@@ -966,6 +970,12 @@ async fn submit_decided_composer_input(
return Ok(false);
}
if looks_like_slash_command_input(&input) {
// Every submit echoes: a command that clears the composer must leave
// what the user typed in the thread, not just its receipt — bare
// error lines with no user row read as a void.
app.add_message(HistoryCell::User {
content: input.clone(),
});
if execute_command_input(
terminal,
app,