Settings › AI: Add agent opens from the Home tab too (#3483, #3513) (#3522)

* 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 <noreply@anthropic.com>

---------

Co-authored-by: Phanoob <phanoob@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-21 00:44:41 +00:00
1 parent d21e2b1afd
commit f2f9c6fe27
3 files changed
+21 -1

No files matched your search

-1
View File
@@ -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);
}
+17
View File
@@ -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");
}
+4
View File
@@ -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 {