fix(tui): flush active cell before inserting steer message in transcript

Steered/queued user messages were being inserted into app.history
before the active cell (holding streaming thinking/tool content) was
flushed, causing the user's message to render above (before) the
thinking block that chronologically preceded it.

Now call app.flush_active_cell() before app.add_message() in
steer_user_message(), matching the pattern used in MessageStarted
and MessageDelta handlers.

Fixes #2225.
This commit is contained in:
Hunter Bown
2026-05-26 13:39:57 -05:00
parent 0251b4e8e8
commit b9596a9640
+5
View File
@@ -5384,6 +5384,11 @@ async fn steer_user_message(
engine_handle.steer(content.clone()).await?;
app.last_submitted_prompt = Some(message.display.clone());
// Flush any streaming thinking/tool content into history before
// inserting the steer message, so the steer appears after (below)
// the content that chronologically preceded it.
app.flush_active_cell();
// Mirror steer input in local transcript/session state.
app.add_message(HistoryCell::User {
content: format!("+ {}", message.display),