commit 557ea7225eb8b971fb1fd05277811e885ecec090
parent d88070a14d6033ea5709df231a3155a97013a460
Author: William Casarin <jb55@jb55.com>
Date: Tue, 27 Jan 2026 08:27:01 -0800
dave: show last message in chat listing instead of last user message
The session title in the classic view now displays the most recent
message from either the user or assistant, rather than only showing
the last user message.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat:
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/crates/notedeck_dave/src/session.rs b/crates/notedeck_dave/src/session.rs
@@ -59,19 +59,21 @@ impl ChatSession {
}
}
- /// Update the session title from the last user message
+ /// Update the session title from the last message (user or assistant)
pub fn update_title_from_last_message(&mut self) {
for msg in self.chat.iter().rev() {
- if let Message::User(text) = msg {
- // Use first ~30 chars of last user message as title
- let title: String = text.chars().take(30).collect();
- self.title = if text.len() > 30 {
- format!("{}...", title)
- } else {
- title
- };
- break;
- }
+ let text = match msg {
+ Message::User(text) | Message::Assistant(text) => text,
+ _ => continue,
+ };
+ // Use first ~30 chars of last message as title
+ let title: String = text.chars().take(30).collect();
+ self.title = if text.len() > 30 {
+ format!("{}...", title)
+ } else {
+ title
+ };
+ break;
}
}