assistant2: Combine history views into one (#25293)

This PR combines the two history views in Assistant2 into one.

<img width="1309" alt="Screenshot 2025-02-20 at 5 34 37 PM"
src="https://github.com/user-attachments/assets/fbb08542-58b5-4930-8a20-254234e335fa"
/>

<img width="1309" alt="Screenshot 2025-02-20 at 5 34 41 PM"
src="https://github.com/user-attachments/assets/1174849e-edad-4e02-8bf3-bb92aafba4f8"
/>


Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-02-20 17:53:58 -05:00 committed by GitHub
parent 3a222f0666
commit 74c581b9f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 265 additions and 155 deletions

View file

@ -3366,7 +3366,7 @@ impl SavedContextV0_1_0 {
}
}
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct SavedContextMetadata {
pub title: String,
pub path: PathBuf,

View file

@ -350,6 +350,12 @@ impl ContextStore {
}
}
pub fn contexts(&self) -> Vec<SavedContextMetadata> {
let mut contexts = self.contexts_metadata.iter().cloned().collect::<Vec<_>>();
contexts.sort_unstable_by_key(|thread| std::cmp::Reverse(thread.mtime));
contexts
}
pub fn create(&mut self, cx: &mut Context<Self>) -> Entity<AssistantContext> {
let context = cx.new(|cx| {
AssistantContext::local(