first pass of merging in warp (doesn't build)
This commit is contained in:
@@ -1,29 +1,34 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use ai::LLMId;
|
||||
use anyhow::Result;
|
||||
use galaxy_core::ui::icons::Icon;
|
||||
use galaxy_core::ui::theme::{AnsiColor, AnsiColors, Details, Fill, Image, TerminalColors};
|
||||
use galaxy_core::ui::{appearance::Appearance, theme::GalaxyTheme};
|
||||
use galaxyui::assets::asset_cache::AssetSource;
|
||||
use galaxyui::platform;
|
||||
use galaxyui::{
|
||||
elements::{
|
||||
Container, CrossAxisAlignment, Flex, MainAxisAlignment, MainAxisSize, ParentElement,
|
||||
},
|
||||
fonts::{Cache, FamilyId, Weight},
|
||||
presenter::ChildView,
|
||||
ui_components::components::{UiComponent as _, UiComponentStyles},
|
||||
AddWindowOptions, AppContext, AssetProvider, Element, Entity, SingletonEntity as _,
|
||||
TypedActionView, View, ViewContext, ViewHandle,
|
||||
};
|
||||
use onboarding::slides::OnboardingModelInfo;
|
||||
use onboarding::{
|
||||
AgentOnboardingEvent, AgentOnboardingView, MockTelemetryContextProvider, SelectedSettings,
|
||||
};
|
||||
use pathfinder_color::ColorU;
|
||||
use rust_embed::RustEmbed;
|
||||
use std::borrow::Cow;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
use galaxy_core::ui::icons::Icon;
|
||||
use galaxy_core::ui::theme::{
|
||||
AnsiColor, AnsiColors, Details, Fill, Image, TerminalColors, WarpTheme,
|
||||
};
|
||||
use galaxyui_core::assets::asset_cache::AssetSource;
|
||||
use galaxyui_core::elements::{
|
||||
Container, CrossAxisAlignment, Flex, MainAxisAlignment, MainAxisSize, ParentElement,
|
||||
};
|
||||
use galaxyui_core::fonts::{Cache, FamilyId, Weight};
|
||||
use galaxyui_core::presenter::ChildView;
|
||||
use galaxyui_core::ui_components::components::{UiComponent as _, UiComponentStyles};
|
||||
use galaxyui_core::{
|
||||
platform, AddWindowOptions, AppContext, AssetProvider, Element, Entity, SingletonEntity as _,
|
||||
TypedActionView, View, ViewContext, ViewHandle,
|
||||
};
|
||||
use onboarding::{
|
||||
AgentOnboardingEvent, AgentOnboardingView, MockTelemetryContextProvider, SelectedSettings,
|
||||
};
|
||||
|
||||
#[derive(Clone, Copy, RustEmbed)]
|
||||
#[folder = "../../app/assets"]
|
||||
@@ -44,10 +49,14 @@ fn main() -> Result<()> {
|
||||
galaxy_logging::init(galaxy_logging::LogConfig {
|
||||
is_cli: false,
|
||||
log_destination: None,
|
||||
..Default::default()
|
||||
})?;
|
||||
|
||||
let app_builder =
|
||||
platform::AppBuilder::new(platform::AppCallbacks::default(), Box::new(ASSETS), None);
|
||||
let app_builder = warpui::platform::AppBuilder::new(
|
||||
platform::AppCallbacks::default(),
|
||||
Box::new(ASSETS),
|
||||
None,
|
||||
);
|
||||
let _ = app_builder.run(move |ctx| {
|
||||
// Register Appearance singleton so views can access Appearance::handle(ctx).
|
||||
ctx.add_singleton_model(|ctx| build_appearance(phenomenon(), ctx));
|
||||
@@ -84,26 +93,23 @@ impl OnboardingMainView {
|
||||
id: LLMId::from("auto"),
|
||||
title: "Auto".to_string(),
|
||||
icon: Icon::Oz,
|
||||
requires_upgrade: false,
|
||||
is_default: true,
|
||||
},
|
||||
OnboardingModelInfo {
|
||||
id: LLMId::from("claude-sonnet"),
|
||||
title: "Claude Sonnet".to_string(),
|
||||
icon: Icon::ClaudeLogo,
|
||||
requires_upgrade: false,
|
||||
is_default: false,
|
||||
},
|
||||
OnboardingModelInfo {
|
||||
id: LLMId::from("gpt-4o"),
|
||||
title: "GPT-4o".to_string(),
|
||||
icon: Icon::OpenAILogo,
|
||||
requires_upgrade: true,
|
||||
is_default: false,
|
||||
},
|
||||
];
|
||||
let onboarding_view = ctx.add_typed_action_view(move |ctx| {
|
||||
// agent_modality_enabled and no_ai_experiment are false for demo purposes
|
||||
// agent_modality_enabled is false for demo purposes
|
||||
AgentOnboardingView::new(
|
||||
themes.clone(),
|
||||
true,
|
||||
@@ -111,8 +117,6 @@ impl OnboardingMainView {
|
||||
default_model_id.clone(),
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
None,
|
||||
onboarding::OnboardingAuthState::LoggedOut,
|
||||
ctx,
|
||||
)
|
||||
@@ -266,7 +270,7 @@ impl View for OnboardingMainView {
|
||||
}
|
||||
}
|
||||
|
||||
fn on_focus(&mut self, focus_ctx: &galaxyui::FocusContext, ctx: &mut ViewContext<Self>) {
|
||||
fn on_focus(&mut self, focus_ctx: &galaxyui_core::FocusContext, ctx: &mut ViewContext<Self>) {
|
||||
if let OnboardingMainState::Onboarding(view) = &self.state {
|
||||
if focus_ctx.is_self_focused() {
|
||||
ctx.focus(view);
|
||||
|
||||
Reference in New Issue
Block a user