assistant2: Factor out ActiveThread view (#21555)

This PR factors a new `ActiveThread` view out of the `AssistantPanel` to
group together the state that pertains solely to the active view.

There was a bunch of related state on the `AssistantPanel` pertaining to
the active thread that needed to be initialized/reset together and it
makes for a clearer narrative is this state is encapsulated in its own
view.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-12-04 16:39:39 -05:00 committed by GitHub
parent 55ecb3c51b
commit a30ea2fc68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 396 additions and 291 deletions

View file

@ -85,6 +85,10 @@ impl Thread {
&self.id
}
pub fn is_empty(&self) -> bool {
self.messages.is_empty()
}
pub fn message(&self, id: MessageId) -> Option<&Message> {
self.messages.iter().find(|message| message.id == id)
}