diff --git a/crates/copilot/src/sign_in.rs b/crates/copilot/src/sign_in.rs index 0a9299f512..cce064160e 100644 --- a/crates/copilot/src/sign_in.rs +++ b/crates/copilot/src/sign_in.rs @@ -66,6 +66,7 @@ pub fn init(cx: &mut MutableAppContext) { .detach(); // Modal theming test: + // use gpui::geometry::vector::vec2f; // let window_size = cx.global::().theme.copilot.modal.dimensions(); // let window_options = WindowOptions { // bounds: gpui::WindowBounds::Fixed(RectF::new(Default::default(), window_size)), @@ -326,52 +327,17 @@ impl CopilotCodeVerification { .aligned() .boxed(), Self::render_device_code(data, &style, cx), - // match &self.prompt { - // SignInContents::PromptingUser(data) => { - - // } - // SignInContents::Unauthorized => Self::render_not_authorized_warning(&style), - // SignInContents::Enabled => Self::render_copilot_enabled(&style), - // }, Flex::column() - .with_child( - theme::ui::cta_button_with_click( - "Connect to GitHub", - style.auth.content_width, - &style.auth.cta_button, - cx, - { - let verification_uri = data.verification_uri.clone(); - move |_, cx| cx.platform().open_url(&verification_uri) - }, - ), - // { - // match &self.prompt { - // SignInContents::PromptingUser(data) => { - - // } - // // SignInContents::Unauthorized => theme::ui::cta_button_with_click( - // // "Close", - // // style.auth.content_width, - // // &style.auth.cta_button, - // // cx, - // // |_, cx| { - // // let window_id = cx.window_id(); - // // cx.remove_window(window_id) - // // }, - // // ), - // // SignInContents::Enabled => theme::ui::cta_button_with_click( - // // "Done", - // // style.auth.content_width, - // // &style.auth.cta_button, - // // cx, - // // |_, cx| { - // // let window_id = cx.window_id(); - // // cx.remove_window(window_id) - // // }, - // // ), - // } - ) + .with_child(theme::ui::cta_button_with_click( + "Connect to GitHub", + style.auth.content_width, + &style.auth.cta_button, + cx, + { + let verification_uri = data.verification_uri.clone(); + move |_, cx| cx.platform().open_url(&verification_uri) + }, + )) .align_children_center() .contained() .with_style(style.auth.github_group) diff --git a/crates/copilot_button/src/copilot_button.rs b/crates/copilot_button/src/copilot_button.rs index 45255b4f65..e61a8814af 100644 --- a/crates/copilot_button/src/copilot_button.rs +++ b/crates/copilot_button/src/copilot_button.rs @@ -11,7 +11,7 @@ use workspace::{ item::ItemHandle, notifications::simple_message_notification::OsOpen, StatusItemView, }; -use copilot::{Copilot, SignOut, Status}; +use copilot::{Copilot, SignIn, SignOut, Status}; const COPILOT_SETTINGS_URL: &str = "https://github.com/settings/copilot"; @@ -140,7 +140,7 @@ impl View for CopilotButton { if authorized { cx.dispatch_action(DeployCopilotMenu); } else { - cx.dispatch_action(DeployCopilotModal); + cx.dispatch_action(SignIn); } }) .with_tooltip::( diff --git a/crates/settings/src/settings.rs b/crates/settings/src/settings.rs index e28ce180b1..2e087dd260 100644 --- a/crates/settings/src/settings.rs +++ b/crates/settings/src/settings.rs @@ -567,6 +567,10 @@ impl Settings { merge(&mut self.autosave, data.autosave); merge(&mut self.default_dock_anchor, data.default_dock_anchor); merge(&mut self.base_keymap, data.base_keymap); + merge( + &mut self.enable_copilot_integration, + data.enable_copilot_integration, + ); self.editor_overrides = data.editor; self.git_overrides = data.git.unwrap_or_default();