Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A drop-down that allows changing the execution mode. #6130

Merged
merged 21 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
11945cd
enso-5931 A drop-down that allows changing the execution mode.
MichaelMauderer Mar 29, 2023
a47b113
Changelog update.
MichaelMauderer Mar 29, 2023
739e2f9
Revert opt level change.
MichaelMauderer Mar 29, 2023
2abc196
Reduce unused crate dependencies.
MichaelMauderer Mar 30, 2023
6426666
Merge remote-tracking branch 'origin/develop' into wip/MichaelMaudere…
MichaelMauderer Mar 31, 2023
d811fd2
Implement review feedback.
MichaelMauderer Mar 31, 2023
883cb43
Add docs.
MichaelMauderer Mar 31, 2023
37ec08f
Review feedback.
MichaelMauderer Apr 4, 2023
6632a6f
Layout.
MichaelMauderer Apr 4, 2023
2031123
Merge branch 'develop' into wip/MichaelMauderer/Execution_Context_Dro…
MichaelMauderer Apr 6, 2023
ed2e4f5
Fix shape offset.
MichaelMauderer Apr 6, 2023
f39f74d
Make the shape of the Play button bigger
vitvakatu Apr 7, 2023
b4f06ca
Remove logging.
MichaelMauderer Apr 11, 2023
70a12ce
Merge branch 'develop' into wip/MichaelMauderer/Execution_Context_Dro…
MichaelMauderer Apr 11, 2023
39ce6a2
Fix click overlay.
MichaelMauderer Apr 11, 2023
9fda421
Add docs for workaround.
MichaelMauderer Apr 11, 2023
9d38b2b
Fix default layer label.
MichaelMauderer Apr 11, 2023
2781f0a
Merge branch 'develop' into wip/MichaelMauderer/Execution_Context_Dro…
MichaelMauderer Apr 16, 2023
71f3bf0
Merge branch 'develop' into wip/MichaelMauderer/Execution_Context_Dro…
mergify[bot] Apr 17, 2023
1748b1f
Merge branch 'develop' into wip/MichaelMauderer/Execution_Context_Dro…
mergify[bot] Apr 17, 2023
a004adb
Merge branch 'develop' into wip/MichaelMauderer/Execution_Context_Dro…
mergify[bot] Apr 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
shortened labels for entries with long module paths. When an option is
selected from the dropdown, the necessary module imports are inserted,
eliminating the need for fully qualified names.
- [The IDE now has a new UI element for selecting the execution mode of the
project][6130].

#### EnsoGL (rendering engine)

Expand Down Expand Up @@ -182,6 +184,7 @@
[4047]: https://github.com/enso-org/enso/pull/4047
[4003]: https://github.com/enso-org/enso/pull/4003
[5895]: https://github.com/enso-org/enso/pull/5895
[5895]: https://github.com/enso-org/enso/pull/6130

#### Enso Standard Library

Expand Down
40 changes: 40 additions & 0 deletions Cargo.lock

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

10 changes: 10 additions & 0 deletions app/gui/src/presenter/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,20 @@ impl Project {
let graph_controller = self.model.graph_controller.clone_ref();

self.init_analytics()
.init_execution_modes()
.setup_notification_handler()
.attach_frp_to_values_computed_notifications(graph_controller, values_computed)
}

/// Initialises execution modes. Currently a dummy implementqation to be replaced during
/// implementation of #5930.
fn init_execution_modes(self) -> Self {
let graph = &self.model.view.graph();
let entries = Rc::new(vec!["development".to_string(), "production".to_string()]);
graph.set_execution_modes(entries);
self
}

