assistant2: Thread history keyboard navigation (#23145)

Open and delete threads via keyboard:


https://github.com/user-attachments/assets/79b402ad-a49d-4c52-9d46-28a7bf32ff1f



Note: this doesn't include navigation in the "recent threads" section of
the empty state

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga 2025-01-17 18:41:17 -03:00 committed by GitHub
parent 5da67899b7
commit 938e28f871
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 126 additions and 11 deletions

View file

@ -52,6 +52,14 @@ impl ThreadStore {
})
}
/// Returns the number of non-empty threads.
pub fn non_empty_len(&self, cx: &AppContext) -> usize {
self.threads
.iter()
.filter(|thread| !thread.read(cx).is_empty())
.count()
}
pub fn threads(&self, cx: &ModelContext<Self>) -> Vec<Model<Thread>> {
let mut threads = self
.threads