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:
parent
55ecb3c51b
commit
a30ea2fc68
5 changed files with 396 additions and 291 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue