Fix child pane reopening and overload retries
This commit is contained in:
@@ -783,6 +783,66 @@ fn test_insert_hidden_child_agent_pane_keeps_focus_and_active_session() {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_closing_split_off_child_keeps_backing_pane_for_reopen() {
|
||||
App::test((), |mut app| async move {
|
||||
initialize_app(&mut app);
|
||||
let pane_group = mock_pane_group(&mut app, Default::default());
|
||||
|
||||
pane_group.update(&mut app, |panes, ctx| {
|
||||
let parent_pane_id = get_newly_created_pane_id(panes, &[]);
|
||||
let parent_conversation_id = start_parent_conversation(panes, parent_pane_id, ctx);
|
||||
let child = create_hidden_child_agent_conversation(
|
||||
panes,
|
||||
HiddenChildAgentConversationRequest {
|
||||
parent_pane_id,
|
||||
name: "Agent 1".to_string(),
|
||||
parent_conversation_id,
|
||||
orchestration_harness: None,
|
||||
env_vars: HashMap::new(),
|
||||
task_context: None,
|
||||
is_shared_session_creator: IsSharedSessionCreator::No,
|
||||
},
|
||||
ctx,
|
||||
)
|
||||
.expect("fresh hidden child conversation should be created");
|
||||
let child_pane_id = panes
|
||||
.child_agent_panes
|
||||
.get(&child.conversation_id)
|
||||
.copied()
|
||||
.expect("fresh hidden child pane should be tracked");
|
||||
|
||||
assert_eq!(
|
||||
panes.unhide_child_agent_pane_for_split_off(child.conversation_id, ctx),
|
||||
Some(child_pane_id)
|
||||
);
|
||||
assert!(panes.panes.is_pane_in_tree(child_pane_id));
|
||||
|
||||
panes.close_pane(child_pane_id, ctx);
|
||||
|
||||
assert_eq!(panes.focused_pane_id(ctx), parent_pane_id);
|
||||
assert!(panes.has_pane_id(child_pane_id));
|
||||
assert_eq!(
|
||||
panes.child_agent_panes.get(&child.conversation_id),
|
||||
Some(&child_pane_id)
|
||||
);
|
||||
assert!(!panes.panes.is_pane_in_tree(child_pane_id));
|
||||
|
||||
assert_eq!(
|
||||
panes.unhide_child_agent_pane_for_split_off(child.conversation_id, ctx),
|
||||
Some(child_pane_id)
|
||||
);
|
||||
assert_eq!(panes.focused_pane_id(ctx), child_pane_id);
|
||||
assert!(panes.panes.is_pane_in_tree(child_pane_id));
|
||||
assert!(panes
|
||||
.panes
|
||||
.pane_ids()
|
||||
.into_iter()
|
||||
.all(|pane_id| panes.has_pane_id(pane_id)));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_swapping_to_child_agent_from_maximized_pane_keeps_maximized_state() {
|
||||
App::test((), |mut app| async move {
|
||||
|
||||
Reference in New Issue
Block a user