Decide which panel should be active for a dock based on ordering panels (#22346)

This means that `workspace::ToggleRightDock` will open the assistant if
no right-dock panel has been manually activated, instead of the chat as
before. Also cleans up the `active_panel_index` logic a bit.

cc @nathansobo 

Release Notes:

- Make `workspace::ToggleRightDock` open the assistant panel if no
right-dock panel has yet been activated
This commit is contained in:
Cole Miller 2024-12-30 09:43:17 -05:00 committed by GitHub
parent ad51df7644
commit dcbff982ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 109 additions and 41 deletions

View file

@ -345,7 +345,7 @@ fn initialize_panels(prompt_builder: Arc<PromptBuilder>, cx: &mut ViewContext<Wo
workspace.add_panel(channels_panel, cx);
workspace.add_panel(chat_panel, cx);
workspace.add_panel(notification_panel, cx);
workspace.add_panel(assistant_panel, cx);
workspace.add_panel(assistant_panel, cx)
})?;
let git_ui_enabled = git_ui_feature_flag.await;
@ -380,7 +380,9 @@ fn initialize_panels(prompt_builder: Arc<PromptBuilder>, cx: &mut ViewContext<Wo
} else {
workspace.register_action(assistant::AssistantPanel::inline_assist);
}
})
})?;
anyhow::Ok(())
})
.detach();
}