Rebrand to Galaxy, major improvements to Bedrock support, still needs some TLC though
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use warp_core::ui::icons::Icon;
|
||||
use warp_core::ui::theme::AnsiColorIdentifier;
|
||||
use warpui::elements::{ChildView, Element, Empty, ParentElement, Wrap};
|
||||
use warpui::{AppContext, Entity, TypedActionView, View, ViewContext, ViewHandle};
|
||||
use galaxy_core::ui::icons::Icon;
|
||||
use galaxy_core::ui::theme::AnsiColorIdentifier;
|
||||
use galaxyui::elements::{ChildView, Element, Empty, ParentElement, Wrap};
|
||||
use galaxyui::{AppContext, Entity, TypedActionView, View, ViewContext, ViewHandle};
|
||||
|
||||
use crate::notebooks::NotebookId;
|
||||
use crate::terminal::input::MenuPositioning;
|
||||
|
||||
+21
-21
@@ -4,11 +4,11 @@ use std::path::PathBuf;
|
||||
|
||||
use anyhow::anyhow;
|
||||
use ui_components::lightbox::{LightboxImage, LightboxImageSource};
|
||||
use warp_core::report_error;
|
||||
use galaxy_core::report_error;
|
||||
use warp_multi_agent_api as api;
|
||||
#[cfg(feature = "local_fs")]
|
||||
use warpui::platform::SaveFilePickerConfiguration;
|
||||
use warpui::SingletonEntity;
|
||||
use galaxyui::platform::SaveFilePickerConfiguration;
|
||||
use galaxyui::SingletonEntity;
|
||||
|
||||
#[cfg(feature = "local_fs")]
|
||||
use crate::ai::artifact_download::default_download_filename;
|
||||
@@ -208,19 +208,19 @@ impl From<api::message::artifact_event::PlanArtifact> for Artifact {
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<warp_graphql::ai::AIConversationArtifact> for Artifact {
|
||||
impl TryFrom<galaxy_graphql::ai::AIConversationArtifact> for Artifact {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(value: warp_graphql::ai::AIConversationArtifact) -> Result<Self, Self::Error> {
|
||||
fn try_from(value: galaxy_graphql::ai::AIConversationArtifact) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
warp_graphql::ai::AIConversationArtifact::PlanArtifact(plan) => Ok(Artifact::Plan {
|
||||
galaxy_graphql::ai::AIConversationArtifact::PlanArtifact(plan) => Ok(Artifact::Plan {
|
||||
document_uid: plan.document_uid.into_inner(),
|
||||
notebook_uid: plan
|
||||
.notebook_uid
|
||||
.map(|id| NotebookId::from(id.into_inner())),
|
||||
title: plan.title,
|
||||
}),
|
||||
warp_graphql::ai::AIConversationArtifact::PullRequestArtifact(pr) => {
|
||||
galaxy_graphql::ai::AIConversationArtifact::PullRequestArtifact(pr) => {
|
||||
let (repo, number) = parse_github_pr_url(&pr.url).unzip();
|
||||
Ok(Artifact::PullRequest {
|
||||
url: pr.url,
|
||||
@@ -229,14 +229,14 @@ impl TryFrom<warp_graphql::ai::AIConversationArtifact> for Artifact {
|
||||
number,
|
||||
})
|
||||
}
|
||||
warp_graphql::ai::AIConversationArtifact::ScreenshotArtifact(screenshot) => {
|
||||
galaxy_graphql::ai::AIConversationArtifact::ScreenshotArtifact(screenshot) => {
|
||||
Ok(Artifact::Screenshot {
|
||||
artifact_uid: screenshot.artifact_uid.into_inner(),
|
||||
mime_type: screenshot.mime_type,
|
||||
description: screenshot.description,
|
||||
})
|
||||
}
|
||||
warp_graphql::ai::AIConversationArtifact::FileArtifact(file) => Ok(Artifact::File {
|
||||
galaxy_graphql::ai::AIConversationArtifact::FileArtifact(file) => Ok(Artifact::File {
|
||||
artifact_uid: file.artifact_uid.into_inner(),
|
||||
filepath: file.filepath.clone(),
|
||||
filename: sanitized_basename(&file.filepath).unwrap_or(file.filepath),
|
||||
@@ -244,7 +244,7 @@ impl TryFrom<warp_graphql::ai::AIConversationArtifact> for Artifact {
|
||||
description: file.description,
|
||||
size_bytes: file.size_bytes,
|
||||
}),
|
||||
warp_graphql::ai::AIConversationArtifact::Unknown => Err(()),
|
||||
galaxy_graphql::ai::AIConversationArtifact::Unknown => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,9 +296,9 @@ pub fn file_button_label(filename: &str, filepath: &str) -> String {
|
||||
"File".to_string()
|
||||
}
|
||||
|
||||
pub fn open_screenshot_lightbox<V: warpui::View>(
|
||||
pub fn open_screenshot_lightbox<V: galaxyui::View>(
|
||||
artifact_uids: &[String],
|
||||
ctx: &mut warpui::ViewContext<V>,
|
||||
ctx: &mut galaxyui::ViewContext<V>,
|
||||
) {
|
||||
// Open lightbox immediately with Loading placeholders.
|
||||
let loading_images: Vec<LightboxImage> = artifact_uids
|
||||
@@ -367,9 +367,9 @@ fn screenshot_lightbox_image_from_download_result(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn download_file_artifact<V: warpui::View>(
|
||||
pub fn download_file_artifact<V: galaxyui::View>(
|
||||
artifact_uid: &str,
|
||||
ctx: &mut warpui::ViewContext<V>,
|
||||
ctx: &mut galaxyui::ViewContext<V>,
|
||||
) {
|
||||
let ai_client = ServerApiProvider::handle(ctx).as_ref(ctx).get_ai_client();
|
||||
let artifact_uid = artifact_uid.to_string();
|
||||
@@ -395,10 +395,10 @@ pub fn download_file_artifact<V: warpui::View>(
|
||||
);
|
||||
}
|
||||
|
||||
fn open_file_download_result<V: warpui::View>(
|
||||
fn open_file_download_result<V: galaxyui::View>(
|
||||
artifact_uid: &str,
|
||||
artifact: ArtifactDownloadResponse,
|
||||
ctx: &mut warpui::ViewContext<V>,
|
||||
ctx: &mut galaxyui::ViewContext<V>,
|
||||
) {
|
||||
match artifact {
|
||||
ArtifactDownloadResponse::File { .. } => {
|
||||
@@ -419,9 +419,9 @@ fn open_file_download_result<V: warpui::View>(
|
||||
}
|
||||
|
||||
#[cfg(feature = "local_fs")]
|
||||
fn open_file_download_picker<V: warpui::View>(
|
||||
fn open_file_download_picker<V: galaxyui::View>(
|
||||
artifact: ArtifactDownloadResponse,
|
||||
ctx: &mut warpui::ViewContext<V>,
|
||||
ctx: &mut galaxyui::ViewContext<V>,
|
||||
) {
|
||||
let mut config = SaveFilePickerConfiguration::new()
|
||||
.with_default_filename(default_download_filename(&artifact));
|
||||
@@ -430,7 +430,7 @@ fn open_file_download_picker<V: warpui::View>(
|
||||
}
|
||||
|
||||
ctx.open_save_file_picker(
|
||||
move |path_opt: Option<String>, _me: &mut V, ctx: &mut warpui::ViewContext<V>| {
|
||||
move |path_opt: Option<String>, _me: &mut V, ctx: &mut galaxyui::ViewContext<V>| {
|
||||
let Some(path) = path_opt else {
|
||||
return;
|
||||
};
|
||||
@@ -468,10 +468,10 @@ fn open_file_download_picker<V: warpui::View>(
|
||||
);
|
||||
}
|
||||
|
||||
fn show_file_download_toast<V: warpui::View>(
|
||||
fn show_file_download_toast<V: galaxyui::View>(
|
||||
artifact_uid: &str,
|
||||
toast: DismissibleToast<WorkspaceAction>,
|
||||
ctx: &mut warpui::ViewContext<V>,
|
||||
ctx: &mut galaxyui::ViewContext<V>,
|
||||
) {
|
||||
let toast_id = format!("artifact_download:{artifact_uid}");
|
||||
let window_id = ctx.window_id();
|
||||
|
||||
@@ -153,8 +153,8 @@ fn default_download_filename_falls_back_to_artifact_uid_with_extension() {
|
||||
|
||||
#[test]
|
||||
fn converts_graphql_file_artifact() {
|
||||
let artifact = Artifact::try_from(warp_graphql::ai::AIConversationArtifact::FileArtifact(
|
||||
warp_graphql::ai::FileArtifact {
|
||||
let artifact = Artifact::try_from(galaxy_graphql::ai::AIConversationArtifact::FileArtifact(
|
||||
galaxy_graphql::ai::FileArtifact {
|
||||
artifact_uid: "artifact-file-1".into(),
|
||||
filepath: "outputs/report.txt".to_string(),
|
||||
mime_type: "text/plain".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user