commit eda042a93a131ae3476588595ee4dc1dea9af264
parent 12f409f57be857a73884740f0ec0864987d20457
Author: William Casarin <jb55@jb55.com>
Date: Wed, 18 Feb 2026 17:34:43 -0800
dave: create chat session directly in chat mode, skip directory picker
On Android (and any non-agentic backend), creating a new session
would show the directory picker overlay, which is only relevant for
agentic mode. In chat mode, create the session immediately with the
current directory instead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat:
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/crates/notedeck_dave/src/lib.rs b/crates/notedeck_dave/src/lib.rs
@@ -1020,8 +1020,17 @@ You are an AI agent for the nostr protocol called Dave, created by Damus. nostr
}
fn handle_new_chat(&mut self) {
- // Show the directory picker overlay
- self.active_overlay = DaveOverlay::DirectoryPicker;
+ match self.ai_mode {
+ AiMode::Chat => {
+ // In chat mode, create a session directly without the directory picker
+ let cwd = std::env::current_dir().unwrap_or_default();
+ self.create_session_with_cwd(cwd);
+ }
+ AiMode::Agentic => {
+ // In agentic mode, show the directory picker to select a working directory
+ self.active_overlay = DaveOverlay::DirectoryPicker;
+ }
+ }
}
/// Create a new session with the given cwd (called after directory picker selection)
@@ -1922,6 +1931,12 @@ You are an AI agent for the nostr protocol called Dave, created by Damus. nostr
ctx: &AppContext,
ui: &egui::Ui,
) -> Option<AppAction> {
+ // Intercept NewChat to handle chat vs agentic mode
+ if matches!(action, DaveAction::NewChat) {
+ self.handle_new_chat();
+ return None;
+ }
+
match ui::handle_ui_action(
action,
&mut self.session_manager,