From 4b7afbfd3619c22b6b31f2840fa807f0af41fb57 Mon Sep 17 00:00:00 2001 From: Ilya Bogdanov Date: Thu, 11 May 2023 19:51:25 +0300 Subject: [PATCH] Fix blank input port (#6614) Fixes #6485 Conflicting requirements for the widget tree caused the issue: 1. The span tree node had a connection, and the text of the `number1` label was changed to white (as per the `Connected` color state) 2. The node configuration did not consider it a valid port because the span tree kind was `Operation`, which is not a port usually. So the port shape was not displayed, making the label blend with the node background. I fixed the issue by considering the existence of the current connection for `Operation` nodes. Remember that it does not turn the node into a port, so after removing the connection, it's not possible to connect it back. That makes sense, in my opinion, as the resulting AST is invalid anyway. But at least we can see the label on the invalid node. https://github.com/enso-org/enso/assets/6566674/23934966-8f72-4675-abe3-78a3f0c0cda4 --- app/gui/view/graph-editor/src/component/node/input/widget.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 a63d70cb42..7f8fa09ea7 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 @@ -306,7 +306,9 @@ impl Configuration { } else { Self::always(label::Config::default()) }, - Kind::Token | Kind::Operation if !has_children => Self::inert(label::Config::default()), + Kind::Operation if !has_children => + Self::maybe_with_port(label::Config::default(), is_directly_connected), + Kind::Token if !has_children => Self::inert(label::Config::default()), Kind::NamedArgument => Self::inert(hierarchy::Config), Kind::InsertionPoint(_) => Self::maybe_with_port(insertion_point::Config, is_directly_connected),