first pass of merging in warp (doesn't build)

This commit is contained in:
Ryan Ward
2026-07-01 16:08:58 -05:00
parent 2f64909469
commit 4770ac06b5
3662 changed files with 414574 additions and 89772 deletions
+7 -8
View File
@@ -3,15 +3,14 @@ use std::env::current_dir;
use galaxy_core::ui::appearance::Appearance;
use galaxyui::App;
use crate::{
cloud_object::model::persistence::CloudModel,
network::NetworkStatus,
server::{cloud_objects::update_manager::UpdateManager, sync_queue::SyncQueue},
workspaces::{team_tester::TeamTesterStatus, user_workspaces::UserWorkspaces},
GlobalResourceHandles, GlobalResourceHandlesProvider,
};
use super::expand_dirs;
use crate::cloud_object::model::persistence::CloudModel;
use crate::network::NetworkStatus;
use crate::server::cloud_objects::update_manager::UpdateManager;
use crate::server::sync_queue::SyncQueue;
use crate::workspaces::team_tester::TeamTesterStatus;
use crate::workspaces::user_workspaces::UserWorkspaces;
use crate::{GlobalResourceHandles, GlobalResourceHandlesProvider};
#[test]
fn test_expand_directories() {
+18 -20
View File
@@ -1,29 +1,27 @@
use crate::{
appearance::Appearance,
cloud_object::{model::persistence::CloudModel, CloudObject, Owner},
server::{ids::SyncId, sync_queue::SyncQueue},
themes::theme::GalaxyTheme,
workspaces::user_workspaces::UserWorkspaces,
};
use pathfinder_geometry::vector::vec2f;
use galaxy_core::ui::theme::Fill;
use galaxyui::elements::{
Align, Border, ChildAnchor, ClippedScrollStateHandle, ClippedScrollable, ConstrainedBox,
Container, CornerRadius, CrossAxisAlignment, Flex, Highlight, MouseStateHandle,
OffsetPositioning, ParentAnchor, ParentElement, ParentOffsetBounds, Radius, ScrollbarWidth,
Shrinkable, Stack, Text,
};
use galaxyui::platform::{FilePickerConfiguration, FileType};
use galaxyui::presenter::ChildView;
use galaxyui::ui_components::button::ButtonVariant;
use galaxyui::ui_components::components::{UiComponent, UiComponentStyles};
use galaxyui::{
elements::{
Align, Border, ChildAnchor, ClippedScrollStateHandle, ClippedScrollable, ConstrainedBox,
Container, CornerRadius, CrossAxisAlignment, Flex, Highlight, MouseStateHandle,
OffsetPositioning, ParentAnchor, ParentElement, ParentOffsetBounds, Radius, ScrollbarWidth,
Shrinkable, Stack, Text,
},
platform::{FilePickerConfiguration, FileType},
presenter::ChildView,
ui_components::{
button::ButtonVariant,
components::{UiComponent, UiComponentStyles},
},
AppContext, Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle,
};
use pathfinder_geometry::vector::vec2f;
use super::modal_body::{ImportModalBody, ImportModalBodyAction, ImportModalBodyEvent};
use crate::appearance::Appearance;
use crate::cloud_object::model::persistence::CloudModel;
use crate::cloud_object::{CloudObject, Owner};
use crate::server::ids::SyncId;
use crate::server::sync_queue::SyncQueue;
use crate::themes::theme::WarpTheme;
use crate::workspaces::user_workspaces::UserWorkspaces;
const CLOSE_BUTTON_SIZE: f32 = 24.;
const HEADER_FONT_SIZE: f32 = 16.;
+23 -30
View File
@@ -1,38 +1,31 @@
use futures_util::stream::AbortHandle;
use galaxyui::{
elements::{
Align, ConstrainedBox, Container, CornerRadius, CrossAxisAlignment, Flex,
MainAxisAlignment, MainAxisSize, MouseStateHandle, ParentElement, Radius,
},
platform::{file_picker::FilePickerError, Cursor},
ui_components::{
button::{ButtonVariant, TextAndIcon, TextAndIconAlignment},
components::{Coords, UiComponent, UiComponentStyles},
},
AppContext, Element, Entity, ModelHandle, SingletonEntity, TypedActionView, View, ViewContext,
};
use pathfinder_geometry::vector::vec2f;
use std::path::PathBuf;
use crate::{
appearance::Appearance,
cloud_object::Owner,
server::{
ids::{ClientId, SyncId},
sync_queue::SyncQueue,
},
ui_components::icons::Icon,
view_components::DismissibleToast,
workspace::ToastStack,
use futures_util::stream::AbortHandle;
use pathfinder_geometry::vector::vec2f;
use galaxyui::elements::{
Align, ConstrainedBox, Container, CornerRadius, CrossAxisAlignment, Flex, MainAxisAlignment,
MainAxisSize, MouseStateHandle, ParentElement, Radius,
};
use galaxyui::platform::file_picker::FilePickerError;
use galaxyui::platform::Cursor;
use galaxyui::ui_components::button::{ButtonVariant, TextAndIcon, TextAndIconAlignment};
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
use galaxyui::{
AppContext, Element, Entity, ModelHandle, SingletonEntity, TypedActionView, View, ViewContext,
};
use super::{
modal::BODY_HEIGHT,
nodes::{
expand_dirs, parse_file, FileContent, FileId, FileUploadState, FolderId, UploadResult,
},
queue::{ImportQueue, ImportQueueArgs, ImportQueueEvent, ParentId, RequestContent},
use super::modal::BODY_HEIGHT;
use super::nodes::{
expand_dirs, parse_file, FileContent, FileId, FileUploadState, FolderId, UploadResult,
};
use super::queue::{ImportQueue, ImportQueueArgs, ImportQueueEvent, ParentId, RequestContent};
use crate::appearance::Appearance;
use crate::cloud_object::Owner;
use crate::server::ids::{ClientId, SyncId};
use crate::server::sync_queue::SyncQueue;
use crate::ui_components::icons::Icon;
use crate::view_components::DismissibleToast;
use crate::workspace::ToastStack;
const FILE_PICKER_BUTTON_WIDTH: f32 = 250.;
const BUTTON_FONT_SIZE: f32 = 14.;
+3 -3
View File
@@ -1,8 +1,8 @@
use std::{collections::HashMap, path::PathBuf};
use crate::drive::import::nodes::{UploadResult, UploadStatus};
use std::collections::HashMap;
use std::path::PathBuf;
use super::{FileId, FileNode, FileType, FileUploadState, FolderId, FolderNode, ImportedNode};
use crate::drive::import::nodes::{UploadResult, UploadStatus};
fn mock_tree() -> FileUploadState {
let mut folder_id_to_node = HashMap::new();
+23 -30
View File
@@ -1,36 +1,31 @@
use crate::{
drive::{cloud_object_styling::warp_drive_icon_color, DriveObjectType},
notebooks::post_process_notebook,
workflows::{
export_workflow::export_deserialize, workflow::Workflow, workflow_enum::WorkflowEnum,
},
};
use std::collections::HashMap;
use std::ffi::OsStr;
use std::ops::{Add, AddAssign, SubAssign};
use std::path::{Path, PathBuf};
use anyhow::Result;
use async_recursion::async_recursion;
use futures_lite::StreamExt;
use galaxyui::{
elements::{
Align, ConstrainedBox, Container, CornerRadius, CrossAxisAlignment, Flex, Hoverable,
MouseStateHandle, ParentElement, Radius, Shrinkable,
},
platform::Cursor,
ui_components::components::{UiComponent, UiComponentStyles},
Element,
};
use pathfinder_color::ColorU;
use std::{
collections::HashMap,
ffi::OsStr,
ops::{Add, AddAssign, SubAssign},
path::{Path, PathBuf},
};
use crate::{
appearance::Appearance, notebooks::file::is_markdown_file, server::ids::ClientId,
themes::theme::Fill, ui_components::icons::Icon,
use galaxyui::elements::{
Align, ConstrainedBox, Container, CornerRadius, CrossAxisAlignment, Flex, Hoverable,
MouseStateHandle, ParentElement, Radius, Shrinkable,
};
use warpui::platform::Cursor;
use warpui::ui_components::components::{UiComponent, UiComponentStyles};
use warpui::Element;
use super::modal_body::{ImportModalBodyAction, BASE_INDENT, IMPORT_FONT_SIZE, INDENT_MARGIN};
use crate::appearance::Appearance;
use crate::drive::cloud_object_styling::warp_drive_icon_color;
use crate::drive::DriveObjectType;
use crate::notebooks::file::is_markdown_file;
use crate::server::ids::ClientId;
use crate::themes::theme::Fill;
use crate::ui_components::icons::Icon;
use crate::workflows::export_workflow::export_deserialize;
use crate::workflows::workflow::Workflow;
use crate::workflows::workflow_enum::WorkflowEnum;
#[cfg(test)]
#[path = "node_tests.rs"]
@@ -756,7 +751,7 @@ impl FileUploadState {
folder.server_id = Some(server_id.clone());
// If a folder has no children or all of its children complete syncing,
// we need to bubble the state up in the folder hierachy tree.
// we need to bubble the state up in the folder hierarchy tree.
if folder.children().is_empty() || folder.all_children_synced {
folder.status = UploadStatus::Loaded(server_id);
true
@@ -898,9 +893,7 @@ impl FileUploadState {
pub(super) async fn parse_file(path: PathBuf, file_type: FileType) -> Result<FileContent> {
match file_type {
FileType::Notebook => Ok(FileContent::Notebook(post_process_notebook(
&async_fs::read_to_string(path).await?,
))),
FileType::Notebook => Ok(FileContent::Notebook(async_fs::read_to_string(path).await?)),
FileType::Workflow => {
let file = async_fs::read(path).await?;
let mut workflow_enums: HashMap<ClientId, WorkflowEnum> = HashMap::new();
+12 -15
View File
@@ -2,20 +2,17 @@ use std::collections::HashMap;
use galaxyui::{Entity, ModelContext, SingletonEntity};
use crate::{
cloud_object::{model::persistence::CloudModel, CloudObjectEventEntrypoint, Owner},
drive::folders::FolderId,
notebooks::CloudNotebookModel,
server::{
cloud_objects::update_manager::{
InitiatedBy, ObjectOperation, OperationSuccessType, UpdateManager, UpdateManagerEvent,
},
ids::{ClientId, SyncId},
},
workflows::{workflow::Workflow, workflow_enum::WorkflowEnum},
};
use super::nodes::{self, FileId};
use crate::cloud_object::model::persistence::CloudModel;
use crate::cloud_object::{CloudObjectEventEntrypoint, Owner};
use crate::drive::folders::FolderId;
use crate::notebooks::CloudNotebookModel;
use crate::server::cloud_objects::update_manager::{
InitiatedBy, ObjectOperation, OperationSuccessType, UpdateManager, UpdateManagerEvent,
};
use crate::server::ids::{ClientId, SyncId};
use crate::workflows::workflow::Workflow;
use crate::workflows::workflow_enum::WorkflowEnum;
pub(super) enum ImportQueueEvent {
FileCompleted {
@@ -105,7 +102,7 @@ pub(super) struct ImportQueue {
impl ImportQueue {
pub fn new(ctx: &mut ModelContext<Self>) -> Self {
let update_manager = UpdateManager::handle(ctx);
ctx.subscribe_to_model(&update_manager, |me, event, ctx| {
ctx.subscribe_to_model(&update_manager, |me, _, event, ctx| {
me.handle_update_manager_event(event, ctx);
});
@@ -117,7 +114,7 @@ impl ImportQueue {
}
}
// Whether all dependcies of an item has been sync-ed.
// Whether all dependencies of an item has been sync-ed.
fn dependency_synced(&self, item: &ImportQueueArgs) -> bool {
match &item.parent_id {
ParentId::FolderToUpload(id) => self