Skip to content

Commit

Permalink
Clean up - linter and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
farmaazon committed Jul 4, 2022
1 parent 84e58b8 commit 5196f49
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ Cargo.lock
# TODO [mwu]: Adjust Engine build to not leave them.
ci-build/
enso/

# Popular IDEs
.idea
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/gui/src/presenter/searcher/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl list_view::entry::ModelProvider<component_group_view::Entry> for Component
fn get(&self, id: usize) -> Option<component_group_view::entry::Model> {
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,
Expand Down
22 changes: 13 additions & 9 deletions app/gui/view/component-browser/searcher-list-panel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;

Expand Down Expand Up @@ -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 ===
Expand Down Expand Up @@ -700,9 +704,9 @@ impl component::Frp<Model> for Frp {
let groups = &model.groups_wrapper;
let selection = &model.selection;

let selection_animation = Animation::<Vector2>::new(&network);
let selection_size_animation = Animation::<Vector2>::new(&network);
let selection_corners_animation = Animation::<f32>::new(&network);
let selection_animation = Animation::<Vector2>::new(network);
let selection_size_animation = Animation::<Vector2>::new(network);
let selection_corners_animation = Animation::<f32>::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 {
Expand Down
21 changes: 11 additions & 10 deletions app/gui/view/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,16 @@ 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<searcher::View>),
}

impl SearcherVariant {
fn new(app: &Application) -> Self {
if ARGS.enable_component_browser.unwrap_or(false) {
Self::ComponentBrowser(app.new_view::<component_browser::View>())
} else {
Self::OldNodeSearcher(app.new_view::<searcher::View>())
Self::OldNodeSearcher(Rc::new(app.new_view::<searcher::View>()))
}
}

Expand All @@ -177,19 +178,19 @@ 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) => {
frp::extend! {project_view_network
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(),
}
}
}
Expand All @@ -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(),
}
}

Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion app/ide-desktop/lib/client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion app/ide-desktop/lib/content/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/rust/ensogl/app/theme/derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#![warn(unused_qualifications)]



extern crate proc_macro;

use proc_macro::TokenStream;
Expand Down
1 change: 1 addition & 0 deletions lib/rust/ensogl/component/scroll-area/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Camera2d>) {
let camera = camera.into();
self.model.display_object.layer.masked_layer.set_camera(camera.clone_ref());
Expand Down

0 comments on commit 5196f49

Please sign in to comment.