fn init_analytics(self) -> Self {
let network = &self.network;
let project = &self.model.view;
Expand Down
1 change: 1 addition & 0 deletions app/gui/view/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ensogl-text = { path = "../../../lib/rust/ensogl/component/text" }
ensogl-text-msdf = { path = "../../../lib/rust/ensogl/component/text/src/font/msdf" }
ensogl-hardcoded-theme = { path = "../../../lib/rust/ensogl/app/theme/hardcoded" }
ide-view-component-browser = { path = "component-browser" }
ide-view-execution-mode-selector = { path = "execution-mode-selector" }
ide-view-documentation = { path = "documentation" }
ide-view-graph-editor = { path = "graph-editor" }
span-tree = { path = "../language/span-tree" }
Expand Down
1 change: 1 addition & 0 deletions app/gui/view/examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ debug-scene-icons = { path = "icons" }
debug-scene-interface = { path = "interface" }
debug-scene-text-grid-visualization = { path = "text-grid-visualization" }
debug-scene-visualization = { path = "visualization" }
debug-scene-execution-mode-dropdown = { path = "execution-mode-dropdown" }

# Stop wasm-pack from running wasm-opt, because we run it from our build scripts in order to customize options.
[package.metadata.wasm-pack.profile.release]
Expand Down
17 changes: 17 additions & 0 deletions app/gui/view/examples/execution-mode-dropdown/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "debug-scene-execution-mode-dropdown"
version = "0.1.0"
authors = ["Enso Team <[email protected]>"]
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
ensogl = { path = "../../../../../lib/rust/ensogl" }
ensogl-drop-down-menu = { path = "../../../../../lib/rust/ensogl/component/drop-down-menu" }
ensogl-list-view = { path = "../../../../../lib/rust/ensogl/component/list-view" }
ensogl-hardcoded-theme = { path = "../../../../../lib/rust/ensogl/app/theme/hardcoded" }
ide-view = { path = "../.." }
ensogl-text-msdf = { path = "../../../../../lib/rust/ensogl/component/text/src/font/msdf" }
ide-view-execution-mode-selector = { path = "../../execution-mode-selector" }
62 changes: 62 additions & 0 deletions app/gui/view/examples/execution-mode-dropdown/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
//! This is a visualization example scene which creates a sinusoidal graph.

// === Standard Linter Configuration ===
#![deny(non_ascii_idents)]
#![warn(unsafe_code)]
#![allow(clippy::bool_to_int_with_if)]
#![allow(clippy::let_and_return)]
// === Non-Standard Linter Configuration ===
#![warn(missing_copy_implementations)]
#![warn(missing_debug_implementations)]
#![warn(missing_docs)]
#![warn(trivial_casts)]
#![warn(trivial_numeric_casts)]
#![warn(unused_import_braces)]
#![warn(unused_qualifications)]

use ensogl::prelude::*;

use ensogl::animation;
use ensogl::application::Application;
use ensogl_text_msdf::run_once_initialized;
use ide_view_execution_mode_selector as execution_mode_selector;



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no section

fn make_entries() -> execution_mode_selector::ExecutionModes {
Rc::new(vec!["development".to_string(), "production".to_string()])
}

fn init(app: &Application) {
let app = app.clone_ref();
let world = &app.display;
let _scene = &world.default_scene;

let execution_mode_selector = execution_mode_selector::ExecutionModeSelector::new(&app);
world.add_child(&execution_mode_selector);
execution_mode_selector.set_execution_modes(make_entries());

world
.on
.before_frame
.add(move |_time_info: animation::TimeInfo| {
let _keep_alive = &execution_mode_selector;
})
.forget();
}


// ===================
// === Entry Point ===
// ===================

/// Entry point for the demo scene.
#[entry_point]
#[allow(dead_code)]
pub fn main() {
run_once_initialized(|| {
let app = Application::new("root");
init(&app);
mem::forget(app);
});
}
1 change: 1 addition & 0 deletions app/gui/view/examples/icons/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use ide_view_component_list_panel_icons::SIZE;
use ide_view_graph_editor::component::node::action_bar;



farmaazon marked this conversation as resolved.
Show resolved Hide resolved
// =============
// === Frame ===
// =============
Expand Down
3 changes: 2 additions & 1 deletion app/gui/view/examples/interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
ast = { path = "../../../language/ast/impl" }
parser = { path = "../../../language/parser" }
enso-frp = { path = "../../../../../lib/rust/frp" }
ensogl = { path = "../../../../../lib/rust/ensogl" }
ensogl-hardcoded-theme = { path = "../../../../../lib/rust/ensogl/app/theme/hardcoded" }
ensogl-text-msdf = { path = "../../../../../lib/rust/ensogl/component/text/src/font/msdf" }
ide-view = { path = "../.." }
ide-view-execution-mode-selector = { path = "../../execution-mode-selector" }
parser = { path = "../../../language/parser" }
span-tree = { path = "../../../language/span-tree" }
uuid = { version = "0.8", features = ["v4", "wasm-bindgen"] }
wasm-bindgen = { workspace = true }
Expand Down
7 changes: 7 additions & 0 deletions app/gui/view/examples/interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@ fn init(app: &Application) {
graph_editor.set_node_profiling_status(node3_id, node3_status);


// === Execution Modes ===

graph_editor.set_execution_modes(vec!["development".to_string(), "production".to_string()]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These strings ar defiend in another file as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are dummy strings anyway. The ones in the demo scene will only be used there, while the other ones will be removed during integration.



// === Rendering ===

// let tgt_type = dummy_type_generator.get_dummy_type();
let mut was_rendered = false;
let mut loader_hidden = false;
Expand Down
1 change: 1 addition & 0 deletions app/gui/view/examples/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

pub use debug_scene_component_list_panel_view as new_component_list_panel_view;
pub use debug_scene_documentation as documentation;
pub use debug_scene_execution_mode_dropdown as execution_mode_dropdown;
pub use debug_scene_icons as icons;
pub use debug_scene_interface as interface;
pub use debug_scene_text_grid_visualization as text_grid_visualization;
Expand Down
27 changes: 27 additions & 0 deletions app/gui/view/execution-mode-selector/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "ide-view-execution-mode-selector"
version = "0.1.0"
authors = ["Enso Team <[email protected]>"]
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
enso-frp = { path = "../../../../lib/rust/frp" }
enso-prelude = { path = "../../../../lib/rust/prelude" }
enso-shapely = { path = "../../../../lib/rust/shapely" }
enso-text = { path = "../../../../lib/rust/text" }
ensogl = { path = "../../../../lib/rust/ensogl" }
ensogl-hardcoded-theme = { path = "../../../../lib/rust/ensogl/app/theme/hardcoded" }
ensogl-text-msdf = { path = "../../../../lib/rust/ensogl/component/text/src/font/msdf" }
failure = { workspace = true }
indexmap = "1.9.2"
nalgebra = { workspace = true }
ordered-float = { workspace = true }
serde = { version = "1.0", features = ["derive"] }
serde-wasm-bindgen = { workspace = true }
serde_json = { workspace = true }
ensogl-drop-down-menu = { path = "../../../../lib/rust/ensogl/component/drop-down-menu" }
ensogl-list-view = { path = "../../../../lib/rust/ensogl/component/list-view" }
ensogl-gui-component = { path = "../../../../lib/rust/ensogl/component/gui" }
farmaazon marked this conversation as resolved.
Show resolved Hide resolved
Loading