Fix cursor focus and selection in input box, add AWS env var warning box, and remove AWS Bedrock login banner

This commit is contained in:
2026-07-02 14:54:15 -05:00
parent 4770ac06b5
commit 3769646ca6
1194 changed files with 5312 additions and 8032 deletions
@@ -87,6 +87,8 @@ impl TryFrom<RequestCommandOutputResult> for api::request::input::tool_call_resu
output: "User cancelled the command before it executed."
.to_string(),
exit_code: 130,
start_ts: None,
finish_ts: None,
},
)),
},
@@ -162,6 +164,8 @@ impl TryFrom<WriteToLongRunningShellCommandResult>
command_id: String::new(),
output: "User cancelled the long-running shell command.".to_string(),
exit_code: 130,
start_ts: None,
finish_ts: None,
}
))
},
+2
View File
@@ -5,6 +5,8 @@ use std::ops::Range;
use std::time::SystemTime;
use chrono::{DateTime, Local};
use galaxy_core::command::ExitCode;
use galaxy_terminal::model::BlockId;
use itertools::Itertools as _;
use serde::{Deserialize, Serialize};
use warp_multi_agent_api::apply_file_diffs_result::success::UpdatedFileContent;
+2 -2
View File
@@ -1,10 +1,10 @@
use std::time::{Duration, SystemTime};
use galaxyui_core::{Entity, ModelContext, SingletonEntity};
use galaxyui_extras::secure_storage::{self, AppContextExt};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use warp_multi_agent_api as api;
use galaxyui_core::{Entity, ModelContext, SingletonEntity};
use galaxyui_extras::secure_storage::{self, AppContextExt};
pub use crate::aws_credentials::{AwsCredentials, AwsCredentialsState};
pub use crate::geap_credentials::{
+12
View File
@@ -43,6 +43,18 @@ impl AwsCredentials {
}
}
pub fn access_key(&self) -> &str {
&self.access_key
}
pub fn secret_key(&self) -> &str {
&self.secret_key
}
pub fn session_token(&self) -> Option<&str> {
self.session_token.as_deref()
}
pub fn expires_at(&self) -> Option<SystemTime> {
self.expires_at
}
+2 -2
View File
@@ -5,6 +5,7 @@ use std::path::Path;
use anyhow::anyhow;
use arborium::tree_sitter::{Parser, Query, QueryCursor, Tree};
use futures::channel::oneshot;
use galaxy_util::standardized_path::StandardizedPath;
use ignore::gitignore::Gitignore;
use itertools::Itertools;
use rayon::prelude::*;
@@ -12,7 +13,6 @@ use repo_metadata::entry::{is_file_parsable, BudgetExceededBehavior, IgnoredPath
use repo_metadata::RepositoryUpdate;
use streaming_iterator::StreamingIterator;
use syntax_tree::TextSlice;
use warp_util::standardized_path::StandardizedPath;
use crate::index::file_outline::{FileOutline, Outline, Symbol};
use crate::index::{Entry, FileId, FileMetadata, THREADPOOL};
@@ -122,7 +122,7 @@ impl Outline {
// Extract paths from TargetFile for addition, filtering out gitignored files
for target_file in added
.into_iter()
.chain(modified.into_iter())
.chain(modified)
.chain(moved.keys().cloned())
.filter(|target_file| !target_file.is_ignored)
{
@@ -1,8 +1,8 @@
use std::path::Path;
use string_offset::ByteOffset;
#[cfg(not(target_family = "wasm"))]
use warp_util::standardized_path::StandardizedPath;
use galaxy_util::standardized_path::StandardizedPath;
use string_offset::ByteOffset;
mod naive;
#[cfg(not(target_family = "wasm"))]
@@ -1,7 +1,7 @@
use std::path::Path;
use galaxy_util::standardized_path::StandardizedPath;
use languages::language_by_filename;
use warp_util::standardized_path::StandardizedPath;
use super::*;
@@ -9,13 +9,12 @@ use async_channel;
use chrono::{DateTime, Utc};
use futures::stream::AbortHandle;
use galaxy_core::safe_error;
use galaxyui::{Entity, ModelContext, ModelHandle};
use galaxyui_core::{Entity, ModelContext, ModelHandle};
use ignore::gitignore::Gitignore;
use instant::Instant;
#[cfg(feature = "local_fs")]
use repo_metadata::entry::{BudgetExceededBehavior, IgnoredPathStrategy};
use repo_metadata::Repository;
use galaxyui_core::{Entity, ModelContext, ModelHandle};
use super::fragment_metadata::{
FragmentMetadata, LeafToFragmentMetadata, LeafToFragmentMetadataUpdates,
@@ -6,11 +6,11 @@ use std::sync::Arc;
use chrono::Utc;
use futures::executor::block_on;
use galaxy_util::standardized_path::StandardizedPath;
use galaxyui_core::{App, SingletonEntity};
use repo_metadata::DirectoryWatcher;
use string_offset::ByteOffset;
use virtual_fs::{Stub, VirtualFS};
use warp_util::standardized_path::StandardizedPath;
use galaxyui_core::{App, SingletonEntity};
use super::{
CodebaseIndex, CodebaseIndexTimeStampMetadata, ServerSyncResult, TreeSourceSyncState,
@@ -3,9 +3,9 @@ use std::sync::Arc;
#[cfg(feature = "local_fs")]
use chrono::Utc;
use galaxyui_core::App;
#[cfg(feature = "local_fs")]
use repo_metadata::DirectoryWatcher;
use galaxyui_core::App;
use super::{
BuildSource, CodebaseIndexFinishedStatus, CodebaseIndexManager, CodebaseIndexManagerConfig,
@@ -119,7 +119,7 @@ impl From<EmbeddingConfig> for galaxy_graphql::full_source_code_embedding::Embed
galaxy_graphql::full_source_code_embedding::EmbeddingConfig::Voyage35Lite512
}
EmbeddingConfig::Voyage4_512 => {
warp_graphql::full_source_code_embedding::EmbeddingConfig::Voyage4512
galaxy_graphql::full_source_code_embedding::EmbeddingConfig::Voyage4512
}
}
}
@@ -144,7 +144,7 @@ impl TryFrom<galaxy_graphql::full_source_code_embedding::EmbeddingConfig> for Em
galaxy_graphql::full_source_code_embedding::EmbeddingConfig::Voyage35512 => {
Ok(Self::Voyage3_5_512)
}
warp_graphql::full_source_code_embedding::EmbeddingConfig::Voyage4512 => {
galaxy_graphql::full_source_code_embedding::EmbeddingConfig::Voyage4512 => {
Ok(Self::Voyage4_512)
}
}
@@ -214,7 +214,7 @@ impl From<Fragment> for galaxy_graphql::queries::rerank_fragments::RerankFragmen
Self {
content: val.content,
content_hash: val.content_hash.into(),
location: FragmentLocationInput {
location: galaxy_graphql::queries::rerank_fragments::FragmentLocationInput {
byte_start: val.location.byte_range.start.as_usize() as i32,
byte_end: val.location.byte_range.end.as_usize() as i32,
file_path: val.location.absolute_path.to_string_lossy().to_string(),
@@ -5,11 +5,9 @@ use std::time::Duration;
use chrono::Utc;
#[cfg(feature = "local_fs")]
use galaxyui::ModelHandle;
use galaxyui_core::ModelHandle;
#[cfg(feature = "local_fs")]
use repo_metadata::Repository;
#[cfg(feature = "local_fs")]
use galaxyui_core::ModelHandle;
cfg_if::cfg_if! {
if #[cfg(feature = "local_fs")] {
@@ -6,8 +6,8 @@ use std::pin::Pin;
use std::sync::Arc;
use anyhow::{anyhow, Result};
use itertools::Itertools;
use galaxy_core::sync_queue::{IsTransientError, SyncQueue, SyncQueueTaskTrait};
use itertools::Itertools;
use super::changed_files::ChangedFiles;
use super::codebase_index::{build_fragments_from_metadata, SyncProgress};
@@ -272,7 +272,7 @@ impl<'a> CodebaseIndexSyncOperation<'a> {
}
let fragment_metadata_clone = fragment_metadatas.clone();
let res = build_fragments_from_metadata(fragment_metadata_clone.into_iter()).await;
let res = build_fragments_from_metadata(fragment_metadata_clone).await;
if !res.fail_to_read.is_empty() {
let failed_node_count = res.fail_to_read.len();
+1
View File
@@ -3,6 +3,7 @@ use galaxy_util::path::{
convert_msys2_to_windows_native_path, convert_wsl_to_windows_host_path, msys2_exe_to_root,
};
use galaxyui_core::platform::OperatingSystem;
use typed_path::{TypedPath, TypedPathBuf, WindowsPath};
fn use_unix_paths(shell: Option<&ShellLaunchData>) -> bool {
OperatingSystem::get().is_linux()
@@ -1,4 +1,4 @@
use warp_util::local_or_remote_path::LocalOrRemotePath;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use galaxyui_core::ModelContext;
use super::model::{ProjectContextModel, ProjectRule};
@@ -2,14 +2,14 @@ use std::collections::{BTreeMap, HashMap};
use std::path::{Path, PathBuf};
use async_channel::Sender;
use galaxy_core::safe_warn;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use galaxy_util::standardized_path::StandardizedPath;
use galaxyui_core::{ModelContext, ModelHandle, SingletonEntity};
use repo_metadata::repository::{RepositorySubscriber, SubscriberId};
use repo_metadata::{DirectoryWatcher, Repository, RepositoryUpdate};
use strum::IntoEnumIterator;
use strum_macros::EnumIter;
use galaxy_core::safe_warn;
use warp_util::local_or_remote_path::LocalOrRemotePath;
use warp_util::standardized_path::StandardizedPath;
use galaxyui_core::{ModelContext, ModelHandle, SingletonEntity};
use watcher::{HomeDirectoryWatcher, HomeDirectoryWatcherEvent};
use super::model::{GlobalRulesDelta, ProjectContextModel, ProjectContextModelEvent, ProjectRule};
+40 -5
View File
@@ -56,12 +56,21 @@ pub struct ProjectRule {
#[derive(Debug, Clone)]
struct RuleAtPath {
parent_path: LocalOrRemotePath,
galaxy_md: Option<ProjectRule>,
warp_md: Option<ProjectRule>,
claude_md: Option<ProjectRule>,
agents_md: Option<ProjectRule>,
}
impl RuleAtPath {
fn respected_rule(&self) -> Option<&ProjectRule> {
self.galaxy_md
.as_ref()
.or(self.warp_md.as_ref())
.or(self.claude_md.as_ref())
.or(self.agents_md.as_ref())
}
fn all_rules(&self) -> Vec<&ProjectRule> {
[
self.galaxy_md.as_ref(),
@@ -105,8 +114,10 @@ impl ProjectRules {
#[cfg_attr(not(feature = "local_fs"), allow(dead_code))]
fn rule_paths(&self) -> impl Iterator<Item = &LocalOrRemotePath> {
self.rules.iter().flat_map(|rule| {
rule.warp_md
rule.galaxy_md
.iter()
.chain(rule.warp_md.iter())
.chain(rule.claude_md.iter())
.chain(rule.agents_md.iter())
.map(|rule| &rule.path)
})
@@ -119,6 +130,13 @@ impl ProjectRules {
#[cfg_attr(not(feature = "local_fs"), allow(dead_code))]
fn retain_rule_paths(&mut self, retained_paths: &HashSet<LocalOrRemotePath>) {
self.rules.retain_mut(|rule| {
if rule
.galaxy_md
.as_ref()
.is_some_and(|rule| !retained_paths.contains(&rule.path))
{
rule.galaxy_md = None;
}
if rule
.warp_md
.as_ref()
@@ -126,6 +144,13 @@ impl ProjectRules {
{
rule.warp_md = None;
}
if rule
.claude_md
.as_ref()
.is_some_and(|rule| !retained_paths.contains(&rule.path))
{
rule.claude_md = None;
}
if rule
.agents_md
.as_ref()
@@ -133,7 +158,10 @@ impl ProjectRules {
{
rule.agents_md = None;
}
rule.warp_md.is_some() || rule.agents_md.is_some()
rule.galaxy_md.is_some()
|| rule.warp_md.is_some()
|| rule.claude_md.is_some()
|| rule.agents_md.is_some()
});
}
/// Finds the set of rules that are active in the given path and the set that are available to be applied.
@@ -185,15 +213,22 @@ impl ProjectRules {
None => {
let mut rule = RuleAtPath {
parent_path: parent,
galaxy_md: None,
warp_md: None,
claude_md: None,
agents_md: None,
};
if file_name.to_lowercase() == "warp.md" {
rule.warp_md = rule_file;
if file_name.to_lowercase() == "galaxy.md" {
rule.galaxy_md = rule_file.clone();
} else if file_name.to_lowercase() == "warp.md" {
rule.warp_md = rule_file.clone();
} else if file_name.to_lowercase() == "claude.md" {
rule.claude_md = rule_file.clone();
} else if file_name.to_lowercase() == "agents.md" {
rule.agents_md = rule_file;
rule.agents_md = rule_file.clone();
}
self.rules.push(rule);
self.rules.last_mut().unwrap()
}
};
+5 -5
View File
@@ -1,9 +1,9 @@
use std::path::PathBuf;
use warp_util::host_id::HostId;
use warp_util::local_or_remote_path::LocalOrRemotePath;
use warp_util::remote_path::RemotePath;
use warp_util::standardized_path::StandardizedPath;
use galaxy_util::host_id::HostId;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use galaxy_util::remote_path::RemotePath;
use galaxy_util::standardized_path::StandardizedPath;
fn local_path(path: &str) -> LocalOrRemotePath {
LocalOrRemotePath::Local(PathBuf::from(path))
@@ -169,7 +169,7 @@ fn test_find_applicable_rules_complex_scenario() {
let path = local_path("/a/b/c/file.rs");
let result = rules.find_active_or_applicable_rules(&path).active_rules;
assert_eq!(result.len(), 4);
assert_eq!(result.len(), 2);
// Expect only WARP.md files to be included as they have higher priority.
assert_eq!(result[0].path, local_path("/a/WARP.md"));
+4 -4
View File
@@ -1,11 +1,11 @@
use std::path::PathBuf;
use galaxy_util::host_id::HostId;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use galaxy_util::remote_path::RemotePath;
use galaxy_util::standardized_path::StandardizedPath;
use thiserror::Error;
use warp_multi_agent_api as api;
use warp_util::host_id::HostId;
use warp_util::local_or_remote_path::LocalOrRemotePath;
use warp_util::remote_path::RemotePath;
use warp_util::standardized_path::StandardizedPath;
use crate::agent::action_result::{AnyFileContent, FileContext};
use crate::skills::{ParsedSkill, SkillProvider, SkillReference, SkillScope};
+4 -4
View File
@@ -1,8 +1,8 @@
use galaxy_util::host_id::HostId;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use galaxy_util::remote_path::RemotePath;
use galaxy_util::standardized_path::StandardizedPath;
use warp_multi_agent_api as api;
use warp_util::host_id::HostId;
use warp_util::local_or_remote_path::LocalOrRemotePath;
use warp_util::remote_path::RemotePath;
use warp_util::standardized_path::StandardizedPath;
use super::{
skill_reference_from_api_skill_ref, skill_reference_from_read_skill_ref, SkillConversionError,
+1 -1
View File
@@ -4,10 +4,10 @@ use std::ops::Range;
use std::path::Path;
use anyhow::Result;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use lazy_static::lazy_static;
use regex::Regex;
use thiserror::Error;
use warp_util::local_or_remote_path::LocalOrRemotePath;
use super::parser::parse_markdown_content;
use super::skill_provider::{get_provider_for_path, get_scope_for_path, SkillProvider, SkillScope};
+1 -1
View File
@@ -1,7 +1,7 @@
use std::path::PathBuf;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use tempfile::TempDir;
use warp_util::local_or_remote_path::LocalOrRemotePath;
use super::*;
+1 -1
View File
@@ -1,7 +1,7 @@
use std::fs;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use tempfile::tempdir;
use warp_util::local_or_remote_path::LocalOrRemotePath;
use super::*;
+2 -2
View File
@@ -7,12 +7,12 @@ use std::path::{Path, PathBuf};
use std::sync::LazyLock;
use dirs::home_dir;
use serde::{Deserialize, Serialize};
use strum_macros::{Display, EnumString, VariantNames};
use galaxy_core::ui::color::CLAUDE_ORANGE;
use galaxy_core::ui::icons::Icon;
use galaxy_core::ui::theme::Fill;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use serde::{Deserialize, Serialize};
use strum_macros::{Display, EnumString, VariantNames};
/// Represents a skill provider/origin (Agents, Claude, Codex, or Warp).
#[derive(
+6 -6
View File
@@ -1,7 +1,7 @@
use warp_util::host_id::HostId;
use warp_util::local_or_remote_path::LocalOrRemotePath;
use warp_util::remote_path::RemotePath;
use warp_util::standardized_path::StandardizedPath;
use galaxy_util::host_id::HostId;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use galaxy_util::remote_path::RemotePath;
use galaxy_util::standardized_path::StandardizedPath;
use super::{
get_provider_for_path, get_scope_for_path, home_skills_path,
@@ -12,13 +12,13 @@ use super::{
fn warp_home_skills_path_uses_warp_home_path() {
assert_eq!(
home_skills_path(SkillProvider::Warp),
galaxy_core::paths::warp_home_skills_dir()
galaxy_core::paths::galaxy_home_skills_dir()
);
}
#[test]
fn warp_home_skill_path_is_home_warp_skill() {
let Some(warp_home_skills_dir) = galaxy_core::paths::warp_home_skills_dir() else {
let Some(warp_home_skills_dir) = galaxy_core::paths::galaxy_home_skills_dir() else {
eprintln!("Skipping test: home directory not available");
return;
};
+1 -1
View File
@@ -1,7 +1,7 @@
use std::fmt;
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
use serde::{Deserialize, Serialize};
use warp_util::local_or_remote_path::LocalOrRemotePath;
/// An unique reference to a skill.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
+3 -3
View File
@@ -1,11 +1,11 @@
use std::time::Duration;
use serde::Serialize;
use serde_json::{json, Value};
use strum_macros::{EnumDiscriminants, EnumIter};
use galaxy_core::features::FeatureFlag;
use galaxy_core::register_telemetry_event;
use galaxy_core::telemetry::{EnablementState, TelemetryEvent, TelemetryEventDesc};
use serde::Serialize;
use serde_json::{json, Value};
use strum_macros::{EnumDiscriminants, EnumIter};
#[cfg_attr(not(feature = "local_fs"), allow(dead_code))]
#[derive(Clone, EnumDiscriminants)]
+1 -1
View File
@@ -25,12 +25,12 @@ extern crate proc_macro;
use std::env;
use std::path::{Path, PathBuf};
use galaxy_util::assets::{ASSETS_DIR, ASYNC_ASSETS_DIR, BUNDLED_ASSETS_DIR, REMOTE_ASSETS_DIR};
use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use sha2::Digest;
use syn::parse::Parse;
use syn::{parse_macro_input, LitStr, Token};
use galaxy_util::assets::{ASSETS_DIR, ASYNC_ASSETS_DIR, BUNDLED_ASSETS_DIR, REMOTE_ASSETS_DIR};
struct MacroArgs {
/// The name of the asset. E.g. `jpg/jellyfish_bg.jpg`
@@ -84,6 +84,7 @@ pub fn read_folders(
}
pub fn delete_folder(conn: &mut SqliteConnection, folder_id: i32) -> Result<(), Error> {
use schema::folders::dsl::*;
diesel::delete(folders.filter(id.eq(folder_id))).execute(conn)?;
Ok(())
}
@@ -98,6 +98,7 @@ pub fn read_notebooks(
}
pub fn delete_notebook(conn: &mut SqliteConnection, notebook_id: i32) -> Result<(), Error> {
use schema::notebooks::dsl::*;
diesel::delete(notebooks.filter(id.eq(notebook_id))).execute(conn)?;
Ok(())
}
@@ -77,6 +77,7 @@ pub fn read_workflows(
}
pub fn delete_workflow(conn: &mut SqliteConnection, workflow_id: i32) -> Result<(), Error> {
use schema::workflows::dsl::*;
diesel::delete(workflows.filter(id.eq(workflow_id))).execute(conn)?;
Ok(())
}
@@ -436,6 +436,7 @@ pub fn delete_generic_string_object(
conn: &mut SqliteConnection,
generic_string_object_id: CloudObjectId,
) -> Result<(), Error> {
use schema::generic_string_objects::dsl::*;
diesel::delete(generic_string_objects.filter(id.eq(generic_string_object_id))).execute(conn)?;
Ok(())
}
@@ -447,6 +448,7 @@ pub fn mark_object_as_synced(
new_revision_and_editor: RevisionAndLastEditor,
new_metadata_ts: Option<ServerTimestamp>,
) -> Result<(), Error> {
use schema::object_metadata::dsl::*;
conn.transaction::<(), Error, _>(|conn| {
diesel::update(object_metadata.filter(server_id.eq(Some(hashed_sqlite_id.as_str()))))
.set(is_pending.eq(false))
@@ -471,6 +473,7 @@ pub fn increment_retry_count(
conn: &mut SqliteConnection,
server_id_string: String,
) -> Result<(), Error> {
use schema::object_metadata::dsl::*;
conn.transaction::<(), Error, _>(|conn| {
diesel::update(object_metadata.filter(server_id.eq(Some(server_id_string))))
.set(retry_count.eq(retry_count + 1))
@@ -485,6 +488,7 @@ pub fn update_object_after_server_creation(
server_creation_info: ServerCreationInfo,
) -> Result<(), Error> {
use schema::commands::dsl::*;
use schema::object_metadata::dsl::*;
conn.transaction::<(), Error, _>(|conn| {
diesel::update(object_metadata.filter(client_id.eq(Some(client_id_string.clone()))))
@@ -519,6 +523,7 @@ pub fn update_object_metadata(
hashed_id: String,
metadata: CloudObjectMetadata,
) -> Result<(), Error> {
use schema::object_metadata::dsl::*;
let metadata_last_updated_at = metadata
.metadata_last_updated_ts
.map(|ts| ts.timestamp_micros());
@@ -24,6 +24,7 @@ pub fn record_time_of_next_refresh(
pub fn read_time_of_next_force_object_refresh(
conn: &mut SqliteConnection,
) -> Result<Option<DateTime<Utc>>, Error> {
use schema::cloud_objects_refreshes::dsl::*;
// Find the smallest refresh timestamp to pass into CloudModel.
Ok(cloud_objects_refreshes
.select(time_of_next_refresh)
+3 -3
View File
@@ -23,7 +23,7 @@ settings_value.workspace = true
session-sharing-protocol.workspace = true
thiserror.workspace = true
uuid.workspace = true
warp_core.workspace = true
warp_graphql.workspace = true
galaxy_core.workspace = true
galaxy_graphql.workspace = true
warp_server_auth.workspace = true
warpui_core.workspace = true
galaxyui_core.workspace = true
@@ -1,4 +1,4 @@
use warp_graphql::scalars::time::ServerTimestamp;
use galaxy_graphql::scalars::time::ServerTimestamp;
use super::{
CloudObjectEventEntrypoint, GenericStringObjectFormat, GenericStringObjectUniqueKey, Owner,
+2 -2
View File
@@ -5,8 +5,6 @@ use std::str::FromStr;
use anyhow::{Result, anyhow};
use chrono::{DateTime, Utc};
use derivative::Derivative;
use pathfinder_geometry::vector::vec2f;
use serde::{Deserialize, Serialize};
use galaxy_core::features::FeatureFlag;
use galaxy_core::ui::Icon;
use galaxy_core::ui::appearance::Appearance;
@@ -19,6 +17,8 @@ use galaxyui_core::elements::{
ParentAnchor, ParentElement, ParentOffsetBounds, Stack,
};
use galaxyui_core::ui_components::components::UiComponent;
use pathfinder_geometry::vector::vec2f;
use serde::{Deserialize, Serialize};
use crate::auth::UserUid;
use crate::drive::sharing::{SharingAccessLevel, Subject, TeamKind, UserKind};
@@ -1,4 +1,4 @@
use warp_graphql::queries::get_updated_cloud_objects::UpdatedObjectInput;
use galaxy_graphql::queries::get_updated_cloud_objects::UpdatedObjectInput;
use super::RevisionAndLastEditor;
+1 -1
View File
@@ -11,11 +11,11 @@ mod screenshot;
mod session;
use async_trait::async_trait;
use galaxyui_core::r#async::Timer;
use keyboard::Keyboard;
use mouse::Mouse;
use pathfinder_geometry::vector::Vector2I;
use session::PortalSession;
use galaxyui_core::r#async::Timer;
use crate::{Action, ActionResult, Options, TargetedAction};
+1 -1
View File
@@ -6,8 +6,8 @@ mod screenshot;
use async_trait::async_trait;
use galaxyui::r#async::Timer;
use pathfinder_geometry::vector::Vector2I;
use galaxyui_core::r#async::Timer;
use pathfinder_geometry::vector::Vector2I;
use x11rb::connection::Connection;
use x11rb::protocol::xproto::{self, ConnectionExt as _};
use x11rb::protocol::xtest::ConnectionExt as _;
+1 -1
View File
@@ -8,10 +8,10 @@ mod util;
mod window;
use async_trait::async_trait;
use galaxyui_core::r#async::Timer;
use pathfinder_geometry::vector::Vector2I;
use post::PostTarget;
use util::{display_scale_factor_for_window, main_display_scale_factor};
use galaxyui_core::r#async::Timer;
use crate::{Action, ActionResult, Options, Target, TargetedAction};
+1 -1
View File
@@ -1,5 +1,6 @@
use std::time::Duration;
use galaxyui_core::r#async::Timer;
use instant::Instant;
use objc2::rc::Retained;
use objc2_core_foundation::CGPoint;
@@ -8,7 +9,6 @@ use objc2_core_graphics::{
CGScrollEventUnit,
};
use pathfinder_geometry::vector::Vector2I;
use galaxyui_core::r#async::Timer;
use super::post::PostTarget;
use super::util::main_display_scale_factor;
+1
View File
@@ -49,6 +49,7 @@ pathfinder_color = "0.5.0"
unicode-width.workspace = true
vec1.workspace = true
galaxyui_core.workspace = true
galaxyui.workspace = true
galaxy_core.workspace = true
galaxy_util.workspace = true
rayon.workspace = true
+2 -2
View File
@@ -1,12 +1,12 @@
use std::fs;
use criterion::{Criterion, criterion_group, criterion_main};
use rand::SeedableRng;
use rand::rngs::StdRng;
use galaxy_editor::content::buffer::Buffer;
use galaxy_editor::content::selection_model::BufferSelectionModel;
use galaxy_editor::content::text::IndentBehavior;
use galaxyui_core::{App, ModelHandle};
use rand::SeedableRng;
use rand::rngs::StdRng;
const EDIT_SAMPLE_SIZE: usize = 10;
const MAX_EDIT_REPLACEMENT_LENGTH: usize = 20;
+1 -1
View File
@@ -1,8 +1,8 @@
use std::cmp::Ordering;
use galaxyui_core::App;
use string_offset::CharOffset;
use sum_tree::SumTree;
use galaxyui_core::App;
use super::{AnchorSide, Anchors};
use crate::content::anchor::{Anchor, AnchorUpdate};
+8 -8
View File
@@ -5,6 +5,14 @@ use std::ops::Range;
use std::sync::Arc;
use enum_iterator::all;
use galaxy_core::platform::SessionPlatform;
use galaxy_core::safe_error;
use galaxy_util::content_version::ContentVersion;
use galaxyui_core::elements::ListIndentLevel;
use galaxyui_core::fonts::Weight;
use galaxyui_core::text::point::Point;
use galaxyui_core::text::{TextBuffer, char_slice};
use galaxyui_core::{AppContext, Entity, EntityId, ModelContext, ModelHandle};
use itertools::{Either, Itertools};
use line_ending::LineEnding;
use markdown_parser::{
@@ -20,14 +28,6 @@ use serde_yaml::Mapping;
use string_offset::{ByteOffset, CharOffset};
use sum_tree::{SeekBias, SumTree};
use vec1::{Vec1, vec1};
use galaxy_core::platform::SessionPlatform;
use galaxy_core::safe_error;
use galaxy_util::content_version::ContentVersion;
use galaxyui_core::elements::ListIndentLevel;
use galaxyui_core::fonts::Weight;
use galaxyui_core::text::point::Point;
use galaxyui_core::text::{TextBuffer, char_slice};
use galaxyui_core::{AppContext, Entity, EntityId, ModelContext, ModelHandle};
use super::anchor::{Anchor, AnchorSide, Anchors};
use super::cursor::BufferCursor;
+3 -4
View File
@@ -2,7 +2,10 @@ use std::ops::Range;
use std::sync::Arc;
use std::sync::atomic::{AtomicU8, Ordering};
use galaxy_util::content_version::ContentVersion;
use galaxyui::{App, AppContext, ModelContext, ModelHandle, ReadModel};
use galaxyui_core::elements::ListIndentLevel;
use galaxyui_core::text::point::Point;
use line_ending::LineEnding;
use markdown_parser::{
FormattedIndentTextInline, FormattedText, FormattedTextFragment, FormattedTextLine, parse_html,
@@ -14,10 +17,6 @@ use rand::rngs::StdRng;
use serde_yaml::{Mapping, Value};
use string_offset::{ByteOffset, CharOffset};
use vec1::{Vec1, vec1};
use galaxy_util::content_version::ContentVersion;
use galaxyui_core::elements::ListIndentLevel;
use galaxyui_core::text::point::Point;
use galaxyui_core::{App, AppContext, ModelContext, ModelHandle, ReadModel};
use super::{BufferEvent, EditResult, ToBufferCharOffset};
use crate::content::buffer::{
-1
View File
@@ -5,7 +5,6 @@ use galaxyui::elements::ListIndentLevel;
use markdown_parser::{FormattedText, FormattedTextFragment, FormattedTextLine};
use string_offset::CharOffset;
use sum_tree::SumTree;
use galaxyui_core::elements::ListIndentLevel;
use super::buffer::{Buffer, EditOrigin, EditResult};
use super::cursor::BufferSumTree;
+8 -8
View File
@@ -5,14 +5,6 @@ use std::ops::Range;
use std::path::{Path, PathBuf};
use anyhow::{Result, anyhow};
use itertools::Itertools;
use markdown_parser::{Hyperlink, TableAlignment};
use num_traits::SaturatingSub;
use rangemap::RangeSet;
use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator};
use string_offset::{ByteOffset, CharOffset};
use urlocator::{UrlLocation, UrlLocator};
use vec1::Vec1;
use galaxy_core::features::FeatureFlag;
use galaxy_core::ui::theme::Fill as ThemeFill;
use galaxyui_core::assets::asset_cache::{AssetCache, AssetSource, AssetState};
@@ -23,6 +15,14 @@ use galaxyui_core::text::point::Point;
use galaxyui_core::text_layout::{StyleAndFont, TextAlignment};
use galaxyui_core::units::{IntoPixels, Pixels};
use galaxyui_core::{AppContext, SingletonEntity};
use itertools::Itertools;
use markdown_parser::{Hyperlink, TableAlignment};
use num_traits::SaturatingSub;
use rangemap::RangeSet;
use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator};
use string_offset::{ByteOffset, CharOffset};
use urlocator::{UrlLocation, UrlLocator};
use vec1::Vec1;
use super::buffer::{StyledBufferBlock, StyledBufferRun, StyledTextBlock};
use super::mermaid_diagram::{mermaid_asset_source, mermaid_diagram_layout};
+1 -1
View File
@@ -1,12 +1,12 @@
use std::path::Path;
use string_offset::CharOffset;
use galaxy_core::features::FeatureFlag;
use galaxyui_core::assets::asset_cache::{AssetCache, AssetSource, AssetState};
use galaxyui_core::fonts::{Properties, Style, Weight};
use galaxyui_core::image_cache::ImageType;
use galaxyui_core::text_layout::{LayoutCache, StyleAndFont, TextStyle};
use galaxyui_core::{App, SingletonEntity};
use string_offset::CharOffset;
use super::{
BlockLocation, LayOutArgs, layout_mermaid_diagram_block, layout_table_block, layout_text_block,
-1
View File
@@ -8,7 +8,6 @@ use itertools::Itertools;
use rangemap::RangeSet;
use string_offset::CharOffset;
use sum_tree::SumTree;
use galaxyui_core::App;
use super::{Engine, Match, SearchConfig};
use crate::content::buffer::Buffer;
@@ -4,7 +4,6 @@ use std::ops::Range;
use galaxyui::{AppContext, Entity, ModelContext, ModelHandle};
use rangemap::RangeSet;
use string_offset::CharOffset;
use galaxyui_core::{AppContext, Entity, ModelContext, ModelHandle};
use super::anchor::{Anchor, AnchorSide};
use crate::content::buffer::Buffer;
+3 -3
View File
@@ -4,6 +4,9 @@ use std::ops::Range;
use std::{io, iter};
use anyhow::{Context, Result};
use galaxyui_core::elements::{ListIndentLevel, ListNumbering};
use galaxyui_core::text::point::Point;
use galaxyui_core::{AppContext, ModelContext, ModelHandle};
use html5ever::serialize::{Serialize, Serializer, TraversalScope};
use html5ever::{QualName, serialize};
use itertools::Itertools;
@@ -14,9 +17,6 @@ use markdown_parser::{
};
use markup5ever::ns;
use string_offset::CharOffset;
use galaxyui_core::elements::{ListIndentLevel, ListNumbering};
use galaxyui_core::text::point::Point;
use galaxyui_core::{AppContext, ModelContext, ModelHandle};
use super::buffer::{
ActionWithSelectionDelta, Buffer, EditOrigin, EditResult, StyledBufferBlock,
@@ -5,7 +5,6 @@ use markdown_parser::{compute_formatted_text_delta, parse_markdown};
use serde_yaml::Value;
use string_offset::CharOffset;
use vec1::Vec1;
use galaxyui_core::{App, ReadModel};
use super::MarkdownStyle;
use crate::content::buffer::tests::TestEmbeddedItem;
+1 -1
View File
@@ -1,6 +1,6 @@
use galaxyui_core::App;
use itertools::Itertools;
use string_offset::CharOffset;
use galaxyui_core::App;
use crate::content::buffer::Buffer;
use crate::content::outline::BlockOutline;
+3 -4
View File
@@ -3,11 +3,10 @@
//! [`TextBuffer`] API.
use anyhow::anyhow;
use galaxyui::text::{TextBuffer, point::Point, word_boundaries::WordBoundariesPolicy};
use galaxyui::text::TextBuffer;
use galaxyui::text::point::Point;
use galaxyui::text::word_boundaries::WordBoundariesPolicy;
use string_offset::CharOffset;
use galaxyui_core::text::TextBuffer;
use galaxyui_core::text::point::Point;
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
use super::buffer::{Buffer, ToBufferCharOffset, ToBufferPoint};
use super::cursor::BufferCursor;
@@ -1,11 +1,11 @@
use galaxy_core::features::FeatureFlag;
use itertools::Itertools;
use markdown_parser::parse_markdown;
use string_offset::CharOffset;
use galaxyui_core::App;
use galaxyui_core::text::TextBuffer;
use galaxyui_core::text::point::Point;
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
use itertools::Itertools;
use markdown_parser::parse_markdown;
use string_offset::CharOffset;
use crate::content::buffer::{Buffer, EditOrigin};
use crate::content::selection_model::BufferSelectionModel;
@@ -4,7 +4,6 @@ use galaxyui::{AppContext, Entity, ModelHandle};
use itertools::Itertools;
use string_offset::CharOffset;
use vec1::{Vec1, vec1};
use galaxyui_core::{AppContext, Entity, ModelHandle};
use crate::content::anchor::{Anchor, AnchorSide, AnchorUpdate, Anchors};
use crate::content::buffer::{Buffer, SelectionOffsets, ToBufferPoint};
+2 -9
View File
@@ -8,13 +8,11 @@ use std::sync::{Arc, OnceLock};
use arrayvec::ArrayString;
use enum_iterator::Sequence;
use galaxy_core::features::FeatureFlag;
use galaxyui::AppContext;
use galaxyui::elements::ListIndentLevel;
use galaxyui::fonts::{Properties, Style, Weight};
use galaxyui::text::BlockHeaderSize as HeaderSize;
use galaxyui::text::point::Point;
use galaxyui::{
AppContext,
fonts::{Properties, Style, Weight},
};
use lazy_static::lazy_static;
pub use markdown_parser::markdown_parser::TABLE_BLOCK_MARKDOWN_LANG;
use markdown_parser::markdown_parser::{
@@ -33,11 +31,6 @@ use rand::Rng;
use serde::{Deserialize, Serialize};
use string_offset::{ByteOffset, CharOffset, impl_offset};
use sum_tree::{Cursor, SeekBias, SumTree};
use galaxyui_core::AppContext;
use galaxyui_core::elements::ListIndentLevel;
use galaxyui_core::fonts::{Properties, Style, Weight};
use galaxyui_core::text::BlockHeaderSize as HeaderSize;
use galaxyui_core::text::point::Point;
use super::buffer::Buffer;
use super::core::CursorType;
+1 -1
View File
@@ -1,6 +1,6 @@
use markdown_parser::{CodeBlockText, FormattedTable};
use galaxy_core::features::FeatureFlag;
use galaxyui_core::fonts::Weight;
use markdown_parser::{CodeBlockText, FormattedTable};
use super::{
BufferBlockItem, BufferTextStyle, CodeBlockType, MarkdownStyle, TextStyles,
@@ -1,5 +1,5 @@
use sum_tree::SumTree;
use galaxyui_core::elements::ListIndentLevel;
use sum_tree::SumTree;
use crate::content::cursor::BufferSumTree;
use crate::content::text::{
+3 -3
View File
@@ -5,13 +5,13 @@ use std::any::Any;
use std::cell::Ref;
use std::ops::Range;
use galaxyui_core::elements::Border;
use galaxyui_core::text_layout::PaintStyleOverride;
use galaxyui_core::{Action, AppContext, Element, TypedActionView, View};
use num_traits::SaturatingSub;
use pathfinder_color::ColorU;
use rangemap::{RangeMap, RangeSet};
use string_offset::CharOffset;
use galaxyui_core::elements::Border;
use galaxyui_core::text_layout::PaintStyleOverride;
use galaxyui_core::{Action, AppContext, Element, TypedActionView, View};
use crate::content::version::BufferVersion;
use crate::render::element::RichTextAction;
+3 -6
View File
@@ -1,15 +1,12 @@
use std::ops::Range;
use galaxyui::{
AppContext, Entity, ModelAsRef, ModelContext, ModelHandle, clipboard::ClipboardContent,
};
use galaxyui::clipboard::ClipboardContent;
use galaxyui::elements::ListIndentLevel;
use galaxyui::{AppContext, Entity, ModelAsRef, ModelContext, ModelHandle};
use itertools::{Either, Itertools};
use line_ending::LineEnding;
use string_offset::{ByteOffset, CharOffset};
use vec1::{Vec1, vec1};
use galaxyui_core::clipboard::ClipboardContent;
use galaxyui_core::elements::ListIndentLevel;
use galaxyui_core::{AppContext, Entity, ModelAsRef, ModelContext, ModelHandle};
use crate::content::anchor::Anchor;
use crate::content::buffer::{
+1 -2
View File
@@ -42,11 +42,10 @@ use std::fmt;
use std::marker::PhantomData;
use std::ops::Deref;
use galaxy_core::platform::SessionPlatform;
use itertools::Itertools as _;
use line_ending::LineEnding;
use galaxy_core::platform::SessionPlatform;
/// A line ending format. This is the compile-time equivalent to [`LineEnding`].
pub trait LineFormat {
/// The `LineEnding` corresponding to this format.
+5 -13
View File
@@ -4,11 +4,6 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::time::Duration;
use float_cmp::ApproxEq;
use instant::Instant;
use parking_lot::Mutex;
use string_offset::CharOffset;
use temporary_block::RenderableTemporaryBlock;
use vim::vim::VimMode;
use galaxy_core::ui::theme::Fill as ThemeFill;
use galaxyui_core::color::ColorU;
use galaxyui_core::elements::new_scrollable::{NewScrollableElement, ScrollableAxis};
@@ -24,14 +19,11 @@ use galaxyui_core::{
AfterLayoutContext, AppContext, Element, Event, EventContext, LayoutContext, ModelHandle,
PaintContext, SizeConstraint, WeakViewHandle,
};
use std::{
fmt,
sync::{
Arc,
atomic::{AtomicBool, Ordering},
},
time::Duration,
};
use instant::Instant;
use parking_lot::Mutex;
use string_offset::CharOffset;
use temporary_block::RenderableTemporaryBlock;
use vim::vim::VimMode;
use self::empty::Empty;
use self::header::RenderableHeader;
+2 -2
View File
@@ -2,14 +2,14 @@
use std::ops::Range;
use string_offset::CharOffset;
use vim::vim::VimMode;
use galaxy_core::ui::appearance::DEFAULT_UI_FONT_SIZE;
use galaxyui_core::PaintContext;
use galaxyui_core::elements::{CornerRadius, Point, Radius};
use galaxyui_core::geometry::rect::RectF;
use galaxyui_core::geometry::vector::{Vector2F, vec2f};
use galaxyui_core::text_layout::{Line, PaintStyleOverride, TextFrame};
use string_offset::CharOffset;
use vim::vim::VimMode;
use crate::editor::TextDecoration;
use crate::render::layout::line_height;
+1 -1
View File
@@ -1,6 +1,5 @@
use std::ops::Range;
use string_offset::CharOffset;
use galaxyui_core::elements::{
Axis, CornerRadius, DEFAULT_SCROLL_WHEEL_PIXELS_PER_LINE, Radius, ScrollData,
ScrollbarAppearance, ScrollbarGeometry, ScrollbarWidth, compute_scrollbar_geometry,
@@ -11,6 +10,7 @@ use galaxyui_core::geometry::rect::RectF;
use galaxyui_core::geometry::vector::{Vector2F, vec2f};
use galaxyui_core::units::{IntoPixels, Pixels};
use galaxyui_core::{AppContext, ClipBounds, Event, EventContext};
use string_offset::CharOffset;
use super::paint::{CursorData, CursorDisplayType};
use super::{RenderContext, RenderableBlock};
@@ -1,14 +1,14 @@
use std::cell::Cell;
use std::sync::Arc;
use pathfinder_color::ColorU;
use string_offset::CharOffset;
use galaxyui_core::elements::{Axis, scroll_delta_for_pointer_movement};
use galaxyui_core::fonts::FamilyId;
use galaxyui_core::geometry::rect::RectF;
use galaxyui_core::geometry::vector::vec2f;
use galaxyui_core::text_layout::TextFrame;
use galaxyui_core::units::{IntoPixels, Pixels};
use pathfinder_color::ColorU;
use string_offset::CharOffset;
use crate::content::text::{FormattedTable, table_cell_offset_maps};
use crate::render::element::table::{
@@ -1,4 +1,3 @@
use pathfinder_color::ColorU;
use galaxyui_core::elements::{
Align, Border, ConstrainedBox, Container, CornerRadius, Hoverable, Icon, ListIndentLevel,
MouseStateHandle, Radius, Rect,
@@ -6,6 +5,7 @@ use galaxyui_core::elements::{
use galaxyui_core::geometry::vector::vec2f;
use galaxyui_core::platform::Cursor;
use galaxyui_core::{AppContext, Element, SizeConstraint, WeakViewHandle};
use pathfinder_color::ColorU;
use super::paint::RenderContext;
use super::placeholder::{self, BlockPlaceholder};
+2 -2
View File
@@ -3,8 +3,6 @@
use std::ops::Range;
use std::sync::Arc;
#[cfg(test)]
use markdown_parser::FormattedTextInline;
use galaxyui_core::color::ColorU;
use galaxyui_core::fonts::TextLayoutSystem;
#[cfg(test)]
@@ -14,6 +12,8 @@ use galaxyui_core::text_layout::{
};
use galaxyui_core::units::{IntoPixels, Pixels};
use galaxyui_core::{AppContext, LayoutContext};
#[cfg(test)]
use markdown_parser::FormattedTextInline;
use super::model::{BlockSpacing, ParagraphStyles, RenderState, RichTextStyles};
use crate::content::text::{BufferBlockStyle, TextStylesWithMetadata};
+1 -1
View File
@@ -1,8 +1,8 @@
//! End-to-end editor tests.
use string_offset::CharOffset;
use galaxy_core::features::FeatureFlag;
use galaxyui_core::{App, ModelHandle, ReadModel};
use string_offset::CharOffset;
use super::model::test_utils::{TEST_STYLES, init_logging};
use super::model::{BlockItem, RenderEvent, RenderState};
@@ -4,7 +4,6 @@ use galaxyui::units::{IntoPixels, Pixels};
use num_traits::SaturatingSub;
use string_offset::CharOffset;
use sum_tree::SeekBias;
use galaxyui_core::units::{IntoPixels, Pixels};
use super::positioned::{Positioned, PositionedCursor};
use super::{
@@ -1,13 +1,13 @@
use std::cell::Cell;
use std::sync::Arc;
use pathfinder_color::ColorU;
use string_offset::CharOffset;
use sum_tree::SumTree;
use galaxyui_core::assets::asset_cache::AssetSource;
use galaxyui_core::fonts::FamilyId;
use galaxyui_core::text_layout::{CaretPosition, TextFrame};
use galaxyui_core::units::IntoPixels;
use pathfinder_color::ColorU;
use string_offset::CharOffset;
use sum_tree::SumTree;
use crate::content::text::{
BufferBlockStyle, CodeBlockType, FormattedTable, table_cell_offset_maps,
+18 -19
View File
@@ -7,18 +7,6 @@ use std::sync::Arc;
use std::{fmt, mem};
use float_cmp::ApproxEq;
use itertools::Itertools;
use markdown_parser::TableAlignment;
use num_traits::SaturatingSub;
use ordered_float::OrderedFloat;
use parking_lot::Mutex;
use rangemap::RangeSet;
use serde::{Deserialize, Serialize};
use serde_yaml::Mapping;
use string_offset::{CharOffset, impl_offset};
use sum_tree::{SeekBias, SumTree};
use vec1::Vec1;
use vim::vim::{MotionType, VimMode};
use galaxy_core::channel::ChannelState;
use galaxy_core::ui::Icon;
use galaxy_core::ui::theme::Fill as ThemeFill;
@@ -38,6 +26,18 @@ use galaxyui_core::text_selection_utils::{
};
use galaxyui_core::units::{IntoPixels, Pixels};
use galaxyui_core::{AppContext, Entity, EntityId, ModelContext, ModelHandle};
use itertools::Itertools;
use markdown_parser::TableAlignment;
use num_traits::SaturatingSub;
use ordered_float::OrderedFloat;
use parking_lot::Mutex;
use rangemap::RangeSet;
use serde::{Deserialize, Serialize};
use serde_yaml::Mapping;
use string_offset::{CharOffset, impl_offset};
use sum_tree::{SeekBias, SumTree};
use vec1::Vec1;
use vim::vim::{MotionType, VimMode};
use self::location::WrapDirection;
pub use self::location::{HitTestOptions, Location};
@@ -2241,10 +2241,7 @@ impl RenderState {
} else {
0
};
loop {
let Some(item) = cursor.positioned_item() else {
break;
};
while let Some(item) = cursor.positioned_item() {
if item.start_line != previous_line {
index_within_line = 0;
} else {
@@ -3190,9 +3187,11 @@ impl RenderState {
self.reveal_offset_in_table(*character_offset)
}
AutoScrollMode::ScrollToActiveSelections { .. } => {
self.selections().iter().fold(false, |changed, selection| {
self.reveal_offset_in_table(selection.head) || changed
})
let mut changed = false;
for selection in self.selections().iter() {
changed = self.reveal_offset_in_table(selection.head) || changed;
}
changed
}
}
}
+7 -5
View File
@@ -1,11 +1,6 @@
use std::cell::Cell;
use std::sync::Arc;
use markdown_parser::{FormattedTextStyles, Hyperlink};
use rangemap::RangeSet;
use string_offset::CharOffset;
use sum_tree::SumTree;
use vec1::{Vec1, vec1};
use galaxyui_core::assets::asset_cache::AssetSource;
use galaxyui_core::color::ColorU;
use galaxyui_core::elements::ListIndentLevel;
@@ -14,6 +9,11 @@ use galaxyui_core::geometry::rect::RectF;
use galaxyui_core::geometry::vector::vec2f;
use galaxyui_core::text_layout::TextFrame;
use galaxyui_core::units::{IntoPixels, Pixels};
use markdown_parser::{FormattedTextStyles, Hyperlink};
use rangemap::RangeSet;
use string_offset::CharOffset;
use sum_tree::SumTree;
use vec1::{Vec1, vec1};
use super::debug::Describe;
use super::test_utils::{layout_paragraph, layout_paragraphs};
@@ -1433,6 +1433,8 @@ fn test_link_at_offset_uses_cached_cell_links() {
mod char_cell {
use string_offset::CharOffset;
use crate::render::model::{
ColumnUnit, LineCount, SoftWrapPoint, char_cell_display_width, char_cell_line_row_starts,
char_cell_max_line, char_cell_offset_to_softwrap_point, char_cell_softwrap_point_to_offset,
+2 -2
View File
@@ -3,11 +3,11 @@
use std::sync::Arc;
use string_offset::CharOffset;
use sum_tree::{Cursor, Dimension};
use galaxyui_core::geometry::vector::Vector2F;
use galaxyui_core::text_layout::Line;
use galaxyui_core::units::{IntoPixels, Pixels};
use string_offset::CharOffset;
use sum_tree::{Cursor, Dimension};
use super::{
BlockItem, BlockSpacing, HorizontalRuleConfig, ImageBlockConfig, LaidOutEmbeddedItem,
+6 -6
View File
@@ -3,15 +3,15 @@
use std::mem;
use std::sync::Arc;
use ordered_float::OrderedFloat;
use parking_lot::Once;
use vec1::{Vec1, vec1};
use galaxyui_core::color::ColorU;
use galaxyui_core::elements::{Border, Fill, ListIndentLevel};
use galaxyui_core::fonts::{FamilyId, Weight};
use galaxyui_core::geometry::vector::vec2f;
use galaxyui_core::text_layout::{CaretPosition, Glyph, Line, Run, TextFrame};
use galaxyui_core::units::{IntoPixels, Pixels};
use ordered_float::OrderedFloat;
use parking_lot::Once;
use vec1::{Vec1, vec1};
use super::{
BlockItem, BrokenLinkStyle, CheckBoxStyle, DEFAULT_BLOCK_SPACINGS, HorizontalRuleStyle,
@@ -310,12 +310,12 @@ pub fn layout(text: &str, styles: &RichTextStyles, max_width: impl IntoPixels) -
/// Initialize logging for tests. This should be called at the start of any test that needs logging.
pub fn init_logging() {
// If multiple tests run in the same process, we should still only set up logging once.
static INIT: Once = Once::new();
INIT.call_once(|| {
env_logger::builder()
let _ = env_logger::builder()
.parse_filters("galaxy_editor=trace")
.is_test(true)
.init();
.try_init();
});
}
+2 -2
View File
@@ -1,10 +1,10 @@
use float_cmp::ApproxEq;
use string_offset::CharOffset;
use sum_tree::{SeekBias, SumTree};
use galaxyui_core::SizeConstraint;
use galaxyui_core::geometry::rect::RectF;
use galaxyui_core::geometry::vector::{Vector2F, vec2f};
use galaxyui_core::units::{IntoPixels, Pixels};
use string_offset::CharOffset;
use sum_tree::{SeekBias, SumTree};
use super::positioned::PositionedCursor;
use super::{
@@ -1,8 +1,8 @@
use itertools::Itertools;
use sum_tree::SumTree;
use galaxyui_core::SizeConstraint;
use galaxyui_core::geometry::vector::vec2f;
use galaxyui_core::units::{IntoPixels, Pixels};
use itertools::Itertools;
use sum_tree::SumTree;
use super::ViewportState;
use crate::render::model::RenderState;
+2 -3
View File
@@ -1,13 +1,12 @@
use std::ops::Range;
use galaxy_core::ui::theme::Fill;
use galaxyui::{Entity, ModelContext, ModelHandle, r#async::SpawnedFutureHandle};
use galaxyui::r#async::SpawnedFutureHandle;
use galaxyui::{Entity, ModelContext, ModelHandle};
use itertools::Itertools;
use lazy_static::lazy_static;
use pathfinder_color::ColorU;
use string_offset::CharOffset;
use galaxyui_core::r#async::SpawnedFutureHandle;
use galaxyui_core::{Entity, ModelContext, ModelHandle};
use crate::content::anchor::Anchor;
use crate::content::buffer::{Buffer, BufferEvent};
+3 -3
View File
@@ -1,12 +1,12 @@
use std::ops::Range;
use num_traits::SaturatingSub;
use string_offset::CharOffset;
use vec1::Vec1;
use galaxyui_core::text::TextBuffer;
use galaxyui_core::text::point::Point;
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
use galaxyui_core::{AppContext, Entity, ModelAsRef, ModelContext, ModelHandle};
use num_traits::SaturatingSub;
use string_offset::CharOffset;
use vec1::Vec1;
use crate::content::buffer::{
AutoScrollBehavior, Buffer, BufferEvent, BufferSelectAction, SelectionOffsets,
+4 -5
View File
@@ -1,15 +1,14 @@
use std::sync::Arc;
use galaxy_core::features::FeatureFlag;
use galaxyui::{App, ModelAsRef, units::IntoPixels};
use galaxyui::units::IntoPixels;
use galaxyui::{App, ModelAsRef};
use galaxyui_core::assets::asset_cache::AssetSource;
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
use serde_yaml::Value;
use string_offset::CharOffset;
use sum_tree::SumTree;
use vec1::vec1;
use galaxyui_core::assets::asset_cache::AssetSource;
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
use galaxyui_core::units::IntoPixels;
use galaxyui_core::{App, ModelAsRef};
use super::{SelectionModel, TextDirection, TextUnit};
use crate::content::buffer::tests::TestEmbeddedItem;
+1 -2
View File
@@ -4,10 +4,9 @@ use std::path::Path;
use std::{env, fmt};
use clap::{CommandFactory, Parser, Subcommand, ValueEnum};
use url::Url;
use galaxy_core::channel::ChannelState;
use galaxy_core::features::FeatureFlag;
use url::Url;
use crate::agent::OutputFormat;
@@ -1,4 +1,5 @@
//! Implementations for user-facing `warpctrl` command groups.
use galaxy_core::channel::ChannelState;
use local_control::discovery::InstanceRecord;
use local_control::protocol::{
Action, ActionKind, ActionNameParams, BindingNameParams, BooleanValueParams, ColorValueParams,
@@ -9,7 +10,6 @@ use local_control::protocol::{
};
use local_control::selection::select_instance;
use serde::Serialize;
use galaxy_core::channel::ChannelState;
use crate::agent::OutputFormat;
use crate::local_control::output::{write_json, write_json_line};
+1
View File
@@ -34,6 +34,7 @@ galaxy_cli.workspace = true
galaxy_core.workspace = true
galaxy_js = { workspace = true, optional = true }
galaxyui_core.workspace = true
galaxyui.workspace = true
galaxy_util.workspace = true
typed-path.workspace = true
@@ -15,7 +15,6 @@ use galaxy_util::path::{EscapeChar, ShellFamily};
use galaxyui::platform::OperatingSystem;
use smol_str::SmolStr;
use typed_path::{TypedPath, TypedPathBuf};
use galaxyui_core::platform::OperatingSystem;
use super::engine::EngineDirEntry;
use crate::completer::TopLevelCommandCaseSensitivity;
@@ -1,7 +1,7 @@
use async_trait::async_trait;
use galaxy_js::{JsFunctionId, SerializedJsValue, TypedJsFunctionRef};
use serde::de::DeserializeOwned;
use serde::Serialize;
use galaxy_js::{JsFunctionId, SerializedJsValue, TypedJsFunctionRef};
#[derive(thiserror::Error, Debug)]
pub enum JsExecutionError {
@@ -1,7 +1,6 @@
use galaxyui::platform::OperatingSystem;
use itertools::Itertools;
use string_offset::ByteOffset;
use galaxyui_core::platform::OperatingSystem;
use super::context::CompletionContext;
use super::suggest::{suggestions, CompleterOptions, CompletionsFallbackStrategy, SuggestionType};
@@ -250,28 +250,26 @@ async fn suggestions_for_parse_error(
ParseErrorReason::ArgumentError {
command: _,
error: UnexpectedArgument(arg),
} => {
if arg.span.end() == line.len() {
// The unexpected argument could be a prefix for a subcommand.
let prefix = arg.item.as_str();
let results = (signature.subcommands().iter().filter_map(|subcmd| {
options
.match_strategy
.get_match_type(prefix, subcmd.name())
.map(|match_type| {
let suggestion = Suggestion::with_same_display_and_replacement(
subcmd.name.clone(),
subcmd.description.as_ref().cloned(),
SuggestionType::Subcommand,
subcmd.priority.into(),
);
MatchedSuggestion::new(suggestion, match_type)
})
}))
.sorted_by(MatchedSuggestion::cmp_by_display)
.collect();
return (results, false);
}
} if arg.span.end() == line.len() => {
// The unexpected argument could be a prefix for a subcommand.
let prefix = arg.item.as_str();
let results = (signature.subcommands().iter().filter_map(|subcmd| {
options
.match_strategy
.get_match_type(prefix, subcmd.name())
.map(|match_type| {
let suggestion = Suggestion::with_same_display_and_replacement(
subcmd.name.clone(),
subcmd.description.as_ref().cloned(),
SuggestionType::Subcommand,
subcmd.priority.into(),
);
MatchedSuggestion::new(suggestion, match_type)
})
}))
.sorted_by(MatchedSuggestion::cmp_by_display)
.collect();
return (results, false);
}
_ => {}
}
@@ -55,8 +55,7 @@ pub async fn complete(
.into_iter()
.chain(
sorted_directories_relative_to(parsed_token, matcher, path_completion_context)
.await
.into_iter(),
.await,
)
.collect();
}
@@ -4,12 +4,12 @@ use std::fs::DirEntry;
use std::sync::Arc;
use async_trait::async_trait;
use galaxy_util::path::{ShellFamily, HOME_DIR_ENV_VAR_PREFIX};
use itertools::{iproduct, Itertools};
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use typed_path::{TypedPath, TypedPathBuf};
use warp_command_signatures::{IconType, PathSuggestionType};
use galaxy_util::path::{ShellFamily, HOME_DIR_ENV_VAR_PREFIX};
use crate::completer::context::{PathCompletionContext, PathSeparators};
use crate::completer::matchers::MatchStrategy;
@@ -203,7 +203,8 @@ pub fn test_expand_command_aliases_should_not_expand_if_no_space_after_alias() {
assert!(result.signature_for_completions.is_none());
// The test signature has an alias function which expands subcommand "twelve" to "one", but there's no trailing space so we shouldn't expand.
let result = galaxyui_core::r#async::block_on(expand_command_aliases("test twelve", false, &ctx));
let result =
galaxyui_core::r#async::block_on(expand_command_aliases("test twelve", false, &ctx));
assert_eq!(result.expanded_command_line, "test twelve");
assert_eq!(result.tokens_from_command, vec!["test", "twelve"]);
// "twelve" isn't a valid subcommand, so we should use the "test" signature.
@@ -218,8 +219,11 @@ pub fn test_expand_command_aliases_should_not_expand_if_no_space_after_alias() {
);
// We have a top-level aliasForTest which expands to test. But the test signature does not expand "twelve" to "one" because there's no trailing space.
let result =
galaxyui_core::r#async::block_on(expand_command_aliases("aliasForTest twelve", false, &ctx));
let result = galaxyui_core::r#async::block_on(expand_command_aliases(
"aliasForTest twelve",
false,
&ctx,
));
assert_eq!(result.expanded_command_line, "test twelve");
assert_eq!(result.tokens_from_command, vec!["test", "twelve"]);
// "twelve" isn't a valid subcommand, so we should use the "test" signature.
@@ -10,12 +10,12 @@ use std::hash::{Hash, Hasher};
use alias::{expand_command_aliases, AliasExpansionResult};
use async_recursion::async_recursion;
use galaxy_core::ui::theme::AnsiColorIdentifier;
use imp::*;
use itertools::Itertools;
pub use priority::Priority;
use smol_str::SmolStr;
use warp_command_signatures::IconType;
use galaxy_core::ui::theme::AnsiColorIdentifier;
use super::coalesce::coalesce_completion_results;
use super::context::CompletionContext;
@@ -1,3 +1,5 @@
use warp_command_signatures::{Importance, Order, Priority as OldPriority};
use super::{Priority, MAX_PRIORITY, MIN_PRIORITY};
#[test]
@@ -41,7 +43,6 @@ fn test_priority_comparison() {
/// `warp_command_signatures`.
#[test]
fn test_new_to_old_priority() {
use warp_command_signatures::{Importance, Order, Priority as OldPriority};
assert_eq!(
OldPriority::from(Priority::new(MIN_PRIORITY)),
OldPriority::Global(Importance::Less(Order(1))),
@@ -82,7 +83,6 @@ fn test_new_to_old_priority() {
/// `warp_command_signatures` to the new Priority.
#[test]
fn test_old_to_new_priority() {
assert_eq!(
Priority::from(OldPriority::Global(Importance::Less(Order(1)))),
Priority::new(MIN_PRIORITY)
@@ -6,10 +6,10 @@ mod lexer;
mod parser;
mod token;
use galaxy_util::path::EscapeChar;
use lexer::Lexer;
use parser::Parser;
use string_offset::ByteOffset;
use galaxy_util::path::EscapeChar;
use crate::parsers::LiteCommand;
@@ -378,7 +378,7 @@ fn is_valid_command_separator(token: &Token) -> bool {
///
/// This includes all of the separator tokens as well as the grouping tokens
fn is_command_terminator(token: &Token) -> bool {
use Token::*;
is_valid_command_separator(token)
|| matches!(token, OpenParen | CloseParen | OpenCurly | CloseCurly)
}
@@ -2,11 +2,11 @@
//! `galaxy_completer::signatures::CommandSignature`s, as well as `IntoWarpJs` implementations for
//! Rust structs that may be passed to JS functions defined on the Command Signature (e.g.
//! `GeneratorCompletionContext`).
use rquickjs::{FromJs, Function, Object, Value};
use galaxy_js::util::{
get_one_or_more_optional, get_one_or_more_required, get_optional, get_required,
};
use galaxy_js::{FromWarpJs, IntoWarpJs, JsFunctionRegistry};
use rquickjs::{FromJs, Function, Object, Value};
use super::{
Argument, ArgumentValue, Command, CommandSignature, GeneratorCompletionContext, GeneratorFn,
+1 -1
View File
@@ -1,6 +1,6 @@
use galaxyui_core::{Entity, ModelContext, SingletonEntity};
use std::sync::OnceLock;
use galaxyui_core::{Entity, ModelContext, SingletonEntity};
// Global execution mode, for logic that runs outside the UI framework.
static GLOBAL_EXECUTION_MODE: OnceLock<ExecutionMode> = OnceLock::new();
+2 -2
View File
@@ -27,8 +27,8 @@ pub mod ui;
pub mod user_preferences;
pub use app_id::AppId;
pub use session_id::SessionId;
pub use warp_util::host_id::HostId;
// Re-export galaxyui_core so that it can be referenced safely from the
// telemetry macros.
pub use galaxyui_core;
pub use session_id::SessionId;
pub use warp_util::host_id::HostId;
@@ -3,12 +3,12 @@
use std::fmt::{Display, Formatter};
use std::sync::OnceLock;
use serde::Serialize;
use serde_with::SerializeDisplay;
#[cfg(target_family = "wasm")]
use galaxyui_core::platform::wasm;
#[cfg(target_family = "wasm")]
use galaxyui_core::platform::OperatingSystem;
use serde::Serialize;
use serde_with::SerializeDisplay;
static OS_INFO: OnceLock<Result<OperatingSystemInfo, OperatingSystemInfoError>> = OnceLock::new();
@@ -2,15 +2,13 @@ use std::collections::HashSet;
use std::ops::Range;
use galaxyui_core::elements::SmartSelectFn;
use lazy_static::lazy_static;
use regex::Regex;
use settings::ChangeEventReason;
use settings::macros::define_settings_group;
use settings::{Setting, SupportedPlatforms, SyncToCloud};
use settings_value::SettingsValue;
use string_offset::ByteOffset;
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
use galaxyui_core::text::words::{is_default_word_boundary, DEFAULT_WORD_BOUNDARY_CHARS};
use lazy_static::lazy_static;
use regex::Regex;
use settings::macros::define_settings_group;
use settings::{Setting, SupportedPlatforms, SyncToCloud};
use string_offset::ByteOffset;
/// Upper limit for how many characters in either direction we'll search for patterns. Need to
/// limit this to avoid running regex on absurdly long words

Some files were not shown because too many files have changed in this diff Show More