Skip to content

Commit

Permalink
Component list panel integration (#3530)
Browse files Browse the repository at this point in the history
This PR contains all work for finishing integration of first Component List Panel in the IDE:
* It adds a stub for the whole Component Browser View. The documentation panel is re-used from the old searcher.
* It has the presenter implementation, integrating the view with Hierarchical Component List from the controller.
* It extends the View API, so the integration is possible, making use of Component Group Set wrapper.
* The selection integration was also merged into this PR, because it depended on the API extension mentioned above. However, we should avoid such practice in the future.

https://user-images.githubusercontent.com/3919101/177816427-8c4285b4-8941-4048-a400-52f4acf77a9f.mp4

# Important Notes
There are some known issues, to-be-fixed in the future.
* The performance is bad. It should be improved with new text::Area, and the decent one shall come with [GridView inside component browser](https://www.pivotaltracker.com/story/show/182561072)
* There is no keyboard navigation. It should also be delivered with [GridView](https://www.pivotaltracker.com/story/show/182561072).
* The Favorites section is not [filtered out by node source type](https://www.pivotaltracker.com/story/show/182661634).
  • Loading branch information
farmaazon authored Jul 14, 2022
1 parent 9578dc1 commit b0d627a
Show file tree
Hide file tree
Showing 44 changed files with 1,265 additions and 247 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 @@ -50,6 +50,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-new-component-browser` flag.

#### EnsoGL (rendering engine)

Expand Down Expand Up @@ -236,6 +240,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
[3542]: https://github.com/enso-org/enso/pull/3542
[3551]: https://github.com/enso-org/enso/pull/3551
[3552]: https://github.com/enso-org/enso/pull/3552
Expand Down
62 changes: 38 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ ensogl-drop-manager = { path = "../../lib/rust/ensogl/component/drop-manager" }
fuzzly = { path = "../../lib/rust/fuzzly" }
ast = { path = "language/ast/impl" }
ide-view = { path = "view" }
ide-view-component-group = { path = "view/component-browser/component-group" }
engine-protocol = { path = "controller/engine-protocol" }
json-rpc = { path = "../../lib/rust/json-rpc" }
parser = { path = "language/parser" }
span-tree = { path = "language/span-tree" }
bimap = { version = "0.4.0" }
console_error_panic_hook = { version = "0.1.6" }
convert_case = { version = "0.5.0" }
failure = { version = "0.1.6" }
flo_stream = { version = "0.4.0" }
futures = { version = "0.3.1" }
Expand Down
1 change: 1 addition & 0 deletions app/gui/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,6 @@ ensogl::read_args! {
test_workflow : String,
skip_min_version_check : bool,
preferred_engine_version : semver::Version,
enable_new_component_browser : bool,
}
}
11 changes: 11 additions & 0 deletions app/gui/controller/double-representation/src/tp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ impl Display for QualifiedName {
}


// === Comparison ===

impl PartialEq<module::QualifiedName> for QualifiedName {
fn eq(&self, rhs: &module::QualifiedName) -> bool {
self.project_name == rhs.project_name
&& self.module_segments == rhs.id.parent_segments()
&& self.name == rhs.id.name().as_ref()
}
}



// =============
// === Tests ===
Expand Down
4 changes: 3 additions & 1 deletion app/gui/src/controller/searcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,9 @@ pub mod test {
// Verify the contents of the components list loaded by the Searcher.
let components = searcher.components();
if let [module_group] = &components.top_modules()[..] {
assert_eq!(module_group.name, entry1.module.to_string());
let expected_group_name =
format!("{}.{}", entry1.module.project_name.project, entry1.module.name());
assert_eq!(module_group.name, expected_group_name);
let entries = module_group.entries.borrow();
assert_matches!(entries.as_slice(), [e1, e2] if e1.suggestion.name == entry1.name && e2.suggestion.name == entry9.name);
} else {
Expand Down
Loading

0 comments on commit b0d627a

Please sign in to comment.