Unconnected node inputs carry and show their default instead of nothing #234

Closed
opened 2026-09-26 14:09:53 +02:00 by meleki · 1 comment
Owner

Problem

A freshly created node has no values on its unconnected inputs. The inspector shows false, 0, "" or an empty list, but at runtime null arrives, even on a boolean input. The node body shows nothing at all.

Measured over all built-in nodes: 97 of 135 inputs that take a typed-in value delivered null (47 number, 22 text, 14 any, 7 boolean, 7 list).

Cause: two places disagree.

  • The inspector shows inlineInputDef(port).default.
  • The runtime used node.params[key] ?? port.default ?? null (inlineValue), and port.default is set on few ports only.

Most nodes turn null into the right zero themselves (Add, Not, Compare, Count, Branch). Wrong were the nodes that pass the value on or convert it on their own:

  • To text gave "0" instead of the empty text the inspector shows.
  • Select and First not empty passed null on instead of "".
  • Fill filled with 0 instead of "".

Decision (user)

  • One fix in inlineValue: an unconnected input falls back to the same default the inspector shows. That covers every node, future ones included, and existing projects. Nothing is written into project files.
  • The node body shows that value too, on every free input: false, 0, and "" for empty text. What is shown is what the node computes with.
  • Inputs with nothing to type in (object, struct, exec, inline: false) stay null.
## Problem A freshly created node has no values on its unconnected inputs. The inspector shows `false`, `0`, `""` or an empty list, but at runtime `null` arrives, even on a boolean input. The node body shows nothing at all. Measured over all built-in nodes: 97 of 135 inputs that take a typed-in value delivered `null` (47 number, 22 text, 14 `any`, 7 boolean, 7 list). Cause: two places disagree. - The inspector shows `inlineInputDef(port).default`. - The runtime used `node.params[key] ?? port.default ?? null` (`inlineValue`), and `port.default` is set on few ports only. Most nodes turn `null` into the right zero themselves (`Add`, `Not`, `Compare`, `Count`, `Branch`). Wrong were the nodes that pass the value on or convert it on their own: - `To text` gave `"0"` instead of the empty text the inspector shows. - `Select` and `First not empty` passed `null` on instead of `""`. - `Fill` filled with `0` instead of `""`. ## Decision (user) - One fix in `inlineValue`: an unconnected input falls back to the same default the inspector shows. That covers every node, future ones included, and existing projects. Nothing is written into project files. - **The node body shows that value too**, on every free input: `false`, `0`, and `""` for empty text. What is shown is what the node computes with. - Inputs with nothing to type in (object, struct, exec, `inline: false`) stay `null`.
Author
Owner

Done in 1d18862 (wiki: 380fac7, Behaviors).

Behavior

  • An unconnected input now gets the same default at run time that the inspector shows: false, 0, "", []. Before, 97 of 135 typeable inputs of the built-in nodes delivered null.
  • The fix sits in one place (inlineValue in src/core/graph/NodeRegistry.ts), so it covers all nodes, including future ones, and existing projects. Nothing is written into project files.
  • The node itself now shows the value too: empty text and empty lists as (empty), object and struct inputs without a connection as (null). Live values while playing use the same words. A key input without a key keeps —, like the key field in the inspector.
  • Visible changes for existing projects: To text without input gives "" instead of "0", Select and First not empty give "" instead of null. A scan of the user's projects found no such spot.

Tests

  • ./check.sh: 2434 tests, CHECK EXIT 0. 8 new unit tests, including one over all built-in nodes (none delivers null any more). The counter probe at inlineValue makes them fail.
  • e2e 6, 23, 24, 26, 43: 245 checks passed. The new check in module 6 reads the rows of an unconnected Name of node: a (empty), text (empty), start 0, count -1, object (null).
  • After Prettier touched NodeView.ts, the gate ran again (green); e2e 6 was not repeated after that.
Done in 1d18862 (wiki: 380fac7, *Behaviors*). **Behavior** - An unconnected input now gets the same default at run time that the inspector shows: `false`, `0`, `""`, `[]`. Before, 97 of 135 typeable inputs of the built-in nodes delivered `null`. - The fix sits in one place (`inlineValue` in `src/core/graph/NodeRegistry.ts`), so it covers all nodes, including future ones, and existing projects. Nothing is written into project files. - The node itself now shows the value too: empty text and empty lists as `(empty)`, object and struct inputs without a connection as `(null)`. Live values while playing use the same words. A key input without a key keeps `—`, like the key field in the inspector. - Visible changes for existing projects: `To text` without input gives `""` instead of `"0"`, `Select` and `First not empty` give `""` instead of `null`. A scan of the user's projects found no such spot. **Tests** - `./check.sh`: 2434 tests, CHECK EXIT 0. 8 new unit tests, including one over all built-in nodes (none delivers `null` any more). The counter probe at `inlineValue` makes them fail. - e2e 6, 23, 24, 26, 43: 245 checks passed. The new check in module 6 reads the rows of an unconnected `Name of` node: `a (empty)`, `text (empty)`, `start 0`, `count -1`, `object (null)`. - After Prettier touched `NodeView.ts`, the gate ran again (green); e2e 6 was not repeated after that.
admin added this to the Development project 2026-09-27 11:28:31 +02:00
admin moved this to Done in Development on 2026-09-27 11:28:59 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#234