From 35a4a3ffca2f0bd5cce045d84f6f1ee2808f543e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grabarz?= Date: Fri, 21 Apr 2023 20:25:39 +0200 Subject: [PATCH] widget metadata -> configuration --- app/gui/src/controller/graph/widget.rs | 12 +- .../widget/{metadata.rs => configuration.rs} | 18 +-- .../src/controller/graph/widget/response.rs | 2 +- .../src/component/node/input/area.rs | 17 +- .../src/component/node/input/port.rs | 8 +- .../src/component/node/input/widget.rs | 152 +++++++++--------- .../node/input/widget/list_editor.rs | 4 +- .../node/input/widget/single_choice.rs | 2 +- app/gui/view/graph-editor/src/lib.rs | 6 +- 9 files changed, 116 insertions(+), 105 deletions(-) rename app/gui/src/controller/graph/widget/{metadata.rs => configuration.rs} (82%) diff --git a/app/gui/src/controller/graph/widget.rs b/app/gui/src/controller/graph/widget.rs index c39d8f6decdae..8ac56d40353da 100644 --- a/app/gui/src/controller/graph/widget.rs +++ b/app/gui/src/controller/graph/widget.rs @@ -1,11 +1,11 @@ //! Widget controller. //! //! The Widget Controller is responsible for querying the language server for information about -//! the node's widget metadata or resolving it from local cache. +//! the node's widget configuration or resolving it from local cache. -mod metadata; +mod configuration; mod response; use crate::prelude::*; @@ -67,11 +67,11 @@ define_endpoints_2! { } } -/// Graph widgets controller. Handles requests for widget metadata using visualizations. Maps +/// Graph widgets controller. Handles requests for widget configuration using visualizations. Maps /// response data to the relevant node Id updates, and dispatches them over the FRP output. /// Guarantees that each individual query eventually receives an update. It internally caches the -/// results of the last queries, so that the metadata can be delivered to the presenter even when no -/// visualization change is necessary. +/// results of the last queries, so that the configuration can be delivered to the presenter even +/// when no visualization change is necessary. #[derive(Debug, Deref)] pub struct Controller { #[deref] @@ -174,7 +174,7 @@ impl Model { ) -> Option<(NodeId, CallWidgetsConfig)> { let query_data = self.widget_queries.get_mut(&target)?; - let (definitions, errors) = metadata::deserialize_widget_definitions(&data); + let (definitions, errors) = configuration::deserialize_widget_definitions(&data); for error in errors { error!("{:?}", error); diff --git a/app/gui/src/controller/graph/widget/metadata.rs b/app/gui/src/controller/graph/widget/configuration.rs similarity index 82% rename from app/gui/src/controller/graph/widget/metadata.rs rename to app/gui/src/controller/graph/widget/configuration.rs index cb4e59ca3ba2d..f868b4a462145 100644 --- a/app/gui/src/controller/graph/widget/metadata.rs +++ b/app/gui/src/controller/graph/widget/configuration.rs @@ -30,7 +30,7 @@ pub fn deserialize_widget_definitions( let msg = "Failed to deserialize widget data for argument"; e.context(format!("{msg} '{argument_name}'")) })?; - let meta = widget.map(to_metadata); + let meta = widget.map(to_configuration); let argument_name = argument_name.to_owned(); Ok(ArgumentWidgetConfig { argument_name, meta }) }, @@ -46,15 +46,15 @@ pub fn deserialize_widget_definitions( } } -/// == Conversion to Widget Metadata IDE structs === +/// == Conversion to Widget Configuration IDE structs === -/// Convert a widget definition from the engine response into a IDE internal widget metadata struct. -/// See [`widget::Metadata`] for more information. -fn to_metadata(resp: response::WidgetDefinition) -> widget::Metadata { - widget::Metadata { display: resp.display, config: to_config(resp.inner), has_port: true } +/// Convert a widget definition from the engine response into a IDE internal widget configuration +/// struct. See [`widget::Configuration`] for more information. +fn to_configuration(resp: response::WidgetDefinition) -> widget::Configuration { + widget::Configuration { display: resp.display, kind: to_kind(resp.inner), has_port: true } } -fn to_config(inner: response::WidgetKindDefinition) -> widget::Config { +fn to_kind(inner: response::WidgetKindDefinition) -> widget::DynConfig { match inner { response::WidgetKindDefinition::SingleChoice { label, values } => widget::single_choice::Config { @@ -62,9 +62,9 @@ fn to_config(inner: response::WidgetKindDefinition) -> widget::Config { entries: Rc::new(to_entries(&values)), } .into(), - response::WidgetKindDefinition::ListEditor { item_editor, item_default } => + response::WidgetKindDefinition::ListEditor { item_widget, item_default } => widget::list_editor::Config { - item_editor: Some(Rc::new(to_metadata(*item_editor))), + item_widget: Some(Rc::new(to_configuration(*item_widget))), item_default: item_default.into(), } .into(), diff --git a/app/gui/src/controller/graph/widget/response.rs b/app/gui/src/controller/graph/widget/response.rs index 4d35b1198df46..bcd1f1a829a21 100644 --- a/app/gui/src/controller/graph/widget/response.rs +++ b/app/gui/src/controller/graph/widget/response.rs @@ -77,7 +77,7 @@ pub(super) enum WidgetKindDefinition<'a> { ListEditor { /// The widget to use for editing the items. #[serde(borrow, alias = "item_editor")] - item_editor: Box>, + item_widget: Box>, /// The default value for new items inserted when the user adds a new element. #[serde(borrow)] item_default: &'a str, diff --git a/app/gui/view/graph-editor/src/component/node/input/area.rs b/app/gui/view/graph-editor/src/component/node/input/area.rs index f6f437df8e781..8575b722ba529 100644 --- a/app/gui/view/graph-editor/src/component/node/input/area.rs +++ b/app/gui/view/graph-editor/src/component/node/input/area.rs @@ -8,7 +8,7 @@ use ensogl::display::traits::*; use crate::component::type_coloring; use crate::node; use crate::node::input::widget; -use crate::node::input::widget::MetadataPointer; +use crate::node::input::widget::OverrideKey; use crate::node::profiling; use crate::view; use crate::CallWidgetsConfig; @@ -238,13 +238,16 @@ impl Model { Some(cursor::Style::new_highlight(display_object, size, radius, color)) } - /// Apply widget configuration to widgets in this input area. - fn set_widget_configuration(&self, config: &CallWidgetsConfig) { + /// Configure widgets associated with single Enso call expression, overriding default widgets + /// generated from span tree. The provided widget configuration is merged with configurations + /// already present in the widget tree. Setting a widget configuration to `None` will remove + /// an override, and a default widget will be used. + fn apply_widget_configuration(&self, config: &CallWidgetsConfig) { let CallWidgetsConfig { call_id, definitions } = config; for definition in definitions.iter() { let argument_name = definition.argument_name.clone().into(); - let meta_pointer = MetadataPointer { call_id: *call_id, argument_name }; - self.widget_tree.set_metadata(meta_pointer, definition.meta.clone()); + let override_key = OverrideKey { call_id: *call_id, argument_name }; + self.widget_tree.set_config_override(override_key, definition.meta.clone()); } } @@ -324,7 +327,7 @@ ensogl::define_endpoints! { /// contains the color of connected edge. set_connected (Crumbs, Option), - /// Update widget metadata for widgets already present in this input area. + /// Update widget configuration for widgets already present in this input area. update_widgets (CallWidgetsConfig), /// Enable / disable port hovering. The optional type indicates the type of the active edge @@ -511,7 +514,7 @@ impl Area { // === Widgets === - eval frp.update_widgets((a) model.set_widget_configuration(a)); + eval frp.update_widgets((a) model.apply_widget_configuration(a)); eval frp.set_connected(((crumbs,status)) model.set_connected(crumbs,*status)); eval frp.set_expression_usage_type(((id,tp)) model.set_expression_usage_type(*id,tp.clone())); eval frp.set_disabled ((disabled) model.widget_tree.set_disabled(*disabled)); diff --git a/app/gui/view/graph-editor/src/component/node/input/port.rs b/app/gui/view/graph-editor/src/component/node/input/port.rs index 2bdeaa7fd8807..a151cbeaea430 100644 --- a/app/gui/view/graph-editor/src/component/node/input/port.rs +++ b/app/gui/view/graph-editor/src/component/node/input/port.rs @@ -2,10 +2,10 @@ use crate::prelude::*; -use crate::component::node::input::widget::Config; use crate::component::node::input::widget::ConfigContext; -use crate::component::node::input::widget::ConnectionData; +use crate::component::node::input::widget::DynConfig; use crate::component::node::input::widget::DynWidget; +use crate::component::node::input::widget::EdgeData; use crate::component::node::input::widget::SpanWidget; use crate::component::node::input::widget::WidgetsFrp; @@ -213,7 +213,7 @@ impl Port { } /// Configure the port and its attached widget. - pub fn configure(&mut self, config: &Config, ctx: ConfigContext) { + pub fn configure(&mut self, config: &DynConfig, ctx: ConfigContext) { self.crumbs.replace(ctx.span_node.crumbs.clone()); self.set_connected(ctx.info.connection); self.set_port_layout(&ctx); @@ -223,7 +223,7 @@ impl Port { /// Update connection status of this port. Changing the connection status will add or remove the /// port's visible shape from the display hierarchy. - fn set_connected(&self, status: Option) { + fn set_connected(&self, status: Option) { match status { Some(data) => { self.port_root.add_child(&self.port_shape); diff --git a/app/gui/view/graph-editor/src/component/node/input/widget.rs b/app/gui/view/graph-editor/src/component/node/input/widget.rs index e4032a9a66266..bb69d6155496f 100644 --- a/app/gui/view/graph-editor/src/component/node/input/widget.rs +++ b/app/gui/view/graph-editor/src/component/node/input/widget.rs @@ -63,10 +63,10 @@ ensogl::define_endpoints_2! { } } -/// Information associated with widget metadata which describes which uniquely identifies the -/// widget to reconfigure. +/// A key used for overriding widget configuration. Allows locating the widget that should be +/// configured using provided external data. #[derive(Debug, Default, Clone, Hash, PartialEq, Eq)] -pub struct MetadataPointer { +pub struct OverrideKey { /// The function call associated with the widget. pub call_id: ast::Id, /// The name of function argument at which the widget is located. @@ -90,6 +90,7 @@ pub trait SpanWidget { fn configure(&mut self, config: &Self::Config, ctx: ConfigContext); } + /// Generate implementation for [`DynWidget`] enum and its associated [`Config`] enum. Those enums /// are used to represent any possible widget kind and its configuration. macro_rules! define_widget_modules( @@ -102,14 +103,14 @@ macro_rules! define_widget_modules( /// A widget configuration that determines the widget kind. #[derive(Debug, Clone, PartialEq)] #[allow(missing_docs)] - pub enum Config { + pub enum DynConfig { $($name(<$module::Widget as SpanWidget>::Config),)* } /// The node widget view. Represents one widget of any kind on the node input area. Can - /// change its appearance and behavior depending on the widget metadata updates, without - /// being recreated. New widget can be created using the `new` method, while the existing - /// widget can be reconfigured using the `configure` method. + /// change its appearance and behavior depending on the widget configuration updates, + /// without being recreated. New widget can be created using the `new` method, while the + /// existing widget can be reconfigured using the `configure` method. /// /// When a new configuration is applied, the existing widget will handle the update using /// its `configure` method. If the new configuration requires a different widget kind, the @@ -124,7 +125,7 @@ macro_rules! define_widget_modules( } $( - impl const From<<$module::Widget as SpanWidget>::Config> for Config { + impl const From<<$module::Widget as SpanWidget>::Config> for DynConfig { fn from(config: <$module::Widget as SpanWidget>::Config) -> Self { Self::$name(config) } @@ -138,22 +139,22 @@ macro_rules! define_widget_modules( )* impl SpanWidget for DynWidget { - type Config = Config; + type Config = DynConfig; fn root_object(&self) -> &display::object::Instance { match self { $(DynWidget::$name(inner) => inner.root_object(),)* } } - fn new(config: &Config, ctx: &ConfigContext) -> Self { + fn new(config: &DynConfig, ctx: &ConfigContext) -> Self { match config { - $(Config::$name(config) => DynWidget::$name(SpanWidget::new(config, ctx)),)* + $(DynConfig::$name(config) => DynWidget::$name(SpanWidget::new(config, ctx)),)* } } - fn configure(&mut self, config: &Config, ctx: ConfigContext) { + fn configure(&mut self, config: &DynConfig, ctx: ConfigContext) { match (self, config) { - $((DynWidget::$name(model), Config::$name(config)) => { + $((DynWidget::$name(model), DynConfig::$name(config)) => { SpanWidget::configure(model, config, ctx); },)* (this, _) => { @@ -189,17 +190,22 @@ define_widget_modules! { /// indicate that they are connected. #[derive(Debug, Clone, PartialEq)] #[allow(missing_docs)] -pub struct Metadata { - /// The placeholder text value. By default, the parameter name is used. +pub struct Configuration { + /// Display mode of the widget: determines whether or not the widget should be displayed + /// depending on current tree display mode. pub display: Display, - pub config: Config, + /// Whether or not the widget can receive a port. If `true`, the widget can be wrapped in a + /// [`Port`] struct, but it is not guaranteed. If multiple widgets created at single span node + /// declare themselves as wanting a port, only one of them will actually have one. pub has_port: bool, + /// Configuration specific to given widget kind. + pub kind: DynConfig, } -impl Metadata { - /// Derive widget metadata from the expression, node data in span tree and inferred value type. - /// When no metadata is provided by language server, the metadata returned from this function - /// will be used to create a default widget. +impl Configuration { + /// Derive widget configuration from the expression, node data in span tree and inferred value + /// type. When no metadata is provided by language server, the metadata returned from this + /// function will be used to create a default widget. fn from_node(span_node: &SpanRef, usage_type: Option, expression: &str) -> Self { use span_tree::node::Kind; @@ -240,25 +246,28 @@ impl Metadata { } } - const fn always(config: C) -> Self - where C: ~const Into { - Self { display: Display::Always, config: config.into(), has_port: true } + const fn always(kind: C) -> Self + where C: ~const Into { + Self { display: Display::Always, kind: kind.into(), has_port: true } } - const fn inert(config: C) -> Self - where C: ~const Into { - Self { display: Display::Always, config: config.into(), has_port: false } + const fn inert(kind: C) -> Self + where C: ~const Into { + Self { display: Display::Always, kind: kind.into(), has_port: false } } - /// Widget metadata for static dropdown, based on the tag values provided by suggestion + /// Widget configuration for static dropdown, based on the tag values provided by suggestion /// database. - fn static_dropdown(label: Option, tag_values: &[span_tree::TagValue]) -> Metadata { + fn static_dropdown( + label: Option, + tag_values: &[span_tree::TagValue], + ) -> Configuration { let entries = Rc::new(tag_values.iter().map(Entry::from).collect()); Self::always(single_choice::Config { label, entries }) } - fn list_editor() -> Metadata { - Self::always(list_editor::Config { item_editor: None, item_default: "_".into() }) + fn list_editor() -> Configuration { + Self::always(list_editor::Config { item_widget: None, item_default: "_".into() }) } } @@ -409,17 +418,17 @@ impl Tree { Self { frp, widgets_frp, model } } - /// Override widget metadata. The metadata is used to determine the widget appearance and - /// behavior. By default, the widget metadata will be inferred from its span tree kind and type. - /// However, in some cases, we want to change the selected widget for a given span tree node, - /// and it can be done by calling this method. The set metadata is persistent, and will be - /// applied to any future widget of this node that matches given pointer. - pub fn set_metadata(&self, pointer: MetadataPointer, meta: Option) { - self.notify_dirty(self.model.set_metadata(pointer, meta)); + /// Override widget configuration. The configuration is used to determine the widget appearance + /// and behavior. By default, the widget configuration will be inferred from its span tree kind + /// and type. However, in some cases, we want to change the selected widget for a given span + /// tree node, and it can be done by calling this method. The set metadata is persistent, and + /// will be applied to any future widget of this node that matches given pointer. + pub fn set_config_override(&self, pointer: OverrideKey, meta: Option) { + self.notify_dirty(self.model.set_config_override(pointer, meta)); } /// Set usage type for given AST node. The usage type is used to determine the widget appearance - /// and default inferred widget metadata. + /// and default inferred widget configuration. pub fn set_usage_type(&self, ast_id: ast::Id, usage_type: Option) { self.notify_dirty(self.model.set_usage_type(ast_id, usage_type)); } @@ -439,7 +448,7 @@ impl Tree { /// Rebuild tree if it has been marked as dirty. The dirty flag is marked whenever more data - /// external to the span-tree is provided, using `set_metadata`, `set_usage_type`, + /// external to the span-tree is provided, using `set_config_override`, `set_usage_type`, /// `set_connected` or `set_disabled` methods of the widget tree. pub fn rebuild_tree_if_dirty( &self, @@ -547,15 +556,15 @@ struct TreeEntry { -// ====================== -// === ConnectionData === -// ====================== +// ================ +// === EdgeData === +// ================ /// Data associated with an edge connected to a port in the tree. It is accessible to the connected /// port, its widget and all its descendants through `connection` and `subtree_connection` fields /// of [`NodeState`]. #[derive(Debug, Clone, Copy, PartialEq)] -pub(super) struct ConnectionData { +pub(super) struct EdgeData { /// Color of an edge connected to the port. pub color: color::Lcha, /// Span tree depth at which the connection is made. @@ -579,7 +588,7 @@ struct TreeModel { /// of a node. hierarchy: RefCell>, ports_map: RefCell>, - metadata_map: Rc>>, + override_map: Rc>>, connected_map: Rc>>, usage_type_map: Rc>>, node_disabled: Cell, @@ -605,7 +614,7 @@ impl TreeModel { nodes_map: default(), hierarchy: default(), ports_map: default(), - metadata_map: default(), + override_map: default(), connected_map: default(), usage_type_map: default(), tree_dirty: default(), @@ -622,9 +631,9 @@ impl TreeModel { } } - /// Set the metadata under given pointer. It may cause the tree to be marked as dirty. - fn set_metadata(&self, pointer: MetadataPointer, meta: Option) -> bool { - let mut map = self.metadata_map.borrow_mut(); + /// Set the configuration under given key. It may cause the tree to be marked as dirty. + fn set_config_override(&self, pointer: OverrideKey, meta: Option) -> bool { + let mut map = self.override_map.borrow_mut(); let dirty = map.synchronize_entry(pointer, meta); self.mark_dirty_flag(dirty) } @@ -694,7 +703,7 @@ impl TreeModel { ) { self.tree_dirty.set(false); let app = self.app.clone(); - let metadata_map = self.metadata_map.borrow(); + let metadata_map = self.override_map.borrow(); let connected_map = self.connected_map.borrow(); let usage_type_map = self.usage_type_map.borrow(); let old_nodes = self.nodes_map.take(); @@ -796,11 +805,11 @@ pub(super) struct NodeInfo { pub nesting_level: NestingLevel, /// Data associated with an edge connected to this node's span. Only present at the exact node /// that is connected, not at any of its children. - pub connection: Option, + pub connection: Option, /// Data associated with an edge connected to this subtree. Contains the status of this node's /// connection, or its first parent that is connected. It is the same as `connection` for nodes /// that are directly connected. - pub subtree_connection: Option, + pub subtree_connection: Option, /// Whether the node is disabled, i.e. its expression is not currently used in the computation. /// Widgets of disabled nodes are usually grayed out. pub disabled: bool, @@ -1037,7 +1046,7 @@ struct TreeBuilder<'a> { node_disabled: bool, node_expression: &'a str, styles: &'a StyleWatch, - metadata_map: &'a HashMap, + metadata_map: &'a HashMap, connected_map: &'a HashMap, usage_type_map: &'a HashMap, old_nodes: HashMap, @@ -1082,7 +1091,7 @@ impl<'a> TreeBuilder<'a> { &mut self, span_node: span_tree::node::Ref<'_>, nesting_level: NestingLevel, - meta: Metadata, + meta: Configuration, ) -> display::object::Instance { self.create_child_widget(span_node, nesting_level, Some(meta)) } @@ -1094,7 +1103,7 @@ impl<'a> TreeBuilder<'a> { &mut self, span_node: span_tree::node::Ref<'_>, nesting_level: NestingLevel, - set_metadata: Option, + config_override: Option, ) -> display::object::Instance { // This call can recurse into itself within the widget configuration logic. We need to save // the current layer's state, so it can be restored later after visiting the child node. @@ -1124,21 +1133,21 @@ impl<'a> TreeBuilder<'a> { let sibling_offset = span_node.sibling_offset.as_usize(); let usage_type = main_ptr.id.and_then(|id| self.usage_type_map.get(&id)).cloned(); - // Get widget metadata. There are three potential sources for metadata, that are used in - // order, whichever is available first: - // 1. The `set_metadata` argument, which can be set by the parent widget if it wants to - // override the metadata for its child. - // 2. The `MetadataPointer` stored in the span tree node. This can be set by an external - // source (e.g. based on language server) to override the default metadata for the node. + // Get widget configuration. There are three potential sources for configuration, that are + // used in order, whichever is available first: + // 1. The `config_override` argument, which can be set by the parent widget if it wants to + // override the configuration for its child. + // 2. The override stored in the span tree node, located using `OverrideKey`. This can be + // set by an external source, e.g. based on language server. // 3. The default metadata for the node, which is determined based on the node kind, usage - // type and whether it has children. + // type and whether it has children. let mut meta_fallback = None; let kind = &span_node.kind; - let meta = set_metadata + let configuration = config_override .as_ref() .or_else(|| { let pointer_data = kind.call_id().zip(kind.argument_name()); - let meta_pointer = pointer_data.map(|(call_id, argument_name)| MetadataPointer { + let meta_pointer = pointer_data.map(|(call_id, argument_name)| OverrideKey { call_id, argument_name: argument_name.into(), }); @@ -1147,11 +1156,11 @@ impl<'a> TreeBuilder<'a> { }) .unwrap_or_else(|| { meta_fallback.get_or_insert_with(|| { - Metadata::from_node(&span_node, usage_type.clone(), self.node_expression) + Configuration::from_node(&span_node, usage_type.clone(), self.node_expression) }) }); - let widget_has_port = ptr_usage.request_port(&widget_id, meta.has_port); + let widget_has_port = ptr_usage.request_port(&widget_id, configuration.has_port); let insertion_index = self.hierarchy.len(); self.hierarchy.push(NodeHierarchy { @@ -1163,10 +1172,9 @@ impl<'a> TreeBuilder<'a> { let old_node = self.old_nodes.remove(&widget_id).map(|e| e.node); - // Once we have the metadata and potential old widget to reuse, we have to apply the - // configuration to the widget. + // Prepare the widget node info and build context. let connection_color = self.connected_map.get(&span_node.crumbs); - let connection = connection_color.map(|&color| ConnectionData { color, depth }); + let connection = connection_color.map(|&color| EdgeData { color, depth }); let parent_connection = self.parent_info.as_ref().and_then(|info| info.connection); let subtree_connection = connection.or(parent_connection); @@ -1198,17 +1206,17 @@ impl<'a> TreeBuilder<'a> { let mut port = match old_node { Some(TreeNode::Port(port)) => port, Some(TreeNode::Widget(widget)) => Port::new(widget, app, frp), - None => Port::new(DynWidget::new(&meta.config, &ctx), app, frp), + None => Port::new(DynWidget::new(&configuration.kind, &ctx), app, frp), }; - port.configure(&meta.config, ctx); + port.configure(&configuration.kind, ctx); TreeNode::Port(port) } else { let mut widget = match old_node { Some(TreeNode::Port(port)) => port.into_widget(), Some(TreeNode::Widget(widget)) => widget, - None => DynWidget::new(&meta.config, &ctx), + None => DynWidget::new(&configuration.kind, &ctx), }; - widget.configure(&meta.config, ctx); + widget.configure(&configuration.kind, ctx); TreeNode::Widget(widget) }; diff --git a/app/gui/view/graph-editor/src/component/node/input/widget/list_editor.rs b/app/gui/view/graph-editor/src/component/node/input/widget/list_editor.rs index 4a4e4ca6d70d5..acd21d0c17344 100644 --- a/app/gui/view/graph-editor/src/component/node/input/widget/list_editor.rs +++ b/app/gui/view/graph-editor/src/component/node/input/widget/list_editor.rs @@ -8,7 +8,7 @@ use crate::prelude::*; use crate::component::node::input::widget::single_choice::triangle; use crate::component::node::input::widget::single_choice::ACTIVATION_SHAPE_SIZE; -use crate::component::node::input::widget::Metadata; +use crate::component::node::input::widget::Configuration; use ensogl::application::Application; use ensogl::control::io::mouse; @@ -127,7 +127,7 @@ pub struct Config { /// Configuration of inner element widgets. If not present, the child widget types have to be /// automatically inferred. #[allow(dead_code)] - pub item_editor: Option>, + pub item_widget: Option>, /// Default expression to insert when adding new elements. #[allow(dead_code)] pub item_default: ImString, diff --git a/app/gui/view/graph-editor/src/component/node/input/widget/single_choice.rs b/app/gui/view/graph-editor/src/component/node/input/widget/single_choice.rs index 404cd8dd50778..0136e1e3eb918 100644 --- a/app/gui/view/graph-editor/src/component/node/input/widget/single_choice.rs +++ b/app/gui/view/graph-editor/src/component/node/input/widget/single_choice.rs @@ -278,7 +278,7 @@ impl super::SpanWidget for Widget { if ctx.span_node.children.is_empty() { let child_level = ctx.info.nesting_level; - let label_meta = super::Metadata::always(super::label::Config); + let label_meta = super::Configuration::always(super::label::Config); let child = ctx.builder.child_widget_of_type(ctx.span_node, child_level, label_meta); self.label_wrapper.replace_children(&[child]); } else { diff --git a/app/gui/view/graph-editor/src/lib.rs b/app/gui/view/graph-editor/src/lib.rs index a1047a5e0fddb..09bf7eff0c4cf 100644 --- a/app/gui/view/graph-editor/src/lib.rs +++ b/app/gui/view/graph-editor/src/lib.rs @@ -1124,9 +1124,9 @@ pub struct CallWidgetsConfig { pub struct ArgumentWidgetConfig { /// The function argument name that this widget is for. pub argument_name: String, - /// Widget metadata queried from the language server. When this is `None`, the widget metadata - /// should be inferred automatically. - pub meta: Option, + /// Widget configuration queried from the language server. When this is `None`, the widget + /// configuration should be inferred automatically. + pub meta: Option, }