diff --git a/.prettierignore b/.prettierignore index 5075cafe4b7a..bce3654ee7d9 100644 --- a/.prettierignore +++ b/.prettierignore @@ -30,3 +30,6 @@ Cargo.lock # TODO [mwu]: Adjust Engine build to not leave them. ci-build/ enso/ + +# Popular IDEs +.idea diff --git a/CHANGELOG.md b/CHANGELOG.md index 47c8e6e9b54a..54c4d3ca6dab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,10 @@ node cration.][3186] - [Fixed developer console error about failing to decode a notification "executionContext/visualisationEvaluationFailed"][3193] +- [New Version of the Node Searcher - the Component Browser][3530] The available + methods, atoms and functions are presented in nice, categorized view. The most + popular tools are available at hand. The The panel is unstable, and thus is + available under the `--enable-component-browser` flag. #### EnsoGL (rendering engine) @@ -227,6 +231,7 @@ [3519]: https://github.com/enso-org/enso/pull/3519 [3523]: https://github.com/enso-org/enso/pull/3523 [3528]: https://github.com/enso-org/enso/pull/3528 +[3530]: https://github.com/enso-org/enso/pull/3530 #### Enso Compiler diff --git a/app/gui/src/presenter/searcher/provider.rs b/app/gui/src/presenter/searcher/provider.rs index 0dd7569bfc76..476d79c5dd49 100644 --- a/app/gui/src/presenter/searcher/provider.rs +++ b/app/gui/src/presenter/searcher/provider.rs @@ -178,7 +178,7 @@ impl list_view::entry::ModelProvider for Component fn get(&self, id: usize) -> Option { let component = self.group.get_entry(id)?; let match_info = component.match_info.borrow(); - let label = component.label().to_owned(); + let label = component.label(); let highlighted = bytes_of_matched_letters(&*match_info, &label); Some(component_group_view::entry::Model { icon: component_group_view::icon::Id::AddColumn, diff --git a/app/gui/view/component-browser/searcher-list-panel/src/lib.rs b/app/gui/view/component-browser/searcher-list-panel/src/lib.rs index 088f66fd662e..3beed9c37164 100644 --- a/app/gui/view/component-browser/searcher-list-panel/src/lib.rs +++ b/app/gui/view/component-browser/searcher-list-panel/src/lib.rs @@ -40,12 +40,6 @@ #![warn(unused_import_braces)] #![warn(unused_qualifications)] -pub mod column_grid; - -pub use column_grid::LabeledAnyModelProvider; -pub use component_group::set::GroupId; - - use ensogl_core::display::shape::*; use ensogl_core::prelude::*; @@ -78,6 +72,16 @@ use ide_view_component_group::Layers as GroupLayers; use searcher_theme::list_panel as list_panel_theme; +// ============== +// === Export === +// ============== + +pub mod column_grid; + +pub use column_grid::LabeledAnyModelProvider; +pub use component_group::set::GroupId; + + // ================= // === Constants === @@ -700,9 +704,9 @@ impl component::Frp for Frp { let groups = &model.groups_wrapper; let selection = &model.selection; - let selection_animation = Animation::::new(&network); - let selection_size_animation = Animation::::new(&network); - let selection_corners_animation = Animation::::new(&network); + let selection_animation = Animation::::new(network); + let selection_size_animation = Animation::::new(network); + let selection_corners_animation = Animation::::new(network); let spring = inertia::Spring::default() * SELECTION_ANIMATION_SPRING_FORCE_MULTIPLIER; selection_animation.set_spring.emit(spring); fn selection_position(model: &Model, id: GroupId, group_local_pos: Vector2) -> Vector2 { diff --git a/app/gui/view/src/project.rs b/app/gui/view/src/project.rs index a7dea321df3a..299b953e0dcf 100644 --- a/app/gui/view/src/project.rs +++ b/app/gui/view/src/project.rs @@ -149,7 +149,8 @@ struct SearcherFrp { #[derive(Clone, CloneRef, Debug)] pub enum SearcherVariant { ComponentBrowser(component_browser::View), - OldNodeSearcher(searcher::View), + /// We keep the old searcher in a Rc, as its memory size is much greater than the new one. + OldNodeSearcher(Rc), } impl SearcherVariant { @@ -157,7 +158,7 @@ impl SearcherVariant { if ARGS.enable_component_browser.unwrap_or(false) { Self::ComponentBrowser(app.new_view::()) } else { - Self::OldNodeSearcher(app.new_view::()) + Self::OldNodeSearcher(Rc::new(app.new_view::())) } } @@ -177,9 +178,9 @@ impl SearcherVariant { } is_empty.emit(false); SearcherFrp { - editing_committed: editing_committed.into(), - is_visible: view.output.is_visible.clone_ref().into(), - is_empty: is_empty.into(), + editing_committed, + is_visible: view.output.is_visible.clone_ref().into(), + is_empty: is_empty.into(), } } SearcherVariant::OldNodeSearcher(view) => { @@ -187,9 +188,9 @@ impl SearcherVariant { editing_committed <- view.editing_committed.constant(()); } SearcherFrp { - editing_committed: editing_committed.into(), - is_visible: view.output.is_visible.clone_ref().into(), - is_empty: view.output.is_empty.clone_ref().into(), + editing_committed, + is_visible: view.output.is_visible.clone_ref().into(), + is_empty: view.output.is_empty.clone_ref().into(), } } } @@ -198,7 +199,7 @@ impl SearcherVariant { fn documentation(&self) -> &documentation::View { match self { SearcherVariant::ComponentBrowser(view) => &view.model().documentation, - SearcherVariant::OldNodeSearcher(view) => &view.documentation(), + SearcherVariant::OldNodeSearcher(view) => view.documentation(), } } @@ -760,7 +761,7 @@ impl View { model.debug_mode_popup.enabled <+ frp.enable_debug_mode; model.debug_mode_popup.disabled <+ frp.disable_debug_mode; } - model.searcher.setup_anchor(&network, &searcher_anchor.value); + model.searcher.setup_anchor(network, &searcher_anchor.value); init.emit(()); std::mem::forget(prompt_visibility); diff --git a/app/ide-desktop/lib/client/src/index.js b/app/ide-desktop/lib/client/src/index.js index ba1d9b652e12..cc7bea567b00 100644 --- a/app/ide-desktop/lib/client/src/index.js +++ b/app/ide-desktop/lib/client/src/index.js @@ -242,7 +242,8 @@ optParser.options('preferred-engine-version', { }) optParser.options('enable-component-browser', { - describe: 'Enable to have new Component Browser panel in place of old Node Searcher. A temporary feature flag, ' + + describe: + 'Enable to have new Component Browser panel in place of old Node Searcher. A temporary feature flag, ' + 'until the Component Browser is unstable', type: 'boolean', default: BUNDLED_ENGINE_VERSION, diff --git a/app/ide-desktop/lib/content/src/index.ts b/app/ide-desktop/lib/content/src/index.ts index 9388d2694e57..6c5ff8b9dea9 100644 --- a/app/ide-desktop/lib/content/src/index.ts +++ b/app/ide-desktop/lib/content/src/index.ts @@ -852,7 +852,9 @@ class Config { : this.skip_min_version_check this.preferred_engine_version = semver.parse(other.preferred_engine_version) ?? this.preferred_engine_version - this.enable_component_browser = ok(other.enable_component_browser) ? tryAsBoolean(other.enable_component_browser) : this.enable_component_browser + this.enable_component_browser = ok(other.enable_component_browser) + ? tryAsBoolean(other.enable_component_browser) + : this.enable_component_browser } } diff --git a/lib/rust/ensogl/app/theme/derive/src/lib.rs b/lib/rust/ensogl/app/theme/derive/src/lib.rs index b5e1390e6ce3..421fb1f1c265 100644 --- a/lib/rust/ensogl/app/theme/derive/src/lib.rs +++ b/lib/rust/ensogl/app/theme/derive/src/lib.rs @@ -58,6 +58,7 @@ #![warn(unused_qualifications)] + extern crate proc_macro; use proc_macro::TokenStream; diff --git a/lib/rust/ensogl/component/scroll-area/src/lib.rs b/lib/rust/ensogl/component/scroll-area/src/lib.rs index 620d3680207a..efde0f5557a8 100644 --- a/lib/rust/ensogl/component/scroll-area/src/lib.rs +++ b/lib/rust/ensogl/component/scroll-area/src/lib.rs @@ -348,6 +348,7 @@ impl ScrollArea { &self.model.display_object.layer.mask_layer } + /// Set camera in the every layer handled by this Scroll Area. pub fn set_camera(&self, camera: impl Into) { let camera = camera.into(); self.model.display_object.layer.masked_layer.set_camera(camera.clone_ref());