diff --git a/Cargo.lock b/Cargo.lock index 2e1163fa..00162423 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5313,7 +5313,7 @@ dependencies = [ [[package]] name = "galaxy" -version = "1.6.0" +version = "1.6.2" dependencies = [ "addr", "aho-corasick", diff --git a/app/Cargo.toml b/app/Cargo.toml index b51083e8..14c641b7 100644 --- a/app/Cargo.toml +++ b/app/Cargo.toml @@ -5,7 +5,7 @@ description = "Galaxy - AI-powered terminal" edition = "2021" autobins = false name = "galaxy" -version = "1.6.1" +version = "1.6.2" publish.workspace = true license.workspace = true diff --git a/app/src/ai/blocklist/action_model/execute/shell_command.rs b/app/src/ai/blocklist/action_model/execute/shell_command.rs index 2866df7f..65e7138f 100644 --- a/app/src/ai/blocklist/action_model/execute/shell_command.rs +++ b/app/src/ai/blocklist/action_model/execute/shell_command.rs @@ -268,10 +268,15 @@ impl ShellCommandExecutor { let block_selector = BlockSelector::RequestedCommandId(action_id.clone()); let command = command.clone(); + let delay = if *wait_until_completion { + Some(ShellCommandDelay::OnCompletion) + } else { + None + }; drop(model); ActionExecution::new_async( - self.action_result_future(block_selector.clone(), None), + self.action_result_future(block_selector.clone(), delay), move |result, ctx| { // Remove the senders from the maps. if let Some(handle) = handle.upgrade(ctx) { diff --git a/app/src/terminal/model/blocks.rs b/app/src/terminal/model/blocks.rs index 22e5a2ad..355673e1 100644 --- a/app/src/terminal/model/blocks.rs +++ b/app/src/terminal/model/blocks.rs @@ -3194,53 +3194,6 @@ impl BlockList { self.maintain_pinned_to_bottom(); } - /// Insert a rich content item immediately after the given removable item. - /// Returns true if insertion succeeded. - pub(in crate::terminal) fn insert_rich_content_after_item( - &mut self, - after_item: RemovableBlocklistItem, - item: RichContentItem, - ) -> bool { - let Some(current_index) = self - .removable_blocklist_item_positions - .get(&after_item) - .copied() - else { - return false; - }; - - let view_id = item.view_id; - - // Recreate block heights tree with new item inserted. - let (new_tree, inserted_index) = { - let mut cursor = self.block_heights.cursor::(); - let mut prefix = cursor.slice(&(current_index + 1), SeekBias::Right); - let inserted_index = TotalIndex(prefix.summary().total_count); - prefix.push(BlockHeightItem::RichContent(item)); - prefix.push_tree(cursor.suffix()); - (prefix, inserted_index) - }; - - self.block_heights = new_tree; - self.update_block_height_indices(BlockHeightUpdate::Insertion(inserted_index), true); - - // If there is an item at the index that we are inserting into, - // we should shift that item forward by one. - self.removable_blocklist_item_positions - .values_mut() - .for_each(|pos| { - if *pos == inserted_index { - pos.0 += 1; - } - }); - - self.removable_blocklist_item_positions - .insert(RemovableBlocklistItem::RichContent(view_id), inserted_index); - self.event_proxy.send_wakeup_event(); - - true - } - pub(in crate::terminal) fn set_marked_text( &mut self, marked_text: &str, diff --git a/crates/galaxy_terminal/src/model/grid/flat_storage/index.rs b/crates/galaxy_terminal/src/model/grid/flat_storage/index.rs index 9e8306a9..9391a1e3 100644 --- a/crates/galaxy_terminal/src/model/grid/flat_storage/index.rs +++ b/crates/galaxy_terminal/src/model/grid/flat_storage/index.rs @@ -584,6 +584,7 @@ impl EntryBuilder { /// Builds an [`Entry`] and appends it to the provided index, or simply /// drops `self` if the [`Entry`] would be empty. + #[allow(unused_mut)] pub fn append_to_index_if_nonempty(mut self, index: &mut Index) { #[cfg(debug_assertions)] { diff --git a/crates/galaxyui_core/src/core/app.rs b/crates/galaxyui_core/src/core/app.rs index 33a1b901..e7293bed 100644 --- a/crates/galaxyui_core/src/core/app.rs +++ b/crates/galaxyui_core/src/core/app.rs @@ -1560,7 +1560,7 @@ impl AppContext { #[cfg(not(debug_assertions))] pub fn register_binding_validator( &mut self, - binding_validator: impl Fn(BindingLens) -> IsBindingValid + 'static, + _binding_validator: impl Fn(BindingLens) -> IsBindingValid + 'static, ) { } @@ -1582,7 +1582,7 @@ impl AppContext { #[cfg(not(debug_assertions))] pub fn set_default_binding_validator( &mut self, - binding_validator: impl Fn(BindingLens) -> IsBindingValid + 'static, + _binding_validator: impl Fn(BindingLens) -> IsBindingValid + 'static, ) { } diff --git a/crates/galaxyui_core/src/elements/new_scrollable/dual_axis_config.rs b/crates/galaxyui_core/src/elements/new_scrollable/dual_axis_config.rs index c3c18bae..182e505c 100644 --- a/crates/galaxyui_core/src/elements/new_scrollable/dual_axis_config.rs +++ b/crates/galaxyui_core/src/elements/new_scrollable/dual_axis_config.rs @@ -5,9 +5,8 @@ use pathfinder_geometry::{ use crate::{ elements::{ - new_scrollable::{util::child_constraint_for_axis, ScrollableAxis}, - Axis, ClippedScrollStateHandle, ScrollData, ScrollStateHandle, SelectableElement, - Vector2FExt, + new_scrollable::util::child_constraint_for_axis, Axis, ClippedScrollStateHandle, + ScrollData, ScrollStateHandle, SelectableElement, Vector2FExt, }, event::DispatchedEvent, units::{IntoPixels, Pixels}, @@ -19,6 +18,8 @@ use super::{ util::{scroll_clipped_scrollable_handle_with_delta, scroll_delta_for_axis}, NewScrollableElement, SingleAxisConfig, }; +#[cfg(debug_assertions)] +use super::ScrollableAxis; use crate::elements::ScrollTarget; diff --git a/crates/galaxyui_core/src/elements/new_scrollable/single_axis_config.rs b/crates/galaxyui_core/src/elements/new_scrollable/single_axis_config.rs index 139136f7..e38838db 100644 --- a/crates/galaxyui_core/src/elements/new_scrollable/single_axis_config.rs +++ b/crates/galaxyui_core/src/elements/new_scrollable/single_axis_config.rs @@ -13,8 +13,10 @@ use crate::{ use super::{ util::{scroll_clipped_scrollable_handle_with_delta, scroll_delta_for_axis}, - NewScrollableElement, ScrollableAxis, + NewScrollableElement, }; +#[cfg(debug_assertions)] +use super::ScrollableAxis; use crate::elements::{ScrollTarget, ScrollToPositionMode}; @@ -42,11 +44,11 @@ pub enum SingleAxisConfig { impl SingleAxisConfig { /// At run-time, validate if the passed-in axis config is valid. - pub(super) fn validate(&self, axis: Axis) { + pub(super) fn validate(&self, _axis: Axis) { #[cfg(debug_assertions)] { if let SingleAxisConfig::Manual { child, .. } = self { - if matches!(axis, Axis::Horizontal) + if matches!(_axis, Axis::Horizontal) && matches!(child.axis(), ScrollableAxis::Vertical) { panic!( @@ -54,7 +56,7 @@ impl SingleAxisConfig { ); } - if matches!(axis, Axis::Vertical) + if matches!(_axis, Axis::Vertical) && matches!(child.axis(), ScrollableAxis::Horizontal) { panic!( diff --git a/crates/galaxyui_core/src/elements/rect.rs b/crates/galaxyui_core/src/elements/rect.rs index 79eadcca..0a406635 100644 --- a/crates/galaxyui_core/src/elements/rect.rs +++ b/crates/galaxyui_core/src/elements/rect.rs @@ -153,6 +153,7 @@ impl Element for Rect { } #[cfg_attr(debug_assertions, track_caller)] + #[allow(unused_mut)] fn finish(mut self) -> Box where Self: 'static + Sized, diff --git a/crates/galaxyui_core/src/keymap/matcher.rs b/crates/galaxyui_core/src/keymap/matcher.rs index 541084a3..a67e29bb 100644 --- a/crates/galaxyui_core/src/keymap/matcher.rs +++ b/crates/galaxyui_core/src/keymap/matcher.rs @@ -12,9 +12,11 @@ pub struct Matcher { keymap: Keymap, /// Default binding validator that should run on every binding (irrespective of the [`Context`] /// the binding was registered against). + #[cfg_attr(not(debug_assertions), allow(dead_code))] default_binding_validator: Option, /// List of validators to be used during binding validation. Each binding validator validates /// all of the bindings that match the [`Context`] it is paired with. + #[cfg_attr(not(debug_assertions), allow(dead_code))] binding_validators: Vec<(Context, BindingValidatorFn)>, /// Function to convert bindings that have a [`CustomTag`] trigger to one that has a /// [`Keystroke`]-based trigger instead. If `None`, bindings are not converted. diff --git a/crates/galaxyui_core/src/scene.rs b/crates/galaxyui_core/src/scene.rs index 2680b9cb..3befa20f 100644 --- a/crates/galaxyui_core/src/scene.rs +++ b/crates/galaxyui_core/src/scene.rs @@ -533,9 +533,9 @@ impl Scene { } } - fn validate_rect(rect: &RectF, location: Option<&'static std::panic::Location<'static>>) { + fn validate_rect(rect: &RectF, _location: Option<&'static std::panic::Location<'static>>) { #[cfg(debug_assertions)] - let location_info = location + let location_info = _location .map(|loc| { format!( " (element created at {}:{}:{})", diff --git a/install.sh b/install.sh new file mode 100755 index 00000000..d1d91bb8 --- /dev/null +++ b/install.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -e +cd "$(dirname "$0")" + +PROFILE="debug" +if [ "$1" = "--release" ]; then + PROFILE="release" + CARGO_FLAGS="--release" +fi + +APP_PATH="target/${PROFILE}/bundle/osx/Galaxy.app" +INSTALL_PATH="/Applications/Galaxy.app" + +echo "=== Building Galaxy (${PROFILE}) ===" +cargo bundle ${CARGO_FLAGS} --bin galaxy-oss --package galaxy + +if [ ! -d "$APP_PATH" ]; then + echo "Error: Bundle not found at ${APP_PATH}" + exit 1 +fi + +echo "=== Installing to /Applications ===" +if [ -d "$INSTALL_PATH" ]; then + rm -rf "$INSTALL_PATH" +fi + +cp -R "$APP_PATH" "$INSTALL_PATH" +echo "=== Installed Galaxy.app to /Applications ==="