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
+3 -3
View File
@@ -16,7 +16,7 @@ We defined `CloudEnvVarCollection` in `mod.rs`, which implements the `GenericClo
The implementation of EVCs as a Warp Drive object is in `app/src/drive/items/env_var_collection.rs`, where code for the Warp Drive preview and click action is located.
Code relevant to edit collisions and fetching EVCs from the server is in `app/src/server/server_api.rs` and `app/src/server/update_manager.rs`. We aimed to maintain a similar liveness property to workflows, meaning a concurrent edit made by another user requires one to check out the other's edit before committing their own.
Code relevant to edit collisions and fetching EVCs from the server is in `app/src/server/server_api.rs` and `app/src/server/cloud_objects/update_manager.rs`. We aimed to maintain a similar liveness property to workflows, meaning a concurrent edit made by another user requires one to check out the other's edit before committing their own.
## Client Side
@@ -31,12 +31,12 @@ We'll describe our core UI components by line-by-lining each file in the view di
- `env_var_collection.rs` — Contains the core functions and implementation of the `EnvVarCollectionView`. Functions like "open_new_env_var_collection" and "load" (which loads an existing EVC or reloads an open EVC after a collision) are documented with descriptions of their relevance.
- `secrets.rs` — separate section below as it's a crucial flow
- `command_dialog`
- `view.rs` — Defines the view for the command dialog.
- `command_dialog_view.rs` — Defines the view for the command dialog.
- `mod.rs` — Contains functionality related to the command dialog i.e. (listening to events from the dialog)
- `unsaved_changes_dialog.rs` — Contains code related to the dialog presented when a user tries to close the pane without saving changes.
- `menus.rs` — Defines menu-related code for EVCs. This includes secret menus (linked to the key icon or a rendered secret/command) and pane-bound menus (overflow menu with object-specific actions and the context menu with split pane actions, triggered on right-click).
- `editors.rs` — Defines code for initializing editors, handling their events (such as tab navigation), and rendering the "metadata" section.
- `section_headers_and_footers.rs` — Contains render functions for components like the trash overflow banner or the save button in the footer.
- `fixed_view_components.rs` — Contains render functions for components like the trash overflow banner or the save button in the footer.
- `active_env_var_collection_data.rs` — Tracks the currently open EVC, including the current revision and saving status.
### Secrets
@@ -1,23 +1,17 @@
use crate::{
cloud_object::{
breadcrumbs::ContainingObject,
model::{persistence::CloudModelEvent, view::CloudViewModel},
CloudObject, Owner, Revision, Space,
},
drive::sharing::{ContentEditability, SharingAccessLevel},
env_vars::CloudEnvVarCollection,
server::{
cloud_objects::update_manager::{
ObjectOperation, OperationSuccessType, UpdateManagerEvent,
},
ids::{ClientId, ServerId, SyncId},
},
AppContext, CloudModel, UpdateManager,
};
use galaxyui::{Entity, ModelContext, SingletonEntity};
use super::CloudEnvVarCollectionModel;
use crate::cloud_object::breadcrumbs::ContainingObject;
use crate::cloud_object::model::persistence::CloudModelEvent;
use crate::cloud_object::model::view::CloudViewModel;
use crate::cloud_object::{CloudObject, Owner, Revision, Space};
use crate::drive::sharing::{ContentEditability, SharingAccessLevel};
use crate::env_vars::CloudEnvVarCollection;
use crate::server::cloud_objects::update_manager::{
ObjectOperation, OperationSuccessType, UpdateManagerEvent,
};
use crate::server::ids::{ClientId, ServerId, SyncId};
use crate::{AppContext, CloudModel, UpdateManager};
#[derive(Default, Clone)]
pub enum ActiveEnvVarCollection {
@@ -50,13 +44,13 @@ impl ActiveEnvVarCollectionData {
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);
});
let cloud_model = CloudModel::handle(ctx);
ctx.subscribe_to_model(&cloud_model, |me, event, ctx| {
ctx.subscribe_to_model(&cloud_model, |me, _, event, ctx| {
me.handle_cloud_model_event(event, ctx);
});
@@ -168,7 +162,7 @@ impl ActiveEnvVarCollectionData {
let new_id = ClientId::default();
// Set the active env var collection to be an uncommited collection
// Set the active env var collection to be an uncommitted collection
self.active_env_var_collection = ActiveEnvVarCollection::NewEnvVarCollection(Box::new(
CloudEnvVarCollection::new_local(
CloudEnvVarCollectionModel::default(),
+36 -36
View File
@@ -1,43 +1,43 @@
use crate::{
ai::agent::icons::{yellow_running_icon, yellow_stop_icon},
view_components::compactible_action_button::{
CompactibleActionButton, RenderCompactibleActionButton, SMALL_SIZE_SWITCH_THRESHOLD,
},
};
use galaxy_core::semantic_selection::SemanticSelection;
use galaxy_core::{features::FeatureFlag, ui::Icon};
use galaxyui::{
elements::{
get_rich_content_position_id, Border, Clipped, Container, CornerRadius, CrossAxisAlignment,
Flex, FormattedTextElement, MouseStateHandle, ParentElement, Radius, SavePosition,
SelectableArea, SelectionHandle,
},
keymap::{FixedBinding, Keystroke},
AppContext, Element, Entity, EntityId, FocusContext, SingletonEntity, TypedActionView, View,
ViewContext,
};
use lazy_static::lazy_static;
use parking_lot::RwLock;
use settings::Setting as _;
use std::borrow::Cow;
use std::rc::Rc;
use std::sync::Arc;
use crate::{
ai::blocklist::block::view_impl::{CONTENT_HORIZONTAL_PADDING, CONTENT_ITEM_VERTICAL_MARGIN},
ai::blocklist::inline_action::inline_action_header::INLINE_ACTION_HORIZONTAL_PADDING,
ai::blocklist::inline_action::inline_action_header::{
ExpandedConfig, HeaderConfig, InteractionMode,
},
ai::blocklist::inline_action::inline_action_icons::{self},
appearance::Appearance,
settings::InputModeSettings,
terminal::{
block_list_element::BlockListMenuSource, block_list_viewport::InputMode,
view::TerminalAction,
},
ui_components::blended_colors,
view_components::action_button::{ButtonSize, KeystrokeSource, NakedTheme, PrimaryTheme},
use lazy_static::lazy_static;
use parking_lot::RwLock;
use settings::Setting as _;
use galaxy_core::features::FeatureFlag;
use galaxy_core::semantic_selection::SemanticSelection;
use galaxy_core::ui::Icon;
use galaxyui::elements::{
get_rich_content_position_id, Border, Clipped, Container, CornerRadius, CrossAxisAlignment,
Flex, FormattedTextElement, MouseStateHandle, ParentElement, Radius, SavePosition,
SelectableArea, SelectionHandle,
};
use galaxyui::keymap::{FixedBinding, Keystroke};
use galaxyui::{
AppContext, Element, Entity, EntityId, FocusContext, SingletonEntity, TypedActionView, View,
ViewContext,
};
use crate::ai::agent::icons::{yellow_running_icon, yellow_stop_icon};
use crate::ai::blocklist::block::view_impl::{
CONTENT_HORIZONTAL_PADDING, CONTENT_ITEM_VERTICAL_MARGIN,
};
use crate::ai::blocklist::inline_action::inline_action_header::{
ExpandedConfig, HeaderConfig, InteractionMode, INLINE_ACTION_HORIZONTAL_PADDING,
};
use crate::ai::blocklist::inline_action::inline_action_icons::{self};
use crate::appearance::Appearance;
use crate::settings::InputModeSettings;
use crate::terminal::block_list_element::BlockListMenuSource;
use crate::terminal::block_list_viewport::InputMode;
use crate::terminal::view::TerminalAction;
use crate::ui_components::blended_colors;
use crate::view_components::action_button::{
ButtonSize, KeystrokeSource, NakedTheme, PrimaryTheme,
};
use crate::view_components::compactible_action_button::{
CompactibleActionButton, RenderCompactibleActionButton, SMALL_SIZE_SWITCH_THRESHOLD,
};
/// The vertical padding applied to the env var collection block's content body.
+14 -14
View File
@@ -1,18 +1,17 @@
use crate::{
cloud_object::{model::persistence::CloudModel, Owner},
env_vars::view::env_var_collection::EnvVarCollectionView,
pane_group::{EnvVarCollectionPane, PaneContent},
safe_warn,
server::{
cloud_objects::update_manager::{
ObjectOperation, OperationSuccessType, UpdateManager, UpdateManagerEvent,
},
ids::SyncId,
},
PaneViewLocator, WindowId,
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use warpui::{Entity, EntityId, ModelContext, ModelHandle, SingletonEntity, WeakViewHandle};
use crate::cloud_object::model::persistence::CloudModel;
use crate::cloud_object::Owner;
use crate::env_vars::view::env_var_collection::EnvVarCollectionView;
use crate::pane_group::{EnvVarCollectionPane, PaneContent};
use crate::server::cloud_objects::update_manager::{
ObjectOperation, OperationSuccessType, UpdateManager, UpdateManagerEvent,
};
use galaxyui::{Entity, EntityId, ModelContext, SingletonEntity, WeakViewHandle};
use std::collections::{hash_map::Entry, HashMap};
use crate::server::ids::SyncId;
use crate::{safe_warn, PaneViewLocator, WindowId};
pub struct EnvVarCollectionManager {
panes_by_hashed_id: HashMap<String, EnvVarCollectionPaneData>,
@@ -175,6 +174,7 @@ impl EnvVarCollectionManager {
fn handle_update_manager_event(
&mut self,
_: ModelHandle<UpdateManager>,
event: &UpdateManagerEvent,
ctx: &mut ModelContext<Self>,
) {
+33 -99
View File
@@ -1,28 +1,25 @@
use galaxy_util::path::ShellFamily;
pub use cloud_object_models::{
CloudEnvVarCollection, CloudEnvVarCollectionModel, EnvVar, EnvVarCollection, EnvVarValue,
};
use itertools::Itertools;
use serde::{Deserialize, Serialize};
use view::command_dialog::EnvVarSecretCommand;
use galaxy_util::path::ShellFamily;
pub mod active_env_var_collection_data;
pub mod env_var_collection_block;
pub mod manager;
pub mod view;
use crate::{
cloud_object::{
model::{
generic_string_model::{GenericStringModel, GenericStringObjectId, StringModel},
json_model::{JsonModel, JsonSerializer},
},
GenericCloudObject, GenericStringObjectFormat, GenericStringObjectUniqueKey,
JsonObjectType, Revision, ServerCloudObject,
},
drive::items::{env_var_collection::WarpDriveEnvVarCollection, WarpDriveItem},
external_secrets::ExternalSecret,
server::{ids::SyncId, sync_queue::QueueItem},
terminal::shell::ShellType,
Appearance, CloudObjectTypeAndId,
use crate::cloud_object::model::generic_string_model::StringModel;
use crate::cloud_object::model::json_model::JsonModel;
use crate::cloud_object::{
GenericStringObjectFormat, GenericStringObjectUniqueKey, JsonObjectType, Revision,
};
use crate::drive::items::env_var_collection::WarpDriveEnvVarCollection;
use crate::drive::items::WarpDriveItem;
use crate::server::ids::SyncId;
use crate::server::sync_queue::QueueItem;
use crate::terminal::shell::ShellType;
use crate::{Appearance, CloudObjectTypeAndId};
#[derive(Clone, Debug, PartialEq)]
pub enum EnvVarCollectionType {
@@ -38,48 +35,12 @@ impl EnvVarCollectionType {
}
}
pub type CloudEnvVarCollection =
GenericCloudObject<GenericStringObjectId, CloudEnvVarCollectionModel>;
pub type CloudEnvVarCollectionModel = GenericStringModel<EnvVarCollection, JsonSerializer>;
/// Defines the data model for a single environment variable
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Default)]
pub struct EnvVar {
// Variable name
pub name: String,
// Variable value
pub value: EnvVarValue,
// Description of variable
pub description: Option<String>,
pub trait EnvVarExt {
fn get_initialization_string(&self, shell_type: ShellType) -> String;
}
/// Defines the various forms a value can take
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub enum EnvVarValue {
// Represents a string variable, i.e. PORT=4000
Constant(String),
// Represents a computed secret, i.e. gcloud print auth token
Command(EnvVarSecretCommand),
// Represents a secret from an external secret manager
Secret(ExternalSecret),
}
impl Default for EnvVarValue {
fn default() -> Self {
EnvVarValue::Constant(String::new())
}
}
impl EnvVar {
pub fn new(name: String, value: String, description: Option<String>) -> Self {
Self {
name,
value: EnvVarValue::Constant(value),
description,
}
}
pub fn get_initialization_string(&self, shell_type: ShellType) -> String {
impl EnvVarExt for EnvVar {
fn get_initialization_string(&self, shell_type: ShellType) -> String {
let shell_family = ShellFamily::from(shell_type);
let name = shell_family.escape(&self.name);
let value = get_init_command_for_env_var(&self.value, shell_family);
@@ -111,38 +72,24 @@ fn get_init_command_for_env_var(value: &EnvVarValue, shell_family: ShellFamily)
}
}
/// Defines the data model for a cloud synced collection of environment variables.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Default)]
pub struct EnvVarCollection {
// Collection title
pub title: Option<String>,
// Description of collection
pub description: Option<String>,
// Environment variables associated with this collection
pub vars: Vec<EnvVar>,
pub trait EnvVarCollectionExt {
fn export_variables_for_shell(&self, shell_type: ShellType) -> String;
}
impl EnvVarCollection {
#[allow(dead_code)]
pub fn new(title: Option<String>, description: Option<String>, vars: Vec<EnvVar>) -> Self {
Self {
title,
description,
vars,
}
impl EnvVarCollectionExt for EnvVarCollection {
fn export_variables_for_shell(&self, shell_type: ShellType) -> String {
serialize_variables_for_shell(self.key_value_iter(), shell_type)
}
}
trait EnvVarCollectionKeyValueIter {
fn key_value_iter(&self) -> impl Iterator<Item = (&str, &EnvVarValue)>;
}
impl EnvVarCollectionKeyValueIter for EnvVarCollection {
fn key_value_iter(&self) -> impl Iterator<Item = (&str, &EnvVarValue)> {
self.vars.iter().map(|var| (var.name.as_str(), &var.value))
}
pub fn export_variables(&self, delimeter: &str, shell_family: ShellFamily) -> String {
serialize_variables_internal(self.key_value_iter(), "", "=", "", delimeter, shell_family)
}
pub fn export_variables_for_shell(&self, shell_type: ShellType) -> String {
serialize_variables_for_shell(self.key_value_iter(), shell_type)
}
}
impl StringModel for EnvVarCollection {
@@ -188,13 +135,6 @@ impl StringModel for EnvVarCollection {
None
}
fn new_from_server_update(&self, server_cloud_object: &ServerCloudObject) -> Option<Self> {
if let ServerCloudObject::EnvVarCollection(server_envvar_collection) = server_cloud_object {
return Some(server_envvar_collection.model.clone().string_model);
}
None
}
fn should_show_activity_toasts() -> bool {
true
}
@@ -237,12 +177,6 @@ impl JsonModel for EnvVarCollection {
}
}
impl PartialEq<CloudEnvVarCollection> for CloudEnvVarCollection {
fn eq(&self, other: &CloudEnvVarCollection) -> bool {
self.model().string_model == other.model().string_model && self.id == other.id
}
}
pub fn serialize_variables_for_shell<'s, I: IntoIterator<Item = (&'s str, &'s EnvVarValue)>>(
pairs: I,
shell_type: ShellType,
@@ -264,17 +198,17 @@ pub fn serialize_variables_for_shell<'s, I: IntoIterator<Item = (&'s str, &'s En
// Prefix — what's prepended to each variable
// Separator — what separates the variable name from the value
// Postfix — what's appended to the end of each variable
// Delimeter — what separates one variable from the next one
// Delimiter — what separates one variable from the next one
// set -x var_name var_value; set -x name2 value2;
// ------ - - -
// ^ ^ ^ ^
// prefix separator postfix delimeter (in this case 4 spaces, usually one space or newline)
// prefix separator postfix delimiter (in this case 4 spaces, usually one space or newline)
fn serialize_variables_internal<'s, I: IntoIterator<Item = (&'s str, &'s EnvVarValue)>>(
pairs: I,
prefix: &str,
separator: &str,
postfix: &str,
delimeter: &str,
delimiter: &str,
shell_family: ShellFamily,
) -> String {
pairs
@@ -290,5 +224,5 @@ fn serialize_variables_internal<'s, I: IntoIterator<Item = (&'s str, &'s EnvVarV
)
})
.collect_vec()
.join(delimeter)
.join(delimiter)
}
@@ -1,25 +1,22 @@
use galaxy_core::ui::appearance::Appearance;
use galaxy_editor::editor::NavigationKey;
use galaxyui::elements::{
Border, ConstrainedBox, Container, CornerRadius, Flex, MouseStateHandle, ParentElement, Radius,
Shrinkable,
};
use galaxyui::ui_components::button::ButtonVariant;
use galaxyui::ui_components::components::{UiComponent, UiComponentStyles};
use galaxyui::{
elements::{
Border, ConstrainedBox, Container, CornerRadius, Flex, MouseStateHandle, ParentElement,
Radius, Shrinkable,
},
ui_components::{
button::ButtonVariant,
components::{UiComponent, UiComponentStyles},
},
AppContext, Element, Entity, FocusContext, SingletonEntity, TypedActionView, View, ViewContext,
ViewHandle,
};
use super::EnvVarSecretCommand;
use crate::editor::{
EditorOptions, EditorView, Event, PropagateAndNoOpNavigationKeys, SingleLineEditorOptions,
TextOptions,
};
use super::EnvVarSecretCommand;
const COMMAND_EDITOR_MIN_LINES: f32 = 6.;
const SPAN_FONT_SIZE: f32 = 16.;
const BUTTON_FONT_SIZE: f32 = 14.;
+3 -9
View File
@@ -1,19 +1,13 @@
use serde::{Deserialize, Serialize};
pub use cloud_object_models::EnvVarSecretCommand;
use galaxyui::ViewContext;
use super::env_var_collection::{EnvVarCollectionView, VariableRowIndex};
use crate::env_vars::{active_env_var_collection_data::SavingStatus, EnvVarValue};
use crate::env_vars::active_env_var_collection_data::SavingStatus;
use crate::env_vars::EnvVarValue;
mod command_dialog_view;
pub(super) use command_dialog_view::{EnvVarCommandDialog, EnvVarCommandDialogEvent};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct EnvVarSecretCommand {
pub name: String,
pub command: String,
}
impl EnvVarCollectionView {
pub(super) fn display_command_dialog(
&mut self,
+14 -20
View File
@@ -1,27 +1,21 @@
use galaxy_editor::editor::NavigationKey;
use galaxyui::{
elements::{
Align, ConstrainedBox, Container, Flex, ParentElement, SavePosition, Shrinkable, Stack,
},
fonts::FamilyId,
ui_components::components::{Coords, UiComponent, UiComponentStyles},
AppContext, Element, ViewContext, ViewHandle,
use galaxyui::elements::{
Align, ConstrainedBox, Container, Flex, ParentElement, SavePosition, Shrinkable, Stack,
};
use warpui::fonts::FamilyId;
use warpui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
use warpui::{AppContext, Element, ViewContext, ViewHandle};
use crate::{
editor::{
EditOrigin, EditorOptions, EditorView, Event as EditorEvent, InteractionState,
PropagateAndNoOpNavigationKeys, SingleLineEditorOptions, TextOptions,
},
env_vars::{
active_env_var_collection_data::SavingStatus,
view::env_var_collection::{
EditorType, EnvVarCollectionView, DESCRIPTION_EDITOR_POSITION, ROW_SPACING,
},
EnvVarValue,
},
Appearance,
use crate::editor::{
EditOrigin, EditorOptions, EditorView, Event as EditorEvent, InteractionState,
PropagateAndNoOpNavigationKeys, SingleLineEditorOptions, TextOptions,
};
use crate::env_vars::active_env_var_collection_data::SavingStatus;
use crate::env_vars::view::env_var_collection::{
EditorType, EnvVarCollectionView, DESCRIPTION_EDITOR_POSITION, ROW_SPACING,
};
use crate::env_vars::EnvVarValue;
use crate::Appearance;
// Metadata labels (name and description)
const LABEL_FONT_SIZE: f32 = 12.;
+51 -62
View File
@@ -1,72 +1,61 @@
use pathfinder_geometry::vector::{vec2f, Vector2F};
use galaxy_core::features::FeatureFlag;
use galaxyui::clipboard::ClipboardContent;
use galaxyui::elements::{
Align, AnchorPair, ChildAnchor, Clipped, ClippedScrollStateHandle, ClippedScrollable,
ConstrainedBox, Container, CrossAxisAlignment, DispatchEventResult, EventHandler, Fill, Flex,
MainAxisAlignment, MainAxisSize, MouseStateHandle, OffsetPositioning, OffsetType, ParentAnchor,
ParentElement, ParentOffsetBounds, PositioningAxis, SavePosition, ScrollbarWidth, Shrinkable,
Stack, XAxisAnchor, YAxisAnchor,
};
use galaxyui::keymap::EditableBinding;
use galaxyui::platform::Cursor;
use galaxyui::presenter::ChildView;
use galaxyui::ui_components::components::UiComponent;
use galaxyui::{
clipboard::ClipboardContent,
elements::{
Align, AnchorPair, ChildAnchor, Clipped, ClippedScrollStateHandle, ClippedScrollable,
ConstrainedBox, Container, CrossAxisAlignment, DispatchEventResult, EventHandler, Fill,
Flex, MainAxisAlignment, MainAxisSize, MouseStateHandle, OffsetPositioning, OffsetType,
ParentAnchor, ParentElement, ParentOffsetBounds, PositioningAxis, SavePosition,
ScrollbarWidth, Shrinkable, Stack, XAxisAnchor, YAxisAnchor,
},
id,
keymap::EditableBinding,
platform::Cursor,
presenter::ChildView,
ui_components::components::UiComponent,
AppContext, BlurContext, Element, Entity, FocusContext, ModelAsRef, ModelHandle,
id, AppContext, BlurContext, Element, Entity, FocusContext, ModelAsRef, ModelHandle,
SingletonEntity, TypedActionView, View, ViewContext, ViewHandle, WindowId,
};
use crate::{
ai::blocklist::block::secret_redaction::find_secrets_in_text_with_levels,
cloud_object::{
breadcrumbs::ContainingObject,
model::persistence::{CloudModel, CloudModelEvent},
CloudObjectEventEntrypoint, Owner,
},
drive::{
items::WarpDriveItemId,
sharing::{ContentEditability, ShareableObject},
},
editor::EditorView,
env_vars::{
active_env_var_collection_data::{
ActiveEnvVarCollection, ActiveEnvVarCollectionData, ActiveEnvVarCollectionDataEvent,
SavingStatus, TrashStatus,
},
CloudEnvVarCollection, CloudEnvVarCollectionModel, EnvVar, EnvVarCollection,
EnvVarCollectionType, EnvVarValue,
},
external_secrets::SecretManager,
menu::MenuItem,
network::{NetworkStatus, NetworkStatusEvent},
pane_group::{
focus_state::PaneFocusHandle, pane::view, BackingView, PaneConfiguration, PaneEvent,
},
search::external_secrets::view::ExternalSecretsMenu,
send_telemetry_from_ctx,
server::{
cloud_objects::update_manager::{FetchSingleObjectOption, UpdateManager},
ids::{ServerId, SyncId},
},
terminal::{model::secrets::SecretLevel, safe_mode_settings::get_secret_obfuscation_mode},
ui_components::{
breadcrumb::{render_breadcrumbs, BreadcrumbState},
buttons::icon_button,
icons::Icon,
menu_button::{
highlight_icon_button_with_context_menu, icon_button_with_context_menu, MenuDirection,
},
},
util::bindings::CustomAction,
view_components::{alert::AlertConfig, Alert, DismissibleToast, ToastType},
workspace::ToastStack,
Appearance, CloudObjectTypeAndId, TelemetryEvent,
use super::command_dialog::EnvVarCommandDialog;
use super::menus::Menus;
use crate::ai::blocklist::block::secret_redaction::find_secrets_in_text_with_levels;
use crate::cloud_object::breadcrumbs::ContainingObject;
use crate::cloud_object::model::persistence::{CloudModel, CloudModelEvent};
use crate::cloud_object::{CloudObjectEventEntrypoint, Owner};
use crate::drive::items::WarpDriveItemId;
use crate::drive::sharing::{ContentEditability, ShareableObject};
use crate::editor::EditorView;
use crate::env_vars::active_env_var_collection_data::{
ActiveEnvVarCollection, ActiveEnvVarCollectionData, ActiveEnvVarCollectionDataEvent,
SavingStatus, TrashStatus,
};
use super::{command_dialog::EnvVarCommandDialog, menus::Menus};
use crate::env_vars::{
CloudEnvVarCollection, CloudEnvVarCollectionModel, EnvVar, EnvVarCollection,
EnvVarCollectionType, EnvVarValue,
};
use crate::external_secrets::SecretManager;
use crate::menu::MenuItem;
use crate::network::{NetworkStatus, NetworkStatusEvent};
use crate::pane_group::focus_state::PaneFocusHandle;
use crate::pane_group::pane::view;
use crate::pane_group::{BackingView, PaneConfiguration, PaneEvent};
use crate::search::external_secrets::view::ExternalSecretsMenu;
use crate::server::cloud_objects::update_manager::{FetchSingleObjectOption, UpdateManager};
use crate::server::ids::{ServerId, SyncId};
use crate::terminal::model::secrets::SecretLevel;
use crate::terminal::safe_mode_settings::get_secret_obfuscation_mode;
use crate::ui_components::breadcrumb::{render_breadcrumbs, BreadcrumbState};
use crate::ui_components::buttons::icon_button;
use crate::ui_components::icons::Icon;
use crate::ui_components::menu_button::{
highlight_icon_button_with_context_menu, icon_button_with_context_menu, MenuDirection,
};
use crate::util::bindings::CustomAction;
use crate::view_components::alert::AlertConfig;
use crate::view_components::{Alert, DismissibleToast, ToastType};
use crate::workspace::ToastStack;
use crate::{send_telemetry_from_ctx, Appearance, CloudObjectTypeAndId, TelemetryEvent};
// Universal
pub(super) const CORE_HORIZONATAL_MARGIN: f32 = 24.;
@@ -1,26 +1,24 @@
use galaxy_core::ui::appearance::Appearance;
use galaxyui::{platform::WindowStyle, App, ViewHandle};
use galaxyui::platform::WindowStyle;
use galaxyui::{App, ViewHandle};
use crate::auth::AuthStateProvider;
use crate::{
cloud_object::model::{actions::ObjectActions, persistence::CloudModel, view::CloudViewModel},
env_vars::{
active_env_var_collection_data::SavingStatus,
view::env_var_collection::EnvVarCollectionView,
},
network::NetworkStatus,
server::{
cloud_objects::update_manager::UpdateManager, server_api::ServerApiProvider,
sync_queue::SyncQueue,
},
settings_view::keybindings::KeybindingChangedNotifier,
test_util::settings::initialize_settings_for_tests,
workspace::ActiveSession,
workspaces::{
team_tester::TeamTesterStatus, user_profiles::UserProfiles, user_workspaces::UserWorkspaces,
},
GlobalResourceHandles, GlobalResourceHandlesProvider,
};
use crate::cloud_object::model::actions::ObjectActions;
use crate::cloud_object::model::persistence::CloudModel;
use crate::cloud_object::model::view::CloudViewModel;
use crate::env_vars::active_env_var_collection_data::SavingStatus;
use crate::env_vars::view::env_var_collection::EnvVarCollectionView;
use crate::network::NetworkStatus;
use crate::server::cloud_objects::update_manager::UpdateManager;
use crate::server::server_api::ServerApiProvider;
use crate::server::sync_queue::SyncQueue;
use crate::settings_view::keybindings::KeybindingChangedNotifier;
use crate::test_util::settings::initialize_settings_for_tests;
use crate::workspace::ActiveSession;
use crate::workspaces::team_tester::TeamTesterStatus;
use crate::workspaces::user_profiles::UserProfiles;
use crate::workspaces::user_workspaces::UserWorkspaces;
use crate::{GlobalResourceHandles, GlobalResourceHandlesProvider};
fn initialize_app(app: &mut App) {
initialize_settings_for_tests(app);
+16 -22
View File
@@ -1,28 +1,22 @@
use galaxy_core::features::FeatureFlag;
use galaxyui::{
elements::{
Align, ConstrainedBox, Container, CrossAxisAlignment, Empty, Flex, MainAxisAlignment,
MainAxisSize, ParentElement, Rect, Shrinkable, Stack,
},
fonts::Weight,
ui_components::{
button::{ButtonVariant, TextAndIcon, TextAndIconAlignment},
components::{UiComponent, UiComponentStyles},
},
Element, ViewContext,
};
use pathfinder_color::ColorU;
use pathfinder_geometry::vector::Vector2F;
use crate::{
drive::sharing::{ContentEditability, SharingAccessLevel},
env_vars::{
active_env_var_collection_data::TrashStatus,
view::env_var_collection::{EnvVarCollectionAction, EnvVarCollectionView},
},
ui_components::{breadcrumb::BreadcrumbState, buttons::icon_button, icons::Icon},
AppContext, Appearance, SingletonEntity,
use galaxy_core::features::FeatureFlag;
use galaxyui::elements::{
Align, ConstrainedBox, Container, CrossAxisAlignment, Empty, Flex, MainAxisAlignment,
MainAxisSize, ParentElement, Rect, Shrinkable, Stack,
};
use galaxyui::fonts::Weight;
use galaxyui::ui_components::button::{ButtonVariant, TextAndIcon, TextAndIconAlignment};
use galaxyui::ui_components::components::{UiComponent, UiComponentStyles};
use galaxyui::{Element, ViewContext};
use crate::drive::sharing::{ContentEditability, SharingAccessLevel};
use crate::env_vars::active_env_var_collection_data::TrashStatus;
use crate::env_vars::view::env_var_collection::{EnvVarCollectionAction, EnvVarCollectionView};
use crate::ui_components::breadcrumb::BreadcrumbState;
use crate::ui_components::buttons::icon_button;
use crate::ui_components::icons::Icon;
use crate::{AppContext, Appearance, SingletonEntity};
const VARIABLE_DIVIDER_HEIGHT: f32 = 2.;
const SECTION_FONT_SIZE: f32 = 16.;
+16 -16
View File
@@ -1,24 +1,24 @@
use galaxy_core::context_flag::ContextFlag;
use galaxyui::{keymap::Trigger, SingletonEntity, ViewContext, ViewHandle};
use pathfinder_geometry::vector::Vector2F;
use crate::{
cloud_object::{CloudObject, GenericStringObjectFormat, Space},
drive::{
drive_helpers::has_feature_gated_anonymous_user_reached_env_var_limit,
export::ExportManager, CloudObjectTypeAndId,
},
env_vars::active_env_var_collection_data::TrashStatus,
external_secrets::SecretManager,
menu::{Event as MenuEvent, Menu, MenuItem, MenuItemFields},
pane_group::PaneEvent,
server::cloud_objects::update_manager::UpdateManager,
ui_components::icons::Icon,
util::bindings::{keybinding_name_to_display_string, trigger_to_keystroke, CustomAction},
AppContext, CloudModel, FeatureFlag,
};
use galaxyui::keymap::Trigger;
use galaxyui::{SingletonEntity, ViewContext, ViewHandle};
use super::env_var_collection::{EnvVarCollectionAction, EnvVarCollectionView, VariableRowIndex};
use crate::cloud_object::{CloudObject, GenericStringObjectFormat, Space};
use crate::drive::drive_helpers::has_feature_gated_anonymous_user_reached_env_var_limit;
use crate::drive::export::ExportManager;
use crate::drive::CloudObjectTypeAndId;
use crate::env_vars::active_env_var_collection_data::TrashStatus;
use crate::external_secrets::SecretManager;
use crate::menu::{Event as MenuEvent, Menu, MenuItem, MenuItemFields};
use crate::pane_group::PaneEvent;
use crate::server::cloud_objects::update_manager::UpdateManager;
use crate::ui_components::icons::Icon;
use crate::util::bindings::{
keybinding_name_to_display_string, trigger_to_keystroke, CustomAction,
};
use crate::{AppContext, CloudModel, FeatureFlag};
const PANE_MENU_WIDTH: f32 = 200.;
+19 -25
View File
@@ -1,34 +1,28 @@
use galaxy_core::{features::FeatureFlag, ui::appearance::Appearance};
use pathfinder_geometry::vector::vec2f;
use galaxy_core::features::FeatureFlag;
use galaxy_core::ui::appearance::Appearance;
use galaxyui::elements::{
ChildAnchor, ChildView, Clipped, ConstrainedBox, Container, Empty, Fill, MainAxisAlignment,
MainAxisSize, MouseStateHandle, OffsetPositioning, ParentAnchor, ParentElement,
ParentOffsetBounds, Shrinkable, Stack,
};
use galaxyui::fonts::Weight;
use galaxyui::ui_components::button::{ButtonVariant, TextAndIcon, TextAndIconAlignment};
use galaxyui::ui_components::components::{UiComponent, UiComponentStyles};
#[cfg(not(target_family = "wasm"))]
use galaxyui::SingletonEntity;
use galaxyui::{
elements::{
ChildAnchor, ChildView, Clipped, ConstrainedBox, Container, Empty, Fill, MainAxisAlignment,
MainAxisSize, MouseStateHandle, OffsetPositioning, ParentAnchor, ParentElement,
ParentOffsetBounds, Shrinkable, Stack,
},
fonts::Weight,
ui_components::{
button::{ButtonVariant, TextAndIcon, TextAndIconAlignment},
components::{UiComponent, UiComponentStyles},
},
Element, ViewContext,
};
use pathfinder_geometry::vector::vec2f;
use galaxyui::{Element, ViewContext};
use super::env_var_collection::{
EnvVarCollectionAction, EnvVarCollectionView, VariableRowIndex, CORE_MAX_WIDTH, ROW_SPACING,
};
use crate::{
drive::sharing::ContentEditability,
env_vars::{active_env_var_collection_data::SavingStatus, EnvVarValue},
external_secrets::{ExternalSecretManager, SecretManager},
search::external_secrets::{
searcher::ExternalSecretSearchItemAction, view::ExternalSecretsMenuEvent,
},
ui_components::icons::Icon,
};
use crate::drive::sharing::ContentEditability;
use crate::env_vars::active_env_var_collection_data::SavingStatus;
use crate::env_vars::EnvVarValue;
use crate::external_secrets::{ExternalSecretManager, SecretManager};
use crate::search::external_secrets::searcher::ExternalSecretSearchItemAction;
use crate::search::external_secrets::view::ExternalSecretsMenuEvent;
use crate::ui_components::icons::Icon;
#[cfg(all(not(target_family = "wasm"), feature = "local_tty"))]
use crate::{
terminal::local_shell::LocalShellState,
@@ -1,18 +1,13 @@
use galaxy_core::ui::appearance::Appearance;
use galaxyui::{
elements::{Container, MouseStateHandle},
fonts::Weight,
platform::Cursor,
ui_components::{
button::ButtonVariant,
components::{Coords, UiComponent, UiComponentStyles},
},
Element,
};
use crate::ui_components::dialog::{dialog_styles, Dialog};
use galaxyui::elements::{Container, MouseStateHandle};
use galaxyui::fonts::Weight;
use galaxyui::platform::Cursor;
use galaxyui::ui_components::button::ButtonVariant;
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
use galaxyui::Element;
use super::env_var_collection::{EnvVarCollectionAction, EnvVarCollectionView};
use crate::ui_components::dialog::{dialog_styles, Dialog};
const UNSAVED_CHANGES_TEXT: &str = "You have unsaved changes.";
const KEEP_EDITING_TEXT: &str = "Keep editing";