Let a Sequence grow an output as you connect the last one
The Outputs setting is gone. A Sequence now keeps one free output below the last connected one: nothing plugged in is one output, connecting the spare grows a new one, unplugging the bottom edge shrinks it back. It counts the last *connected* port rather than the number of edges, so unplugging a middle one leaves a gap instead of silently dropping an edge. Removing the setting also removes a bug it caused. Typing in the Outputs field did nothing and the arrow keys did nothing, while dragging the value worked: onInput fires per keystroke, the preview writes into node.params, that emits 'project', and Inspector.refreshValues() sees the node's signature change -- the port list is part of it -- so it rebuilds and destroys the row being typed in. A drag survives because it keeps receiving globalpointermove on the old widget. refreshValues() has no focus guard where refreshLive() does; the trap is still there for the next typed field that changes a node's shape. Ports that depend on the edges around a node mean derivePorts needs the graph, not just the params, so resolveDef and portSignature take it too. And a node whose ports are derived cannot know how many it has from its type, so run is handed the definition resolved for it.
This commit is contained in:
1 parent
b6a609ae24
commit
3c76106fd2
15 files changed
+159
-111
No files matched your search
@@ -73,7 +73,7 @@ describe('a behavior used as a node', () => {
|
||||
const callee = doubler(fixture);
|
||||
const caller = callerOf(fixture, callee, 1);
|
||||
const call = caller.graph.nodes.find((n) => n.type === RUN_BEHAVIOR)!;
|
||||
const def = resolveDef(call, behaviorLookup(fixture.project))!;
|
||||
const def = resolveDef(call, caller.graph, behaviorLookup(fixture.project))!;
|
||||
expect(def.inputs.map((p) => p.key)).toEqual(['exec', 'in1']);
|
||||
expect(def.outputs.map((p) => p.key)).toEqual(['exec', 'out1']);
|
||||
// Named after the behavior it runs: a graph of calls is unreadable as a row of "Run behavior".
|
||||
@@ -214,11 +214,11 @@ describe('a call that cannot do anything says so', () => {
|
||||
const start = graphEditor(fixture, callee).addNode(BEHAVIOR_START);
|
||||
const caller = makeBehavior(fixture, 'Caller');
|
||||
const call = graphEditor(fixture, caller).addNode(RUN_BEHAVIOR, { [BEHAVIOR_PARAM]: callee.id });
|
||||
const signature = () => portSignature(call, behaviorLookup(fixture.project), caller.id);
|
||||
const signature = () => portSignature(call, caller.graph, behaviorLookup(fixture.project), caller.id);
|
||||
|
||||
const healthy = signature();
|
||||
fixture.stack.execute(new RemoveNodeCommand(callee.id, start.id));
|
||||
expect(resolveDef(call, behaviorLookup(fixture.project))!.label).toBe('Bare');
|
||||
expect(resolveDef(call, caller.graph, behaviorLookup(fixture.project))!.label).toBe('Bare');
|
||||
expect(signature()).not.toBe(healthy);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user