From f2f9c6fe277f4d09faec61809c99ec47cae79653 Mon Sep 17 00:00:00 2001 From: phanoob Date: Wed, 21 Oct 2026 00:44:41 +0000 Subject: [PATCH] =?UTF-8?q?Settings=20=E2=80=BA=20AI:=20Add=20agent=20open?= =?UTF-8?q?s=20from=20the=20Home=20tab=20too=20(#3483,=20#3513)=20(#3522)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * claim: #3483 * Settings > AI: Add agent opens from the Home tab too (#3483, #3513) The Add agent dialog was drawn by the chat panel, which Home doesn't show, so Add agent did nothing while Home was open. It is now drawn from the frame itself, before Home and the workspace part ways. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Phanoob Co-authored-by: Claude Opus 5.5 --- crates/ui-egui/src/agent_chat/panel.rs | 1 - crates/ui-egui/src/agent_chat/tests.rs | 17 +++++++++++++++++ crates/ui-egui/src/lib.rs | 4 ++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/agent_chat/panel.rs b/crates/ui-egui/src/agent_chat/panel.rs index 0b108f177..39309352c 100644 --- a/crates/ui-egui/src/agent_chat/panel.rs +++ b/crates/ui-egui/src/agent_chat/panel.rs @@ -64,7 +64,6 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) { if !shown(app) { return; } - super::settings::dialog(app, &ctx); if ctx.input_mut(|i| i.consume_shortcut(&SHORTCUT)) { toggle(app); } diff --git a/crates/ui-egui/src/agent_chat/tests.rs b/crates/ui-egui/src/agent_chat/tests.rs index 193abff08..d4ea32c87 100644 --- a/crates/ui-egui/src/agent_chat/tests.rs +++ b/crates/ui-egui/src/agent_chat/tests.rs @@ -1699,3 +1699,20 @@ fn an_attached_picture_and_the_views_picture_share_the_viewer() { let Some(Item::User { pictures, .. }) = chat.items.last() else { panic!("a sent message") }; assert_eq!(pictures.len(), 2); } + +/// Settings › AI › Add agent opens its dialog from the Home tab too (#3483, #3513). +#[test] +fn add_agent_opens_its_dialog_from_home() { + use crate::scenario::handle_at; + let mut h = crate::scenario::Harness::new(); + h.call("ui.resize", json!({"width": 1600.0, "height": 1000.0})); + h.call("ui.home", json!({"open": true})); + h.call("ui.prefs", json!({"open": "AI"})); + h.frames(4); + assert!(h.app.home.open, "Home is showing"); + let add = handle_at("prefs:ai_add").expect("Add agent is drawn"); + h.call("ui.click", json!({"x": add.x, "y": add.y})); + h.frames(4); + assert!(h.app.agent_chat.settings.add.is_some(), "Add agent opened its dialog"); + assert!(handle_at("ai_add:add").is_some(), "the dialog is drawn over Home"); +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 0f9445b4b..37b6c20fa 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1521,6 +1521,10 @@ impl SolveApp { documents::prompt(self, ui.ctx()); update::show(self, ui.ctx()); install::show(self, ui.ctx()); + // Settings › AI's Add agent dialog: Settings opens over Home too (#3483). + if agent_chat::shown(self) { + agent_chat::settings::dialog(self, ui.ctx()); + } if self.home.open { home::show(self, ui); if self.home.open {