commit d88070a14d6033ea5709df231a3155a97013a460
parent 28c74bc838f1127e88b219315563056a3eb8542e
Author: William Casarin <jb55@jb55.com>
Date: Tue, 27 Jan 2026 08:23:28 -0800
dave: fix classic view real-time status updates and auto-focus
Move update_all_statuses() and check_attention() from scene_ui to the
update method so status updates and auto-focus switching work for all
views (classic, scene, and narrow), not just the scene view.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat:
2 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/crates/notedeck_dave/src/lib.rs b/crates/notedeck_dave/src/lib.rs
@@ -312,14 +312,6 @@ You are an AI agent for the nostr protocol called Dave, created by Damus. nostr
let mut dave_response = DaveResponse::default();
let mut scene_response: Option<SceneResponse> = None;
- // Update all session statuses
- self.session_manager.update_all_statuses();
-
- // Check for agents needing attention and auto-jump to them
- if let Some(attention_id) = self.scene.check_attention(&self.session_manager) {
- // Also sync with session manager's active session
- self.session_manager.switch_to(attention_id);
- }
// Check if Ctrl is held for showing keybinding hints
let ctrl_held = ui.input(|i| i.modifiers.ctrl);
@@ -347,11 +339,14 @@ You are an AI agent for the nostr protocol called Dave, created by Damus. nostr
ui.separator();
if ui
.button("Classic View")
- .on_hover_text("Tab/Shift+Tab to cycle agents")
+ .on_hover_text("Ctrl+G to toggle views")
.clicked()
{
self.show_scene = false;
}
+ if ctrl_held {
+ ui::keybind_hint(ui, "G");
+ }
});
ui.separator();
@@ -461,9 +456,18 @@ You are an AI agent for the nostr protocol called Dave, created by Damus. nostr
.inner_margin(egui::Margin::symmetric(8, 12))
.show(ui, |ui| {
// Add scene view toggle button
- if ui.button("Scene View").clicked() {
- self.show_scene = true;
- }
+ ui.horizontal(|ui| {
+ if ui
+ .button("Scene View")
+ .on_hover_text("Ctrl+G to toggle views")
+ .clicked()
+ {
+ self.show_scene = true;
+ }
+ if ctrl_held {
+ ui::keybind_hint(ui, "G");
+ }
+ });
ui.separator();
SessionListUi::new(&self.session_manager, ctrl_held).ui(ui)
})
@@ -860,6 +864,9 @@ impl notedeck::App for Dave {
KeyAction::Interrupt => {
self.handle_interrupt_request(ui);
}
+ KeyAction::ToggleView => {
+ self.show_scene = !self.show_scene;
+ }
}
}
@@ -868,6 +875,15 @@ impl notedeck::App for Dave {
//update_dave(self, ctx, ui.ctx());
let should_send = self.process_events(ctx);
+
+ // Update all session statuses after processing events
+ self.session_manager.update_all_statuses();
+
+ // Check for agents needing attention and auto-switch to them
+ if let Some(attention_id) = self.scene.check_attention(&self.session_manager) {
+ self.session_manager.switch_to(attention_id);
+ }
+
if let Some(action) = self.ui(ctx, ui).action {
match action {
DaveAction::ToggleChrome => {
diff --git a/crates/notedeck_dave/src/ui/scene.rs b/crates/notedeck_dave/src/ui/scene.rs
@@ -183,7 +183,9 @@ impl AgentScene {
.show(ui, &mut scene_rect, |ui| {
// Draw agents and collect interaction responses
// Use sessions_ordered() to match keybinding order (Ctrl+1 = first in order, etc.)
- for (keybind_idx, session) in session_manager.sessions_ordered().into_iter().enumerate() {
+ for (keybind_idx, session) in
+ session_manager.sessions_ordered().into_iter().enumerate()
+ {
let id = session.id;
let keybind_number = keybind_idx + 1; // 1-indexed for display
let position = session.scene_position;
@@ -191,8 +193,16 @@ impl AgentScene {
let title = &session.title;
let is_selected = selected_ids.contains(&id);
- let agent_response =
- Self::draw_agent(ui, id, keybind_number, position, status, title, is_selected, ctrl_held);
+ let agent_response = Self::draw_agent(
+ ui,
+ id,
+ keybind_number,
+ position,
+ status,
+ title,
+ is_selected,
+ ctrl_held,
+ );
if agent_response.clicked() {
let shift = ui.input(|i| i.modifiers.shift);