Make repo and branch popovers extend up from their trigger buttons (#26950)

Previously, when clicking on the branch, the popover would obscure the
button you just clicked, which was awkward.

Release Notes:

- Improved the placement of the repo and branch picker popovers in the
git panel.
- Added a 'SelectRepo' action that opens the repository selector in a
modal.
This commit is contained in:
Max Brunsfeld
2025-03-17 15:05:17 -07:00
committed by GitHub
parent a05066cd83
commit 2b2b9c1624
8 changed files with 59 additions and 49 deletions
+1 -11
View File
@@ -54,16 +54,6 @@ impl ModalContainerProperties {
}
}
pub fn init(cx: &mut App) {
cx.observe_new(|workspace: &mut Workspace, window, cx| {
let Some(window) = window else {
return;
};
CommitModal::register(workspace, window, cx)
})
.detach();
}
pub struct CommitModal {
git_panel: Entity<GitPanel>,
commit_editor: Entity<Editor>,
@@ -108,7 +98,7 @@ struct RestoreDock {
}
impl CommitModal {
pub fn register(workspace: &mut Workspace, _: &mut Window, _cx: &mut Context<Workspace>) {
pub fn register(workspace: &mut Workspace) {
workspace.register_action(|workspace, _: &Commit, window, cx| {
CommitModal::toggle(workspace, window, cx);
});