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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user