More cleanup on bedrock calls, adding dump file for errors

This commit is contained in:
Ryan Ward
2026-05-13 16:21:40 -05:00
parent b61d6bcbce
commit 57222e208e
27 changed files with 469 additions and 336 deletions
+5
View File
@@ -36,6 +36,11 @@ Environment variables:
- `./script/run-clang-format.py -r --extensions 'c,h,cpp,m' ./crates/warpui/src/ ./app/src/` - Format C/C++/Obj-C code - `./script/run-clang-format.py -r --extensions 'c,h,cpp,m' ./crates/warpui/src/ ./app/src/` - Format C/C++/Obj-C code
- `find . -name "*.wgsl" -exec wgslfmt --check {} +` - Check WGSL shader formatting - `find . -name "*.wgsl" -exec wgslfmt --check {} +` - Check WGSL shader formatting
### Bedrock Diagnostics
- Bedrock request or stream failures automatically write `Error_<timestamp>.txt` to the repository root.
- The error snapshot file includes the serialized Bedrock context window, tool definitions, protobuf request debug payload, captured Bedrock diagnostic lines, and log tails.
- Set `GALAXY_BEDROCK_DIAGNOSTICS=1` to additionally write per-event Bedrock diagnostic logs to `bedrock-diagnostics.log` in the active Warp log directory.
### Platform Setup ### Platform Setup
- `./script/bootstrap` - Platform-specific setup (calls platform-specific bootstrap scripts) - `./script/bootstrap` - Platform-specific setup (calls platform-specific bootstrap scripts)
- `./script/install_cargo_build_deps` - Install Cargo build dependencies - `./script/install_cargo_build_deps` - Install Cargo build dependencies
+9 -3
View File
@@ -163,16 +163,22 @@ impl BedrockClient {
let output = request.send().await.map_err(|e| { let output = request.send().await.map_err(|e| {
let debug_msg = format!("{:?}", e); let debug_msg = format!("{:?}", e);
let display_msg = format!("{}", e); let display_msg = format!("{e}");
log::error!("[bedrock] API error (display): {display_msg}"); log::error!("[bedrock] API error (display): {display_msg}");
log::error!("[bedrock] API error (debug): {debug_msg}"); log::error!("[bedrock] API error (debug): {debug_msg}");
let msg = if debug_msg.len() > display_msg.len() { let msg = if debug_msg.len() > display_msg.len() {
debug_msg debug_msg.clone()
} else { } else {
display_msg display_msg.clone()
}; };
if let Some(ref logger) = diagnostic_logger { if let Some(ref logger) = diagnostic_logger {
logger.log_result_fail(&msg); logger.log_result_fail(&msg);
if let Some(path) = logger.dump_error_snapshot(&display_msg, &debug_msg) {
log::error!(
"[bedrock] Wrote Bedrock failure snapshot to {}",
path.display()
);
}
} }
if msg.contains("AccessDenied") || msg.contains("access denied") { if msg.contains("AccessDenied") || msg.contains("access denied") {
BedrockError::AccessDenied(msg) BedrockError::AccessDenied(msg)
+217 -44
View File
@@ -1,16 +1,18 @@
use std::fs::{self, File, OpenOptions}; use chrono::{Local, Utc};
use std::io::{BufWriter, Write};
use std::path::PathBuf;
use std::sync::Mutex;
use chrono::Utc;
use serde_json::Value as JsonValue; use serde_json::Value as JsonValue;
use std::fs::{self, File, OpenOptions};
use std::io::{BufWriter, Read, Seek, SeekFrom, Write};
use std::path::{Path, PathBuf};
use std::sync::Mutex;
use super::convert::{ConversationMessage, MessageContent, MessageRole, ToolDefinition}; use super::convert::{ConversationMessage, MessageContent, MessageRole, ToolDefinition};
const ENV_VAR: &str = "GALAXY_BEDROCK_DIAGNOSTICS"; const ENV_VAR: &str = "GALAXY_BEDROCK_DIAGNOSTICS";
const LOG_FILENAME: &str = "bedrock-diagnostics.log"; const LOG_FILENAME: &str = "bedrock-diagnostics.log";
const MAX_ROTATIONS: usize = 5; const MAX_ROTATIONS: usize = 5;
const ERROR_DUMP_PREFIX: &str = "Error_";
const MAX_CAPTURED_LINES: usize = 2_000;
const LOG_TAIL_BYTES: u64 = 200 * 1024;
#[derive(Debug, Clone, Copy, PartialEq)] #[derive(Debug, Clone, Copy, PartialEq)]
pub enum Layer { pub enum Layer {
@@ -62,11 +64,15 @@ impl std::fmt::Display for Status {
} }
pub struct BedrockDiagnosticLogger { pub struct BedrockDiagnosticLogger {
writer: Mutex<BufWriter<File>>, writer: Option<Mutex<BufWriter<File>>>,
log_path: Option<PathBuf>,
model_id: String, model_id: String,
conversation_id: Mutex<String>, conversation_id: Mutex<String>,
request_id: Mutex<String>, request_id: Mutex<String>,
task_id: String, task_id: String,
protobuf_input: Mutex<Option<String>>,
bedrock_input: Mutex<Option<JsonValue>>,
captured_lines: Mutex<Vec<String>>,
} }
impl BedrockDiagnosticLogger { impl BedrockDiagnosticLogger {
@@ -76,47 +82,42 @@ impl BedrockDiagnosticLogger {
request_id: &str, request_id: &str,
task_id: &str, task_id: &str,
) -> Option<Self> { ) -> Option<Self> {
if !is_enabled() { let mut writer = None;
return None; let mut log_path = None;
}
let log_path = match log_file_path() { if is_enabled() {
Some(path) => path, if let Some(path) = diagnostic_log_file_path() {
None => { if let Some(parent) = path.parent() {
let _ = fs::create_dir_all(parent);
}
rotate_if_needed(&path);
match OpenOptions::new().create(true).append(true).open(&path) {
Ok(file) => {
writer = Some(Mutex::new(BufWriter::new(file)));
log_path = Some(path.clone());
log::info!("[bedrock-diag] Diagnostic logging enabled -> {path:?}");
}
Err(e) => {
log::warn!("[bedrock-diag] Failed to open log file {path:?}: {e}");
}
}
} else {
log::warn!("[bedrock-diag] Could not determine log directory"); log::warn!("[bedrock-diag] Could not determine log directory");
return None;
} }
};
if let Some(parent) = log_path.parent() {
let _ = fs::create_dir_all(parent);
} }
rotate_if_needed(&log_path);
let file = match OpenOptions::new().create(true).append(true).open(&log_path) {
Ok(f) => f,
Err(e) => {
log::warn!(
"[bedrock-diag] Failed to open log file {:?}: {}",
log_path,
e
);
return None;
}
};
log::info!(
"[bedrock-diag] Diagnostic logging enabled -> {:?}",
log_path
);
Some(Self { Some(Self {
writer: Mutex::new(BufWriter::new(file)), writer,
log_path,
model_id: model_id.to_string(), model_id: model_id.to_string(),
conversation_id: Mutex::new(conversation_id.to_string()), conversation_id: Mutex::new(conversation_id.to_string()),
request_id: Mutex::new(request_id.to_string()), request_id: Mutex::new(request_id.to_string()),
task_id: task_id.to_string(), task_id: task_id.to_string(),
protobuf_input: Mutex::new(None),
bedrock_input: Mutex::new(None),
captured_lines: Mutex::new(Vec::new()),
}) })
} }
@@ -131,6 +132,9 @@ impl BedrockDiagnosticLogger {
pub fn log_protobuf_input(&self, request: &warp_multi_agent_api::Request) { pub fn log_protobuf_input(&self, request: &warp_multi_agent_api::Request) {
let payload = format!("{:?}", request); let payload = format!("{:?}", request);
if let Ok(mut protobuf_input) = self.protobuf_input.lock() {
*protobuf_input = Some(payload.clone());
}
self.write_line(Layer::Protobuf, Direction::Input, Status::Pending, &payload); self.write_line(Layer::Protobuf, Direction::Input, Status::Pending, &payload);
} }
@@ -155,6 +159,9 @@ impl BedrockDiagnosticLogger {
"messages": messages_json, "messages": messages_json,
"tools": tools_json, "tools": tools_json,
}); });
if let Ok(mut bedrock_input) = self.bedrock_input.lock() {
*bedrock_input = Some(payload.clone());
}
self.write_line( self.write_line(
Layer::Bedrock, Layer::Bedrock,
@@ -203,6 +210,111 @@ impl BedrockDiagnosticLogger {
); );
} }
pub fn dump_error_snapshot(&self, error: &str, debug_error: &str) -> Option<PathBuf> {
let conversation_id = self
.conversation_id
.lock()
.map(|value| value.clone())
.unwrap_or_default();
let request_id = self
.request_id
.lock()
.map(|value| value.clone())
.unwrap_or_default();
let protobuf_input = self
.protobuf_input
.lock()
.ok()
.and_then(|value| value.clone());
let bedrock_input = self
.bedrock_input
.lock()
.ok()
.and_then(|value| value.clone());
let captured_lines = self
.captured_lines
.lock()
.map(|lines| lines.clone())
.unwrap_or_default();
let current_log_path = galaxy_logging::log_file_path().ok();
let current_log_tail = current_log_path
.as_ref()
.and_then(|path| read_file_tail(path, LOG_TAIL_BYTES));
let diagnostics_log_tail = self
.log_path
.as_ref()
.and_then(|path| read_file_tail(path, LOG_TAIL_BYTES));
let context_window = bedrock_input
.as_ref()
.and_then(|value| value.get("messages").cloned())
.unwrap_or(JsonValue::Null);
let tools = bedrock_input
.as_ref()
.and_then(|value| value.get("tools").cloned())
.unwrap_or(JsonValue::Null);
let payload = serde_json::json!({
"timestamp_local": Local::now().to_rfc3339_opts(chrono::SecondsFormat::Millis, true),
"timestamp_utc": Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Millis, true),
"error": {
"display": error,
"debug": debug_error,
},
"bedrock": {
"model_id": &self.model_id,
"task_id": &self.task_id,
"conversation_id": conversation_id,
"request_id": request_id,
"input": bedrock_input,
"context_window": context_window,
"tools": tools,
},
"protobuf_request_debug": protobuf_input,
"captured_bedrock_lines": captured_lines,
"logs": {
"warp_log_path": current_log_path
.as_ref()
.map(|path| path.display().to_string())
.unwrap_or_default(),
"warp_log_tail": current_log_tail,
"bedrock_diagnostics_log_path": self
.log_path
.as_ref()
.map(|path| path.display().to_string())
.unwrap_or_default(),
"bedrock_diagnostics_log_tail": diagnostics_log_tail,
}
});
let file_name = format!(
"{ERROR_DUMP_PREFIX}{}.txt",
Local::now().format("%Y%m%d_%H%M%S_%3f")
);
let serialized_payload = match serde_json::to_string_pretty(&payload) {
Ok(value) => value,
Err(e) => {
log::error!("[bedrock] Failed to serialize Bedrock error snapshot: {e}");
return None;
}
};
let mut attempted_paths = Vec::new();
for dump_path in error_dump_paths(&file_name) {
match fs::write(&dump_path, &serialized_payload) {
Ok(()) => return Some(dump_path),
Err(e) => {
attempted_paths.push(format!("{} ({e})", dump_path.display()));
}
}
}
log::error!(
"[bedrock] Failed to write Bedrock error snapshot. Attempted paths: {}",
attempted_paths.join(", ")
);
None
}
fn write_line(&self, layer: Layer, direction: Direction, status: Status, payload: &str) { fn write_line(&self, layer: Layer, direction: Direction, status: Status, payload: &str) {
let timestamp = Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Millis, true); let timestamp = Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Millis, true);
let conversation_id = self let conversation_id = self
@@ -228,9 +340,19 @@ impl BedrockDiagnosticLogger {
payload, payload,
); );
if let Ok(mut writer) = self.writer.lock() { if let Ok(mut captured_lines) = self.captured_lines.lock() {
let _ = writer.write_all(line.as_bytes()); captured_lines.push(line.trim_end().to_string());
let _ = writer.flush(); if captured_lines.len() > MAX_CAPTURED_LINES {
let overflow = captured_lines.len() - MAX_CAPTURED_LINES;
captured_lines.drain(0..overflow);
}
}
if let Some(writer) = &self.writer {
if let Ok(mut writer) = writer.lock() {
let _ = writer.write_all(line.as_bytes());
let _ = writer.flush();
}
} }
} }
} }
@@ -241,13 +363,45 @@ pub fn is_enabled() -> bool {
.unwrap_or(false) .unwrap_or(false)
} }
fn log_file_path() -> Option<PathBuf> { fn diagnostic_log_file_path() -> Option<PathBuf> {
galaxy_logging::log_directory() galaxy_logging::log_directory()
.ok() .ok()
.map(|dir| dir.join(LOG_FILENAME)) .map(|dir| dir.join(LOG_FILENAME))
} }
fn rotate_if_needed(path: &PathBuf) { fn error_dump_directory() -> PathBuf {
let source_root = Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap_or_else(|| Path::new(env!("CARGO_MANIFEST_DIR")))
.to_path_buf();
if source_root.is_dir() {
source_root
} else {
std::env::current_dir().unwrap_or_else(|_| PathBuf::from("."))
}
}
fn error_dump_paths(file_name: &str) -> Vec<PathBuf> {
let mut directories = Vec::new();
push_unique_directory(&mut directories, error_dump_directory());
if let Ok(current_dir) = std::env::current_dir() {
push_unique_directory(&mut directories, current_dir);
}
push_unique_directory(&mut directories, std::env::temp_dir());
directories
.into_iter()
.map(|directory| directory.join(file_name))
.collect()
}
fn push_unique_directory(directories: &mut Vec<PathBuf>, directory: PathBuf) {
if directory.is_dir() && !directories.iter().any(|existing| existing == &directory) {
directories.push(directory);
}
}
fn rotate_if_needed(path: &Path) {
let metadata = match fs::metadata(path) { let metadata = match fs::metadata(path) {
Ok(m) => m, Ok(m) => m,
Err(_) => return, Err(_) => return,
@@ -260,7 +414,7 @@ fn rotate_if_needed(path: &PathBuf) {
for i in (0..MAX_ROTATIONS - 1).rev() { for i in (0..MAX_ROTATIONS - 1).rev() {
let from = if i == 0 { let from = if i == 0 {
path.clone() path.to_path_buf()
} else { } else {
path.with_extension(format!("log.{}", i)) path.with_extension(format!("log.{}", i))
}; };
@@ -272,6 +426,25 @@ fn rotate_if_needed(path: &PathBuf) {
let _ = fs::rename(path, &first_rotation); let _ = fs::rename(path, &first_rotation);
} }
fn read_file_tail(path: &Path, max_bytes: u64) -> Option<String> {
let mut file = File::open(path).ok()?;
let file_len = file.metadata().ok()?.len();
let start = file_len.saturating_sub(max_bytes);
if file.seek(SeekFrom::Start(start)).is_err() {
return None;
}
let mut bytes = Vec::new();
if file.read_to_end(&mut bytes).is_err() {
return None;
}
let mut tail = String::from_utf8_lossy(&bytes).to_string();
if start > 0 {
tail = format!("... log tail truncated to last {max_bytes} bytes ...\n{tail}");
}
Some(tail)
}
fn serialize_messages(messages: &[ConversationMessage]) -> JsonValue { fn serialize_messages(messages: &[ConversationMessage]) -> JsonValue {
let entries: Vec<JsonValue> = messages let entries: Vec<JsonValue> = messages
.iter() .iter()
+10 -1
View File
@@ -218,7 +218,16 @@ pub fn bedrock_stream_to_response_events(
Err(e) => { Err(e) => {
log::error!("[bedrock-debug] Stream error after {event_count} events: {e}"); log::error!("[bedrock-debug] Stream error after {event_count} events: {e}");
if let Some(ref logger) = diagnostic_logger { if let Some(ref logger) = diagnostic_logger {
logger.log_stream_error(&format!("{e}")); let error_msg = format!("{e}");
let debug_error = format!("{e:?}");
logger.log_stream_error(&error_msg);
logger.log_result_fail(&error_msg);
if let Some(path) = logger.dump_error_snapshot(&error_msg, &debug_error) {
log::error!(
"[bedrock] Wrote Bedrock failure snapshot to {}",
path.display()
);
}
} }
if !buffered_text.is_empty() { if !buffered_text.is_empty() {
let msg_id = current_text_message_id let msg_id = current_text_message_id
+20 -22
View File
@@ -1,26 +1,25 @@
#[cfg(target_family = "wasm")] #[cfg(target_family = "wasm")]
use crate::uri::web_intent_parser::open_url_on_desktop; use crate::uri::web_intent_parser::open_url_on_desktop;
use crate::{ use crate::{
ObjectActions,
ai::{ ai::{
document::ai_document_model::AIDocumentId, document::ai_document_model::AIDocumentId,
facts::{AIFact, AIMemory}, facts::{AIFact, AIMemory},
}, },
appearance::Appearance, appearance::Appearance,
auth::{ auth::{
AuthStateProvider,
auth_manager::{AuthManager, LoginGatedFeature}, auth_manager::{AuthManager, LoginGatedFeature},
auth_state::AuthState, auth_state::AuthState,
auth_view_modal::AuthViewVariant, auth_view_modal::AuthViewVariant,
AuthStateProvider,
}, },
cloud_object::{ cloud_object::{
CloudObject, CloudObjectEventEntrypoint, CloudObjectLocation, CloudObjectSyncStatus,
GenericCloudObject, GenericStringObjectFormat, JsonObjectType, NumInFlightRequests,
ObjectType, Space,
model::{ model::{
persistence::{CloudModel, CloudModelEvent}, persistence::{CloudModel, CloudModelEvent},
view::{CloudViewModel, CloudViewModelEvent, UpdateTimestamp}, view::{CloudViewModel, CloudViewModelEvent, UpdateTimestamp},
}, },
CloudObject, CloudObjectEventEntrypoint, CloudObjectLocation, CloudObjectSyncStatus,
GenericCloudObject, GenericStringObjectFormat, JsonObjectType, NumInFlightRequests,
ObjectType, Space,
}, },
editor::{EditorView, Event as EditorEvent, SingleLineEditorOptions}, editor::{EditorView, Event as EditorEvent, SingleLineEditorOptions},
env_vars::CloudEnvVarCollection, env_vars::CloudEnvVarCollection,
@@ -39,8 +38,8 @@ use crate::{
ui_components::{ ui_components::{
blended_colors, blended_colors,
buttons::{highlight, icon_button}, buttons::{highlight, icon_button},
icons::{ICON_DIMENSIONS, Icon}, icons::{Icon, ICON_DIMENSIONS},
menu_button::{MenuDirection, icon_button_with_context_menu}, menu_button::{icon_button_with_context_menu, MenuDirection},
}, },
util::{color::coloru_with_opacity, sync::Condition}, util::{color::coloru_with_opacity, sync::Condition},
view_components::{Dropdown, DropdownItem}, view_components::{Dropdown, DropdownItem},
@@ -49,10 +48,10 @@ use crate::{
workspaces::{ workspaces::{
update_manager::TeamUpdateManager, user_workspaces::UserWorkspaces, workspace::WorkspaceUid, update_manager::TeamUpdateManager, user_workspaces::UserWorkspaces, workspace::WorkspaceUid,
}, },
ObjectActions,
}; };
use super::{ use super::{
CloudObjectTypeAndId, DriveObjectType, DriveSortOrder,
cloud_object_naming_dialog::CloudObjectNamingDialog, cloud_object_naming_dialog::CloudObjectNamingDialog,
drive_helpers::{ drive_helpers::{
has_feature_gated_anonymous_user_reached_env_var_limit, has_feature_gated_anonymous_user_reached_env_var_limit,
@@ -62,16 +61,17 @@ use super::{
empty_trash_confirmation_dialog::{EmptyTrashConfirmationDialog, EmptyTrashConfirmationEvent}, empty_trash_confirmation_dialog::{EmptyTrashConfirmationDialog, EmptyTrashConfirmationEvent},
folders::CloudFolder, folders::CloudFolder,
items::{ items::{
WarpDriveItemId,
ai_fact_collection::WarpDriveAIFactCollection, ai_fact_collection::WarpDriveAIFactCollection,
item::{ItemStates, WarpDriveRow, tools_panel_menu_direction}, item::{tools_panel_menu_direction, ItemStates, WarpDriveRow},
mcp_server_collection::WarpDriveMCPServerCollection, mcp_server_collection::WarpDriveMCPServerCollection,
WarpDriveItemId,
}, },
settings::WarpDriveSettings, settings::WarpDriveSettings,
sharing::{ sharing::{
ContentEditability, ShareableObject,
dialog::{SharingDialog, SharingDialogEvent}, dialog::{SharingDialog, SharingDialogEvent},
ContentEditability, ShareableObject,
}, },
CloudObjectTypeAndId, DriveObjectType, DriveSortOrder,
}; };
use crate::drive::panel::DrivePanelAction; use crate::drive::panel::DrivePanelAction;
use crate::server::cloud_objects::update_manager::InitiatedBy; use crate::server::cloud_objects::update_manager::InitiatedBy;
@@ -80,8 +80,6 @@ use galaxy_core::{
context_flag::ContextFlag, settings::Setting, ui::theme::color::internal_colors, context_flag::ContextFlag, settings::Setting, ui::theme::color::internal_colors,
}; };
use galaxyui::{ use galaxyui::{
AppContext, BlurContext, Element, Entity, ModelHandle, SingletonEntity, TypedActionView,
UpdateView, View, ViewContext, ViewHandle, WindowId,
clipboard::ClipboardContent, clipboard::ClipboardContent,
elements::{ elements::{
Align, AnchorPair, Border, ChildAnchor, ChildView, ClippedScrollStateHandle, Align, AnchorPair, Border, ChildAnchor, ChildView, ClippedScrollStateHandle,
@@ -100,10 +98,12 @@ use galaxyui::{
components::{Coords, UiComponent, UiComponentStyles}, components::{Coords, UiComponent, UiComponentStyles},
}, },
units::IntoPixels, units::IntoPixels,
AppContext, BlurContext, Element, Entity, ModelHandle, SingletonEntity, TypedActionView,
UpdateView, View, ViewContext, ViewHandle, WindowId,
}; };
use itertools::Itertools; use itertools::Itertools;
use pathfinder_color::ColorU; use pathfinder_color::ColorU;
use pathfinder_geometry::vector::{Vector2F, vec2f}; use pathfinder_geometry::vector::{vec2f, Vector2F};
use std::{any::Any, collections::HashMap, sync::Arc}; use std::{any::Any, collections::HashMap, sync::Arc};
use url::Url; use url::Url;
@@ -4908,14 +4908,12 @@ impl DriveIndex {
space: *space, space: *space,
offset, offset,
}); });
let menu_items = vec![ let menu_items = vec![MenuItemFields::new("Collapse all")
MenuItemFields::new("Collapse all") .with_on_select_action(DriveIndexAction::CollapseAllInLocation(
.with_on_select_action(DriveIndexAction::CollapseAllInLocation( CloudObjectLocation::Space(*space),
CloudObjectLocation::Space(*space), ))
)) .with_icon(Icon::ListCollapsed)
.with_icon(Icon::ListCollapsed) .into_item()];
.into_item(),
];
ctx.update_view(&self.menu, |menu, ctx| { ctx.update_view(&self.menu, |menu, ctx| {
menu.set_items(menu_items, ctx); menu.set_items(menu_items, ctx);
+6 -6
View File
@@ -1,18 +1,17 @@
use galaxy_core::ui::appearance::Appearance; use galaxy_core::ui::appearance::Appearance;
use galaxy_server_client::cloud_object::ServerPermissions; use galaxy_server_client::cloud_object::ServerPermissions;
use galaxyui::{ use galaxyui::{
AddSingletonModel, App, SingletonEntity, TypedActionView, ViewHandle, platform::WindowStyle, platform::WindowStyle, AddSingletonModel, App, SingletonEntity, TypedActionView, ViewHandle,
}; };
use crate::{ use crate::{
Assets,
ai::blocklist::BlocklistAIHistoryModel, ai::blocklist::BlocklistAIHistoryModel,
auth::{AuthStateProvider, auth_manager::AuthManager}, auth::{auth_manager::AuthManager, AuthStateProvider},
cloud_object::{ cloud_object::{
CloudObjectSyncStatus, ObjectIdType, ObjectType, Owner, ServerCreationInfo, Space,
model::{actions::ObjectActions, persistence::CloudModel, view::CloudViewModel}, model::{actions::ObjectActions, persistence::CloudModel, view::CloudViewModel},
CloudObjectSyncStatus, ObjectIdType, ObjectType, Owner, ServerCreationInfo, Space,
}, },
drive::{CloudObjectTypeAndId, items::WarpDriveItemId}, drive::{items::WarpDriveItemId, CloudObjectTypeAndId},
menu::MenuItem, menu::MenuItem,
network::NetworkStatus, network::NetworkStatus,
notebooks::{CloudNotebook, CloudNotebookModel}, notebooks::{CloudNotebook, CloudNotebookModel},
@@ -26,10 +25,11 @@ use crate::{
settings_view::keybindings::KeybindingChangedNotifier, settings_view::keybindings::KeybindingChangedNotifier,
terminal::shared_session::permissions_manager::SessionPermissionsManager, terminal::shared_session::permissions_manager::SessionPermissionsManager,
test_util::settings::initialize_settings_for_tests, test_util::settings::initialize_settings_for_tests,
workflows::{CloudWorkflow, CloudWorkflowModel, workflow::Workflow}, workflows::{workflow::Workflow, CloudWorkflow, CloudWorkflowModel},
workspaces::{ workspaces::{
team_tester::TeamTesterStatus, user_profiles::UserProfiles, user_workspaces::UserWorkspaces, team_tester::TeamTesterStatus, user_profiles::UserProfiles, user_workspaces::UserWorkspaces,
}, },
Assets,
}; };
use super::{DriveIndex, DriveIndexAction}; use super::{DriveIndex, DriveIndexAction};
+2 -2
View File
@@ -1,19 +1,19 @@
use super::{ use super::{
SettingsSection,
settings_page::{ settings_page::{
MatchData, PageType, SettingsPageEvent, SettingsPageMeta, SettingsPageViewHandle, MatchData, PageType, SettingsPageEvent, SettingsPageMeta, SettingsPageViewHandle,
SettingsWidget, SettingsWidget,
}, },
SettingsSection,
}; };
use crate::{appearance::Appearance, channel::ChannelState, workspace::WorkspaceAction}; use crate::{appearance::Appearance, channel::ChannelState, workspace::WorkspaceAction};
use galaxyui::{ use galaxyui::{
AppContext, Entity, View, ViewContext, ViewHandle,
assets::asset_cache::AssetSource, assets::asset_cache::AssetSource,
elements::{ elements::{
Align, CacheOption, ConstrainedBox, Container, CrossAxisAlignment, Element, Flex, Image, Align, CacheOption, ConstrainedBox, Container, CrossAxisAlignment, Element, Flex, Image,
MainAxisAlignment, MouseStateHandle, ParentElement, Wrap, MainAxisAlignment, MouseStateHandle, ParentElement, Wrap,
}, },
ui_components::components::UiComponent, ui_components::components::UiComponent,
AppContext, Entity, View, ViewContext, ViewHandle,
}; };
pub struct AboutPageView { pub struct AboutPageView {
+95 -127
View File
@@ -21,27 +21,26 @@ mod wasm_view;
use self::vertical_tabs::telemetry::{VerticalTabsDisplayOption, VerticalTabsTelemetryEvent}; use self::vertical_tabs::telemetry::{VerticalTabsDisplayOption, VerticalTabsTelemetryEvent};
use self::vertical_tabs::{ use self::vertical_tabs::{
VERTICAL_TABS_SETTINGS_BUTTON_POSITION_ID, VerticalTabsPanelState, render_detail_sidecar, render_detail_sidecar, render_settings_popup, VerticalTabsPanelState,
render_settings_popup, VERTICAL_TABS_SETTINGS_BUTTON_POSITION_ID,
}; };
pub(crate) use onboarding::OnboardingTutorial; pub(crate) use onboarding::OnboardingTutorial;
use crate::ai::AIRequestUsageModel;
use crate::ai::active_agent_views_model::ActiveAgentViewsModel; use crate::ai::active_agent_views_model::ActiveAgentViewsModel;
use crate::ai::agent_conversations_model::AgentConversationsModel; use crate::ai::agent_conversations_model::AgentConversationsModel;
use crate::ai::agent_conversations_model::ConversationOrTask; use crate::ai::agent_conversations_model::ConversationOrTask;
use crate::ai::agent_management::AgentManagementEvent;
use crate::ai::agent_management::notifications::NotificationFilter;
use crate::ai::agent_management::notifications::toast_stack::AgentNotificationToastStack; use crate::ai::agent_management::notifications::toast_stack::AgentNotificationToastStack;
use crate::ai::agent_management::notifications::view::{ use crate::ai::agent_management::notifications::view::{
NotificationMailboxView, NotificationMailboxViewEvent, NotificationMailboxView, NotificationMailboxViewEvent,
}; };
use crate::ai::agent_management::notifications::NotificationFilter;
use crate::ai::agent_management::telemetry::AgentManagementTelemetryEvent; use crate::ai::agent_management::telemetry::AgentManagementTelemetryEvent;
use crate::ai::agent_management::view::{AgentManagementView, AgentManagementViewEvent}; use crate::ai::agent_management::view::{AgentManagementView, AgentManagementViewEvent};
use crate::ai::ambient_agents::AmbientAgentTaskId; use crate::ai::agent_management::AgentManagementEvent;
use crate::ai::ambient_agents::telemetry::{CloudAgentTelemetryEvent, CloudModeEntryPoint}; use crate::ai::ambient_agents::telemetry::{CloudAgentTelemetryEvent, CloudModeEntryPoint};
use crate::ai::blocklist::agent_view::AgentViewEntryOrigin; use crate::ai::ambient_agents::AmbientAgentTaskId;
use crate::ai::blocklist::agent_view::agent_input_footer::editor::AgentToolbarEditorMode; use crate::ai::blocklist::agent_view::agent_input_footer::editor::AgentToolbarEditorMode;
use crate::ai::blocklist::agent_view::AgentViewEntryOrigin;
use crate::ai::blocklist::history_model::load_conversation_from_server; use crate::ai::blocklist::history_model::load_conversation_from_server;
use crate::ai::blocklist::suggested_agent_mode_workflow_modal::SuggestedAgentModeWorkflowAndId; use crate::ai::blocklist::suggested_agent_mode_workflow_modal::SuggestedAgentModeWorkflowAndId;
use crate::ai::blocklist::suggested_rule_modal::{ use crate::ai::blocklist::suggested_rule_modal::{
@@ -51,16 +50,17 @@ use crate::ai::conversation_utils;
use crate::ai::document::ai_document_model::{AIDocumentId, AIDocumentModel}; use crate::ai::document::ai_document_model::{AIDocumentId, AIDocumentModel};
use crate::ai::llms::LLMPreferences; use crate::ai::llms::LLMPreferences;
use crate::ai::persisted_workspace::PersistedWorkspace; use crate::ai::persisted_workspace::PersistedWorkspace;
use crate::ai::AIRequestUsageModel;
use crate::ai::{ use crate::ai::{
agent::{EntrypointType, api::ServerConversationToken, conversation::AIConversationId}, agent::{api::ServerConversationToken, conversation::AIConversationId, EntrypointType},
blocklist::{ blocklist::{
SlashCommandRequest,
inline_action::code_diff_view::CodeDiffView, inline_action::code_diff_view::CodeDiffView,
suggested_agent_mode_workflow_modal::{ suggested_agent_mode_workflow_modal::{
SuggestedAgentModeWorkflowModal, SuggestedAgentModeWorkflowModalEvent, SuggestedAgentModeWorkflowModal, SuggestedAgentModeWorkflowModalEvent,
}, },
SlashCommandRequest,
}, },
facts::{AIFactManager, AIFactView, AIFactViewEvent, view::AIFactPage}, facts::{view::AIFactPage, AIFactManager, AIFactView, AIFactViewEvent},
}; };
use crate::ai_assistant::execution_context::WarpAiExecutionContext; use crate::ai_assistant::execution_context::WarpAiExecutionContext;
use crate::app_state::{ use crate::app_state::{
@@ -68,10 +68,10 @@ use crate::app_state::{
PaneNodeSnapshot, PaneUuid, RightPanelSnapshot, SettingsPaneSnapshot, TabSnapshot, PaneNodeSnapshot, PaneUuid, RightPanelSnapshot, SettingsPaneSnapshot, TabSnapshot,
TerminalPaneSnapshot, WindowSnapshot, WorkflowPaneSnapshot, TerminalPaneSnapshot, WindowSnapshot, WorkflowPaneSnapshot,
}; };
use crate::code_review::diff_state::DiffStateModel;
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use crate::code_review::CodeReviewTelemetryEvent; use crate::code_review::CodeReviewTelemetryEvent;
use crate::code_review::GlobalCodeReviewModel; use crate::code_review::GlobalCodeReviewModel;
use crate::code_review::diff_state::DiffStateModel;
use crate::coding_panel_enablement_state::CodingPanelEnablementState; use crate::coding_panel_enablement_state::CodingPanelEnablementState;
use crate::default_terminal::DefaultTerminal; use crate::default_terminal::DefaultTerminal;
use crate::notebooks::CloudNotebook; use crate::notebooks::CloudNotebook;
@@ -108,13 +108,12 @@ use crate::util::file::external_editor::Editor;
use crate::util::file::external_editor::EditorSettings; use crate::util::file::external_editor::EditorSettings;
use crate::util::openable_file_type::FileTarget; use crate::util::openable_file_type::FileTarget;
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use crate::util::openable_file_type::{EditorLayout, resolve_file_target_with_editor_choice}; use crate::util::openable_file_type::{resolve_file_target_with_editor_choice, EditorLayout};
use crate::BlocklistAIHistoryModel;
use crate::ai::blocklist::FORK_PREFIX;
use crate::ai::blocklist::history_model::CloudConversationData; use crate::ai::blocklist::history_model::CloudConversationData;
use crate::ai::blocklist::FORK_PREFIX;
#[cfg(not(target_family = "wasm"))] #[cfg(not(target_family = "wasm"))]
use crate::terminal::cli_agent_sessions::plugin_manager::{PluginModalKind, plugin_manager_for}; use crate::terminal::cli_agent_sessions::plugin_manager::{plugin_manager_for, PluginModalKind};
use crate::terminal::cli_agent_sessions::{CLIAgentSessionsModel, CLIAgentSessionsModelEvent}; use crate::terminal::cli_agent_sessions::{CLIAgentSessionsModel, CLIAgentSessionsModelEvent};
use crate::workspace::header_toolbar_editor::{HeaderToolbarEditorEvent, HeaderToolbarEditorModal}; use crate::workspace::header_toolbar_editor::{HeaderToolbarEditorEvent, HeaderToolbarEditorModal};
use crate::workspace::header_toolbar_item::HeaderToolbarItemKind; use crate::workspace::header_toolbar_item::HeaderToolbarItemKind;
@@ -134,18 +133,19 @@ use crate::workspace::view::openwarp_launch_modal::{
OpenWarpLaunchModal, OpenWarpLaunchModalEvent, OpenWarpLaunchModal, OpenWarpLaunchModalEvent,
}; };
use crate::workspace::{ForkFromExchange, ForkedConversationDestination}; use crate::workspace::{ForkFromExchange, ForkedConversationDestination};
use crate::BlocklistAIHistoryModel;
use ai::index::full_source_code_embedding::manager::CodebaseIndexManager; use ai::index::full_source_code_embedding::manager::CodebaseIndexManager;
use galaxyui::notification::NotificationSendError; use galaxyui::notification::NotificationSendError;
#[cfg(all(target_os = "macos", feature = "crash_reporting"))] #[cfg(all(target_os = "macos", feature = "crash_reporting"))]
use sentry::protocol::{Attachment, AttachmentType}; use sentry::protocol::{Attachment, AttachmentType};
use serde_json; use serde_json;
use super::WorkspaceRegistry;
use super::hoa_onboarding::{ use super::hoa_onboarding::{
HoaOnboardingFlow, HoaOnboardingFlowEvent, HoaOnboardingStep, mark_hoa_onboarding_completed, mark_hoa_onboarding_completed, HoaOnboardingFlow, HoaOnboardingFlowEvent, HoaOnboardingStep,
}; };
use super::lightbox_view::{LightboxParams, LightboxView, LightboxViewEvent}; use super::lightbox_view::{LightboxParams, LightboxView, LightboxViewEvent};
use super::util; use super::util;
use super::WorkspaceRegistry;
use crate::ai::execution_profiles::editor::ExecutionProfileEditorManager; use crate::ai::execution_profiles::editor::ExecutionProfileEditorManager;
use crate::ai::execution_profiles::profiles::{AIExecutionProfilesModel, ClientProfileId}; use crate::ai::execution_profiles::profiles::{AIExecutionProfilesModel, ClientProfileId};
use crate::auth::auth_manager::{AuthManager, AuthManagerEvent}; use crate::auth::auth_manager::{AuthManager, AuthManagerEvent};
@@ -211,15 +211,15 @@ use crate::wasm_nux_dialog::WasmNUXDialog;
use crate::drive::items::WarpDriveItemId; use crate::drive::items::WarpDriveItemId;
use crate::drive::settings::WarpDriveSettingsChangedEvent; use crate::drive::settings::WarpDriveSettingsChangedEvent;
use crate::env_vars::{ use crate::env_vars::{
CloudEnvVarCollection,
manager::{EnvVarCollectionManager, EnvVarCollectionSource}, manager::{EnvVarCollectionManager, EnvVarCollectionSource},
CloudEnvVarCollection,
}; };
use crate::settings::cloud_preferences::CloudPreferencesSettings; use crate::settings::cloud_preferences::CloudPreferencesSettings;
use crate::appearance::{Appearance, AppearanceManager}; use crate::appearance::{Appearance, AppearanceManager};
use crate::auth::AuthStateProvider; use crate::auth::AuthStateProvider;
use crate::autoupdate::{ use crate::autoupdate::{
AutoupdateState, AutoupdateStateEvent, RelaunchModel, is_incoming_version_past_current, is_incoming_version_past_current, AutoupdateState, AutoupdateStateEvent, RelaunchModel,
}; };
use crate::banner::BannerState; use crate::banner::BannerState;
use crate::changelog_model::{ChangelogModel, ChangelogRequestType, Event as ChangelogEvent}; use crate::changelog_model::{ChangelogModel, ChangelogRequestType, Event as ChangelogEvent};
@@ -237,8 +237,8 @@ use crate::drive::{
}; };
use crate::experiments::{BlockOnboarding, Experiment}; use crate::experiments::{BlockOnboarding, Experiment};
use crate::menu::{ use crate::menu::{
DEFAULT_WIDTH as MENU_DEFAULT_WIDTH, Event as MenuEvent, Menu, MenuItem, MenuItemFields, Event as MenuEvent, Menu, MenuItem, MenuItemFields, MenuSelectionSource,
MenuSelectionSource, DEFAULT_WIDTH as MENU_DEFAULT_WIDTH,
}; };
use crate::modal::{Modal, ModalEvent, ModalViewState}; use crate::modal::{Modal, ModalEvent, ModalViewState};
use crate::network::{NetworkStatus, NetworkStatusEvent}; use crate::network::{NetworkStatus, NetworkStatusEvent};
@@ -262,11 +262,11 @@ use crate::prompt::editor_modal::{
}; };
use crate::referral_theme_status::ReferralThemeEvent; use crate::referral_theme_status::ReferralThemeEvent;
use crate::resource_center::{ use crate::resource_center::{
ResourceCenterEvent, ResourceCenterPage, ResourceCenterView, Tip, TipAction, TipsCompleted,
mark_feature_used_and_write_to_user_defaults, skip_tips_and_write_to_user_defaults, mark_feature_used_and_write_to_user_defaults, skip_tips_and_write_to_user_defaults,
ResourceCenterEvent, ResourceCenterPage, ResourceCenterView, Tip, TipAction, TipsCompleted,
}; };
use crate::reward_view::{RewardEvent, RewardKind, RewardView}; use crate::reward_view::{RewardEvent, RewardKind, RewardView};
use crate::root_view::{NewWorkspaceSource, OpenLaunchConfigArg, quake_mode_window_id}; use crate::root_view::{quake_mode_window_id, NewWorkspaceSource, OpenLaunchConfigArg};
use crate::search::command_search::searcher::{ use crate::search::command_search::searcher::{
AcceptedHistoryItem, AcceptedWorkflow, CommandSearchItemAction, AcceptedHistoryItem, AcceptedWorkflow, CommandSearchItemAction,
}; };
@@ -284,10 +284,10 @@ use crate::server::telemetry::{
}; };
use crate::session_management::{SessionNavigationData, SessionSource}; use crate::session_management::{SessionNavigationData, SessionSource};
use crate::settings::{ use crate::settings::{
AccessibilitySettings, AliasExpansionSettings, AppEditorSettings, BlockVisibilitySettings, active_theme_kind, respect_system_theme, AccessibilitySettings, AliasExpansionSettings,
ChangelogSettings, CursorBlink, DebugSettings, FontSettings, GPUSettings, InputSettings, AppEditorSettings, BlockVisibilitySettings, ChangelogSettings, CursorBlink, DebugSettings,
MonospaceFontSize, PaneSettings, PrivacySettings, SelectionSettings, Settings, SshSettings, FontSettings, GPUSettings, InputSettings, MonospaceFontSize, PaneSettings, PrivacySettings,
ThemeSettings, active_theme_kind, respect_system_theme, SelectionSettings, Settings, SshSettings, ThemeSettings,
}; };
use crate::settings_view::flags; use crate::settings_view::flags;
use crate::settings_view::keybindings::{KeybindingChangedEvent, KeybindingChangedNotifier}; use crate::settings_view::keybindings::{KeybindingChangedEvent, KeybindingChangedNotifier};
@@ -301,7 +301,7 @@ use crate::terminal::model::blockgrid::BlockGrid;
use crate::terminal::model::session::Session; use crate::terminal::model::session::Session;
use crate::terminal::model::session::SessionId; use crate::terminal::model::session::SessionId;
use crate::terminal::resizable_data::{ use crate::terminal::resizable_data::{
DEFAULT_LEFT_PANEL_WIDTH, DEFAULT_RIGHT_PANEL_WIDTH, ModalSizes, ModalType, ResizableData, ModalSizes, ModalType, ResizableData, DEFAULT_LEFT_PANEL_WIDTH, DEFAULT_RIGHT_PANEL_WIDTH,
}; };
use crate::terminal::safe_mode_settings::SafeModeSettings; use crate::terminal::safe_mode_settings::SafeModeSettings;
use crate::terminal::session_settings::{ use crate::terminal::session_settings::{
@@ -316,13 +316,13 @@ use crate::terminal::{self, SizeInfo, TerminalView};
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
use crate::workspace::cli_install; use crate::workspace::cli_install;
use crate::workspaces::user_workspaces::UserWorkspaces; use crate::workspaces::user_workspaces::UserWorkspaces;
use crate::{AgentNotificationsModel, report_if_error}; use crate::{report_if_error, AgentNotificationsModel};
use ::settings::{Setting, ToggleableSetting}; use ::settings::{Setting, ToggleableSetting};
use galaxy_core::features::FeatureFlag; use galaxy_core::features::FeatureFlag;
use crate::search::{self, QueryFilter}; use crate::search::{self, QueryFilter};
use crate::terminal::view::{ use crate::terminal::view::{
NOTIFICATIONS_TROUBLESHOOT_URL, SyncEvent, SyncInputType, TerminalAction, SyncEvent, SyncInputType, TerminalAction, NOTIFICATIONS_TROUBLESHOOT_URL,
}; };
use crate::terminal::{BlockListSettings, TerminalModel}; use crate::terminal::{BlockListSettings, TerminalModel};
use crate::themes::theme::{AnsiColorIdentifier, RespectSystemTheme, ThemeKind}; use crate::themes::theme::{AnsiColorIdentifier, RespectSystemTheme, ThemeKind};
@@ -332,31 +332,31 @@ use crate::themes::theme_deletion_modal::{ThemeDeletionModal, ThemeDeletionModal
use crate::tips::{TipsEvent, TipsView}; use crate::tips::{TipsEvent, TipsView};
use crate::ui_components::buttons::{combo_inner_button, icon_button_with_color}; use crate::ui_components::buttons::{combo_inner_button, icon_button_with_color};
use crate::undo_close::UndoCloseStack; use crate::undo_close::UndoCloseStack;
use crate::user_config::{WarpConfig, WarpConfigUpdateEvent};
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use crate::user_config::{ use crate::user_config::{
ensure_default_worktree_config, find_unused_tab_config_path, find_unused_toml_path, ensure_default_worktree_config, find_unused_tab_config_path, find_unused_toml_path,
find_unused_worktree_config_path, materialize_default_worktree_config, sanitize_toml_base_name, find_unused_worktree_config_path, materialize_default_worktree_config, sanitize_toml_base_name,
tab_configs_dir, tab_configs_dir,
}; };
use crate::user_config::{WarpConfig, WarpConfigUpdateEvent};
use crate::util::bindings::{ use crate::util::bindings::{
keybinding_name_to_display_string, keybinding_name_to_keystroke, trigger_to_keystroke, keybinding_name_to_display_string, keybinding_name_to_keystroke, trigger_to_keystroke,
}; };
use crate::util::links; use crate::util::links;
use crate::util::traffic_lights::{TrafficLightMouseStates, TrafficLightSide, traffic_light_data}; use crate::util::traffic_lights::{traffic_light_data, TrafficLightMouseStates, TrafficLightSide};
use crate::util::truncation::truncate_from_end; use crate::util::truncation::truncate_from_end;
#[cfg(target_family = "wasm")] #[cfg(target_family = "wasm")]
use crate::view_components::action_button::ActionButton; use crate::view_components::action_button::ActionButton;
use crate::view_components::callout_bubble::{ use crate::view_components::callout_bubble::{
CalloutArrowDirection, CalloutArrowPosition, CalloutBubbleConfig, render_callout_bubble, render_callout_bubble, CalloutArrowDirection, CalloutArrowPosition, CalloutBubbleConfig,
}; };
use crate::view_components::{ use crate::view_components::{
AgentToast, AgentToastStack, DismissibleToast, DismissibleToastStack, ToastLink, AgentToast, AgentToastStack, DismissibleToast, DismissibleToastStack, ToastLink,
}; };
use crate::window_settings::{WindowSettings, WindowSettingsChangedEvent, ZoomLevel}; use crate::window_settings::{WindowSettings, WindowSettingsChangedEvent, ZoomLevel};
use crate::workflows::{ use crate::workflows::{
AIWorkflowOrigin, CloudWorkflow, WorkflowSelectionSource, WorkflowSource, WorkflowType, manager::WorkflowOpenSource, AIWorkflowOrigin, CloudWorkflow, WorkflowSelectionSource,
WorkflowViewMode, manager::WorkflowOpenSource, WorkflowSource, WorkflowType, WorkflowViewMode,
}; };
use crate::workspace::action::CommandSearchOptions; use crate::workspace::action::CommandSearchOptions;
use crate::workspace::one_time_modal_model::OneTimeModalModel; use crate::workspace::one_time_modal_model::OneTimeModalModel;
@@ -364,20 +364,20 @@ use crate::workspace::sync_inputs::SyncedInputState;
use crate::workspace::toast_stack::{ use crate::workspace::toast_stack::{
ToastStack as WorkspaceToastStack, ToastStackEvent as WorkspaceToastStackEvent, ToastStack as WorkspaceToastStack, ToastStackEvent as WorkspaceToastStackEvent,
}; };
use crate::{GlobalResourceHandles, send_telemetry_from_ctx};
use crate::{ use crate::{
ai_assistant::{ ai_assistant::{
AI_ASSISTANT_FEATURE_NAME, AI_ASSISTANT_LOGO_COLOR, AskAIType,
panel::{AIAssistantPanelEvent, AIAssistantPanelView}, panel::{AIAssistantPanelEvent, AIAssistantPanelView},
AskAIType, AI_ASSISTANT_FEATURE_NAME, AI_ASSISTANT_LOGO_COLOR,
}, },
settings, settings,
ui_components::blended_colors, ui_components::blended_colors,
}; };
use crate::{send_telemetry_from_ctx, GlobalResourceHandles};
use futures::Future; use futures::Future;
use galaxy_core::context_flag::ContextFlag; use galaxy_core::context_flag::ContextFlag;
use galaxy_core::semantic_selection::SemanticSelection; use galaxy_core::semantic_selection::SemanticSelection;
use galaxy_util::path::{LineAndColumnArg, user_friendly_path}; use galaxy_util::path::{user_friendly_path, LineAndColumnArg};
use galaxyui::fonts::Weight; use galaxyui::fonts::Weight;
use galaxyui::modals::{AlertDialogWithCallbacks, AppModalCallback}; use galaxyui::modals::{AlertDialogWithCallbacks, AppModalCallback};
use galaxyui::windowing::{StateEvent, WindowManager}; use galaxyui::windowing::{StateEvent, WindowManager};
@@ -454,22 +454,22 @@ use crate::tab_configs::{
NewWorktreeModal, NewWorktreeModalEvent, TabConfigParamsModal, TabConfigParamsModalEvent, NewWorktreeModal, NewWorktreeModalEvent, TabConfigParamsModal, TabConfigParamsModalEvent,
}; };
use crate::TelemetryEvent;
use crate::code::editor::{add_color, remove_color}; use crate::code::editor::{add_color, remove_color};
use crate::palette::PaletteMode; use crate::palette::PaletteMode;
use crate::search::command_palette::view::{Event as CommandPaletteEvent, View as CommandPalette}; use crate::search::command_palette::view::{Event as CommandPaletteEvent, View as CommandPalette};
use crate::server::telemetry::{NotificationsTurnedOnSource, PaletteSource, TabRenameEvent}; use crate::server::telemetry::{NotificationsTurnedOnSource, PaletteSource, TabRenameEvent};
use crate::tab::{ use crate::tab::{
NewSessionMenuItem, PaneNameMenuTarget, SelectedTabColor, TAB_BAR_BORDER_HEIGHT, TabBarState, tab_position_id, NewSessionMenuItem, PaneNameMenuTarget, SelectedTabColor, TabBarState,
TabComponent, TabData, TabTelemetryAction, tab_position_id, TabComponent, TabData, TabTelemetryAction, TAB_BAR_BORDER_HEIGHT,
}; };
use crate::terminal::view::ssh_file_upload::FileUploadId; use crate::terminal::view::ssh_file_upload::FileUploadId;
use crate::ui_components::icons; use crate::ui_components::icons;
use crate::TelemetryEvent;
use autoupdate::AutoupdateStage; use autoupdate::AutoupdateStage;
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
use command::blocking::Command; use command::blocking::Command;
use galaxy_core::ui::theme::{Fill, color::internal_colors, phenomenon::PhenomenonStyle}; use galaxy_core::ui::theme::{color::internal_colors, phenomenon::PhenomenonStyle, Fill};
use galaxy_core::ui::{Icon, color::coloru_with_opacity}; use galaxy_core::ui::{color::coloru_with_opacity, Icon};
use galaxy_editor::editor::NavigationKey; use galaxy_editor::editor::NavigationKey;
use galaxyui::keymap::Context; use galaxyui::keymap::Context;
use galaxyui::notification::{RequestPermissionsOutcome, UserNotification}; use galaxyui::notification::{RequestPermissionsOutcome, UserNotification};
@@ -479,7 +479,6 @@ use galaxyui::platform::{
use galaxyui::text_layout::ClipConfig; use galaxyui::text_layout::ClipConfig;
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles}; use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
use galaxyui::{ use galaxyui::{
AppContext, Entity, TypedActionView, UpdateView, View, ViewContext, ViewHandle,
accessibility::{ accessibility::{
AccessibilityContent, AccessibilityVerbosity, ActionAccessibilityContent, WarpA11yRole, AccessibilityContent, AccessibilityVerbosity, ActionAccessibilityContent, WarpA11yRole,
}, },
@@ -491,7 +490,8 @@ use galaxyui::{
PositionedElementAnchor, PositionedElementOffsetBounds, Radius, SavePosition, Shrinkable, PositionedElementAnchor, PositionedElementOffsetBounds, Radius, SavePosition, Shrinkable,
Stack, Text, Stack, Text,
}, },
geometry::vector::{Vector2F, vec2f}, geometry::vector::{vec2f, Vector2F},
AppContext, Entity, TypedActionView, UpdateView, View, ViewContext, ViewHandle,
}; };
use galaxyui::{ use galaxyui::{
EntityId, FocusContext, ModelHandle, SingletonEntity, UpdateModel, ViewAsRef, WeakViewHandle, EntityId, FocusContext, ModelHandle, SingletonEntity, UpdateModel, ViewAsRef, WeakViewHandle,
@@ -508,7 +508,7 @@ use std::path::Path;
use std::path::PathBuf; use std::path::PathBuf;
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
use std::process; use std::process;
use std::sync::{Mutex, mpsc}; use std::sync::{mpsc, Mutex};
use std::{cmp::Ordering, sync::Arc}; use std::{cmp::Ordering, sync::Arc};
use crate::terminal::view::LeftPanelTargetView; use crate::terminal::view::LeftPanelTargetView;
@@ -1919,16 +1919,12 @@ impl Workspace {
&& ai_settings.default_tab_config_path() == path.to_string_lossy(); && ai_settings.default_tab_config_path() == path.to_string_lossy();
if is_removed_default { if is_removed_default {
AISettings::handle(ctx).update(ctx, |settings, ctx| { AISettings::handle(ctx).update(ctx, |settings, ctx| {
report_if_error!( report_if_error!(settings
settings .default_session_mode_internal
.default_session_mode_internal .set_value(DefaultSessionMode::Terminal, ctx));
.set_value(DefaultSessionMode::Terminal, ctx) report_if_error!(settings
); .default_tab_config_path
report_if_error!( .set_value(String::new(), ctx));
settings
.default_tab_config_path
.set_value(String::new(), ctx)
);
}); });
} }
if let Err(e) = std::fs::remove_file(path) { if let Err(e) = std::fs::remove_file(path) {
@@ -5507,11 +5503,9 @@ impl Workspace {
right, right,
}; };
TabSettings::handle(ctx).update(ctx, |settings, ctx| { TabSettings::handle(ctx).update(ctx, |settings, ctx| {
report_if_error!( report_if_error!(settings
settings .header_toolbar_chip_selection
.header_toolbar_chip_selection .set_value(selection, ctx));
.set_value(selection, ctx)
);
}); });
} }
@@ -5559,11 +5553,9 @@ impl Workspace {
if !FeatureFlag::ConfigurableToolbar.is_enabled() { if !FeatureFlag::ConfigurableToolbar.is_enabled() {
return; return;
} }
let items = vec![ let items = vec![MenuItemFields::new("Re-arrange toolbar items")
MenuItemFields::new("Re-arrange toolbar items") .with_on_select_action(WorkspaceAction::OpenHeaderToolbarEditor)
.with_on_select_action(WorkspaceAction::OpenHeaderToolbarEditor) .into_item()];
.into_item(),
];
self.header_toolbar_context_menu self.header_toolbar_context_menu
.update(ctx, |menu, ctx| menu.set_items(items, ctx)); .update(ctx, |menu, ctx| menu.set_items(items, ctx));
self.show_header_toolbar_context_menu = Some(position); self.show_header_toolbar_context_menu = Some(position);
@@ -7616,21 +7608,17 @@ impl Workspace {
fn toggle_recording_mode(&self, ctx: &mut ViewContext<Self>) { fn toggle_recording_mode(&self, ctx: &mut ViewContext<Self>) {
DebugSettings::handle(ctx).update(ctx, |debug_settings, settings_ctx| { DebugSettings::handle(ctx).update(ctx, |debug_settings, settings_ctx| {
report_if_error!( report_if_error!(debug_settings
debug_settings .recording_mode
.recording_mode .toggle_and_save_value(settings_ctx));
.toggle_and_save_value(settings_ctx)
);
}); });
} }
fn toggle_in_band_generators(&self, ctx: &mut ViewContext<Self>) { fn toggle_in_band_generators(&self, ctx: &mut ViewContext<Self>) {
DebugSettings::handle(ctx).update(ctx, |debug_settings, settings_ctx| { DebugSettings::handle(ctx).update(ctx, |debug_settings, settings_ctx| {
report_if_error!( report_if_error!(debug_settings
debug_settings .are_in_band_generators_for_all_sessions_enabled
.are_in_band_generators_for_all_sessions_enabled .toggle_and_save_value(settings_ctx));
.toggle_and_save_value(settings_ctx)
);
}); });
} }
@@ -7793,11 +7781,9 @@ impl Workspace {
// Mark that we've done the one-time auto-open // Mark that we've done the one-time auto-open
AISettings::handle(ctx).update(ctx, |settings, ctx| { AISettings::handle(ctx).update(ctx, |settings, ctx| {
report_if_error!( report_if_error!(settings
settings .has_auto_opened_conversation_list
.has_auto_opened_conversation_list .set_value(true, ctx));
.set_value(true, ctx)
);
}); });
} }
@@ -9710,11 +9696,9 @@ impl Workspace {
pub fn toggle_block_snackbar(&mut self, ctx: &mut ViewContext<Self>) { pub fn toggle_block_snackbar(&mut self, ctx: &mut ViewContext<Self>) {
BlockListSettings::handle(ctx).update(ctx, |blocklist_settings, ctx| { BlockListSettings::handle(ctx).update(ctx, |blocklist_settings, ctx| {
report_if_error!( report_if_error!(blocklist_settings
blocklist_settings .snackbar_enabled
.snackbar_enabled .toggle_and_save_value(ctx));
.toggle_and_save_value(ctx)
);
}); });
} }
@@ -9726,11 +9710,9 @@ impl Workspace {
pub fn toggle_syntax_highlighting(&mut self, ctx: &mut ViewContext<Self>) { pub fn toggle_syntax_highlighting(&mut self, ctx: &mut ViewContext<Self>) {
InputSettings::handle(ctx).update(ctx, |input_settings, ctx| { InputSettings::handle(ctx).update(ctx, |input_settings, ctx| {
report_if_error!( report_if_error!(input_settings
input_settings .syntax_highlighting
.syntax_highlighting .toggle_and_save_value(ctx));
.toggle_and_save_value(ctx)
);
}); });
} }
@@ -9745,11 +9727,9 @@ impl Workspace {
ctx: &mut ViewContext<Self>, ctx: &mut ViewContext<Self>,
) { ) {
AccessibilitySettings::handle(ctx).update(ctx, |accessibility_settings, ctx| { AccessibilitySettings::handle(ctx).update(ctx, |accessibility_settings, ctx| {
report_if_error!( report_if_error!(accessibility_settings
accessibility_settings .a11y_verbosity
.a11y_verbosity .set_value(verbosity, ctx));
.set_value(verbosity, ctx)
);
}); });
} }
@@ -15569,11 +15549,9 @@ impl Workspace {
fn reset_zoom(&mut self, ctx: &mut ViewContext<Self>) { fn reset_zoom(&mut self, ctx: &mut ViewContext<Self>) {
WindowSettings::handle(ctx).update(ctx, |window_settings, ctx| { WindowSettings::handle(ctx).update(ctx, |window_settings, ctx| {
report_if_error!( report_if_error!(window_settings
window_settings .zoom_level
.zoom_level .set_value(ZoomLevel::default_value(), ctx));
.set_value(ZoomLevel::default_value(), ctx)
);
}); });
} }
@@ -15593,11 +15571,9 @@ impl Workspace {
}; };
WindowSettings::handle(ctx).update(ctx, |window_settings, ctx| { WindowSettings::handle(ctx).update(ctx, |window_settings, ctx| {
report_if_error!( report_if_error!(window_settings
window_settings .zoom_level
.zoom_level .set_value(crate::window_settings::ZoomLevel::VALUES[next_index], ctx));
.set_value(crate::window_settings::ZoomLevel::VALUES[next_index], ctx)
);
}); });
} }
@@ -15610,11 +15586,9 @@ impl Workspace {
fn set_terminal_font_size(&mut self, new_font_size: f32, ctx: &mut ViewContext<Self>) { fn set_terminal_font_size(&mut self, new_font_size: f32, ctx: &mut ViewContext<Self>) {
FontSettings::handle(ctx).update(ctx, |font_settings, ctx| { FontSettings::handle(ctx).update(ctx, |font_settings, ctx| {
report_if_error!( report_if_error!(font_settings
font_settings .monospace_font_size
.monospace_font_size .set_value(new_font_size, ctx));
.set_value(new_font_size, ctx)
);
}); });
} }
@@ -15864,8 +15838,8 @@ impl Workspace {
} }
fn handle_codex_modal_event(&mut self, event: &CodexModalEvent, ctx: &mut ViewContext<Self>) { fn handle_codex_modal_event(&mut self, event: &CodexModalEvent, ctx: &mut ViewContext<Self>) {
use crate::AIExecutionProfilesModel;
use crate::ai::blocklist::agent_view::AgentViewEntryOrigin; use crate::ai::blocklist::agent_view::AgentViewEntryOrigin;
use crate::AIExecutionProfilesModel;
match event { match event {
CodexModalEvent::Close => { CodexModalEvent::Close => {
@@ -19654,16 +19628,12 @@ impl TypedActionView for Workspace {
} else { } else {
// Config missing or deleted — clear and fall through to Terminal. // Config missing or deleted — clear and fall through to Terminal.
AISettings::handle(ctx).update(ctx, |settings, ctx| { AISettings::handle(ctx).update(ctx, |settings, ctx| {
report_if_error!( report_if_error!(settings
settings .default_session_mode_internal
.default_session_mode_internal .set_value(DefaultSessionMode::Terminal, ctx));
.set_value(DefaultSessionMode::Terminal, ctx) report_if_error!(settings
); .default_tab_config_path
report_if_error!( .set_value(String::new(), ctx));
settings
.default_tab_config_path
.set_value(String::new(), ctx)
);
}); });
self.add_terminal_tab(false, ctx); self.add_terminal_tab(false, ctx);
} }
@@ -19783,11 +19753,9 @@ impl TypedActionView for Workspace {
AISettings::handle(ctx).update(ctx, |settings, ctx| { AISettings::handle(ctx).update(ctx, |settings, ctx| {
report_if_error!(settings.default_session_mode_internal.set_value(*mode, ctx)); report_if_error!(settings.default_session_mode_internal.set_value(*mode, ctx));
if let Some(path) = tab_config_path { if let Some(path) = tab_config_path {
report_if_error!( report_if_error!(settings
settings .default_tab_config_path
.default_tab_config_path .set_value(path.to_string_lossy().into_owned(), ctx));
.set_value(path.to_string_lossy().into_owned(), ctx)
);
} }
}); });
#[cfg(feature = "local_tty")] #[cfg(feature = "local_tty")]
@@ -25,8 +25,8 @@ use pathfinder_color::ColorU;
use pathfinder_geometry::vector::vec2f; use pathfinder_geometry::vector::vec2f;
use thousands::Separable; use thousands::Separable;
use crate::TelemetryEvent;
use crate::send_telemetry_from_ctx; use crate::send_telemetry_from_ctx;
use crate::TelemetryEvent;
const MODAL_WIDTH: f32 = 360.; const MODAL_WIDTH: f32 = 360.;
const MODAL_HEIGHT: f32 = 532.; const MODAL_HEIGHT: f32 = 532.;
@@ -1,12 +1,12 @@
use crate::ai::active_agent_views_model::ActiveAgentViewsModel; use crate::ai::active_agent_views_model::ActiveAgentViewsModel;
use crate::ai::active_agent_views_model::ConversationOrTaskId; use crate::ai::active_agent_views_model::ConversationOrTaskId;
use crate::ai::agent_conversations_model::ConversationOrTask; use crate::ai::agent_conversations_model::ConversationOrTask;
use crate::ai::conversation_status_ui::{STATUS_ELEMENT_PADDING, render_status_element}; use crate::ai::conversation_status_ui::{render_status_element, STATUS_ELEMENT_PADDING};
use crate::appearance::Appearance; use crate::appearance::Appearance;
use crate::drive::sharing::dialog::SharingDialog; use crate::drive::sharing::dialog::SharingDialog;
use crate::menu::Menu; use crate::menu::Menu;
use crate::ui_components::icons::Icon; use crate::ui_components::icons::Icon;
use crate::ui_components::menu_button::{MenuDirection, icon_button_with_context_menu}; use crate::ui_components::menu_button::{icon_button_with_context_menu, MenuDirection};
use crate::util::time_format::format_approx_duration_from_now_utc; use crate::util::time_format::format_approx_duration_from_now_utc;
use crate::util::truncation::truncate_from_end; use crate::util::truncation::truncate_from_end;
use crate::workspace::view::conversation_list::view::ConversationListViewAction; use crate::workspace::view::conversation_list::view::ConversationListViewAction;
@@ -10,25 +10,25 @@ use crate::ai::agent_conversations_model::{AgentConversationsModel, Conversation
use crate::ai::agent_management::telemetry::{AgentManagementTelemetryEvent, OpenedFrom}; use crate::ai::agent_management::telemetry::{AgentManagementTelemetryEvent, OpenedFrom};
use crate::ai::blocklist::history_model::BlocklistAIHistoryModel; use crate::ai::blocklist::history_model::BlocklistAIHistoryModel;
use crate::appearance::Appearance; use crate::appearance::Appearance;
use crate::drive::sharing::ShareableObject;
use crate::drive::sharing::dialog::SharingDialog; use crate::drive::sharing::dialog::SharingDialog;
use crate::drive::sharing::ShareableObject;
use crate::editor::{ use crate::editor::{
EditorView, Event as EditorEvent, PropagateAndNoOpNavigationKeys, EditorView, Event as EditorEvent, PropagateAndNoOpNavigationKeys,
PropagateHorizontalNavigationKeys, SingleLineEditorOptions, TextOptions, PropagateHorizontalNavigationKeys, SingleLineEditorOptions, TextOptions,
}; };
use crate::menu::{Event as MenuEvent, Menu, MenuItem, MenuItemFields}; use crate::menu::{Event as MenuEvent, Menu, MenuItem, MenuItemFields};
use crate::server::telemetry::SharingDialogSource; use crate::server::telemetry::SharingDialogSource;
use crate::view_components::DismissibleToast;
use crate::view_components::action_button::{ActionButton, ButtonSize, SecondaryTheme}; use crate::view_components::action_button::{ActionButton, ButtonSize, SecondaryTheme};
use crate::workspace::ToastStack; use crate::view_components::DismissibleToast;
use crate::workspace::WorkspaceAction;
use crate::workspace::global_actions::ForkedConversationDestination; use crate::workspace::global_actions::ForkedConversationDestination;
use crate::workspace::header_toolbar_item::HeaderToolbarItemKind; use crate::workspace::header_toolbar_item::HeaderToolbarItemKind;
use crate::workspace::tab_settings::TabSettings; use crate::workspace::tab_settings::TabSettings;
use crate::workspace::view::conversation_list::item::{ use crate::workspace::view::conversation_list::item::{
ItemProps, ItemState, OverflowMenuDisplay, STATIC_ITEM_MIN_HEIGHT, StaticItemProps, render_item, render_static_item, ItemProps, ItemState, OverflowMenuDisplay, StaticItemProps,
render_item, render_static_item, STATIC_ITEM_MIN_HEIGHT,
}; };
use crate::workspace::ToastStack;
use crate::workspace::WorkspaceAction;
use galaxy_core::features::FeatureFlag; use galaxy_core::features::FeatureFlag;
use galaxy_core::send_telemetry_from_ctx; use galaxy_core::send_telemetry_from_ctx;
use galaxy_core::ui::Icon; use galaxy_core::ui::Icon;
@@ -43,8 +43,8 @@ use galaxyui::elements::{
ScrollbarWidth, Shrinkable, Stack, Text, UniformList, UniformListState, ScrollbarWidth, Shrinkable, Stack, Text, UniformList, UniformListState,
}; };
use galaxyui::fonts::{Properties, Weight}; use galaxyui::fonts::{Properties, Weight};
use galaxyui::keymap::FixedBinding;
use galaxyui::keymap::macros::*; use galaxyui::keymap::macros::*;
use galaxyui::keymap::FixedBinding;
use galaxyui::platform::Cursor; use galaxyui::platform::Cursor;
use galaxyui::text_layout::TextAlignment; use galaxyui::text_layout::TextAlignment;
use galaxyui::{ use galaxyui::{
@@ -1,10 +1,10 @@
use crate::TelemetryEvent;
use crate::ai::{AIRequestUsageModel, AIRequestUsageModelEvent}; use crate::ai::{AIRequestUsageModel, AIRequestUsageModelEvent};
use crate::auth::AuthStateProvider; use crate::auth::AuthStateProvider;
use crate::pricing::{PricingInfoModel, PricingInfoModelEvent}; use crate::pricing::{PricingInfoModel, PricingInfoModelEvent};
use crate::ui_components::blended_colors; use crate::ui_components::blended_colors;
use crate::ui_components::icons::Icon; use crate::ui_components::icons::Icon;
use crate::workspaces::user_workspaces::UserWorkspaces; use crate::workspaces::user_workspaces::UserWorkspaces;
use crate::TelemetryEvent;
use asset_macro::bundled_or_fetched_asset; use asset_macro::bundled_or_fetched_asset;
use galaxy_core::send_telemetry_from_ctx; use galaxy_core::send_telemetry_from_ctx;
use galaxy_core::ui::appearance::Appearance; use galaxy_core::ui::appearance::Appearance;
@@ -1,5 +1,5 @@
use crate::workspace::view::global_search::SearchConfig;
use crate::workspace::view::global_search::view::GlobalSearchEvent; use crate::workspace::view::global_search::view::GlobalSearchEvent;
use crate::workspace::view::global_search::SearchConfig;
use anyhow::Result; use anyhow::Result;
use futures::StreamExt as _; use futures::StreamExt as _;
use galaxy_ripgrep::search::{Match as RipgrepMatch, Submatch}; use galaxy_ripgrep::search::{Match as RipgrepMatch, Submatch};
@@ -1,7 +1,7 @@
use std::path::PathBuf; use std::path::PathBuf;
use crate::workspace::view::global_search::SearchConfig;
use crate::workspace::view::global_search::view::GlobalSearchEvent; use crate::workspace::view::global_search::view::GlobalSearchEvent;
use crate::workspace::view::global_search::SearchConfig;
use galaxyui::{Entity, ModelContext}; use galaxyui::{Entity, ModelContext};
pub struct GlobalSearch {} pub struct GlobalSearch {}
+4 -4
View File
@@ -13,7 +13,6 @@ use galaxy_ripgrep::search::{Match as RipgrepMatch, Submatch};
use pathfinder_geometry::vector::vec2f; use pathfinder_geometry::vector::vec2f;
use string_offset::{ByteOffset, CharCounter}; use string_offset::{ByteOffset, CharCounter};
use crate::TelemetryEvent;
use crate::code::icon_from_file_path; use crate::code::icon_from_file_path;
use crate::debounce::debounce; use crate::debounce::debounce;
use crate::editor::{ use crate::editor::{
@@ -24,15 +23,16 @@ use crate::search::ItemHighlightState as SearchHighlightState;
use crate::ui_components::blended_colors; use crate::ui_components::blended_colors;
use crate::ui_components::icons::Icon as UiIcon; use crate::ui_components::icons::Icon as UiIcon;
use crate::ui_components::item_highlight::{ImageOrIcon, ItemHighlightState}; use crate::ui_components::item_highlight::{ImageOrIcon, ItemHighlightState};
use crate::ui_components::render_file_search_row::{FileSearchRowOptions, render_file_search_row}; use crate::ui_components::render_file_search_row::{render_file_search_row, FileSearchRowOptions};
use crate::view_components::action_button::{ActionButton, ButtonSize, NakedTheme}; use crate::view_components::action_button::{ActionButton, ButtonSize, NakedTheme};
use crate::workspace::view::global_search::SearchConfig;
use crate::workspace::view::global_search::model::GlobalSearch; use crate::workspace::view::global_search::model::GlobalSearch;
use crate::workspace::view::global_search::SearchConfig;
use crate::TelemetryEvent;
use galaxy_core::send_telemetry_from_ctx; use galaxy_core::send_telemetry_from_ctx;
use galaxy_core::ui::Icon;
use galaxy_core::ui::appearance::Appearance; use galaxy_core::ui::appearance::Appearance;
use galaxy_core::ui::theme::color::internal_colors; use galaxy_core::ui::theme::color::internal_colors;
use galaxy_core::ui::theme::{AnsiColorIdentifier, Fill as ThemeFill}; use galaxy_core::ui::theme::{AnsiColorIdentifier, Fill as ThemeFill};
use galaxy_core::ui::Icon;
use galaxyui::elements::{ use galaxyui::elements::{
Border, ChildAnchor, ChildView, Clipped, ConstrainedBox, Container, CornerRadius, Border, ChildAnchor, ChildView, Clipped, ConstrainedBox, Container, CornerRadius,
CrossAxisAlignment, DispatchEventResult, Empty, EventHandler, Fill, Flex, FormattedTextElement, CrossAxisAlignment, DispatchEventResult, Empty, EventHandler, Fill, Flex, FormattedTextElement,
+1 -1
View File
@@ -28,7 +28,7 @@ use galaxyui::ui_components::components::UiComponent;
use galaxyui::{ use galaxyui::{
AppContext, Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle, AppContext, Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle,
}; };
use markdown_parser::{FormattedText, FormattedTextLine, parse_markdown}; use markdown_parser::{parse_markdown, FormattedText, FormattedTextLine};
use pathfinder_color::ColorU; use pathfinder_color::ColorU;
use std::collections::HashMap; use std::collections::HashMap;
+8 -8
View File
@@ -5,15 +5,15 @@ use galaxy_core::ui::theme::color::internal_colors;
use galaxy_core::{send_telemetry_from_ctx, ui::Icon}; use galaxy_core::{send_telemetry_from_ctx, ui::Icon};
use galaxy_util::path::LineAndColumnArg; use galaxy_util::path::LineAndColumnArg;
use galaxyui::{ use galaxyui::{
AppContext, Entity, FocusContext, ModelHandle, SingletonEntity, TypedActionView, View,
ViewContext, ViewHandle, WeakViewHandle,
elements::{ elements::{
ChildView, ConstrainedBox, Container, CrossAxisAlignment, DragBarSide, Element, Empty, resizable_state_handle, ChildView, ConstrainedBox, Container, CrossAxisAlignment,
Flex, MainAxisAlignment, MainAxisSize, MouseStateHandle, ParentElement, Resizable, DragBarSide, Element, Empty, Flex, MainAxisAlignment, MainAxisSize, MouseStateHandle,
ResizableStateHandle, Shrinkable, resizable_state_handle, ParentElement, Resizable, ResizableStateHandle, Shrinkable,
}, },
platform::Cursor, platform::Cursor,
ui_components::components::{Coords, UiComponent, UiComponentStyles}, ui_components::components::{Coords, UiComponent, UiComponentStyles},
AppContext, Entity, FocusContext, ModelHandle, SingletonEntity, TypedActionView, View,
ViewContext, ViewHandle, WeakViewHandle,
}; };
use crate::ai::agent::conversation::AIConversationId; use crate::ai::agent::conversation::AIConversationId;
@@ -30,9 +30,9 @@ use crate::server::telemetry::{FileTreeSource, WarpDriveSource};
use crate::settings_view::keybindings::{KeybindingChangedEvent, KeybindingChangedNotifier}; use crate::settings_view::keybindings::{KeybindingChangedEvent, KeybindingChangedNotifier};
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use crate::util::file::external_editor::EditorSettings; use crate::util::file::external_editor::EditorSettings;
use crate::util::openable_file_type::FileTarget;
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use crate::util::openable_file_type::resolve_file_target_with_editor_choice; use crate::util::openable_file_type::resolve_file_target_with_editor_choice;
use crate::util::openable_file_type::FileTarget;
use crate::workspace::view::conversation_list::view::{ use crate::workspace::view::conversation_list::view::{
ConversationListView, Event as ConversationListViewEvent, ConversationListView, Event as ConversationListViewEvent,
}; };
@@ -46,11 +46,10 @@ use crate::workspace::view::{
TOGGLE_PROJECT_EXPLORER_BINDING_NAME, TOGGLE_WARP_DRIVE_BINDING_NAME, TOGGLE_PROJECT_EXPLORER_BINDING_NAME, TOGGLE_WARP_DRIVE_BINDING_NAME,
}; };
use crate::{ use crate::{
TelemetryEvent,
appearance::Appearance, appearance::Appearance,
code::file_tree::FileTreeView, code::file_tree::FileTreeView,
drive::panel::{MAX_SIDEBAR_WIDTH_RATIO, MIN_SIDEBAR_WIDTH}, drive::panel::{MAX_SIDEBAR_WIDTH_RATIO, MIN_SIDEBAR_WIDTH},
pane_group::pane::view::header::{PANE_HEADER_HEIGHT, components::HEADER_EDGE_PADDING}, pane_group::pane::view::header::{components::HEADER_EDGE_PADDING, PANE_HEADER_HEIGHT},
pane_group::{self}, pane_group::{self},
terminal::resizable_data::{ModalType, ResizableData}, terminal::resizable_data::{ModalType, ResizableData},
ui_components::{ ui_components::{
@@ -59,6 +58,7 @@ use crate::{
}, },
util::bindings::keybinding_name_to_display_string, util::bindings::keybinding_name_to_display_string,
workspace::WorkspaceAction, workspace::WorkspaceAction,
TelemetryEvent,
}; };
#[derive(Default)] #[derive(Default)]
+1 -1
View File
@@ -1,4 +1,3 @@
use crate::FeatureFlag;
use crate::pane_group::{NewTerminalOptions, PanesLayout}; use crate::pane_group::{NewTerminalOptions, PanesLayout};
use crate::settings::AISettings; use crate::settings::AISettings;
use crate::terminal; use crate::terminal;
@@ -6,6 +5,7 @@ use crate::terminal::view::{
AgentOnboardingVersion, OnboardingIntention, OnboardingVersion, TerminalAction, AgentOnboardingVersion, OnboardingIntention, OnboardingVersion, TerminalAction,
}; };
use crate::workspace::Workspace; use crate::workspace::Workspace;
use crate::FeatureFlag;
use galaxyui::{SingletonEntity as _, ViewContext}; use galaxyui::{SingletonEntity as _, ViewContext};
use onboarding::{ProjectOnboardingSettings, SelectedSettings}; use onboarding::{ProjectOnboardingSettings, SelectedSettings};
use std::collections::HashMap; use std::collections::HashMap;
@@ -1,3 +1,3 @@
mod view; mod view;
pub use view::{OpenWarpLaunchModal, OpenWarpLaunchModalEvent, init}; pub use view::{init, OpenWarpLaunchModal, OpenWarpLaunchModalEvent};
@@ -1,4 +1,4 @@
use galaxy_core::ui::theme::{Fill, phenomenon::PhenomenonStyle}; use galaxy_core::ui::theme::{phenomenon::PhenomenonStyle, Fill};
use galaxyui::assets::asset_cache::AssetSource; use galaxyui::assets::asset_cache::AssetSource;
use galaxyui::elements::{ use galaxyui::elements::{
Align, CacheOption, ChildAnchor, ChildView, ConstrainedBox, Container, CornerRadius, Align, CacheOption, ChildAnchor, ChildView, ConstrainedBox, Container, CornerRadius,
+10 -10
View File
@@ -3,27 +3,27 @@ use crate::code_review::code_review_header::HEADER_BUTTON_PADDING;
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use crate::code_review::code_review_view::CodeReviewAction; use crate::code_review::code_review_view::CodeReviewAction;
use crate::code_review::code_review_view::{ use crate::code_review::code_review_view::{
CONTENT_LEFT_MARGIN, CONTENT_RIGHT_MARGIN, CodeReviewView, render_file_navigation_button, render_file_navigation_button, CodeReviewView, CONTENT_LEFT_MARGIN, CONTENT_RIGHT_MARGIN,
}; };
use crate::code_review::code_review_view::{CodeReviewCommentDebugState, CodeReviewViewEvent}; use crate::code_review::code_review_view::{CodeReviewCommentDebugState, CodeReviewViewEvent};
use crate::code_review::telemetry_event::CodeReviewContextDestination; use crate::code_review::telemetry_event::CodeReviewContextDestination;
use crate::pane_group::pane::view::header::{components::HEADER_EDGE_PADDING, PANE_HEADER_HEIGHT};
use crate::pane_group::WorkingDirectoriesEvent; use crate::pane_group::WorkingDirectoriesEvent;
use crate::pane_group::pane::view::header::{PANE_HEADER_HEIGHT, components::HEADER_EDGE_PADDING};
use crate::pane_group::{Event as PaneGroupEvent, PaneGroup, WorkingDirectoriesModel}; use crate::pane_group::{Event as PaneGroupEvent, PaneGroup, WorkingDirectoriesModel};
use crate::settings::{AISettings, AISettingsChangedEvent}; use crate::settings::{AISettings, AISettingsChangedEvent};
use crate::terminal::CLIAgent;
use crate::terminal::cli_agent_sessions::CLIAgentSessionsModel; use crate::terminal::cli_agent_sessions::CLIAgentSessionsModel;
use crate::terminal::input::MenuPositioning; use crate::terminal::input::MenuPositioning;
use crate::terminal::CLIAgent;
use crate::ui_components::{buttons::icon_button_with_color, icons}; use crate::ui_components::{buttons::icon_button_with_color, icons};
use crate::util::bindings::{CustomAction, keybinding_name_to_display_string}; use crate::util::bindings::{keybinding_name_to_display_string, CustomAction};
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use crate::util::openable_file_type::FileTarget; use crate::util::openable_file_type::FileTarget;
use crate::view_components::action_button::{ActionButton, PaneHeaderTheme}; use crate::view_components::action_button::{ActionButton, PaneHeaderTheme};
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use crate::view_components::action_button::{NakedTheme, TooltipAlignment}; use crate::view_components::action_button::{NakedTheme, TooltipAlignment};
use crate::view_components::{Dropdown, DropdownItem}; use crate::view_components::{Dropdown, DropdownItem};
use crate::workspace::WorkspaceAction;
use crate::workspace::view::TOGGLE_RIGHT_PANEL_BINDING_NAME; use crate::workspace::view::TOGGLE_RIGHT_PANEL_BINDING_NAME;
use crate::workspace::WorkspaceAction;
use crate::{ use crate::{
appearance::Appearance, appearance::Appearance,
drive::panel::{MAX_SIDEBAR_WIDTH_RATIO, MIN_SIDEBAR_WIDTH}, drive::panel::{MAX_SIDEBAR_WIDTH_RATIO, MIN_SIDEBAR_WIDTH},
@@ -34,16 +34,16 @@ use dunce::canonicalize;
use galaxy_core::features::FeatureFlag; use galaxy_core::features::FeatureFlag;
use galaxy_core::ui::Icon; use galaxy_core::ui::Icon;
use galaxy_util::path::LineAndColumnArg; use galaxy_util::path::LineAndColumnArg;
use galaxyui::EntityId;
use galaxyui::elements::{ChildAnchor, Empty, PositionedElementAnchor}; use galaxyui::elements::{ChildAnchor, Empty, PositionedElementAnchor};
use galaxyui::keymap::EditableBinding; use galaxyui::keymap::EditableBinding;
use galaxyui::EntityId;
use galaxyui::{ use galaxyui::{
elements::{
resizable_state_handle, Container, DragBarSide, Element, MainAxisSize, MouseStateHandle,
Resizable, ResizableStateHandle,
},
AppContext, Entity, ModelHandle, SingletonEntity, TypedActionView, View, ViewContext, AppContext, Entity, ModelHandle, SingletonEntity, TypedActionView, View, ViewContext,
ViewHandle, WeakViewHandle, ViewHandle, WeakViewHandle,
elements::{
Container, DragBarSide, Element, MainAxisSize, MouseStateHandle, Resizable,
ResizableStateHandle, resizable_state_handle,
},
}; };
use galaxyui::{ use galaxyui::{
elements::{ elements::{
+1 -1
View File
@@ -1,11 +1,11 @@
//! Logic to determine the working directory for new terminal sessions. //! Logic to determine the working directory for new terminal sessions.
use super::Workspace; use super::Workspace;
use crate::terminal::ShellLaunchData;
use crate::terminal::available_shells::AvailableShell; use crate::terminal::available_shells::AvailableShell;
#[cfg(feature = "local_tty")] #[cfg(feature = "local_tty")]
use crate::terminal::available_shells::AvailableShells; use crate::terminal::available_shells::AvailableShells;
use crate::terminal::session_settings::{NewSessionSource, SessionSettings}; use crate::terminal::session_settings::{NewSessionSource, SessionSettings};
use crate::terminal::ShellLaunchData;
use galaxyui::SingletonEntity; use galaxyui::SingletonEntity;
use galaxyui::{AppContext, ViewContext, WindowId}; use galaxyui::{AppContext, ViewContext, WindowId};
use std::path::PathBuf; use std::path::PathBuf;
+17 -17
View File
@@ -1,22 +1,22 @@
pub mod telemetry; pub mod telemetry;
use crate::FeatureFlag;
use crate::ai::agent::conversation::ConversationStatus; use crate::ai::agent::conversation::ConversationStatus;
use crate::ai::agent_management::AgentNotificationsModel; use crate::ai::agent_management::AgentNotificationsModel;
use crate::code::editor::{add_color, remove_color}; use crate::code::editor::{add_color, remove_color};
use crate::code::icon_from_file_path; use crate::code::icon_from_file_path;
use crate::safe_triangle::SafeTriangle; use crate::safe_triangle::SafeTriangle;
use crate::send_telemetry_from_app_ctx; use crate::send_telemetry_from_app_ctx;
use crate::terminal::CLIAgent;
use crate::terminal::cli_agent_sessions::CLIAgentSessionsModel;
use crate::terminal::cli_agent_sessions::listener::agent_supports_rich_status; use crate::terminal::cli_agent_sessions::listener::agent_supports_rich_status;
use crate::terminal::cli_agent_sessions::CLIAgentSessionsModel;
use crate::terminal::view::TerminalViewState; use crate::terminal::view::TerminalViewState;
use crate::terminal::CLIAgent;
use crate::ui_components::icon_with_status::{ use crate::ui_components::icon_with_status::{
IconWithStatusSizing, IconWithStatusVariant, render_icon_with_status, render_icon_with_status, IconWithStatusSizing, IconWithStatusVariant,
}; };
use crate::workspace::view::vertical_tabs::telemetry::{ use crate::workspace::view::vertical_tabs::telemetry::{
VerticalTabsChipEntrypoint, VerticalTabsTelemetryEvent, VerticalTabsChipEntrypoint, VerticalTabsTelemetryEvent,
}; };
use crate::FeatureFlag;
use std::cell::RefCell; use std::cell::RefCell;
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
@@ -24,16 +24,16 @@ use std::sync::{Arc, Mutex};
use crate::appearance::Appearance; use crate::appearance::Appearance;
use crate::context_chips::display_chip::GitLineChanges; use crate::context_chips::display_chip::GitLineChanges;
use crate::context_chips::github_pr_display_text_from_url; use crate::context_chips::github_pr_display_text_from_url;
use crate::drive::{DriveObjectType, cloud_object_styling::warp_drive_icon_color}; use crate::drive::{cloud_object_styling::warp_drive_icon_color, DriveObjectType};
use crate::editor::EditorView; use crate::editor::EditorView;
use crate::pane_group::TerminalPane;
use crate::pane_group::pane::IPaneType; use crate::pane_group::pane::IPaneType;
use crate::pane_group::TerminalPane;
use crate::pane_group::{ use crate::pane_group::{
CodePane, NotebookPane, PaneGroup, PaneId, TabBarHoverIndex, WorkflowPane, CodePane, NotebookPane, PaneGroup, PaneId, TabBarHoverIndex, WorkflowPane,
}; };
use crate::tab::{SelectedTabColor, TabData, tab_position_id}; use crate::tab::{tab_position_id, SelectedTabColor, TabData};
use crate::terminal::TerminalView;
use crate::terminal::session_settings::SessionSettings; use crate::terminal::session_settings::SessionSettings;
use crate::terminal::TerminalView;
use crate::themes::theme::Fill as ThemeFill; use crate::themes::theme::Fill as ThemeFill;
use crate::ui_components::buttons::combo_inner_button; use crate::ui_components::buttons::combo_inner_button;
use crate::ui_components::icons::Icon as UiIcon; use crate::ui_components::icons::Icon as UiIcon;
@@ -53,20 +53,20 @@ use languages::language_by_filename;
use galaxy_core::context_flag::ContextFlag; use galaxy_core::context_flag::ContextFlag;
use galaxy_core::telemetry::TelemetryEvent as _; use galaxy_core::telemetry::TelemetryEvent as _;
use galaxy_core::ui::Icon as WarpIcon;
use galaxy_core::ui::color::blend::Blend; use galaxy_core::ui::color::blend::Blend;
use galaxy_core::ui::color::coloru_with_opacity; use galaxy_core::ui::color::coloru_with_opacity;
use galaxy_core::ui::theme::color::internal_colors; use galaxy_core::ui::theme::color::internal_colors;
use galaxy_core::ui::theme::{AnsiColorIdentifier, Fill as WarpThemeFill, WarpTheme}; use galaxy_core::ui::theme::{AnsiColorIdentifier, Fill as WarpThemeFill, WarpTheme};
use galaxy_core::ui::Icon as WarpIcon;
use galaxyui::elements::DispatchEventResult; use galaxyui::elements::DispatchEventResult;
use galaxyui::elements::{ use galaxyui::elements::{
Border, ChildAnchor, Clipped, ClippedScrollStateHandle, ClippedScrollable, ConstrainedBox, resizable_state_handle, Border, ChildAnchor, Clipped, ClippedScrollStateHandle,
Container, CornerRadius, CrossAxisAlignment, DragAxis, DragBarSide, Draggable, DropShadow, ClippedScrollable, ConstrainedBox, Container, CornerRadius, CrossAxisAlignment, DragAxis,
DropTarget, Element, Empty, EventHandler, Expanded, Fill as ElementFill, Flex, Hoverable, DragBarSide, Draggable, DropShadow, DropTarget, Element, Empty, EventHandler, Expanded,
MainAxisSize, MouseStateHandle, OffsetPositioning, Padding, ParentAnchor, ParentElement, Fill as ElementFill, Flex, Hoverable, MainAxisSize, MouseStateHandle, OffsetPositioning,
ParentOffsetBounds, PositionedElementAnchor, PositionedElementOffsetBounds, Radius, Resizable, Padding, ParentAnchor, ParentElement, ParentOffsetBounds, PositionedElementAnchor,
ResizableStateHandle, SavePosition, ScrollTarget, ScrollToPositionMode, ScrollbarWidth, PositionedElementOffsetBounds, Radius, Resizable, ResizableStateHandle, SavePosition,
Shrinkable, Stack, Text, resizable_state_handle, ScrollTarget, ScrollToPositionMode, ScrollbarWidth, Shrinkable, Stack, Text,
}; };
use galaxyui::fonts::{Properties, Weight}; use galaxyui::fonts::{Properties, Weight};
use galaxyui::platform::Cursor; use galaxyui::platform::Cursor;
@@ -77,7 +77,7 @@ use galaxyui::ui_components::text_input::TextInput;
use galaxyui::{AppContext, EntityId, SingletonEntity, ViewHandle, WindowId}; use galaxyui::{AppContext, EntityId, SingletonEntity, ViewHandle, WindowId};
use pathfinder_color::ColorU; use pathfinder_color::ColorU;
use pathfinder_geometry::rect::RectF; use pathfinder_geometry::rect::RectF;
use pathfinder_geometry::vector::{Vector2F, vec2f}; use pathfinder_geometry::vector::{vec2f, Vector2F};
use settings::Setting as _; use settings::Setting as _;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
@@ -1,6 +1,6 @@
use galaxy_core::features::FeatureFlag; use galaxy_core::features::FeatureFlag;
use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc}; use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc};
use serde_json::{Value, json}; use serde_json::{json, Value};
use strum_macros::{EnumDiscriminants, EnumIter}; use strum_macros::{EnumDiscriminants, EnumIter};
use crate::workspace::tab_settings::{ use crate::workspace::tab_settings::{
@@ -4,16 +4,13 @@ use crate::pane_group::{PaneId, TerminalPaneId};
use crate::safe_triangle::SafeTriangle; use crate::safe_triangle::SafeTriangle;
use crate::terminal::CLIAgent; use crate::terminal::CLIAgent;
use crate::workspace::tab_settings::VerticalTabsDisplayGranularity; use crate::workspace::tab_settings::VerticalTabsDisplayGranularity;
use galaxyui::EntityId;
use galaxyui::elements::PositionedElementOffsetBounds; use galaxyui::elements::PositionedElementOffsetBounds;
use galaxyui::EntityId;
use pathfinder_geometry::rect::RectF; use pathfinder_geometry::rect::RectF;
use pathfinder_geometry::vector::Vector2F; use pathfinder_geometry::vector::Vector2F;
use std::path::PathBuf; use std::path::PathBuf;
use super::{ use super::{
AgentTabTextPreference, SummaryPaneKind, SummaryPaneKindIcons, TerminalAgentText,
TerminalPrimaryLineData, TerminalPrimaryLineFont, VerticalTabsDetailTarget,
VerticalTabsDetailTargetKind, VerticalTabsSummaryBranchEntry, VerticalTabsSummaryData,
branch_label_display, coalesce_summary_branch_entries, code_detail_kind_label, branch_label_display, coalesce_summary_branch_entries, code_detail_kind_label,
compact_branch_subtitle_display, detail_sidecar_width_and_bounds, compact_branch_subtitle_display, detail_sidecar_width_and_bounds,
detail_target_for_hovered_row, format_summary_primary_labels, detail_target_for_hovered_row, format_summary_primary_labels,
@@ -23,7 +20,9 @@ use super::{
summary_overflow_count, summary_search_text_fragments, terminal_kind_badge_label, summary_overflow_count, summary_search_text_fragments, terminal_kind_badge_label,
terminal_primary_line_data, terminal_pull_request_badge_label, terminal_search_text_fragments, terminal_primary_line_data, terminal_pull_request_badge_label, terminal_search_text_fragments,
terminal_title_fallback_font, uses_outer_group_container, visible_pane_ids_for_detail_target, terminal_title_fallback_font, uses_outer_group_container, visible_pane_ids_for_detail_target,
vtab_diff_stats_text, vtab_diff_stats_text, AgentTabTextPreference, SummaryPaneKind, SummaryPaneKindIcons,
TerminalAgentText, TerminalPrimaryLineData, TerminalPrimaryLineFont, VerticalTabsDetailTarget,
VerticalTabsDetailTargetKind, VerticalTabsSummaryBranchEntry, VerticalTabsSummaryData,
}; };
fn pane_id() -> PaneId { fn pane_id() -> PaneId {
+1 -1
View File
@@ -9,7 +9,6 @@ use crate::uri::browser_url_handler::parse_current_url;
use super::PanelPosition; use super::PanelPosition;
use crate::BlocklistAIHistoryModel;
use crate::ai::agent_conversations_model::AgentConversationsModel; use crate::ai::agent_conversations_model::AgentConversationsModel;
use crate::ai::conversation_details_panel::{ use crate::ai::conversation_details_panel::{
ConversationDetailsData, ConversationDetailsPanel, ConversationDetailsPanelEvent, ConversationDetailsData, ConversationDetailsPanel, ConversationDetailsPanelEvent,
@@ -22,6 +21,7 @@ use crate::view_components::action_button::{
use crate::wasm_nux_dialog::{WasmNUXDialog, WasmNUXDialogEvent}; use crate::wasm_nux_dialog::{WasmNUXDialog, WasmNUXDialogEvent};
use crate::workspace::action::WorkspaceAction; use crate::workspace::action::WorkspaceAction;
use crate::workspace::view::{NotebookSource, OpenWarpDriveObjectSettings, Workspace}; use crate::workspace::view::{NotebookSource, OpenWarpDriveObjectSettings, Workspace};
use crate::BlocklistAIHistoryModel;
const TRANSCRIPT_PANEL_WIDTH: f32 = 280.0; const TRANSCRIPT_PANEL_WIDTH: f32 = 280.0;
+42 -67
View File
@@ -1,5 +1,4 @@
use super::*; use super::*;
use crate::ai::AIRequestUsageModel;
use crate::ai::blocklist::{BlocklistAIHistoryModel, BlocklistAIPermissions}; use crate::ai::blocklist::{BlocklistAIHistoryModel, BlocklistAIPermissions};
use crate::ai::document::ai_document_model::AIDocumentModel; use crate::ai::document::ai_document_model::AIDocumentModel;
use crate::ai::execution_profiles::profiles::AIExecutionProfilesModel; use crate::ai::execution_profiles::profiles::AIExecutionProfilesModel;
@@ -9,6 +8,7 @@ use crate::ai::outline::RepoOutlines;
use crate::ai::persisted_workspace::PersistedWorkspace; use crate::ai::persisted_workspace::PersistedWorkspace;
use crate::ai::restored_conversations::RestoredAgentConversations; use crate::ai::restored_conversations::RestoredAgentConversations;
use crate::ai::skills::SkillManager; use crate::ai::skills::SkillManager;
use crate::ai::AIRequestUsageModel;
use crate::cloud_object::model::persistence::CloudModel; use crate::cloud_object::model::persistence::CloudModel;
use crate::cloud_object::model::view::CloudViewModel; use crate::cloud_object::model::view::CloudViewModel;
use crate::context_chips::prompt::Prompt; use crate::context_chips::prompt::Prompt;
@@ -22,12 +22,12 @@ use crate::pricing::PricingInfoModel;
use crate::suggestions::ignored_suggestions_model::IgnoredSuggestionsModel; use crate::suggestions::ignored_suggestions_model::IgnoredSuggestionsModel;
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use crate::user_config::tab_configs_dir; use crate::user_config::tab_configs_dir;
use repo_metadata::repositories::DetectedRepositories;
use repo_metadata::watcher::DirectoryWatcher;
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use repo_metadata::CanonicalizedPath; use repo_metadata::CanonicalizedPath;
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
use repo_metadata::RepoMetadataModel; use repo_metadata::RepoMetadataModel;
use repo_metadata::repositories::DetectedRepositories;
use repo_metadata::watcher::DirectoryWatcher;
use session_sharing_protocol::sharer::SessionSourceType; use session_sharing_protocol::sharer::SessionSourceType;
use std::collections::HashMap; use std::collections::HashMap;
#[cfg(feature = "local_fs")] #[cfg(feature = "local_fs")]
@@ -41,8 +41,8 @@ use crate::server::sync_queue::SyncQueue;
use crate::server::telemetry::context_provider::AppTelemetryContextProvider; use crate::server::telemetry::context_provider::AppTelemetryContextProvider;
use crate::settings::PrivacySettings; use crate::settings::PrivacySettings;
use crate::settings_view::DisplayCount;
use crate::settings_view::keybindings::KeybindingChangedNotifier; use crate::settings_view::keybindings::KeybindingChangedNotifier;
use crate::settings_view::DisplayCount;
use crate::system::SystemStats; use crate::system::SystemStats;
use crate::tab_configs::tab_config::{TabConfigPaneNode, TabConfigPaneType}; use crate::tab_configs::tab_config::{TabConfigPaneNode, TabConfigPaneType};
use crate::terminal::history::History; use crate::terminal::history::History;
@@ -61,8 +61,8 @@ use crate::ai::active_agent_views_model::ActiveAgentViewsModel;
use crate::ai::agent_conversations_model::AgentConversationsModel; use crate::ai::agent_conversations_model::AgentConversationsModel;
use crate::ai::ambient_agents::github_auth_notifier::GitHubAuthNotifier; use crate::ai::ambient_agents::github_auth_notifier::GitHubAuthNotifier;
use crate::ai::mcp::{ use crate::ai::mcp::{
FileBasedMCPManager, FileMCPWatcher, gallery::MCPGalleryManager, gallery::MCPGalleryManager, templatable_manager::TemplatableMCPServerManager,
templatable_manager::TemplatableMCPServerManager, FileBasedMCPManager, FileMCPWatcher,
}; };
use crate::resource_center::Tip; use crate::resource_center::Tip;
use crate::terminal::cli_agent_sessions::CLIAgentSessionsModel; use crate::terminal::cli_agent_sessions::CLIAgentSessionsModel;
@@ -70,15 +70,15 @@ use crate::test_util::settings::initialize_settings_for_tests;
use crate::undo_close::UndoCloseSettings; use crate::undo_close::UndoCloseSettings;
use crate::warp_managed_paths_watcher::WarpManagedPathsWatcher; use crate::warp_managed_paths_watcher::WarpManagedPathsWatcher;
use crate::workflows::local_workflows::LocalWorkflows; use crate::workflows::local_workflows::LocalWorkflows;
use crate::{experiments, workspace, GlobalResourceHandlesProvider};
use crate::{AgentNotificationsModel, ObjectActions}; use crate::{AgentNotificationsModel, ObjectActions};
use crate::{GlobalResourceHandlesProvider, experiments, workspace};
use crate::settings::cloud_preferences_syncer::CloudPreferencesSyncer; use crate::settings::cloud_preferences_syncer::CloudPreferencesSyncer;
use ai::index::full_source_code_embedding::manager::CodebaseIndexManager; use ai::index::full_source_code_embedding::manager::CodebaseIndexManager;
use ai::project_context::model::ProjectContextModel; use ai::project_context::model::ProjectContextModel;
use galaxy_editor::editor::NavigationKey; use galaxy_editor::editor::NavigationKey;
use galaxyui::AddSingletonModel; use galaxyui::AddSingletonModel;
use galaxyui::{App, ViewHandle, platform::WindowStyle}; use galaxyui::{platform::WindowStyle, App, ViewHandle};
use pane_group::{NotebookPane, PaneState, SplitPaneState, TerminalPaneId}; use pane_group::{NotebookPane, PaneState, SplitPaneState, TerminalPaneId};
use session_sharing_protocol::common::SessionId; use session_sharing_protocol::common::SessionId;
use terminal::shared_session::permissions_manager::SessionPermissionsManager; use terminal::shared_session::permissions_manager::SessionPermissionsManager;
@@ -879,11 +879,9 @@ fn test_workspace_sessions_retrieves_tabs() {
.map(|tab| tab.read(ctx, |tab, _ctx| tab.pane_id_by_index(0).unwrap())) .map(|tab| tab.read(ctx, |tab, _ctx| tab.pane_id_by_index(0).unwrap()))
.expect("WindowId was not retrieved."); .expect("WindowId was not retrieved.");
assert!( assert!(workspace
workspace .workspace_sessions(ctx.window_id(), ctx)
.workspace_sessions(ctx.window_id(), ctx) .any(|x| { x.pane_view_locator().pane_id == pane_id }));
.any(|x| { x.pane_view_locator().pane_id == pane_id })
);
// Add a tab and check if workspace_sessions finds the second session from the new tab. // Add a tab and check if workspace_sessions finds the second session from the new tab.
workspace.add_terminal_tab(false, ctx); workspace.add_terminal_tab(false, ctx);
@@ -892,11 +890,9 @@ fn test_workspace_sessions_retrieves_tabs() {
.map(|tab| tab.read(ctx, |tab, _ctx| tab.pane_id_by_index(0).unwrap())) .map(|tab| tab.read(ctx, |tab, _ctx| tab.pane_id_by_index(0).unwrap()))
.expect("WindowId was not retrieved."); .expect("WindowId was not retrieved.");
assert!( assert!(workspace
workspace .workspace_sessions(ctx.window_id(), ctx)
.workspace_sessions(ctx.window_id(), ctx) .any(|x| { x.pane_view_locator().pane_id == new_pane_id }));
.any(|x| { x.pane_view_locator().pane_id == new_pane_id })
);
}); });
}); });
} }
@@ -921,11 +917,9 @@ fn test_workspace_sessions_retrieves_panes() {
.get_pane_group_view(0) .get_pane_group_view(0)
.map(|tab| tab.read(ctx, |tab, _ctx| tab.pane_id_by_index(1).unwrap())) .map(|tab| tab.read(ctx, |tab, _ctx| tab.pane_id_by_index(1).unwrap()))
.expect("WindowId was not retrieved."); .expect("WindowId was not retrieved.");
assert!( assert!(workspace
workspace .workspace_sessions(ctx.window_id(), ctx)
.workspace_sessions(ctx.window_id(), ctx) .any(|x| { x.pane_view_locator().pane_id == new_pane_id }));
.any(|x| { x.pane_view_locator().pane_id == new_pane_id })
);
}); });
}); });
} }
@@ -1667,11 +1661,8 @@ fn test_tab_context_menu_share_session_items() {
// for sharing are "Stop sharing" and "Stop sharing all". // for sharing are "Stop sharing" and "Stop sharing all".
workspace.read(&app, |workspace, ctx| { workspace.read(&app, |workspace, ctx| {
let items = workspace.tabs[1].menu_items(1, 3, ctx); let items = workspace.tabs[1].menu_items(1, 3, ctx);
assert!( assert!(items[0]
items[0].is_approximately_same_item_as( .is_approximately_same_item_as(&MenuItemFields::new("Stop sharing").into_item()));
&MenuItemFields::new("Stop sharing").into_item()
)
);
assert!(items[1].is_approximately_same_item_as( assert!(items[1].is_approximately_same_item_as(
&MenuItemFields::new("Stop sharing all").into_item() &MenuItemFields::new("Stop sharing all").into_item()
)); ));
@@ -1691,11 +1682,8 @@ fn test_tab_context_menu_share_session_items() {
// for sharing are "Share session" and "Stop sharing all". // for sharing are "Share session" and "Stop sharing all".
workspace.read(&app, |workspace, ctx| { workspace.read(&app, |workspace, ctx| {
let items = workspace.tabs[1].menu_items(1, 3, ctx); let items = workspace.tabs[1].menu_items(1, 3, ctx);
assert!( assert!(items[0]
items[0].is_approximately_same_item_as( .is_approximately_same_item_as(&MenuItemFields::new("Share session").into_item()));
&MenuItemFields::new("Share session").into_item()
)
);
assert!(items[1].is_approximately_same_item_as( assert!(items[1].is_approximately_same_item_as(
&MenuItemFields::new("Stop sharing all").into_item() &MenuItemFields::new("Stop sharing all").into_item()
)); ));
@@ -1710,11 +1698,8 @@ fn test_tab_context_menu_share_session_items() {
// When there's no shared sessions in a tab, the only option is "Share session". // When there's no shared sessions in a tab, the only option is "Share session".
workspace.read(&app, |workspace, ctx| { workspace.read(&app, |workspace, ctx| {
let items = workspace.tabs[1].menu_items(1, 3, ctx); let items = workspace.tabs[1].menu_items(1, 3, ctx);
assert!( assert!(items[0]
items[0].is_approximately_same_item_as( .is_approximately_same_item_as(&MenuItemFields::new("Share session").into_item()));
&MenuItemFields::new("Share session").into_item()
)
);
assert!(items[1].is_approximately_same_item_as(&MenuItem::Separator)); assert!(items[1].is_approximately_same_item_as(&MenuItem::Separator));
}); });
}); });
@@ -2691,13 +2676,11 @@ fn test_worktree_sidecar_search_editor_proxies_navigation_and_escape() {
assert!(workspace.show_new_session_dropdown_menu.is_none()); assert!(workspace.show_new_session_dropdown_menu.is_none());
assert!(!workspace.show_new_session_sidecar); assert!(!workspace.show_new_session_sidecar);
assert!(workspace.worktree_sidecar_search_query.is_empty()); assert!(workspace.worktree_sidecar_search_query.is_empty());
assert!( assert!(workspace
workspace .worktree_sidecar_search_editor
.worktree_sidecar_search_editor .as_ref(ctx)
.as_ref(ctx) .buffer_text(ctx)
.buffer_text(ctx) .is_empty());
.is_empty()
);
}); });
}); });
} }
@@ -2797,11 +2780,9 @@ fn test_vertical_tabs_context_menu_does_not_show_hover_only_tab_bar() {
workspace.update(&mut app, |workspace, ctx| { workspace.update(&mut app, |workspace, ctx| {
TabSettings::handle(ctx).update(ctx, |settings, ctx| { TabSettings::handle(ctx).update(ctx, |settings, ctx| {
report_if_error!( report_if_error!(settings
settings .workspace_decoration_visibility
.workspace_decoration_visibility .set_value(WorkspaceDecorationVisibility::OnHover, ctx));
.set_value(WorkspaceDecorationVisibility::OnHover, ctx)
);
report_if_error!(settings.use_vertical_tabs.set_value(true, ctx)); report_if_error!(settings.use_vertical_tabs.set_value(true, ctx));
}); });
workspace.should_show_ai_assistant_warm_welcome = false; workspace.should_show_ai_assistant_warm_welcome = false;
@@ -2826,11 +2807,9 @@ fn test_standard_tab_context_menu_shows_hover_only_tab_bar() {
workspace.update(&mut app, |workspace, ctx| { workspace.update(&mut app, |workspace, ctx| {
TabSettings::handle(ctx).update(ctx, |settings, ctx| { TabSettings::handle(ctx).update(ctx, |settings, ctx| {
report_if_error!( report_if_error!(settings
settings .workspace_decoration_visibility
.workspace_decoration_visibility .set_value(WorkspaceDecorationVisibility::OnHover, ctx));
.set_value(WorkspaceDecorationVisibility::OnHover, ctx)
);
}); });
workspace.should_show_ai_assistant_warm_welcome = false; workspace.should_show_ai_assistant_warm_welcome = false;
@@ -2864,12 +2843,10 @@ fn test_open_cloud_agent_setup_guide_action_opens_management_view_and_is_idempot
.current_workspace_state .current_workspace_state
.is_agent_management_view_open .is_agent_management_view_open
); );
assert!( assert!(workspace
workspace .agent_management_view
.agent_management_view .as_ref(ctx)
.as_ref(ctx) .is_showing_setup_guide());
.is_showing_setup_guide()
);
workspace.handle_action(&WorkspaceAction::OpenCloudAgentSetupGuide, ctx); workspace.handle_action(&WorkspaceAction::OpenCloudAgentSetupGuide, ctx);
assert!( assert!(
@@ -2877,12 +2854,10 @@ fn test_open_cloud_agent_setup_guide_action_opens_management_view_and_is_idempot
.current_workspace_state .current_workspace_state
.is_agent_management_view_open .is_agent_management_view_open
); );
assert!( assert!(workspace
workspace .agent_management_view
.agent_management_view .as_ref(ctx)
.as_ref(ctx) .is_showing_setup_guide());
.is_showing_setup_guide()
);
}); });
}); });
} }