Fix bug with enable setting, clean up sign in UIs
This commit is contained in:
parent
cc7c5b416c
commit
a8033b266d
3 changed files with 17 additions and 47 deletions
|
@ -66,6 +66,7 @@ pub fn init(cx: &mut MutableAppContext) {
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
// Modal theming test:
|
// Modal theming test:
|
||||||
|
// use gpui::geometry::vector::vec2f;
|
||||||
// let window_size = cx.global::<Settings>().theme.copilot.modal.dimensions();
|
// let window_size = cx.global::<Settings>().theme.copilot.modal.dimensions();
|
||||||
// let window_options = WindowOptions {
|
// let window_options = WindowOptions {
|
||||||
// bounds: gpui::WindowBounds::Fixed(RectF::new(Default::default(), window_size)),
|
// bounds: gpui::WindowBounds::Fixed(RectF::new(Default::default(), window_size)),
|
||||||
|
@ -326,52 +327,17 @@ impl CopilotCodeVerification {
|
||||||
.aligned()
|
.aligned()
|
||||||
.boxed(),
|
.boxed(),
|
||||||
Self::render_device_code(data, &style, cx),
|
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()
|
Flex::column()
|
||||||
.with_child(
|
.with_child(theme::ui::cta_button_with_click(
|
||||||
theme::ui::cta_button_with_click(
|
"Connect to GitHub",
|
||||||
"Connect to GitHub",
|
style.auth.content_width,
|
||||||
style.auth.content_width,
|
&style.auth.cta_button,
|
||||||
&style.auth.cta_button,
|
cx,
|
||||||
cx,
|
{
|
||||||
{
|
let verification_uri = data.verification_uri.clone();
|
||||||
let verification_uri = data.verification_uri.clone();
|
move |_, cx| cx.platform().open_url(&verification_uri)
|
||||||
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)
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// }
|
|
||||||
)
|
|
||||||
.align_children_center()
|
.align_children_center()
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(style.auth.github_group)
|
.with_style(style.auth.github_group)
|
||||||
|
|
|
@ -11,7 +11,7 @@ use workspace::{
|
||||||
item::ItemHandle, notifications::simple_message_notification::OsOpen, StatusItemView,
|
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";
|
const COPILOT_SETTINGS_URL: &str = "https://github.com/settings/copilot";
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ impl View for CopilotButton {
|
||||||
if authorized {
|
if authorized {
|
||||||
cx.dispatch_action(DeployCopilotMenu);
|
cx.dispatch_action(DeployCopilotMenu);
|
||||||
} else {
|
} else {
|
||||||
cx.dispatch_action(DeployCopilotModal);
|
cx.dispatch_action(SignIn);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.with_tooltip::<Self, _>(
|
.with_tooltip::<Self, _>(
|
||||||
|
|
|
@ -567,6 +567,10 @@ impl Settings {
|
||||||
merge(&mut self.autosave, data.autosave);
|
merge(&mut self.autosave, data.autosave);
|
||||||
merge(&mut self.default_dock_anchor, data.default_dock_anchor);
|
merge(&mut self.default_dock_anchor, data.default_dock_anchor);
|
||||||
merge(&mut self.base_keymap, data.base_keymap);
|
merge(&mut self.base_keymap, data.base_keymap);
|
||||||
|
merge(
|
||||||
|
&mut self.enable_copilot_integration,
|
||||||
|
data.enable_copilot_integration,
|
||||||
|
);
|
||||||
|
|
||||||
self.editor_overrides = data.editor;
|
self.editor_overrides = data.editor;
|
||||||
self.git_overrides = data.git.unwrap_or_default();
|
self.git_overrides = data.git.unwrap_or_default();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue