tui: share pending steer compare key logic

This commit is contained in:
Charles Cunningham
2026-03-02 20:45:47 -08:00
parent 1ef120689c
commit 2dfc7a299c

View File

@@ -116,19 +116,7 @@ impl ChatWidget {
pub(super) fn pending_steer_compare_key_from_item(
item: &codex_protocol::items::UserMessageItem,
) -> PendingSteerCompareKey {
let mut image_count = 0;
for input in &item.content {
match input {
UserInput::Image { .. } | UserInput::LocalImage { .. } => image_count += 1,
UserInput::Text { .. } | UserInput::Skill { .. } | UserInput::Mention { .. } => {}
_ => {}
}
}
PendingSteerCompareKey {
message: item.message(),
image_count,
}
Self::pending_steer_compare_key_from_items(&item.content)
}
#[cfg(test)]