Skip to repository content62 lines · 2.0 KB · rust
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T03:08:35.286Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
edit_prediction_onboarding_content.rs
1use std::sync::Arc;
2
3use gpui::{IntoElement, ParentElement};
4use ui::prelude::*;
5
6pub struct EditPredictionOnboarding {
7 copilot_is_configured: bool,
8 continue_with_copilot: Arc<dyn Fn(&mut Window, &mut App)>,
9}
10
11impl EditPredictionOnboarding {
12 pub fn new(
13 copilot_is_configured: bool,
14 continue_with_copilot: Arc<dyn Fn(&mut Window, &mut App)>,
15 _cx: &mut Context<Self>,
16 ) -> Self {
17 Self {
18 copilot_is_configured,
19 continue_with_copilot,
20 }
21 }
22}
23
24impl Render for EditPredictionOnboarding {
25 fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
26 let github_copilot = v_flex()
27 .gap_1()
28 .child(Label::new(if self.copilot_is_configured {
29 "Alternatively, you can continue to use GitHub Copilot as that's already set up."
30 } else {
31 "Alternatively, you can use GitHub Copilot as your edit prediction provider."
32 }))
33 .child(
34 Button::new(
35 "configure-copilot",
36 if self.copilot_is_configured {
37 "Use Copilot"
38 } else {
39 "Configure Copilot"
40 },
41 )
42 .full_width()
43 .style(ButtonStyle::Outlined)
44 .on_click({
45 let callback = self.continue_with_copilot.clone();
46 move |_, window, cx| callback(window, cx)
47 }),
48 );
49
50 v_flex()
51 .gap_2()
52 .child(Headline::new("Configure edit predictions"))
53 .child(
54 Label::new(
55 "Edit predictions use a provider configured directly in Omega. GitHub Copilot is the available provider for this capability.",
56 )
57 .color(Color::Muted),
58 )
59 .child(github_copilot)
60 }
61}
62