Compare commits

...

1 Commits

Author SHA1 Message Date
Richard Feldman
c0dfefaeaf wip 2025-03-27 16:05:23 -04:00
3 changed files with 13 additions and 2 deletions

View File

@@ -223,7 +223,10 @@ impl ActiveThread {
cx: &mut Context<Self>,
) -> Self {
let subscriptions = vec![
cx.observe(&thread, |_, _, cx| cx.notify()),
cx.observe(&thread, |_, _, cx| {
println!("Thread notified!");
cx.notify()
}),
cx.subscribe_in(&thread, window, Self::handle_thread_event),
];
@@ -371,7 +374,7 @@ impl ActiveThread {
window: &mut Window,
cx: &mut Context<Self>,
) {
match event {
match dbg!(event) {
ThreadEvent::ShowError(error) => {
self.last_error = Some(error.clone());
}

View File

@@ -272,6 +272,13 @@ impl AssistantPanel {
cx,
)
});
cx.observe(&thread, |_, _, cx| {
println!("Panel: Thread notified!");
cx.notify();
})
.detach();
self.message_editor = cx.new(|cx| {
MessageEditor::new(
self.fs.clone(),

View File

@@ -541,6 +541,7 @@ impl Thread {
self.messages.push(Message { id, role, segments });
self.touch_updated_at();
cx.emit(ThreadEvent::MessageAdded(id));
cx.notify();
id
}